// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.163 on Tue Sep  8 09:43:26 2026
//
//
// Buffer Definitions:
//
// cbuffer TransformCB
// {
//
//   float4 mtx_palette[32];            // Index:    0-31             Components:   128
//   float4 y_scale;                    // Index:   32.xyzw           Components:     4
//
// }
//
// cbuffer PerDrawCB
// {
//
//   struct
//   {
//
//       uint width;                    // Index:    0
//       uint height;                   // Index:    0.y
//       bool linear_filtering;         // Index:    0.z
//
//   } textures[7];                     // Index:    0-6.z            Components:    27 [unused]
//   float4 combiner_inputs[6];         // Index:    7-12             Components:    24 [unused]
//   float4 fog_color;                  // Index:   13.xyzw           Components:     4 [unused]
//   float4 grayscale_color;            // Index:   14.xyzw           Components:     4 [unused]
//   float4 uv_transform[2];            // Index:   15 16             Components:     8
//   float4 texture_clamp[2];           // Index:   17 18             Components:     8 [unused]
//   float4 fog_params;                 // Index:   19.xyzw           Components:     4 [unused]
//   float4 palette_params[2];          // Index:   20 21             Components:     8 [unused]
//   float4 lod_params;                 // Index:   22.xyzw           Components:     4 [unused]
//   float4 uCustom[16];                // Index:   23-38             Components:    64 [unused]
//   float4 debug_tint;                 // Index:   39.xyzw           Components:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// StereoParams                      texture  float4          2d  125        1
// PerDrawCB                         cbuffer      NA          NA    1        1
// TransformCB                       cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// MTXSLOT                  0   x           1     NONE   float   x
// TEXCOORD                 0   xy          2     NONE   float   xy
// SHADE                    0   xyz         3     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
// SHADE                    0   xyz         2     NONE   float   xyz
// P                        0   x           3  RTINDEX    uint   x
//
vs_4_0
dcl_output_siv o3.x, rendertarget_array_index
dcl_constantbuffer CB4[33], dynamicIndexed
dcl_constantbuffer CB1[16], immediateIndexed
dcl_resource_buffer (float,float,float,float) t125
dcl_input v0.xyzw
dcl_input v1.x
dcl_input v2.xy
dcl_input v3.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyz
dcl_temps 5
ld_indexable(buffer)(float,float,float,float) r4.xyzw, l(0, 0, 0, 0), t125.xyzw
mov o3.x, r4.z
add r0.x, v1.x, l(0.500000)
round_z r0.x, r0.x
ftou r0.x, r0.x
ishl r0.x, r0.x, l(2)
utof r0.y, r0.x
ftoi r0.y, r0.y
iadd r0.yzw, r0.yyyy, l(0, 1, 2, 3)
itof r0.yzw, r0.yyzw
ftou r0.yzw, r0.yyzw
mul r1.xyzw, v0.yyyy, cb4[r0.y + 0].xyzw
mad r1.xyzw, v0.xxxx, cb4[r0.x + 0].xyzw, r1.xyzw
mad r1.xyzw, v0.zzzz, cb4[r0.z + 0].xyzw, r1.xyzw
mad r0.xyzw, v0.wwww, cb4[r0.w + 0].xyzw, r1.xyzw
ld r1.xyzw, l(0, 0, 0, 0), t125.xyzw
add r1.x, r0.x, r1.x
eq r1.y, r0.w, l(1.000000)
movc r2.x, r1.y, r1.x, r0.x
add r0.x, r0.w, r0.z
mul r2.z, r0.x, l(0.500000)
mul r2.y, r0.y, cb4[32].x
mov r2.w, r0.w
mad o1.xy, v2.xyxx, cb1[15].xzxx, cb1[15].ywyy
mov o2.xyz, v3.xyzx
add r3.x, -r4.y, r2.w
mul r3.y, r4.x, r4.w
mad r3.x, r3.x, r3.y, r2.x
ne r3.y, l(1.000000), r2.w
movc r2.x, r3.y, r3.x, r2.x
mov o0.xyzw, r2.xyzw
ret
// Approximately 24 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v0.6.163 on Tue Sep  8 09:43:26 2026
//
// cbuffer TransformCB : register(b4)
// {
//   float4 mtx_palette[32] : packoffset(c0);
//   float4 y_scale : packoffset(c32);
// }
//
// cbuffer PerDrawCB : register(b1)
// {
//
//   struct
//   {
//     uint width;
//     uint height;
//     bool linear_filtering;
//   } textures[7] : packoffset(c0);
//
//   float4 combiner_inputs[6] : packoffset(c7);
//   float4 fog_color : packoffset(c13);
//   float4 grayscale_color : packoffset(c14);
//   float4 uv_transform[2] : packoffset(c15);
//   float4 texture_clamp[2] : packoffset(c17);
//   float4 fog_params : packoffset(c19);
//   float4 palette_params[2] : packoffset(c20);
//   float4 lod_params : packoffset(c22);
//   float4 uCustom[16] : packoffset(c23);
//   float4 debug_tint : packoffset(c39);
// }
//
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Buffer<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : POSITION0,
//   float v1 : MTXSLOT0,
//   float2 v2 : TEXCOORD0,
//   float3 v3 : SHADE0,
//   out float4 o0 : SV_POSITION0,
//   out float2 o1 : TEXCOORD0,
//   out float3 o2 : SHADE0,
//   out uint o3 : P0)
// {
//   float4 r0,r1,r2,r3,r4;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r4.xyzw = StereoParams.Load(float4(0,0,0,0)).xyzw;
//   o3.x = r4.z;
//   r0.x = 0.5 + v1.x;
//   r0.x = trunc(r0.x);
//   r0.x = (uint)r0.x;
//   r0.x = (uint)r0.x << 2;
//   r0.y = (uint)r0.x;
//   r0.y = (int)r0.y;
//   r0.yzw = (int3)r0.yyy + int3(1,2,3);
//   r0.yzw = (int3)r0.yzw;
//   r0.yzw = (uint3)r0.yzw;
//   r1.xyzw = mtx_palette[r0.y].xyzw * v0.yyyy;
//   r1.xyzw = v0.xxxx * mtx_palette[r0.x].xyzw + r1.xyzw;
//   r1.xyzw = v0.zzzz * mtx_palette[r0.z].xyzw + r1.xyzw;
//   r0.xyzw = v0.wwww * mtx_palette[r0.w].xyzw + r1.xyzw;
//   r1.xyzw = StereoParams.Load(float4(0,0,0,0)).xyzw;
//   r1.x = r1.x + r0.x;
//   r1.y = cmp(r0.w == 1.000000);
//   r2.x = r1.y ? r1.x : r0.x;
//   r0.x = r0.z + r0.w;
//   r2.z = 0.5 * r0.x;
//   r2.y = y_scale.x * r0.y;
//   r2.w = r0.w;
//   o1.xy = v2.xy * uv_transform[0].xz + uv_transform[0].yw;
//   o2.xyz = v3.xyz;
//   r3.x = r2.w + -r4.y;
//   r3.y = r4.w * r4.x;
//   r3.x = r3.x * r3.y + r2.x;
//   r3.y = cmp(1.000000 != r2.w);
//   r2.x = r3.y ? r3.x : r2.x;
//   o0.xyzw = r2.xyzw;
//   return;
// }
/////////////////////////////////////////////////////////////////////////////
