Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 1 | uint tint_pack4x8snorm(float4 param_0) { |
| 2 | int4 i = int4(round(clamp(param_0, -1.0, 1.0) * 127.0)) & 0xff; |
| 3 | return asuint(i.x | i.y << 8 | i.z << 16 | i.w << 24); |
| 4 | } |
| 5 | |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 6 | RWByteAddressBuffer prevent_dce : register(u0, space2); |
| 7 | |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 8 | void pack4x8snorm_4d22e7() { |
Ben Clayton | 4b60615 | 2022-11-04 17:06:03 +0000 | [diff] [blame] | 9 | float4 arg_0 = (1.0f).xxxx; |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 10 | uint res = tint_pack4x8snorm(arg_0); |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 11 | prevent_dce.Store(0u, asuint(res)); |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 12 | } |
| 13 | |
| 14 | struct tint_symbol { |
| 15 | float4 value : SV_Position; |
| 16 | }; |
| 17 | |
| 18 | float4 vertex_main_inner() { |
| 19 | pack4x8snorm_4d22e7(); |
| 20 | return (0.0f).xxxx; |
| 21 | } |
| 22 | |
| 23 | tint_symbol vertex_main() { |
| 24 | const float4 inner_result = vertex_main_inner(); |
| 25 | tint_symbol wrapper_result = (tint_symbol)0; |
| 26 | wrapper_result.value = inner_result; |
| 27 | return wrapper_result; |
| 28 | } |
| 29 | |
| 30 | void fragment_main() { |
| 31 | pack4x8snorm_4d22e7(); |
| 32 | return; |
| 33 | } |
| 34 | |
| 35 | [numthreads(1, 1, 1)] |
| 36 | void compute_main() { |
| 37 | pack4x8snorm_4d22e7(); |
| 38 | return; |
| 39 | } |