From 53319191283527a523b273666c33f8262efa0c8c Mon Sep 17 00:00:00 2001 From: Sergey Kosarevsky Date: Sun, 1 Oct 2023 23:02:36 -0700 Subject: [PATCH] igl | Rename IGL_WITH_TEXTURE_LOADER to USE_TEXTURE_LOADER Summary: Renamed `IGL_WITH_TEXTURE_LOADER` to `USE_TEXTURE_LOADER`. It is local to one demo `Tiny_MeshLarge.cpp`. Reviewed By: EricGriffith Differential Revision: D49784597 fbshipit-source-id: 128dad265c8fb2f0c21ca3b8e98da7892283328d --- samples/desktop/Tiny/Tiny_MeshLarge.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/samples/desktop/Tiny/Tiny_MeshLarge.cpp b/samples/desktop/Tiny/Tiny_MeshLarge.cpp index e2e9f82fc4..be2533ee24 100644 --- a/samples/desktop/Tiny/Tiny_MeshLarge.cpp +++ b/samples/desktop/Tiny/Tiny_MeshLarge.cpp @@ -45,6 +45,7 @@ #include #include +#define USE_TEXTURE_LOADER 0 #define USE_OPENGL_BACKEND 0 #if IGL_BACKEND_OPENGL && !IGL_BACKEND_VULKAN @@ -123,10 +124,12 @@ #include #endif // IGL_WITH_IGLU -#if IGL_WITH_TEXTURE_LOADER +#if USE_TEXTURE_LOADER #include #include -#endif // IGL_WITH_TEXTURE_LOADER +static_assert(IGL_WITH_IGLU != 0, + "USE_TEXTURE_LOADER can be enabled only together with IGL_WITH_IGLU"); +#endif // USE_TEXTURE_LOADER namespace { @@ -151,7 +154,7 @@ std::unique_ptr imguiSession_; igl::shell::InputDispatcher inputDispatcher_; #endif // IGL_WITH_IGLU -#if IGL_WITH_TEXTURE_LOADER +#if USE_TEXTURE_LOADER void loadKtxTexture(const igl::IDevice& device, igl::ICommandQueue& commandQueue, const std::string filename, @@ -200,7 +203,7 @@ void loadKtxTexture(const igl::IDevice& device, } } } -#endif // IGL_WITH_TEXTURE_LOADER +#endif // USE_TEXTURE_LOADER const char* kCodeComputeTest = R"( layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -2253,7 +2256,7 @@ void loadCubemapTexture(const std::string& fileNameKTX, std::shared_ptr createTexture(const LoadedImage& img) { if (kEnableCompression && img.channels == 4 && std::filesystem::exists(img.compressedFileName.c_str())) { -#if IGL_WITH_TEXTURE_LOADER +#if USE_TEXTURE_LOADER loadKtxTexture(*device_, *commandQueue_, img.compressedFileName, tex, false); #else // Uploading the texture @@ -2518,7 +2521,7 @@ std::shared_ptr createTexture(const LoadedImage& img) { tex->upload(rangeDesc.atMipLevel(i), texture->pData + offset); } -#endif +#endif // USE_TEXTURE_LOADER } else { tex->upload(TextureRangeDesc::new2D(0, 0, img.w, img.h), img.pixels); tex->generateMipmap(*commandQueue_.get());