diff --git a/examples/computeraytracing/computeraytracing.cpp b/examples/computeraytracing/computeraytracing.cpp index d2f0e973..f9703c1a 100644 --- a/examples/computeraytracing/computeraytracing.cpp +++ b/examples/computeraytracing/computeraytracing.cpp @@ -55,6 +55,7 @@ public: glm::vec3 lookat = glm::vec3(0.0f, 0.5f, 0.0f); float fov = 10.0f; } camera; + glm::mat4 _pad; } ubo; } compute; diff --git a/examples/ssao/ssao.cpp b/examples/ssao/ssao.cpp index cb87d6fa..3cda3ced 100644 --- a/examples/ssao/ssao.cpp +++ b/examples/ssao/ssao.cpp @@ -11,7 +11,7 @@ #define ENABLE_VALIDATION false -#define SSAO_KERNEL_SIZE 32 +#define SSAO_KERNEL_SIZE 64 #define SSAO_RADIUS 0.3f #if defined(__ANDROID__) diff --git a/examples/texturearray/texturearray.cpp b/examples/texturearray/texturearray.cpp index 921addea..de997fcc 100644 --- a/examples/texturearray/texturearray.cpp +++ b/examples/texturearray/texturearray.cpp @@ -12,6 +12,8 @@ #define ENABLE_VALIDATION false +#define MAX_LAYERS 8 + // Vertex layout for this example struct Vertex { float pos[3]; @@ -120,6 +122,7 @@ public: textureArray.width = ktxTexture->baseWidth; textureArray.height = ktxTexture->baseHeight; layerCount = ktxTexture->numLayers; + assert(layerCount <= MAX_LAYERS); ktx_uint8_t *ktxTextureData = ktxTexture_GetData(ktxTexture); ktx_size_t ktxTextureSize = ktxTexture_GetSize(ktxTexture); @@ -475,7 +478,7 @@ public: { uboVS.instance = new UboInstanceData[layerCount]; - uint32_t uboSize = sizeof(uboVS.matrices) + (layerCount * sizeof(UboInstanceData)); + uint32_t uboSize = sizeof(uboVS.matrices) + (MAX_LAYERS * sizeof(UboInstanceData)); // Vertex shader uniform buffer block VK_CHECK_RESULT(vulkanDevice->createBuffer(