HLSL: Add parens in unpackUint2x32 for clarity.

This commit is contained in:
Hans-Kristian Arntzen 2020-04-21 11:48:37 +02:00
parent e4e4791c4e
commit 7b9cba7424
3 changed files with 6 additions and 6 deletions

View File

@ -7,7 +7,7 @@ struct SPIRV_Cross_Output
uint64_t SPIRV_Cross_packUint2x32(uint2 value)
{
return uint64_t(value.y) << 32 | uint64_t(value.x);
return (uint64_t(value.y) << 32) | uint64_t(value.x);
}
uint2 SPIRV_Cross_unpackUint2x32(uint64_t value)

View File

@ -7,7 +7,7 @@ struct SPIRV_Cross_Output
uint64_t SPIRV_Cross_packUint2x32(uint2 value)
{
return uint64_t(value.y) << 32 | uint64_t(value.x);
return (uint64_t(value.y) << 32) | uint64_t(value.x);
}
uint2 SPIRV_Cross_unpackUint2x32(uint64_t value)

View File

@ -1507,7 +1507,7 @@ void CompilerHLSL::emit_resources()
{
statement("uint64_t SPIRV_Cross_packUint2x32(uint2 value)");
begin_scope();
statement("return uint64_t(value.y) << 32 | uint64_t(value.x);");
statement("return (uint64_t(value.y) << 32) | uint64_t(value.x);");
end_scope();
statement("");