From fc4f5a6aed5758112e6636c472a54250d485154c Mon Sep 17 00:00:00 2001 From: Edgar Date: Sun, 25 Feb 2024 13:31:14 +0100 Subject: [PATCH] :bug: Fixed building manual tests --- tests-manual/controllers/CMakeLists.txt | 3 +++ tests-manual/entities/CMakeLists.txt | 9 ++++++-- tests-manual/gl/CMakeLists.txt | 5 ++++ tests-manual/gpu-textures/CMakeLists.txt | 2 +- .../gpu-textures/src/TestTextures.cpp | 6 ++--- tests-manual/gpu/CMakeLists.txt | 15 +++++------- tests-manual/gpu/src/TestWindow.cpp | 2 +- tests-manual/gpu/src/TestWindow.h | 2 ++ tests-manual/gpu/src/main.cpp | 23 ++++++++++++++++++- tests-manual/render-perf/CMakeLists.txt | 7 ++++-- tests-manual/render-perf/src/main.cpp | 3 ++- .../render-texture-load/CMakeLists.txt | 22 +++++++++--------- 12 files changed, 68 insertions(+), 31 deletions(-) diff --git a/tests-manual/controllers/CMakeLists.txt b/tests-manual/controllers/CMakeLists.txt index d737957742..861e429f6b 100644 --- a/tests-manual/controllers/CMakeLists.txt +++ b/tests-manual/controllers/CMakeLists.txt @@ -2,6 +2,9 @@ # Copyright 2021-2023 Overte e.V. # SPDX-License-Identifier: Apache-2.0 +# TODO: this test still uses QScriptEngine +return() + # FIXME Disabling test on OSX because of unexpected link error if (NOT APPLE) set(TARGET_NAME controllers-test) diff --git a/tests-manual/entities/CMakeLists.txt b/tests-manual/entities/CMakeLists.txt index 31ec977606..a3ad757aca 100644 --- a/tests-manual/entities/CMakeLists.txt +++ b/tests-manual/entities/CMakeLists.txt @@ -11,10 +11,15 @@ setup_thread_debugger() set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/") # link in the shared libraries -link_hifi_libraries(entities avatars shared octree gpu graphics fbx networking animation audio gl) +link_hifi_libraries( + entities hfm avatars script-engine image + procedural material-networking ktx shaders + model-networking shared octree gpu graphics + model-serializers networking animation audio gl +) if (WIN32) - add_dependency_external_projects(wasapi) + add_dependency_external_projects(wasapi) endif () package_libraries_for_deployment() diff --git a/tests-manual/gl/CMakeLists.txt b/tests-manual/gl/CMakeLists.txt index 5b738a6e39..add4375dc2 100644 --- a/tests-manual/gl/CMakeLists.txt +++ b/tests-manual/gl/CMakeLists.txt @@ -1,3 +1,8 @@ +# This is a windows only test +if(NOT WIN32) + return() +endif () + set(TARGET_NAME gl-test) # This is not a testcase -- just set it up as a regular hifi project setup_hifi_project(Quick Gui OpenGL) diff --git a/tests-manual/gpu-textures/CMakeLists.txt b/tests-manual/gpu-textures/CMakeLists.txt index 27eb893c07..404abb8a15 100644 --- a/tests-manual/gpu-textures/CMakeLists.txt +++ b/tests-manual/gpu-textures/CMakeLists.txt @@ -10,7 +10,7 @@ setup_thread_debugger() set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/") link_hifi_libraries( shared shaders task networking gl - ktx gpu octree + ktx gpu octree ${PLATFORM_GL_BACKEND} ) diff --git a/tests-manual/gpu-textures/src/TestTextures.cpp b/tests-manual/gpu-textures/src/TestTextures.cpp index 5d5ddce6fa..b5d44a4a69 100644 --- a/tests-manual/gpu-textures/src/TestTextures.cpp +++ b/tests-manual/gpu-textures/src/TestTextures.cpp @@ -142,9 +142,9 @@ void TexturesTest::onChangeTextures() { const auto& textureFile = ALL_TEXTURE_FILES[i]; auto texture = gpu::Texture::unserialize(textureFile); qDebug() << textureFile.c_str(); - qDebug() << texture->getTexelFormat().getSemantic(); - qDebug() << texture->getTexelFormat().getScalarCount(); - textures.push_back(texture); + qDebug() << texture.first->getTexelFormat().getSemantic(); + qDebug() << texture.first->getTexelFormat().getScalarCount(); + textures.push_back(texture.first); } #endif index = 0; diff --git a/tests-manual/gpu/CMakeLists.txt b/tests-manual/gpu/CMakeLists.txt index aa4e4d497b..33e4cd5593 100644 --- a/tests-manual/gpu/CMakeLists.txt +++ b/tests-manual/gpu/CMakeLists.txt @@ -9,17 +9,14 @@ setup_memory_debugger() setup_thread_debugger() set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/") link_hifi_libraries( - shared task networking gl - ktx shaders gpu procedural octree image - graphics model-networking fbx hfm animation material-networking - script-engine render render-utils - ${PLATFORM_GL_BACKEND} + shared task networking gl + ktx shaders gpu procedural octree image + material-networking ktx shaders model-networking + graphics model-networking model-serializers hfm animation material-networking + script-engine render render-utils + ${PLATFORM_GL_BACKEND} ) -if (WIN32) - add_dependency_external_projects(wasapi) -endif () - package_libraries_for_deployment() target_nsight() diff --git a/tests-manual/gpu/src/TestWindow.cpp b/tests-manual/gpu/src/TestWindow.cpp index af8c6af243..602d19fa60 100644 --- a/tests-manual/gpu/src/TestWindow.cpp +++ b/tests-manual/gpu/src/TestWindow.cpp @@ -110,7 +110,7 @@ void TestWindow::beginFrame() { _renderDeferredInputs.edit0() = frameTransform; // Pass the deferredFrameTransform _renderDeferredInputs.edit1() = _prepareDeferredOutputs.get0(); // Pass the deferredFramebuffer - _renderDeferredInputs.edit2() = lightingModel; // Pass the lightingModel + _renderDeferredInputs.edit3() = lightingModel; // Pass the lightingModel // the rest of the renderDeferred inputs can be omitted #else diff --git a/tests-manual/gpu/src/TestWindow.h b/tests-manual/gpu/src/TestWindow.h index 83cac83768..7148e7bc6f 100644 --- a/tests-manual/gpu/src/TestWindow.h +++ b/tests-manual/gpu/src/TestWindow.h @@ -8,6 +8,8 @@ #pragma once +#include "RenderDeferredTask.h" + #include #include diff --git a/tests-manual/gpu/src/main.cpp b/tests-manual/gpu/src/main.cpp index 7cf941daea..d064368ccf 100644 --- a/tests-manual/gpu/src/main.cpp +++ b/tests-manual/gpu/src/main.cpp @@ -162,7 +162,28 @@ class MyTestWindow : public TestWindow { } }; -extern uvec2 rectifySize(const uvec2& size); +static const glm::uvec2 SPARSE_PAGE_SIZE(128); + +uint rectifyDimension(const uint& dimension) { + if (dimension == 0) { + return 0; + } + if (dimension < SPARSE_PAGE_SIZE.x) { + uint newSize = SPARSE_PAGE_SIZE.x; + while (dimension <= newSize / 2) { + newSize /= 2; + } + return newSize; + } else { + uint pages = (dimension / SPARSE_PAGE_SIZE.x) + (dimension % SPARSE_PAGE_SIZE.x == 0 ? 0 : 1); + return pages * SPARSE_PAGE_SIZE.x; + } +} + + +glm::uvec2 rectifySize(const glm::uvec2& size) { + return { rectifyDimension(size.x), rectifyDimension(size.y) }; +} void testSparseRectify() { std::vector> SPARSE_SIZE_TESTS { diff --git a/tests-manual/render-perf/CMakeLists.txt b/tests-manual/render-perf/CMakeLists.txt index 67d3ac2d86..277bbfd88f 100644 --- a/tests-manual/render-perf/CMakeLists.txt +++ b/tests-manual/render-perf/CMakeLists.txt @@ -1,3 +1,5 @@ +# TODO: this test uses functions that dont exist anymore +return() set(TARGET_NAME render-perf-test) @@ -17,8 +19,9 @@ link_hifi_libraries( shared task workload networking animation ktx image octree shaders gl gpu ${PLATFORM_GL_BACKEND} - render render-utils - graphics hfm fbx model-networking graphics-scripting + render render-utils + material-networking ktx shaders model-networking + graphics hfm model-serializers model-networking graphics-scripting entities entities-renderer audio avatars script-engine physics procedural midi qml ui ${PLATFORM_GL_BACKEND} diff --git a/tests-manual/render-perf/src/main.cpp b/tests-manual/render-perf/src/main.cpp index 10d0d753db..652a54b778 100644 --- a/tests-manual/render-perf/src/main.cpp +++ b/tests-manual/render-perf/src/main.cpp @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -246,7 +247,7 @@ public: _context.makeCurrent(); _frameTimes.resize(FRAME_TIME_BUFFER_SIZE, 0); { - gpu::ShaderPointer program = gpu::Shader::createProgram(shader::display_plugins::program::SrgbToLinear); + gpu::ShaderPointer program = gpu::Shader::createProgram(shader::display_plugins::program::InterleavedSrgbToLinear); gpu::StatePointer state = gpu::StatePointer(new gpu::State()); _presentPipeline = gpu::Pipeline::create(program, state); } diff --git a/tests-manual/render-texture-load/CMakeLists.txt b/tests-manual/render-texture-load/CMakeLists.txt index 77afdfa5d0..f5dafc770f 100644 --- a/tests-manual/render-texture-load/CMakeLists.txt +++ b/tests-manual/render-texture-load/CMakeLists.txt @@ -1,9 +1,9 @@ set(TARGET_NAME render-texture-load) - + if (WIN32) - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4049 /ignore:4217") -endif() + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4049 /ignore:4217") +endif () setup_memory_debugger() setup_thread_debugger() @@ -14,13 +14,13 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/") # link in the shared libraries link_hifi_libraries( - shared task networking octree - shaders gl gpu render ktx image animation - graphics hfm fbx model-networking - render-utils - entities entities-renderer audio avatars - script-engine physics - ${PLATFORM_GL_BACKEND} + shared task networking octree + shaders gl gpu render ktx image animation + graphics hfm model-serializers model-networking + render-utils material-networking procedural + entities entities-renderer audio avatars + script-engine physics + ${PLATFORM_GL_BACKEND} ) package_libraries_for_deployment() @@ -32,7 +32,7 @@ target_zlib() target_quazip() if (WIN32) - add_dependency_external_projects(wasapi) + add_dependency_external_projects(wasapi) endif ()