Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 1 | RWByteAddressBuffer prevent_dce : register(u0, space2); |
| 2 | |
| 3 | void prevent_dce_store(uint offset, float3x4 value) { |
| 4 | prevent_dce.Store4((offset + 0u), asuint(value[0u])); |
| 5 | prevent_dce.Store4((offset + 16u), asuint(value[1u])); |
| 6 | prevent_dce.Store4((offset + 32u), asuint(value[2u])); |
| 7 | } |
| 8 | |
Ben Clayton | 0a2b5f2 | 2021-06-09 14:32:14 +0000 | [diff] [blame] | 9 | void transpose_2585cd() { |
Antonio Maiorano | 9ba5f9e | 2022-11-23 23:12:56 +0000 | [diff] [blame] | 10 | float3x4 res = float3x4((1.0f).xxxx, (1.0f).xxxx, (1.0f).xxxx); |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 11 | prevent_dce_store(0u, res); |
Ben Clayton | 0a2b5f2 | 2021-06-09 14:32:14 +0000 | [diff] [blame] | 12 | } |
| 13 | |
Ben Clayton | 5d2f34e | 2021-06-16 09:19:36 +0000 | [diff] [blame] | 14 | struct tint_symbol { |
| 15 | float4 value : SV_Position; |
| 16 | }; |
| 17 | |
James Price | a5d73ce | 2021-08-04 22:15:28 +0000 | [diff] [blame] | 18 | float4 vertex_main_inner() { |
Ben Clayton | 0a2b5f2 | 2021-06-09 14:32:14 +0000 | [diff] [blame] | 19 | transpose_2585cd(); |
Ben Clayton | e9f8b09 | 2022-06-01 13:14:39 +0000 | [diff] [blame] | 20 | return (0.0f).xxxx; |
James Price | a5d73ce | 2021-08-04 22:15:28 +0000 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | tint_symbol vertex_main() { |
Antonio Maiorano | 144ebed | 2024-01-30 16:30:15 +0000 | [diff] [blame] | 24 | float4 inner_result = vertex_main_inner(); |
James Price | a5d73ce | 2021-08-04 22:15:28 +0000 | [diff] [blame] | 25 | tint_symbol wrapper_result = (tint_symbol)0; |
| 26 | wrapper_result.value = inner_result; |
| 27 | return wrapper_result; |
Ben Clayton | 0a2b5f2 | 2021-06-09 14:32:14 +0000 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | void fragment_main() { |
| 31 | transpose_2585cd(); |
| 32 | return; |
| 33 | } |
| 34 | |
| 35 | [numthreads(1, 1, 1)] |
| 36 | void compute_main() { |
| 37 | transpose_2585cd(); |
| 38 | return; |
| 39 | } |