]> git.tdb.fi Git - libs/gl.git/commit
Disallow specialization constants in certain contexts
authorMikko Rasa <tdb@tdb.fi>
Sun, 7 Nov 2021 12:32:33 +0000 (14:32 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 7 Nov 2021 14:00:32 +0000 (16:00 +0200)
commit2e9d0beaafa8220d8a917749c8a12beaf4718729
treec47a269bb84937b1e3ac2e0f94a60f9835906cf5
parent23779cd03a8b1f6fdc3b2e4d8880170d3fa6146f
Disallow specialization constants in certain contexts

The initialization of a specialization constant must not use other
specialization constants.

Arrays sized by a specialization constant inside structures are broken
by design because member offsets in SPIR-V are required to be literals.
Changing the size through specialization would at best leave empty space
in the struct and at worst overlap other members.
source/glsl/validate.cpp
source/glsl/validate.h
tests/glsl/specialized_array_in_struct.glsl