gta_normal_spec_decalPS8.asm
Parallellines0451_GTAIV_EFLC_LogDepth/win32_30_nv8/gta_normal_spec_decal/gta_normal_spec_decalPS8.asm
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.26.952.2844
//
// Parameters:
//
//   sampler2D StippleTexture;
//   sampler2D TextureSampler;
//   float4 gDirectionalColour;
//   float4 gDirectionalLight;
//   float4 gLightAmbient0;
//   float4 gLightAmbient1;
//   float4 globalFogColor;
//   float4 globalFogParams;
//   float4 globalScalars;
//   float specularColorFactor;
//   float specularFactor;
//
//
// Registers:
//
//   Name                Reg   Size
//   ------------------- ----- ----
//   gDirectionalLight   c17      1
//   gDirectionalColour  c18      1
//   gLightAmbient0      c37      1
//   gLightAmbient1      c38      1
//   globalScalars       c39      1
//   globalFogParams     c41      1
//   globalFogColor      c42      1
//   specularFactor      c66      1
//   specularColorFactor c72      1
//   TextureSampler      s0       1
//   StippleTexture      s10      1
//

    ps_3_0
    def c219, 1.8395173895e+25, 3.9938258725e+24, 4.5435787456e+30, 5.1007264101e-43 // 364
    def c127, 0.9999999, 1, 0, 0 // LogDepth constants
    def c0, 9.99999975e-006, -0.5, 0.5, -0.25
    def c1, 1.33333337, 1, 3.99600005, 4
    def c2, 9.99999975e-005, 0, 0, 0
    def c3, 0.125, 0, -1, -0
    dcl_texcoord v0.xy
    dcl_texcoord1 v1
    dcl_texcoord3 v2.xyz
    dcl_color v3.xw
    dcl vPos.xy
    dcl_texcoord9 v9
    dcl_2d s0
    dcl_2d s10
    texld r0, v0, s0
    add r1.xyz, c0.x, v1
    nrm r2.xyz, r1
    mul r0.w, r0.w, v3.w
    mad_sat r1.x, r2.z, c0.y, c0.z
    mov r3.xyz, c38
    mad r1.xyz, r3, r1.x, c37
    mul r3.xyz, c18.w, c18
    dp3 r1.w, r2, -c17
    add r1.w, r1.w, c0.w
    mul_sat r1.w, r1.w, c1.x
    mul r4.xyz, r3, r1.w
    mad r1.xyz, r1, v3.x, r4
    mov r1.w, c1.y
    mul r0, r0, r1
    mul r0.w, r0.w, c39.x
    mov_sat r1.x, r0.w
    mul r1.x, r1.x, c1.z
    frc r1.y, r1.x
    mul r1.z, r1.y, c1.w
    frc r1.w, r1.z
    add r4.xy, r1.zxzw, -r1.wyzw
    mul r1.xy, c3.x, vPos
    frc r1.xy, r1_abs
    cmp r1.xy, vPos, r1, -r1
    mul r1.xy, r1, -c0.w
    mad r1.xy, r4, -c0.w, r1
    mov r1.zw, c3.y
    texldl r1, r1, s10
    cmp r1, -r1.y, c3.z, c3.w
    texkill r1
    add r1.xyz, c0.x, v2
    nrm r4.xyz, r1
    dp3 r1.x, r4, r2
    add r1.x, r1.x, r1.x
    mad r1.xyz, r2, -r1.x, r4
    dp3_sat r1.x, -c17, r1
    add r1.x, r1.x, c2.x
    mov r2.x, c2.x
    add r1.y, r2.x, c66.x
    pow r2.x, r1.x, r1.y
    mul r1.xyz, r3, r2.x
    mul r1.xyz, r1, c17.w
    mad r0.xyz, c72.x, r1, r0
    add r1.x, -c41.x, v1.w
    add r1.y, -c41.x, c41.y
    rcp r1.y, r1.y
    mul_sat r1.x, r1.x, r1.y
    add r1.yzw, -r0.xxyz, c42.xxyz
    mad oC0.xyz, r1.x, r1.yzww, r0
    mov oC0.w, r0.w
    // ----------------------------------------------------------------- Linear2Log -----------------------------------------------------------------
    if_ne v9.y, c127.y
      rcp r20.z, c128.x
      mul r20.x, v9.w, r20.z
      mul r20.y, c128.y, r20.z
      log r20.x, r20.x
      log r20.y, r20.y
      rcp r20.y, r20.y
    else
      mov r20.x, v9.z
      rcp r20.y, v9.w
    endif
    mul oDepth, r20.x, r20.y
    // ----------------------------------------------------------------------------------------------------------------------------------------------

// approximately 58 instruction slots used (3 texture, 55 arithmetic)
