Skip to content

Commit

Permalink
Merge pull request #2410 from rdb/glsl-legacy-fix-int-literal-suffix
Browse files Browse the repository at this point in the history
GLSL: Use u literal suffix in legacy GLSL if GL_EXT_gpu_shader4 is available
  • Loading branch information
HansKristian-Work authored Nov 13, 2024
2 parents a018347 + 8caa638 commit 6cbb943
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 6cbb943

Please sign in to comment.