Closed Themaister closed 5 years ago
Note that the integer equivalent is supported:
const ivec3 scVec = ivec3(scX, 1, scZ); // partially specialized vector
This generates correct SPIR-V with a specialization constant vector. Will look into why floating point is treated differently.
This is as specified in KHR_vulkan_glsl:
The allowed specialization operator white list for producing a specialization constant includes these:
- int(), uint(), and bool() constructors for type conversions from any of the following types to any of the following types:
- int
- uint
- bool
- vector versions of the above conversion constructors
But, not the floating-point variants.
So, the expression vec3(scX, 1, scZ)
is not a specialization constant, making it a non-constant.
This could instead, if needed, be filed as a feature request against GLSL/Vulkan.
Vulkan GLSL supports partially specializing a vector:
However, this shader fails to compile: