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:
Ben Clayton
2021-06-16 09:50:11 +00:00
committed by Ben Clayton
parent 31936f375f
commit d47eb3a965
16 changed files with 756 additions and 101 deletions

View File

@@ -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);

View File

@@ -1,5 +1,5 @@
struct Uniforms {
float4x4 modelViewProjectionMatrix;
/* 0x0000 */ float4x4 modelViewProjectionMatrix;
};
ConstantBuffer<Uniforms> uniforms : register(b0, space0);