Skip to content

Commit

Permalink
Fix TinyMesh_Large demo for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
rokuz committed Dec 28, 2023
1 parent db79882 commit c09a8fb
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions samples/Tiny_MeshLarge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,17 @@

#include <GLFW/glfw3.h>

#ifdef __APPLE__
#warning Not supported. Currently Vulkan 1.2 + extensions are available in MoltenVK.
// Known issues: https://github.com/KhronosGroup/MoltenVK/issues/2011
#endif

constexpr uint32_t kMeshCacheVersion = 0xC0DE0009;
#ifndef __APPLE__
constexpr int kNumSamplesMSAA = 8;
#else
constexpr int kNumSamplesMSAA = 4;
#endif
#ifdef __APPLE__
constexpr bool kEnableCompression = false;
#else
constexpr bool kEnableCompression = true;
#endif
constexpr bool kPreferIntegratedGPU = false;
#if defined(NDEBUG)
constexpr bool kEnableValidationLayers = false;
Expand Down Expand Up @@ -95,8 +94,10 @@ double timestampEndRendering = 0;
const char* kCodeComputeTest = R"(
layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
layout (set = 0, binding = 2, rgba8) uniform readonly image2D kTextures2Din[];
layout (set = 0, binding = 2, rgba8) uniform writeonly image2D kTextures2Dout[];
// https://github.com/KhronosGroup/MoltenVK/issues/2106
// TODO: set binding = 2 to be compatible with Vulkan image layout on other platforms.
layout (set = 0, binding = 0, rgba8) uniform readonly image2D kTextures2Din[];
layout (set = 1, binding = 0, rgba8) uniform writeonly image2D kTextures2Dout[];
layout(push_constant) uniform constants {
uint tex;
Expand Down Expand Up @@ -1729,9 +1730,7 @@ lvk::TextureHandle createTexture(const LoadedImage& img) {
},
nullptr);

if (!hasCompressedTexture) {
ctx_->generateMipmap(tex);
}
ctx_->generateMipmap(tex);

lvk::TextureHandle handle = tex;

Expand Down

0 comments on commit c09a8fb

Please sign in to comment.