dawn-cmake/test/shader_io/interpolate_integers.wgsl.expected.hlsl
Ben Clayton 2bb45389b7 writer/hlsl: Zero initialize with (T) 0
For structures and arrays.
This behaves identically to the per-element zero-initialization, but can be significantly less verbose.

Change-Id: I380ef86f16c2b3f37a9de2820e707f368955b761
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56764
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2021-07-02 19:27:42 +00:00

38 lines
895 B
HLSL

struct Interface {
int i;
uint u;
int4 vi;
uint4 vu;
float4 pos;
};
struct tint_symbol {
int i : TEXCOORD0;
uint u : TEXCOORD1;
int4 vi : TEXCOORD2;
uint4 vu : TEXCOORD3;
float4 pos : SV_Position;
};
tint_symbol vert_main() {
const Interface tint_symbol_1 = (Interface)0;
const tint_symbol tint_symbol_5 = {tint_symbol_1.i, tint_symbol_1.u, tint_symbol_1.vi, tint_symbol_1.vu, tint_symbol_1.pos};
return tint_symbol_5;
}
struct tint_symbol_3 {
int i : TEXCOORD0;
uint u : TEXCOORD1;
int4 vi : TEXCOORD2;
uint4 vu : TEXCOORD3;
float4 pos : SV_Position;
};
struct tint_symbol_4 {
int value : SV_Target0;
};
tint_symbol_4 frag_main(tint_symbol_3 tint_symbol_2) {
const Interface inputs = {tint_symbol_2.i, tint_symbol_2.u, tint_symbol_2.vi, tint_symbol_2.vu, tint_symbol_2.pos};
const tint_symbol_4 tint_symbol_6 = {inputs.i};
return tint_symbol_6;
}