[General]
language=GLSL
compiler=GLSLANG
entryPoint=main
shaderType=Pixel
shaderModel=460
outputType=SPIR-V
encoding=UTF-8
includePaths=E:/git-code/Source/KG3DEngine/KG3DEngineOpenGL/KEngine/virtualgeometry/shaders
macros=@Invalid()
lastHLSLCompiler=DXC
lastGLSLCompiler=GLSLANG
lastOpenDir=E:/git-code/Source/KG3DEngine/KG3DEngineOpenGL/KEngine/virtualgeometry/shaders
inputContent="#version 450\n#extension GL_ARB_gpu_shader_int64 : require\n#extension GL_EXT_scalar_block_layout : require\n#extension GL_EXT_shader_image_int64 : require\n#extension GL_EXT_samplerless_texture_functions : require\n#extension GL_EXT_ray_query : enable // \x5305\x542b u64texture \x652f\x6301\n#if defined(GL_EXT_control_flow_attributes)\n#extension GL_EXT_control_flow_attributes : require\n#define SPIRV_CROSS_FLATTEN [[flatten]]\n#define SPIRV_CROSS_BRANCH [[dont_flatten]]\n#define SPIRV_CROSS_UNROLL [[unroll]]\n#define SPIRV_CROSS_LOOP [[dont_unroll]]\n#else\n#define SPIRV_CROSS_FLATTEN\n#define SPIRV_CROSS_BRANCH\n#define SPIRV_CROSS_UNROLL\n#define SPIRV_CROSS_LOOP\n#endif\n#extension GL_ARB_shader_stencil_export : require\n\nlayout(set = 0, binding = 0, scalar) uniform type_VGCB_CommonParams\n{\n    int SOAStrides;\n    int MaxNumStreamingPages;\n    int NumSceneInstancesPo2;\n    int CastFlagsMagic;\n    uint MaxNodes;\n    uint MaxVisibleClusters;\n    uint RenderFlags;\n    uint DebugFlags;\n    uint MaxCandidateClusters;\n    uint GPUSceneFrameNumber;\n    uint LargePageRectThreshold;\n    float DisocclusionLodScaleFactor;\n    vec2 HZBViewSize;\n    vec2 HZBSize;\n    uint NumInstances;\n    uint NumViews;\n    int ImposterMaxPixels;\n    uint RasterBinCount;\n    uint bAppointedCull;\n    vec3 AppointedPosition;\n    float ForceSecondBinAppointedDistance;\n    uint bTransparentModelsIncluded;\n    vec2 Paddings_VGCB_CommonParams;\n} VGCB_CommonParams;\n\nlayout(set = 0, binding = 2, std140) uniform type_VGCB_EmitData\n{\n    ivec4 ViewRect;\n    uint StencilClear;\n    uint StencilDecal;\n    uvec2 FetchClamp;\n    uint MaterialRemapCount;\n    uint MaterialTileCount;\n    uint MaterialSlotCount;\n    uint MaterialBinCount;\n    uint RowTileCount;\n    float DepthBias;\n    uint TopologyIndexCount;\n    uint CubemapFaceIndex;\n} VGCB_EmitData;\n\nlayout(set = 0, binding = 4, std430) readonly buffer type_ByteAddressBuffer\n{\n    uint _m0[];\n} ClusterPageData;\n\nlayout(set = 0, binding = 6, std430) readonly buffer type_StructuredBuffer_v4float\n{\n    vec4 _m0[];\n} GPUSceneInstanceSceneData;\n\nlayout(set = 0, binding = 8, std430) readonly buffer VisibleClustersSWHW\n{\n    uint _m0[];\n} VisibleClustersSWHW_1;\n\nlayout(set = 0, binding = 16, std430) readonly buffer type_StructuredBuffer_uint\n{\n    uint _m0[];\n} MaterialSlotTable;\n\nlayout(set = 0, binding = 3) uniform u64texture2D VisBuffer64;\n\nlayout(location = 0) out uint out_var_SV_Target0;\n\nvoid main()\n{\n    u64vec4 _87 = texelFetch(VisBuffer64, ivec2(uvec2(gl_FragCoord.xy)), int(0u));\n    uint64_t _88 = _87.x;\n    uint _89 = uint(_88);\n    uint _92 = uint(_88 >> (32ul & 63ul));\n    uint _94 = _89 & 127u;\n    uint _106;\n    do\n    {\n        if (!((VGCB_CommonParams.RenderFlags & 8u) > 0u))\n        {\n            _106 = 4294967295u - _92;\n            break;\n        }\n        else\n        {\n            _106 = _92;\n            break;\n        }\n        break; // unreachable workaround\n    } while(false);\n    uint _107 = (_89 >> 7u) - 1u;\n    SPIRV_CROSS_BRANCH\n    if (_107 == 4294967295u)\n    {\n        discard;\n    }\n    uint _133;\n    uint _134;\n    uint _135;\n    if (_107 >= 16777216u)\n    {\n        _133 = (_107 << 8u) >> 9u;\n        _134 = 0u;\n        _135 = _107 & 1u;\n    }\n    else\n    {\n        uint _116 = (_107 * 8u) >> 2u;\n        uint _119 = _116 + 1u;\n        _133 = ((VisibleClustersSWHW_1._m0[_116] >> 16u) | (VisibleClustersSWHW_1._m0[_119] << 16u)) & 16777215u;\n        _134 = (VisibleClustersSWHW_1._m0[_119] >> 8u) & 65535u;\n        _135 = (VisibleClustersSWHW_1._m0[_119] >> 24u) & 255u;\n    }\n    uint _142 = uint(VGCB_CommonParams.MaxNumStreamingPages);\n    uint _151 = (min(_134, _142) << 17u) + (uint(max((int(_134) - int(_142)), 0)) << 15u);\n    uint _162 = ((((_151 + (_135 << 4u)) + (5u * (ClusterPageData._m0[_151 >> 2u] << 4u))) + 16u) >> 2u) + 3u;\n    uint _184;\n    uint _185;\n    uint _186;\n    uint _187;\n    uint _188;\n    uint _189;\n    uint _190;\n    SPIRV_CROSS_BRANCH\n    if (ClusterPageData._m0[_162] < 4261412864u)\n    {\n        _184 = 0u;\n        _185 = 0u;\n        _186 = ((ClusterPageData._m0[_162] << 7u) >> 25u) + 1u;\n        _187 = (ClusterPageData._m0[_162] << 26u) >> 26u;\n        _188 = ClusterPageData._m0[_162] >> 25u;\n        _189 = (ClusterPageData._m0[_162] << 20u) >> 26u;\n        _190 = (ClusterPageData._m0[_162] << 14u) >> 26u;\n    }\n    else\n    {\n        _184 = (ClusterPageData._m0[_162] << 13u) >> 13u;\n        _185 = ((ClusterPageData._m0[_162] << 7u) >> 26u) + 1u;\n        _186 = 0u;\n        _187 = 0u;\n        _188 = 0u;\n        _189 = 0u;\n        _190 = 0u;\n    }\n    uint _232;\n    SPIRV_CROSS_BRANCH\n    if (_186 > 0u)\n    {\n        uint _231;\n        if (_94 < _186)\n        {\n            _231 = _187;\n        }\n        else\n        {\n            _231 = (_94 < (_186 + _188)) ? _189 : _190;\n        }\n        _232 = _231;\n    }\n    else\n    {\n        uint _196 = _151 + (_184 * 4u);\n        uint _199;\n        uint _223;\n        uint _198 = _196;\n        uint _201 = 0u;\n        SPIRV_CROSS_LOOP\n        for (;;)\n        {\n            if (_201 < _185)\n            {\n                uint _206 = _198 >> 2u;\n                _199 = _198 + 4u;\n                uint _210 = (ClusterPageData._m0[_206] << 24u) >> 24u;\n                bool _218;\n                if (_94 >= _210)\n                {\n                    _218 = _94 < (_210 + ((ClusterPageData._m0[_206] << 16u) >> 24u));\n                }\n                else\n                {\n                    _218 = false;\n                }\n                if (_218)\n                {\n                    _223 = (ClusterPageData._m0[_206] << 10u) >> 26u;\n                    break;\n                }\n                _198 = _199;\n                _201++;\n                continue;\n            }\n            else\n            {\n                _223 = 4294967295u;\n                break;\n            }\n        }\n        _232 = _223;\n    }\n    out_var_SV_Target0 = (1u | (32766u & ((MaterialSlotTable._m0[((floatBitsToUint(GPUSceneInstanceSceneData._m0[_133].y) * 128u) + 64u) + _232] & 65535u) << 1u))) | 0u;\n    gl_FragDepth = uintBitsToFloat(_106);\n    gl_FragStencilRefARB = int(VGCB_EmitData.StencilClear);\n}\n"
includePathsVisible=true
macrosVisible=false
extraOptionsEnabled=false
extraOptions=
filePath=
