mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
writer/hlsl: Generate padding for UBO padded structs
Combined with the new PadArrayElements transform, arrays with strides are now correctly emitted. Fixed: tint:182 Fixed: tint:895 Change-Id: I26a1be94dee6e4c9d9747c8317a932fc1fb3c810 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54640 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
@@ -27,13 +27,13 @@ tint_symbol_3 frag_main() {
|
||||
}
|
||||
|
||||
struct SimParams {
|
||||
float deltaT;
|
||||
float rule1Distance;
|
||||
float rule2Distance;
|
||||
float rule3Distance;
|
||||
float rule1Scale;
|
||||
float rule2Scale;
|
||||
float rule3Scale;
|
||||
/* 0x0000 */ float deltaT;
|
||||
/* 0x0004 */ float rule1Distance;
|
||||
/* 0x0008 */ float rule2Distance;
|
||||
/* 0x000c */ float rule3Distance;
|
||||
/* 0x0010 */ float rule1Scale;
|
||||
/* 0x0014 */ float rule2Scale;
|
||||
/* 0x0018 */ float rule3Scale;
|
||||
};
|
||||
|
||||
ConstantBuffer<SimParams> params : register(b0, space0);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct Uniforms {
|
||||
float4x4 modelViewProjectionMatrix;
|
||||
/* 0x0000 */ float4x4 modelViewProjectionMatrix;
|
||||
};
|
||||
|
||||
ConstantBuffer<Uniforms> uniforms : register(b0, space0);
|
||||
|
||||
Reference in New Issue
Block a user