Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specialization constant not considered constant for subgroupBroadcast (again?) #3199

Open
nwessing opened this issue Apr 26, 2023 · 0 comments

Comments

@nwessing
Copy link

I think this is the same issues as in #2919
I am using the glslangValidator that is distributed with VulkanSDK 1.3.243.0

Specialization constant derived value should be considered constant for its use in subgroupBroadcast

#version 450
#extension GL_KHR_shader_subgroup_ballot: enable

layout(local_size_x_id = 0, local_size_y = 1, local_size_z = 1) in;
layout(constant_id = 0) const uint SUBGROUP_SIZE = 32;

layout(set = 0, binding = 0) writeonly buffer OutputBuffer {
  uint outputBuffer[];
};

void main() {
  uint value = gl_LocalInvocationID.x;
  uint result = subgroupBroadcast(value, SUBGROUP_SIZE - 1);
  outputBuffer[gl_WorkGroupID.x * SUBGROUP_SIZE + gl_LocalInvocationID.x] = result;
}

Here is the command used to compile and the output:

> glslangValidator.exe -g --target-env vulkan1.1 app/shaders/repro.comp.glsl -o test.spv
app/shaders/repro.comp.glsl
ERROR: app/shaders/repro.comp.glsl:13: 'id' : argument must be compile-time constant
ERROR: app/shaders/repro.comp.glsl:13: '' : compilation terminated
ERROR: 2 compilation errors.  No code generated.


SPIR-V is not generated for failed compile or link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants