From 18404149d8c15f895c210565e43e5c81242cda0d Mon Sep 17 00:00:00 2001 From: Aliya Pazylbekova Date: Tue, 14 Nov 2023 16:46:02 +0000 Subject: [PATCH] A few minor changes Add #include to FreeCamera.cpp for std::clamp Move kApi constant definition to source files for FishTornado and GraphicsPipeline apps --- benchmarks/graphics_pipeline/FreeCamera.cpp | 2 ++ benchmarks/graphics_pipeline/GraphicsBenchmarkApp.cpp | 6 ++++++ benchmarks/graphics_pipeline/GraphicsBenchmarkApp.h | 6 ------ projects/fishtornado_xr/FishTornado.cpp | 6 ++++++ projects/fishtornado_xr/FishTornado.h | 6 ------ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/benchmarks/graphics_pipeline/FreeCamera.cpp b/benchmarks/graphics_pipeline/FreeCamera.cpp index 5049304a7..146bb8ddd 100644 --- a/benchmarks/graphics_pipeline/FreeCamera.cpp +++ b/benchmarks/graphics_pipeline/FreeCamera.cpp @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "FreeCamera.h" #include "ppx/math_util.h" diff --git a/benchmarks/graphics_pipeline/GraphicsBenchmarkApp.cpp b/benchmarks/graphics_pipeline/GraphicsBenchmarkApp.cpp index c07d83ef5..c60ce3830 100644 --- a/benchmarks/graphics_pipeline/GraphicsBenchmarkApp.cpp +++ b/benchmarks/graphics_pipeline/GraphicsBenchmarkApp.cpp @@ -33,6 +33,12 @@ static constexpr size_t SPHERE_METAL_ROUGHNESS_SAMPLER_REGISTER = 6; static constexpr size_t QUADS_SAMPLED_IMAGE_REGISTER = 0; +#if defined(USE_DX12) +const grfx::Api kApi = grfx::API_DX_12_0; +#elif defined(USE_VK) +const grfx::Api kApi = grfx::API_VK_1_1; +#endif + void GraphicsBenchmarkApp::InitKnobs() { const auto& cl_options = GetExtraOptions(); diff --git a/benchmarks/graphics_pipeline/GraphicsBenchmarkApp.h b/benchmarks/graphics_pipeline/GraphicsBenchmarkApp.h index 7ff6727f4..64d2822b9 100644 --- a/benchmarks/graphics_pipeline/GraphicsBenchmarkApp.h +++ b/benchmarks/graphics_pipeline/GraphicsBenchmarkApp.h @@ -26,12 +26,6 @@ #include #include -#if defined(USE_DX12) -const grfx::Api kApi = grfx::API_DX_12_0; -#elif defined(USE_VK) -const grfx::Api kApi = grfx::API_VK_1_1; -#endif - static constexpr uint32_t kMaxSphereInstanceCount = 3000; static constexpr uint32_t kSeed = 89977; static constexpr uint32_t kMaxFullscreenQuadsCount = 1000; diff --git a/projects/fishtornado_xr/FishTornado.cpp b/projects/fishtornado_xr/FishTornado.cpp index da33ab9af..59dc9b490 100644 --- a/projects/fishtornado_xr/FishTornado.cpp +++ b/projects/fishtornado_xr/FishTornado.cpp @@ -28,6 +28,12 @@ constexpr uint32_t kCausticsImageCount = 32; constexpr float3 kFogColor = float3(15.0f, 86.0f, 107.0f) / 255.0f; constexpr float3 kFloorColor = float3(145.0f, 189.0f, 155.0f) / 255.0f; +#if defined(USE_DX12) +const grfx::Api kApi = grfx::API_DX_12_0; +#elif defined(USE_VK) +const grfx::Api kApi = grfx::API_VK_1_1; +#endif + } // namespace FishTornadoApp* FishTornadoApp::GetThisApp() diff --git a/projects/fishtornado_xr/FishTornado.h b/projects/fishtornado_xr/FishTornado.h index f4aae5e7a..49e551999 100644 --- a/projects/fishtornado_xr/FishTornado.h +++ b/projects/fishtornado_xr/FishTornado.h @@ -29,12 +29,6 @@ #include #include -#if defined(USE_DX12) -const grfx::Api kApi = grfx::API_DX_12_0; -#elif defined(USE_VK) -const grfx::Api kApi = grfx::API_VK_1_1; -#endif - struct FishTornadoSettings { bool usePCF = true;