dawn-cmake/test/shader_io/shared_struct_storage_buffer.wgsl.expected.hlsl
Ben Clayton 5d2f34ecf2 writer/hlsl: Simplify emission logic, clean up output
And fix issues where global variables would not be emitted unless they were transitively referenced by an entry point.

This change requires crbug.com/tint/697 to be fixed before landing.

Change-Id: I712bd9d369e08c9a3cdfb0f114c3609584f91f28
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54241
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
2021-06-16 09:19:36 +00:00

29 lines
657 B
HLSL

struct S {
float f;
uint u;
float4 v;
};
void tint_symbol_5(RWByteAddressBuffer buffer, uint offset, S value) {
buffer.Store((offset + 0u), asuint(value.f));
buffer.Store((offset + 4u), asuint(value.u));
buffer.Store4((offset + 128u), asuint(value.v));
}
RWByteAddressBuffer output : register(u0, space0);
struct tint_symbol_1 {
float f : TEXCOORD0;
uint u : TEXCOORD1;
float4 v : SV_Position;
};
void frag_main(tint_symbol_1 tint_symbol) {
const S input = {tint_symbol.f, tint_symbol.u, tint_symbol.v};
const float f = input.f;
const uint u = input.u;
const float4 v = input.v;
tint_symbol_5(output, 0u, input);
return;
}