41007cdc7d
It is possible in SPIR-V to declare multiple specialization constants with the same constant ID. The most common cause of this in GLSL is defining a spec constant, then declaring the workgroup size to use that spec constant by its ID. But, MSL forbids defining multiple function constants with the same function constant ID. So, we must only emit one definition of the actual function constant (with the `[[function_constant(id)]]` attribute); but we can point the other variables at this one definition. Fixes three tests in the Vulkan CTS under `dEQP-VK.compute.basic.max_local_size_*`.
16 lines
385 B
Plaintext
16 lines
385 B
Plaintext
#version 450
|
|
|
|
layout(constant_id=0) const int local_size_x_val = 1;
|
|
layout(constant_id=1) const int local_size_y_val = 1;
|
|
layout(constant_id=2) const int local_size_z_val = 1;
|
|
|
|
layout(local_size_x_id=0, local_size_y_id=1, local_size_z_id=2) in;
|
|
|
|
layout(set=0, binding=0) buffer StorageBuffer {
|
|
uint values[];
|
|
} ssbo;
|
|
|
|
void main() {
|
|
ssbo.values[gl_LocalInvocationIndex] = 1u;
|
|
}
|