From 7d81394f3d441c3859a0079e3284d9b46f11600d Mon Sep 17 00:00:00 2001 From: Sergey Kosarevsky Date: Wed, 27 Sep 2023 15:06:40 -0700 Subject: [PATCH] igl | Add IGL_WITH_TEXTURE_LOADER to Tiny_MeshLarge Summary: Decoupled IGLU and texture loading. Added `IGL_WITH_TEXTURE_LOADER` macro. Reviewed By: MichaelTay Differential Revision: D49669714 fbshipit-source-id: 8e20fafedf256889b9535692df84ff01af8b9854 --- samples/desktop/Tiny/Tiny_MeshLarge.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/samples/desktop/Tiny/Tiny_MeshLarge.cpp b/samples/desktop/Tiny/Tiny_MeshLarge.cpp index 836a5678bf..2a41da24e6 100644 --- a/samples/desktop/Tiny/Tiny_MeshLarge.cpp +++ b/samples/desktop/Tiny/Tiny_MeshLarge.cpp @@ -123,9 +123,12 @@ #if IGL_WITH_IGLU #include +#endif // IGL_WITH_IGLU + +#if IGL_WITH_TEXTURE_LOADER #include #include -#endif +#endif // IGL_WITH_TEXTURE_LOADER namespace { @@ -146,11 +149,11 @@ constexpr bool kEnableValidationLayers = true; std::string contentRootFolder; #if IGL_WITH_IGLU - std::unique_ptr imguiSession_; - igl::shell::InputDispatcher inputDispatcher_; +#endif // IGL_WITH_IGLU +#if IGL_WITH_TEXTURE_LOADER void loadKtxTexture(const igl::IDevice& device, igl::ICommandQueue& commandQueue, const std::string filename, @@ -199,7 +202,7 @@ void loadKtxTexture(const igl::IDevice& device, } } } -#endif // IGL_WITH_IGLU +#endif // IGL_WITH_TEXTURE_LOADER const char* kCodeComputeTest = R"( layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -2251,7 +2254,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_IGLU +#if IGL_WITH_TEXTURE_LOADER loadKtxTexture(*device_, *commandQueue_, img.compressedFileName, tex, false); #else // Uploading the texture