Skip to content

Commit

Permalink
GLSL: Use u literal suffix in legacy if GL_EXT_gpu_shader4 available
Browse files Browse the repository at this point in the history
  • Loading branch information
rdb committed Nov 9, 2024
1 parent a018347 commit 8caa638
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spirv_glsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6438,7 +6438,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
if (splat)
{
res += convert_to_string(c.scalar(vector, 0));
if (is_legacy())
if (is_legacy() && !has_extension("GL_EXT_gpu_shader4"))
{
// Fake unsigned constant literals with signed ones if possible.
// Things like array sizes, etc, tend to be unsigned even though they could just as easily be signed.
Expand All @@ -6457,7 +6457,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
else
{
res += convert_to_string(c.scalar(vector, i));
if (is_legacy())
if (is_legacy() && !has_extension("GL_EXT_gpu_shader4"))
{
// Fake unsigned constant literals with signed ones if possible.
// Things like array sizes, etc, tend to be unsigned even though they could just as easily be signed.
Expand Down

0 comments on commit 8caa638

Please sign in to comment.