[General]
language=HLSL2021
compiler=DXC
entryPoint=EmitDepthOnlyPS
shaderType=Pixel
shaderModel=6_6
outputType=SPIR-V
encoding=UTF-8
includePaths=D:/ygame/code/Engine/KMaterialSystem/shader/hlsl/source/include
macros=@Invalid()
lastHLSLCompiler=DXC
lastGLSLCompiler=DXC
lastOpenDir=F:/Documents/\x6211\x7684\x684c\x9762/feishu_temp
inputContent="#include \"VG/VG_Common.hlsli\"\n#include \"VG/VG_DataDecode.hlsli\"\n#include \"VG/VG_VisBufCommon.hlsli\"\n#include \"VG/VG_MaterialResolve.hlsli\"\n#include \"Common/MurmurMixHash.hlsli\"\n\n#ifndef DEPTH_OUTPUT_TYPE\n#define DEPTH_OUTPUT_TYPE 0\n#endif\n\nTexture2D<uint> DepthBuffer;\n\nvoid EmitDepthOnlyPS(\n\tin float4 SvPosition : SV_Position,\n\tout float OutDepth : SV_Depth\n)\n{\n    uint2 PixelPos = (uint2) SvPosition.xy;\n    uint DepthInt = UnpackVisPixelDepth(DepthBuffer[PixelPos]);\n\n    BRANCH\n    if (DepthInt == 0 || DepthInt == 0xffffffff)\n    {\n        discard;\n    }\n\n    float DeviceZ = asfloat(DepthInt);\n\n#if DEPTH_OUTPUT_TYPE == 0      // Standard depth\n    OutDepth = DeviceZ;\n#elif DEPTH_OUTPUT_TYPE == 1    // Ortho shadow maps\n    bool bReverseZ = (RenderFlags & VG_RENDER_FLAG_PROJECT_REVERSE_Z) > 0;\n    if (!bReverseZ)\n        OutDepth = DeviceZ + DepthBias;\n    else\n        OutDepth = DeviceZ - DepthBias;\n#else                           // Perspective shadow maps\t\n    bool bReverseZ = (RenderFlags & VG_RENDER_FLAG_PROJECT_REVERSE_Z) > 0;\n    if (!bReverseZ)\n        OutDepth = DeviceZ + DepthBias;\n    else\n        OutDepth = DeviceZ - DepthBias;\n    \n    //OutDepth = ViewToClip22 * (DeviceZ - 1) / (DeviceZ - ViewToClip22) + DepthBias;\n    //MinZ = View.ViewToClip[3][2] / ( 1 - View.ViewToClip[2][2] );\n    //ViewZ = View.ViewToClip[3][2] / ( DeviceZ - View.ViewToClip[2][2] );\n#endif\n}\n\n\nstruct FEmitCubemapShadowVSOut\n{\n    float4 Position : SV_Position;\n};\n\nvoid EmitCubemapShadowVS(\n\tin uint VertexID : SV_VertexID,\n\tout FEmitCubemapShadowVSOut Output\n)\n{\n\t// Triangle from [-1 .. 3] covers full viewport\n    float2 Corner = float2(VertexID & 1, (VertexID >> 1) & 1);\n    Output.Position = float4(Corner * 4.0f - 1.0f, 0.5f, 1.0f);\n}\n\nstruct FEmitCubemapShadowGSOut\n{\n    float4 Position : SV_Position;\n    uint RTIndex : SV_RenderTargetArrayIndex;\n};\n\n[maxvertexcount(3)]\nvoid EmitCubemapShadowGS(\n\ttriangle FEmitCubemapShadowVSOut Input[3],\n\tinout TriangleStream<FEmitCubemapShadowGSOut> OutStream\n)\n{\n    FEmitCubemapShadowGSOut Output;\n    Output.RTIndex = CubemapFaceIndex;\n\n    UNROLL\n    for (int VertexIndex = 0; VertexIndex < 3; VertexIndex++)\n    {\n        Output.Position = Input[VertexIndex].Position;\n        OutStream.Append(Output);\n    }\n    OutStream.RestartStrip();\n}\n\nvoid EmitCubemapShadowPS(\n\tin float4 SvPosition : SV_Position,\n\tout float OutDepth : SV_Depth\n)\n{\n    uint2 PixelPos = uint2(SvPosition.xy);\n    uint DepthInt = UnpackVisPixelDepth(DepthBuffer[PixelPos]);\n\n    if (DepthInt == 0 || DepthInt == 0xffffffff)\n    {\n        discard;\n    }\n\n    OutDepth = asfloat(DepthInt);\n}\n"
includePathsVisible=true
macrosVisible=false
extraOptionsEnabled=false
extraOptions=-Zi -Od -Gfp
filePath=
