Fixed offsetting for byte values

このコミットが含まれているのは:
Sergio Pedri committed 2019-09-19 16:47:11 +02:00
1 親 5b9ac13a19
コミット ce28fc9097
1ファイル変更
+1 -1
+1 -1
ファイルの表示
@@ -151,7 +151,7 @@ namespace ComputeSharp.Shaders.Translation
else if (HlslKnownTypes.IsKnownScalarType(member.MemberType) || HlslKnownTypes.IsKnownVectorType(member.MemberType))
{
// Calculate the right offset with 16-bytes padding (HLSL constant buffer)
int size = Marshal.SizeOf(member.MemberType);
int size = member.MemberType == typeof(bool) ? sizeof(uint) : Marshal.SizeOf(member.MemberType); // bool is 4 bytes in HLSL
if (_VariablesByteSize % 16 > 16 - size) _VariablesByteSize += 16 - _VariablesByteSize % 16;
// Load the target address into the variables buffer