mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-14 16:01:07 +00:00
HLSL: Add parens in unpackUint2x32 for clarity.
This commit is contained in:
parent
e4e4791c4e
commit
7b9cba7424
@ -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)
|
||||
@ -15,7 +15,7 @@ uint2 SPIRV_Cross_unpackUint2x32(uint64_t value)
|
||||
uint2 Unpacked;
|
||||
Unpacked.x = uint(value & 0xffffffff);
|
||||
Unpacked.y = uint(value >> 32);
|
||||
return Unpacked;
|
||||
return Unpacked;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
|
@ -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)
|
||||
@ -15,7 +15,7 @@ uint2 SPIRV_Cross_unpackUint2x32(uint64_t value)
|
||||
uint2 Unpacked;
|
||||
Unpacked.x = uint(value & 0xffffffff);
|
||||
Unpacked.y = uint(value >> 32);
|
||||
return Unpacked;
|
||||
return Unpacked;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
|
@ -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("");
|
||||
|
||||
@ -1516,7 +1516,7 @@ void CompilerHLSL::emit_resources()
|
||||
statement("uint2 Unpacked;");
|
||||
statement("Unpacked.x = uint(value & 0xffffffff);");
|
||||
statement("Unpacked.y = uint(value >> 32);");
|
||||
statement("return Unpacked; ");
|
||||
statement("return Unpacked;");
|
||||
end_scope();
|
||||
statement("");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user