//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.16 on Tue Jan 18 18:00:19 2022
//
//
// Buffer Definitions:
//
// cbuffer ConstBuf__modelData
// {
//
//   struct ModelData
//   {
//
//       uint lightGroupID;             // Index:    0
//       uint modelFlags;               // Index:    0.y
//       float lodFade;                 // Index:    0.z
//       float displacementBlend;       // Index:    0.w
//       int turbulenceDataIdx;         // Index:    1
//       int instanceOffset;            // Index:    1.y
//       int characterFxIdx;            // Index:    1.z
//       uint debugRenderChannel;       // Index:    1.w
//       uint decayWriteOffset;         // Index:    2
//       uint decayWriteMaxCount;       // Index:    2.y
//       uint decayAtomicCounterIndex;  // Index:    2.z
//       float modelAlpha;              // Index:    2.w
//       float emissiveScale;           // Index:    3
//       float desaturationScale;       // Index:    3.y
//       float decayCoverageEstimation; // Index:    3.z
//       float3 quantScale;             // Index:    4
//       float3 quantBias;              // Index:    5
//
//   } resourceTables__modelData;       // Index:    0-5.z            Components:    23
                                        // Textures:  t0-t2
//
// }
//
// cbuffer ConstBuf__viewData
// {
//
//   struct ViewData
//   {
//
//       float4x4 view;                 // Index:    0
//       float4x4 invView;              // Index:    4
//       float4x4 proj;                 // Index:    8
//       float4x4 invViewProjNoZReproj; // Index:   12
//       float4x4 viewProj;             // Index:   16
//       float4x4 invViewProj;          // Index:   20
//       float4x4 previousViewProj;     // Index:   24
//       float4 prevLodEyePos;          // Index:   28
//       float4 lodEyePos;              // Index:   29
//       float4 viewDirDepthBias;       // Index:   30
//       float3 eyePos;                 // Index:   31
//       float2 viewportSize;           // Index:   32
//       float2 invViewportSize;        // Index:   32.z
//       float4 mirrorPlaneWS;          // Index:   33
//       float2 mirrorViewportSize;     // Index:   34
//       float2 opaqueRefractionViewportSize;// Index:   34.z
//       float windTime;                // Index:   35
//       float deltaTime;               // Index:   35.y
//       float depthReprojectScale;     // Index:   35.z
//       float depthReprojectBias;      // Index:   35.w
//       uint shadowViewType;           // Index:   36
//       float normalDepthBias;         // Index:   36.y
//       float noNormalAA;              // Index:   36.z
//       float noNormalFromAlpha;       // Index:   36.w
//       float noOpaqueTransparency;    // Index:   37
//       float translucentAmount;       // Index:   37.y
//       uint framePhase;               // Index:   37.z
//       float cameraAmbientExposure;   // Index:   37.w
//       float fxExposure;              // Index:   38
//       float fxAmbientExposure;       // Index:   38.y
//       uint checkerboardPhase;        // Index:   38.z
//       float sparkleIntensityScale;   // Index:   38.w
//
//   } resourceTables__viewData;        // Index:    0-38             Components:   156
//
// }
//
// Resource bind info for resourceTables__modelData.bones
// {
//
//   float4x3 $Element;                 // Index:    0 1 2            Components:    12
//
// }
//
// Resource bind info for resourceTables__modelData.instancingBuffer
// {
//
//   struct InstancingData
//   {
//
//       float4x3 transformCurrentFrame;// Index:    0
//       float4x3 transformPrevFrame;   // Index:    3
//       uint vertColOffset;            // Index:    6
//       uint packedLodFadeDisplacementTurbulenceIdx;// Index:    6.y
//
//   } $Element;                        // Index:    0-6.y            Components:    26
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// resourceTables__modelData.bones    texture  struct         r/o    0        1
// resourceTables__modelData.instancingBuffer    texture  struct         r/o    2        1
// ConstBuf__modelData               cbuffer      NA          NA    1        1
// ConstBuf__viewData                cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyz
// TEXCOORD                 0   xy          1     NONE   float
// NORMAL                   0   xyz         2     NONE   float   xyz
// TANGENT                  0   xyzw        3     NONE   float
// BLENDWEIGHT              0   xyzw        4     NONE   float   xyz
// BLENDINDICES             0   xyzw        5     NONE    uint   xyzw
// TEXCOORD                 4   xyzw        6     NONE    uint
// TEXCOORD                 5   xyz         7     NONE   float   xyz
// SV_InstanceID            0   x           8   INSTID    uint   x
// SV_VertexID              0   x           9   VERTID    uint   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// VERT_ID                  0   x           1     NONE    uint   x
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[6], immediateIndexed
dcl_constantbuffer cb2[37], immediateIndexed
dcl_resource_structured t0, 48
dcl_resource_structured t2, 104
dcl_input v0.xyz
dcl_input v2.xyz
dcl_input v4.xyz
dcl_input v5.xyzw
dcl_input v7.xyz
dcl_input_sgv v8.x, instance_id
dcl_input_sgv v9.x, vertex_id
dcl_output_siv o0.xyzw, position
dcl_output o1.x
dcl_temps 50
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r40.xyzw, l(0, 0, 0, 0), t125.xyzw
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r0.xyzw, v5.y, l(0), t0.xyzw
mul r0.xyzw, r0.xyzw, v4.yyyy
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r1.xyzw, v5.x, l(0), t0.xyzw
mad r0.xyzw, v4.xxxx, r1.xyzw, r0.xyzw
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r1.xyzw, v5.z, l(0), t0.xyzw
mad r0.xyzw, v4.zzzz, r1.xyzw, r0.xyzw
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r1.xyzw, v5.w, l(0), t0.xyzw
add r2.x, v4.y, v4.x
add r2.x, r2.x, v4.z
add r2.x, -r2.x, l(1.000000)
mad r0.xyzw, r2.xxxx, r1.xyzw, r0.xyzw
mov r1.x, r0.w
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r3.xyzw, v5.y, l(16), t0.xyzw
mul r3.xyzw, r3.xyzw, v4.yyyy
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r4.xyzw, v5.x, l(16), t0.xyzw
mad r3.xyzw, v4.xxxx, r4.xyzw, r3.xyzw
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r4.xyzw, v5.z, l(16), t0.xyzw
mad r3.xyzw, v4.zzzz, r4.xyzw, r3.xyzw
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r4.xyzw, v5.w, l(16), t0.xyzw
mad r3.xyzw, r2.xxxx, r4.xyzw, r3.xyzw
mov r1.y, r3.w
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r4.xyzw, v5.y, l(32), t0.xyzw
mul r4.xyzw, r4.xyzw, v4.yyyy
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r5.xyzw, v5.x, l(32), t0.xyzw
mad r4.xyzw, v4.xxxx, r5.xyzw, r4.xyzw
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r5.xyzw, v5.z, l(32), t0.xyzw
mad r4.xyzw, v4.zzzz, r5.xyzw, r4.xyzw
ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r5.xyzw, v5.w, l(32), t0.xyzw
mad r2.xyzw, r2.xxxx, r5.xyzw, r4.xyzw
mov r1.z, r2.w
iadd r0.w, v8.x, cb1[1].y
ld_structured_indexable(structured_buffer, stride=104)(mixed,mixed,mixed,mixed) r0.w, r0.w, l(100), t2.xxxx
ubfe r1.w, l(8), l(16), r0.w
bfi o1.x, l(24), l(0), v9.x, r0.w
utof r0.w, r1.w
mul r0.w, r0.w, l(0.00392156886)
mad r4.xyz, v0.xyzx, cb1[4].xyzx, cb1[5].xyzx
mad r4.xyz, -v7.xyzx, r0.wwww, r4.xyzx
dp3 r5.x, r4.xyzx, r0.xyzx
dp3 r5.y, r4.xyzx, r3.xyzx
dp3 r5.z, r4.xyzx, r2.xyzx
add r1.xyz, r1.xyzx, r5.xyzx
add r4.xyz, r1.xyzx, -cb2[31].xyzx
dp3 r0.w, r4.xyzx, r4.xyzx
rsq r0.w, r0.w
mul r4.xyz, r0.wwww, r4.xyzx
mad r5.xyz, v2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r0.x, r5.xyzx, r0.xyzx
dp3 r0.y, r5.xyzx, r3.xyzx
dp3 r0.z, r5.xyzx, r2.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3_sat r0.w, -r4.xyzx, r0.xyzx
mul r0.xyz, r0.xyzx, cb2[36].yyyy
add r0.w, -r0.w, l(1.000000)
mad r0.xyz, -r0.xyzx, r0.wwww, r1.xyzx
mad r2.xyz, r4.xyzx, cb2[30].wwww, r0.xyzx
add r0.xyz, r0.xyzx, cb2[30].xyzx
ieq r0.w, l(1), cb2[36].x
movc r0.xyz, r0.wwww, r0.xyzx, r2.xyzx
movc r0.xyz, cb2[36].xxxx, r0.xyzx, r1.xyzx
mov r0.w, l(1.000000)
dp4 r42.x, r0.xyzw, cb2[16].xyzw
dp4 r42.y, r0.xyzw, cb2[17].xyzw
dp4 r42.z, r0.xyzw, cb2[18].xyzw
dp4 r42.w, r0.xyzw, cb2[19].xyzw
ieq r41.x, r42.w, l(1.0)
ieq r41.y, l(1), cb2[36].x
if_nz r41.x
if_z r41.y
add r40.w, r42.w, -r40.y
mad r42.x, r40.x, r40.w, r42.x
endif
endif
mov o0.xyzw, r42.xyzw
ret
// Approximately 68 instruction slots used
