Skip to content

Commit

Permalink
igl | Rename IGL_WITH_TEXTURE_LOADER to USE_TEXTURE_LOADER
Browse files Browse the repository at this point in the history
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
  • Loading branch information
corporateshark authored and facebook-github-bot committed Oct 2, 2023
1 parent 058749c commit 5331919
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions samples/desktop/Tiny/Tiny_MeshLarge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <taskflow/taskflow.hpp>
#include <tiny_obj_loader.h>

#define USE_TEXTURE_LOADER 0
#define USE_OPENGL_BACKEND 0

#if IGL_BACKEND_OPENGL && !IGL_BACKEND_VULKAN
Expand Down Expand Up @@ -123,10 +124,12 @@
#include <IGLU/imgui/Session.h>
#endif // IGL_WITH_IGLU

#if IGL_WITH_TEXTURE_LOADER
#if USE_TEXTURE_LOADER
#include <IGLU/texture_loader/ktx1/TextureLoaderFactory.h>
#include <IGLU/texture_loader/ktx2/TextureLoaderFactory.h>
#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 {

Expand All @@ -151,7 +154,7 @@ std::unique_ptr<iglu::imgui::Session> 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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -2253,7 +2256,7 @@ void loadCubemapTexture(const std::string& fileNameKTX, std::shared_ptr<ITexture
return;
}

#if IGL_WITH_TEXTURE_LOADER
#if USE_TEXTURE_LOADER
loadKtxTexture(*device_, *commandQueue_, fileNameKTX, tex, !kEnableCompression);
#else
ktxTexture2* texture;
Expand Down Expand Up @@ -2496,7 +2499,7 @@ std::shared_ptr<ITexture> 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
Expand All @@ -2518,7 +2521,7 @@ std::shared_ptr<ITexture> 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());
Expand Down

0 comments on commit 5331919

Please sign in to comment.