Skip to content

Commit 246db86

Browse files
Samples: fixed YUV samplers array name
1 parent 6de5eae commit 246db86

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lvk/vulkan/VulkanClasses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5777,7 +5777,7 @@ lvk::ShaderModuleState lvk::VulkanContext::createShaderModuleFromGLSL(ShaderStag
57775777
"layout (set = 3, binding = 0) uniform texture2D kTextures2DShadow[];\n"
57785778
"layout (set = 0, binding = 1) uniform sampler kSamplers[];\n"
57795779
"layout (set = 3, binding = 1) uniform samplerShadow kSamplersShadow[];\n"
5780-
"layout (set = 0, binding = 3) uniform sampler2D kSamplerYUV[];\n";
5780+
"layout (set = 0, binding = 3) uniform sampler2D kSamplersYUV[];\n";
57815781
addCode("textureBindless2D(",
57825782
"vec4 textureBindless2D(uint textureid, uint samplerid, vec2 uv) {\n"
57835783
" return texture(nonuniformEXT(sampler2D(kTextures2D[textureid], kSamplers[samplerid])), uv);\n"

samples/004_YUV.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ const char* codeVS = R"(
1414
#version 460
1515
layout (location=0) out vec2 uv;
1616
const vec2 pos[4] = vec2[4](
17-
vec2(-1.0, -1.0),
18-
vec2(-1.0, +1.0),
19-
vec2(+1.0, -1.0),
20-
vec2(+1.0, +1.0)
17+
vec2(-1.0, -1.0),
18+
vec2(-1.0, +1.0),
19+
vec2(+1.0, -1.0),
20+
vec2(+1.0, +1.0)
2121
);
2222
void main() {
23-
gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);
24-
uv = pos[gl_VertexIndex] * 0.5 + 0.5;
25-
uv.y = 1.0-uv.y;
23+
gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);
24+
uv = pos[gl_VertexIndex] * 0.5 + 0.5;
25+
uv.y = 1.0-uv.y;
2626
}
2727
)";
2828

@@ -33,8 +33,8 @@ layout (location=0) out vec4 out_FragColor;
3333
layout (constant_id = 0) const uint textureId = 0;
3434
3535
void main() {
36-
out_FragColor = texture(kSamplerYUV[textureId], uv);
37-
};
36+
out_FragColor = texture(kSamplersYUV[textureId], uv);
37+
}
3838
)";
3939

4040
size_t currentDemo_ = 0;

0 commit comments

Comments
 (0)