blob: 99a1c2e8db1432968123928b9891dee7b616a125 [file] [log] [blame]
Ben Claytonc0af5c52022-06-02 14:36:10 +00001uint tint_insert_bits(uint v, uint n, uint offset, uint count) {
Antonio Maiorano144ebed2024-01-30 16:30:15 +00002 uint e = (offset + count);
3 uint mask = ((((offset < 32u) ? (1u << offset) : 0u) - 1u) ^ (((e < 32u) ? (1u << e) : 0u) - 1u));
Zhaoming Jiang4f3f45c2022-11-09 01:54:08 +00004 return ((((offset < 32u) ? (n << offset) : 0u) & mask) | (v & ~(mask)));
Ben Claytonc0af5c52022-06-02 14:36:10 +00005}
6
Natalie Chouinard6ee63302024-06-25 20:45:30 +00007RWByteAddressBuffer prevent_dce : register(u0);
8
Natalie Chouinarde9027182024-06-13 18:50:19 +00009uint insertBits_e3e3a2() {
Ben Claytonc0af5c52022-06-02 14:36:10 +000010 uint arg_0 = 1u;
11 uint arg_1 = 1u;
12 uint arg_2 = 1u;
13 uint arg_3 = 1u;
14 uint res = tint_insert_bits(arg_0, arg_1, arg_2, arg_3);
Natalie Chouinarde9027182024-06-13 18:50:19 +000015 return res;
Ben Claytonc0af5c52022-06-02 14:36:10 +000016}
17
Ben Claytonc0af5c52022-06-02 14:36:10 +000018void fragment_main() {
Natalie Chouinarde9027182024-06-13 18:50:19 +000019 prevent_dce.Store(0u, asuint(insertBits_e3e3a2()));
Ben Claytonc0af5c52022-06-02 14:36:10 +000020 return;
21}
22
23[numthreads(1, 1, 1)]
24void compute_main() {
Natalie Chouinarde9027182024-06-13 18:50:19 +000025 prevent_dce.Store(0u, asuint(insertBits_e3e3a2()));
Ben Claytonc0af5c52022-06-02 14:36:10 +000026 return;
27}
Natalie Chouinarde9027182024-06-13 18:50:19 +000028
29struct VertexOutput {
30 float4 pos;
31 uint prevent_dce;
32};
33struct tint_symbol_1 {
34 nointerpolation uint prevent_dce : TEXCOORD0;
35 float4 pos : SV_Position;
36};
37
38VertexOutput vertex_main_inner() {
39 VertexOutput tint_symbol = (VertexOutput)0;
40 tint_symbol.pos = (0.0f).xxxx;
41 tint_symbol.prevent_dce = insertBits_e3e3a2();
42 return tint_symbol;
43}
44
45tint_symbol_1 vertex_main() {
46 VertexOutput inner_result = vertex_main_inner();
47 tint_symbol_1 wrapper_result = (tint_symbol_1)0;
48 wrapper_result.pos = inner_result.pos;
49 wrapper_result.prevent_dce = inner_result.prevent_dce;
50 return wrapper_result;
51}