SPIRV-Cross/reference/opt/shaders
Grigory Dzhavadyan a5d82d1138 Alter the handling of spec consts in non-Vulkan GLSL
Previously, when generating non-Vulkan GLSL, each use of a spec constant
would be subsituted for its default value and the declaration of the constant
itself would be omitted completely.

This change slightly alters this behavior. The uses of the constant are kept,
as well as the declaration, although the latter is stripped of the layout
qualifier. The declaration is also prepended with the following code:

    #ifndef <constant name>_value
    #define <constant name> <default constant value>
    #endif

and the constant itself now looks like

    const <constant type> <constant name> = <constant name>_value;

The rationale for this change is that it gives the user a way to provide
custom values for specialization constants even when the target does not
support them.
2018-11-01 00:39:09 -07:00
..
amd Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
asm Alter the handling of spec consts in non-Vulkan GLSL 2018-11-01 00:39:09 -07:00
comp Alter the handling of spec consts in non-Vulkan GLSL 2018-11-01 00:39:09 -07:00
desktop-only Add Windows support in Travis CI. 2018-10-27 00:22:30 +02:00
flatten Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
frag Add Windows support in Travis CI. 2018-10-27 00:22:30 +02:00
geom Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00
legacy Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00
tesc Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00
tese Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00
vert Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
vulkan Alter the handling of spec consts in non-Vulkan GLSL 2018-11-01 00:39:09 -07:00