diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12f31bc0..fa26b69d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,13 +16,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] - #os: [ubuntu-latest, windows-latest] + #os: [ubuntu-latest] + os: [ubuntu-latest, windows-latest] + #os: [windows-latest] build_type: [Release] include: - #- os: windows-latest - #arch: 'win64_mingw' - #host: 'windows' + - os: windows-latest + arch: 'win64_msvc2019_64' + host: 'windows' + shell: 'powershell' #shell: 'cmd' #shell: 'msys2 {0}' - os: ubuntu-latest @@ -74,7 +76,7 @@ jobs: - name: Build run: cmake --build ./build - - name: Test on Linux + - name: Unittests on Linux if: matrix.os == 'ubuntu-latest' env: QT_QPA_PLATFORM: xcb @@ -86,23 +88,12 @@ jobs: #Xvfb :1 -screen 0 1024x768x16 & #./build/unittests/gl_engine/unittests_gl_engine # doesn't work - - name: Test radix on Windows + - name: Unittests on Windows if: matrix.os == 'windows-latest' env: QT_DEBUG_PLUGINS: 1 run: | ./build/alp_external/radix/unittests/unittests_radix.exe - - - name: Test nucleus on Windows - if: matrix.os == 'windows-latest' - env: - QT_DEBUG_PLUGINS: 1 - run: | ./build/unittests/unittests_nucleus.exe + #./build/unittests/unittests_gl_engine.exe - - name: Test gl_engine on Windows - if: matrix.os == 'windows-latest' - env: - QT_DEBUG_PLUGINS: 1 - run: | - ./build/unittests/unittests_gl_engine.exe diff --git a/gl_engine/Framebuffer.cpp b/gl_engine/Framebuffer.cpp index dea2433d..7346de3b 100644 --- a/gl_engine/Framebuffer.cpp +++ b/gl_engine/Framebuffer.cpp @@ -358,16 +358,17 @@ void Framebuffer::reset_fbo() QOpenGLExtraFunctions* f = QOpenGLContext::currentContext()->extraFunctions(); //QOpenGLFunctions* f = QOpenGLContext::currentContext()->functions(); f->glBindFramebuffer(GL_FRAMEBUFFER, m_frame_buffer); - unsigned int draw_attachments[m_colour_textures.size()]; - for (int i = 0; i < m_colour_textures.size(); i++) { - draw_attachments[i] = GL_COLOR_ATTACHMENT0 + i; - f->glFramebufferTexture2D(GL_FRAMEBUFFER, draw_attachments[i], GL_TEXTURE_2D, m_colour_textures[i]->textureId(), 0); + // unsigned int draw_attachments[m_colour_textures.size()]; + std::vector draw_attachments; + for (unsigned i = 0; i < m_colour_textures.size(); i++) { + draw_attachments.push_back(GL_COLOR_ATTACHMENT0 + i); + f->glFramebufferTexture2D(GL_FRAMEBUFFER, draw_attachments.back(), GL_TEXTURE_2D, m_colour_textures[i]->textureId(), 0); } if (m_depth_format != DepthFormat::None) f->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_depth_texture->textureId(), 0); // Tell OpenGL how many attachments to use - f->glDrawBuffers(m_colour_textures.size(), draw_attachments); + f->glDrawBuffers(m_colour_textures.size(), draw_attachments.data()); assert(f->glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); } diff --git a/unittests/gl_engine/framebuffer.cpp b/unittests/gl_engine/framebuffer.cpp index c5974059..a7cc1a6f 100644 --- a/unittests/gl_engine/framebuffer.cpp +++ b/unittests/gl_engine/framebuffer.cpp @@ -133,14 +133,15 @@ TEST_CASE("gl framebuffer") } // Create an array filled with the value 400 for each RG component - GLushort data[width * height * 2]; + std::vector data; + data.resize(width * height * 2); for (int i = 0; i < width * height * 2; i += 2) { data[i] = 400; // R component data[i + 1] = 400; // G component } // Define the texture image - f->glTexImage2D(GL_TEXTURE_2D, 0, GL_RG16UI, width, height, 0, GL_RG_INTEGER, GL_UNSIGNED_SHORT, data); + f->glTexImage2D(GL_TEXTURE_2D, 0, GL_RG16UI, width, height, 0, GL_RG_INTEGER, GL_UNSIGNED_SHORT, data.data()); error = f->glGetError(); CHECK(error == GL_NO_ERROR); if (error != GL_NO_ERROR) { @@ -170,14 +171,15 @@ TEST_CASE("gl framebuffer") texture.allocateStorage(QOpenGLTexture::PixelFormat::RG_Integer, QOpenGLTexture::PixelType::UInt16); // Fill the array with the value 400 for each RG component - GLushort data[width * height * 2]; + std::vector data; + data.resize(width * height * 2); for (int i = 0; i < width * height * 2; i += 2) { data[i] = 400; // R component data[i + 1] = 400; // G component } // Upload the data to the texture - texture.setData(0, QOpenGLTexture::PixelFormat::RG_Integer, QOpenGLTexture::PixelType::UInt16, data); + texture.setData(0, QOpenGLTexture::PixelFormat::RG_Integer, QOpenGLTexture::PixelType::UInt16, data.data()); // Set the texture parameters texture.setMinificationFilter(QOpenGLTexture::Nearest); diff --git a/unittests/nucleus/nucleus_tile_scheduler_rate_limiter.cpp b/unittests/nucleus/nucleus_tile_scheduler_rate_limiter.cpp index 1942e433..e11b8bdd 100644 --- a/unittests/nucleus/nucleus_tile_scheduler_rate_limiter.cpp +++ b/unittests/nucleus/nucleus_tile_scheduler_rate_limiter.cpp @@ -30,7 +30,7 @@ constexpr auto timing_multiplicator = 200; #elif defined __ANDROID__ constexpr auto timing_multiplicator = 50; #else -constexpr auto timing_multiplicator = 2; +constexpr auto timing_multiplicator = 10; #endif TEST_CASE("nucleus/tile_scheduler/rate limiter") diff --git a/unittests/nucleus/nucleus_tile_scheduler_scheduler.cpp b/unittests/nucleus/nucleus_tile_scheduler_scheduler.cpp index b42fb13d..fb60c9b2 100644 --- a/unittests/nucleus/nucleus_tile_scheduler_scheduler.cpp +++ b/unittests/nucleus/nucleus_tile_scheduler_scheduler.cpp @@ -202,6 +202,8 @@ std::vector example_quads_many() #ifdef __EMSCRIPTEN__ constexpr auto timing_multiplicator = 10; +#elif defined _MSC_VER +constexpr auto timing_multiplicator = 20; #else constexpr auto timing_multiplicator = 1; #endif diff --git a/unittests/nucleus/nucleus_utils_stopwatch.cpp b/unittests/nucleus/nucleus_utils_stopwatch.cpp index 3eec33f0..26c585d4 100644 --- a/unittests/nucleus/nucleus_utils_stopwatch.cpp +++ b/unittests/nucleus/nucleus_utils_stopwatch.cpp @@ -24,6 +24,8 @@ #ifdef __EMSCRIPTEN__ constexpr auto timing_multiplicator = 10ll; +#elif defined _MSC_VER +constexpr auto timing_multiplicator = 10ll; #else constexpr auto timing_multiplicator = 5ll; #endif