dan sinclair | 8f1d276 | 2024-07-31 02:35:40 +0000 | [diff] [blame] | 1 | struct VertexOutput { |
| 2 | float4 vtxFragColor; |
| 3 | float4 Position; |
| 4 | }; |
dan sinclair | 6931379 | 2024-06-13 20:35:21 +0000 | [diff] [blame] | 5 | |
dan sinclair | 8f1d276 | 2024-07-31 02:35:40 +0000 | [diff] [blame] | 6 | struct VertexInput { |
| 7 | float4 cur_position; |
| 8 | float4 color; |
| 9 | }; |
| 10 | |
| 11 | struct vtx_main_outputs { |
| 12 | float4 VertexOutput_vtxFragColor : TEXCOORD0; |
| 13 | float4 VertexOutput_Position : SV_Position; |
| 14 | }; |
| 15 | |
| 16 | struct vtx_main_inputs { |
| 17 | float4 VertexInput_cur_position : TEXCOORD0; |
| 18 | float4 VertexInput_color : TEXCOORD1; |
| 19 | }; |
| 20 | |
| 21 | struct frag_main_outputs { |
| 22 | float4 tint_symbol : SV_Target0; |
| 23 | }; |
| 24 | |
| 25 | struct frag_main_inputs { |
| 26 | float4 fragColor : TEXCOORD0; |
| 27 | }; |
| 28 | |
| 29 | |
| 30 | cbuffer cbuffer_uniforms : register(b0) { |
| 31 | uint4 uniforms[4]; |
| 32 | }; |
| 33 | float4x4 v(uint start_byte_offset) { |
| 34 | float4 v_1 = asfloat(uniforms[(start_byte_offset / 16u)]); |
| 35 | float4 v_2 = asfloat(uniforms[((16u + start_byte_offset) / 16u)]); |
| 36 | float4 v_3 = asfloat(uniforms[((32u + start_byte_offset) / 16u)]); |
| 37 | return float4x4(v_1, v_2, v_3, asfloat(uniforms[((48u + start_byte_offset) / 16u)])); |
| 38 | } |
| 39 | |
| 40 | VertexOutput vtx_main_inner(VertexInput input) { |
| 41 | VertexOutput output = (VertexOutput)0; |
| 42 | output.Position = mul(input.cur_position, v(0u)); |
| 43 | output.vtxFragColor = input.color; |
| 44 | VertexOutput v_4 = output; |
| 45 | return v_4; |
| 46 | } |
| 47 | |
| 48 | float4 frag_main_inner(float4 fragColor) { |
| 49 | return fragColor; |
| 50 | } |
| 51 | |
| 52 | vtx_main_outputs vtx_main(vtx_main_inputs inputs) { |
| 53 | VertexInput v_5 = {inputs.VertexInput_cur_position, inputs.VertexInput_color}; |
| 54 | VertexOutput v_6 = vtx_main_inner(v_5); |
dan sinclair | 34a2d65 | 2024-10-25 00:30:58 +0000 | [diff] [blame] | 55 | vtx_main_outputs v_7 = {v_6.vtxFragColor, v_6.Position}; |
| 56 | return v_7; |
dan sinclair | 8f1d276 | 2024-07-31 02:35:40 +0000 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | frag_main_outputs frag_main(frag_main_inputs inputs) { |
dan sinclair | 34a2d65 | 2024-10-25 00:30:58 +0000 | [diff] [blame] | 60 | frag_main_outputs v_8 = {frag_main_inner(inputs.fragColor)}; |
| 61 | return v_8; |
dan sinclair | 8f1d276 | 2024-07-31 02:35:40 +0000 | [diff] [blame] | 62 | } |
| 63 | |