Traverse-Research / rspirv-reflect

🦀 Minimal SPIR-V reflection library.
https://traverseresearch.nl
Apache License 2.0
41 stars 10 forks source link

Reflection::get_descriptor_sets doesn't list samplers #30

Closed wolfiestyle closed 1 year ago

wolfiestyle commented 1 year ago

example fragment shader:

#version 450
layout(binding = 0) uniform sampler2D texSampler;

layout(location = 0) in vec4 fragColor;
layout(location = 1) in vec2 fragTexCoord;

layout(location = 0) out vec4 outColor;

void main() {
    outColor = texture(texSampler, fragTexCoord) * fragColor;
}

the output of get_descriptor_sets is empty

MarijnS95 commented 1 year ago

Thank you for reporting this! The issue may have already been fixed by #27 (but was reported to cause a panic rather than an empty list in #26), but that hasn't made it to a release yet. Can you try the latest master branch and confirm that it works for you?

5 introduces a bunch of GLSL-specific tests, one of which has a layout(set = 5, binding = 0) uniform sampler2D g_samplerimage2d; similar to your example (but in a compute shader) which results in the following binding output:

    5: {
        0: DescriptorInfo {
            ty: COMBINED_IMAGE_SAMPLER,
            binding_count: One,
            name: "g_samplerimage2d",
        },
    },

And there's similar output with your shader on that test branch. Let me know how testing goes, I'll likely just merge #5 and push out a new release if this resolves it for you!