diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 8fabaec44..b0de4a2ce 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -475,6 +475,9 @@ namespace bgfx #include "fs_clear5.bin.h" #include "fs_clear6.bin.h" #include "fs_clear7.bin.h" +#include "vs_resolve_depth.bin.h" +#include "fs_resolve_depth.bin.h" +#include "fs_resolve_depth_array.bin.h" #if BGFX_CONFIG_MIP_GEN_FALLBACK # include "cs_mipgen_pow2.bin.h" @@ -508,6 +511,9 @@ namespace bgfx BGFX_EMBEDDED_SHADER(fs_clear5), BGFX_EMBEDDED_SHADER(fs_clear6), BGFX_EMBEDDED_SHADER(fs_clear7), + BGFX_EMBEDDED_SHADER(vs_resolve_depth), + BGFX_EMBEDDED_SHADER(fs_resolve_depth), + BGFX_EMBEDDED_SHADER(fs_resolve_depth_array), #if BGFX_CONFIG_MIP_GEN_FALLBACK BGFX_EMBEDDED_SHADER(cs_mipgen_pow2), @@ -1135,6 +1141,57 @@ namespace bgfx } #endif // BGFX_CONFIG_BLIT_FALLBACK + DepthResolve* g_depthResolve = NULL; + + void DepthResolve::init() + { + BGFX_CHECK_API_THREAD(); + + const RendererType::Enum rendererType = g_caps.rendererType; + + if (false + || RendererType::Direct3D11 == rendererType + || RendererType::Direct3D12 == rendererType + || RendererType::Vulkan == rendererType + || RendererType::WebGPU == rendererType + ) + { + static const char* fs_resolve_depth[] = + { + "fs_resolve_depth", + "fs_resolve_depth_array", + }; + + for (uint32_t ii = 0; ii < BX_COUNTOF(m_program); ++ii) + { + ShaderHandle vsh = createEmbeddedShader(s_embeddedShaders, rendererType, "vs_resolve_depth"); + ShaderHandle fsh = createEmbeddedShader(s_embeddedShaders, rendererType, fs_resolve_depth[ii]); + BX_ASSERT(isValid(vsh) && isValid(fsh), "Failed to create depth resolve embedded shader \"%s\"", fs_resolve_depth[ii]); + + m_program[ii] = createProgram(vsh, fsh, true); + BX_ASSERT(isValid(m_program[ii]), "Failed to create depth resolve program."); + } + + g_depthResolve = this; + } + } + + void DepthResolve::shutdown() + { + BGFX_CHECK_API_THREAD(); + + g_depthResolve = NULL; + + for (uint32_t ii = 0; ii < BX_COUNTOF(m_program); ++ii) + { + if (isValid(m_program[ii]) ) + { + destroy(m_program[ii]); + m_program[ii] = BGFX_INVALID_HANDLE; + } + } + } + #if BGFX_CONFIG_VIDEO VideoDecode* g_videoDecode = NULL; @@ -2590,6 +2647,7 @@ namespace bgfx m_clearQuad.init(); m_mipGen.init(); m_blitFallback.init(); + m_depthResolve.init(); m_videoDecode.init(); m_submit->m_transientVb = createTransientVertexBuffer(_init.limits.maxTransientVbSize); @@ -2628,6 +2686,7 @@ namespace bgfx m_textVideoMemBlitter.shutdown(); m_clearQuad.shutdown(); m_mipGen.shutdown(); + m_depthResolve.shutdown(); m_blitFallback.shutdown(); m_videoDecode.shutdown(); frame(); @@ -6076,19 +6135,6 @@ namespace bgfx { ++depth; - BGFX_ERROR_CHECK( - // if BGFX_TEXTURE_RT_MSAA_X2 or greater than either BGFX_TEXTURE_RT_WRITE_ONLY or BGFX_TEXTURE_MSAA_SAMPLE is required - // if BGFX_TEXTURE_RT with no MSSA then this is not required. - (1 == ( (tr.m_flags & BGFX_TEXTURE_RT_MSAA_MASK) >> BGFX_TEXTURE_RT_MSAA_SHIFT) ) - || (0 != (tr.m_flags & (BGFX_TEXTURE_RT_WRITE_ONLY | BGFX_TEXTURE_MSAA_SAMPLE) ) ) - , _err - , BGFX_ERROR_FRAME_BUFFER_VALIDATION - , "Frame buffer depth MSAA texture cannot be resolved. It must be created with either `BGFX_TEXTURE_RT_WRITE_ONLY` or `BGFX_TEXTURE_MSAA_SAMPLE` flag." - , "Attachment %d, texture flags 0x%016" PRIx64 "." - , ii - , tr.m_flags - ); - BGFX_ERROR_CHECK( 0 == (at.flags & BGFX_ATTACHMENT_AUTO_GEN_MIPS) , _err diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 09794dbcc..f2612a729 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -1087,6 +1087,25 @@ namespace bgfx extern BlitFallback* g_blitFallback; + /// + struct DepthResolve + { + void init(); + void shutdown(); + + enum Enum + { + Texture2D, + Texture2DArray, + + Count + }; + + ProgramHandle m_program[Count] = { BGFX_INVALID_HANDLE, BGFX_INVALID_HANDLE }; + }; + + extern DepthResolve* g_depthResolve; + /// struct VideoDecode { @@ -8964,6 +8983,7 @@ namespace bgfx ClearQuad m_clearQuad; MipGen m_mipGen; BlitFallback m_blitFallback; + DepthResolve m_depthResolve; VideoDecode m_videoDecode; RendererContextI* m_renderCtx; diff --git a/src/fs_resolve_depth.bin.h b/src/fs_resolve_depth.bin.h new file mode 100644 index 000000000..62c0c31d8 --- /dev/null +++ b/src/fs_resolve_depth.bin.h @@ -0,0 +1,432 @@ +static const uint8_t fs_resolve_depth_glsl[186] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, // epthMs.......... + 0x85, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, // .....uniform sam + 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x4d, 0x53, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, // pler2DMS bgfx_te + 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x3b, 0x0a, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // xDepthMs;..void + 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x67, 0x6c, 0x5f, // main().{. gl_ + 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, 0x70, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x65, // FragDepth = texe + 0x6c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // lFetch(bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x2c, 0x20, 0x69, 0x76, 0x65, 0x63, 0x32, 0x28, 0x67, 0x6c, // epthMs, ivec2(gl + 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x2e, 0x78, 0x79, 0x29, 0x2c, 0x20, // _FragCoord.xy), + 0x30, 0x29, 0x2e, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 0).x;.}... +}; +static const uint8_t fs_resolve_depth_essl[238] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, // epthMs.......... + 0xb9, 0x00, 0x00, 0x00, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x65, // ....precision me + 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x70, 0x72, 0x65, // diump float;.pre + 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, 0x74, // cision highp int + 0x3b, 0x0a, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // ;..uniform highp + 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x4d, 0x53, 0x20, 0x62, 0x67, 0x66, // sampler2DMS bgf + 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x3b, 0x0a, 0x0a, 0x76, // x_texDepthMs;..v + 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, // oid main().{. + 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, 0x70, 0x74, 0x68, 0x20, 0x3d, 0x20, // gl_FragDepth = + 0x74, 0x65, 0x78, 0x65, 0x6c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, // texelFetch(bgfx_ + 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x2c, 0x20, 0x69, 0x76, 0x65, 0x63, // texDepthMs, ivec + 0x32, 0x28, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x2e, 0x78, // 2(gl_FragCoord.x + 0x79, 0x29, 0x2c, 0x20, 0x30, 0x29, 0x2e, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // y), 0).x;.}... +}; +static const uint8_t fs_resolve_depth_spv[760] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x07, 0x29, 0x00, // epthMs0.......). + 0xc0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, // ......#......... + 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, // ~............... + 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, // ........GLSL.std + 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // .450............ + 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // ................ + 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, // main....E...N... + 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, // ................ + 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, // ................ + 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, // ............main + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x08, 0x00, 0x23, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, // ........#...bgfx + 0x5f, 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x54, 0x65, 0x78, 0x74, 0x75, // _texDepthMsTextu + 0x72, 0x65, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x45, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, // re......E...gl_F + 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, // ragCoord........ + 0x4e, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, 0x70, 0x74, 0x68, // N...gl_FragDepth + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, // ....G...#...!... + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, // ....G...#..."... + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x45, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, // ....G...E....... + 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, // ....G...N....... + 0x16, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, // ............!... + 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, // ................ + 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, // ............... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, // ................ + 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, // ............... + 0x0a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, // ................ + 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, // ........ ..."... + 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, // ........;..."... + 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, // #.......+....... + 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x37, 0x00, 0x00, 0x00, // &...........7... + 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x44, 0x00, 0x00, 0x00, // ........ ...D... + 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x44, 0x00, 0x00, 0x00, // ........;...D... + 0x45, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, // E....... ...M... + 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, // ........;...M... + 0x4e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, // N.......6....... + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // ................ + 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, // ....=.......$... + 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, // #...=.......F... + 0x45, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x37, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, // E...O...7...n... + 0x46, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // F...F........... + 0x6e, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, // n.......o...n... + 0x5f, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, // _.......}...$... + 0x6f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // o...@...&...Q... + 0x06, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....r...}....... + 0x3e, 0x00, 0x03, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, // >...N...r....... + 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // 8....... +}; +static const uint8_t fs_resolve_depth_wgsl[534] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x07, 0x29, 0x00, // epthMs0.......). + 0xdc, 0x01, 0x00, 0x00, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x28, 0x6f, // ....diagnostic(o + 0x66, 0x66, 0x2c, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x75, // ff, derivative_u + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x74, 0x79, 0x29, 0x3b, 0x0a, 0x64, 0x69, 0x61, 0x67, // niformity);.diag + 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x28, 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x73, 0x75, 0x62, 0x67, // nostic(off, subg + 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x74, 0x79, 0x29, // roup_uniformity) + 0x3b, 0x0a, 0x0a, 0x40, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x28, 0x30, 0x75, 0x29, 0x20, 0x40, 0x62, // ;..@group(0u) @b + 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x28, 0x32, 0x75, 0x29, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, // inding(2u) var b + 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x54, 0x65, // gfx_texDepthMsTe + 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, // xture : texture_ + 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x5f, 0x32, 0x64, 0x3c, // multisampled_2d< + 0x66, 0x33, 0x32, 0x3e, 0x3b, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x3c, 0x70, 0x72, 0x69, 0x76, 0x61, // f32>;..var gl_FragDepth + 0x20, 0x3a, 0x20, 0x66, 0x33, 0x32, 0x3b, 0x0a, 0x0a, 0x66, 0x6e, 0x20, 0x6d, 0x61, 0x69, 0x6e, // : f32;..fn main + 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x28, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // _inner(gl_FragCo + 0x6f, 0x72, 0x64, 0x20, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x29, // ord : vec4) + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, 0x70, 0x74, // {. gl_FragDept + 0x68, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x28, // h = textureLoad( + 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x54, // bgfx_texDepthMsT + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x32, 0x3c, 0x69, 0x33, 0x32, // exture, vec2(gl_FragCoord.x + 0x79, 0x29, 0x2c, 0x20, 0x30, 0x69, 0x29, 0x2e, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x40, 0x66, // y), 0i).x;.}..@f + 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x0a, 0x66, 0x6e, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, // ragment.fn main( + 0x40, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // @builtin(positio + 0x6e, 0x29, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x20, // n) gl_FragCoord + 0x3a, 0x20, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x29, 0x20, 0x2d, 0x3e, 0x20, // : vec4) -> + 0x40, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28, 0x66, 0x72, 0x61, 0x67, 0x5f, 0x64, 0x65, // @builtin(frag_de + 0x70, 0x74, 0x68, 0x29, 0x20, 0x66, 0x33, 0x32, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x61, 0x69, // pth) f32 {. mai + 0x6e, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x28, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // n_inner(gl_FragC + 0x6f, 0x6f, 0x72, 0x64, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, // oord);. return + 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, 0x70, 0x74, 0x68, 0x3b, 0x0a, 0x7d, 0x0a, // gl_FragDepth;.}. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... +}; +static const uint8_t fs_resolve_depth_dxbc[388] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, // epthMs0......... + 0x4c, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xfd, 0xc2, 0x08, 0x37, 0x5a, 0x34, 0xda, 0x3e, // L...DXBC...7Z4.> + 0x1b, 0x23, 0xba, 0x6c, 0x35, 0x93, 0x85, 0xff, 0x01, 0x00, 0x00, 0x00, 0x4c, 0x01, 0x00, 0x00, // .#.l5.......L... + 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, // ....,...`....... + 0x49, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGN,........... + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x00, 0x00, 0x0f, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, // ........SV_POSIT + 0x49, 0x4f, 0x4e, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ION.OSGN,....... + 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .... ........... + 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x0e, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x44, // ............SV_D + 0x45, 0x50, 0x54, 0x48, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xb0, 0x00, 0x00, 0x00, // EPTH....SHEX.... + 0x50, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x58, 0x20, 0x00, 0x04, // P...,...j...X .. + 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x64, 0x20, 0x00, 0x04, // .p......UU..d .. + 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x02, // 2...........e... + 0x01, 0xc0, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x05, // ....h........... + 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // 2.......F....... + 0x36, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // 6............@.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x2e, 0x00, 0x00, 0x8b, 0x02, 0x01, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0x12, 0x00, 0x10, 0x00, // ........CU...... + 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~.. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x04, // .....@......6... + 0x01, 0xc0, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ............>... + 0x00, 0x00, 0x00, 0x00, // .... +}; +static const uint8_t fs_resolve_depth_dxil[3588] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, // epthMs0......... + 0xcc, 0x0d, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xea, 0x18, 0xf8, 0xb3, 0x9a, 0xaf, 0x37, 0xd0, // ....DXBC......7. + 0x73, 0xdf, 0xd2, 0x99, 0x53, 0xdb, 0xf2, 0x83, 0x01, 0x00, 0x00, 0x00, 0xcc, 0x0d, 0x00, 0x00, // s...S........... + 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, // ....<...L....... + 0xc4, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x90, 0x07, 0x00, 0x00, 0xac, 0x07, 0x00, 0x00, // ....`........... + 0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // SFI0............ + 0x49, 0x53, 0x47, 0x31, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISG14........... + 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....(........... + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x53, 0x56, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x4f, 0x53, 0x47, 0x31, // SV_Position.OSG1 + 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 4............... + 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // (.......A....... + 0xff, 0xff, 0xff, 0xff, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x44, // ............SV_D + 0x65, 0x70, 0x74, 0x68, 0x00, 0x00, 0x00, 0x00, 0x50, 0x53, 0x56, 0x30, 0x94, 0x00, 0x00, 0x00, // epth....PSV0.... + 0x38, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 8............... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, // ................ + 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ................ + 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .main........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x44, 0x03, // ..............D. + 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x11, // ................ + 0x03, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0x28, 0x06, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, // ....STAT(...`... + 0x8a, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // ....DXIL........ + 0x10, 0x06, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, // ....BC..!....... + 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, // .. ...........#. + 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, // A..I..29....%... + 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, 0x14, // ...b..E.B..B..2. + 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88, 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, // 8..K.2R.H.. CF.. + 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90, 0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, // ..2B.H...".PAQ.. + 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // .....)F.Q....... + 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, // ........@....... + 0xff, 0xff, 0x03, 0x20, 0x6d, 0x30, 0x86, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, // ... m0.......... + 0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06, // I.........`B L.. + 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09, // ..... ..B...2"H. + 0x20, 0x64, 0x85, 0x04, 0x93, 0x22, 0xa4, 0x84, 0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, // d..."...."..... + 0x12, 0x4c, 0x8a, 0x8c, 0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x60, 0x23, 0x00, 0x25, 0x00, 0x14, 0x66, // .L.....L.`#.%..f + 0x00, 0xe6, 0x08, 0xc0, 0x60, 0x8e, 0x00, 0x29, 0xc6, 0x20, 0x84, 0x14, 0x42, 0xa6, 0x18, 0x80, // ....`..). ..B... + 0x10, 0x52, 0x06, 0xa1, 0x9b, 0x86, 0xcb, 0x9f, 0xb0, 0x87, 0x90, 0xfc, 0x95, 0x90, 0x56, 0x62, // .R............Vb + 0xf2, 0x8b, 0xdb, 0x46, 0xc5, 0x18, 0x63, 0x10, 0x2a, 0xf7, 0x0c, 0x97, 0x3f, 0x61, 0x0f, 0x21, // ...F..c.*...?a.! + 0xf9, 0x21, 0xd0, 0x0c, 0x0b, 0x81, 0x82, 0x55, 0x14, 0x45, 0x18, 0x21, 0x84, 0x10, 0x42, 0xa8, // .!.....U.E.!..B. + 0xcd, 0x11, 0x04, 0xc5, 0x60, 0xa4, 0x10, 0xf2, 0x08, 0x0e, 0x04, 0x0c, 0x23, 0x10, 0xc3, 0x4c, // ....`.......#..L + 0x73, 0x30, 0x0e, 0xec, 0x10, 0x0e, 0xf3, 0x30, 0x0f, 0x6e, 0x40, 0x0b, 0xe5, 0x80, 0x0f, 0xf4, // s0.....0.n@..... + 0x50, 0x0f, 0xf2, 0x50, 0x0e, 0x72, 0x40, 0x0a, 0xad, 0x30, 0x0b, 0x7c, 0x60, 0x0f, 0xe5, 0x30, // P..P.r@..0.|`..0 + 0x0e, 0xf4, 0xf0, 0x0e, 0xf2, 0xc0, 0x07, 0xe6, 0xc0, 0x0e, 0xef, 0x10, 0x0e, 0xf4, 0xc0, 0x06, // ................ + 0x60, 0x40, 0x07, 0x7e, 0xc0, 0x06, 0x60, 0x00, 0x07, 0x7e, 0xa0, 0x07, 0x7a, 0x30, 0x0f, 0xe1, // `@.~..`..~..z0.. + 0xd0, 0x0e, 0xf0, 0xc0, 0x0e, 0xe5, 0xf0, 0x0b, 0xf4, 0x90, 0x0f, 0xf0, 0x50, 0x0e, 0x28, 0x20, // ............P.( + 0x33, 0x99, 0xc1, 0x38, 0xb0, 0x43, 0x38, 0xcc, 0xc3, 0x3c, 0xb8, 0x01, 0x2d, 0x94, 0x03, 0x3e, // 3..8.C8..<..-..> + 0xd0, 0x43, 0x3d, 0xc8, 0x43, 0x39, 0xc8, 0x01, 0x29, 0xb4, 0xc2, 0x2c, 0xf0, 0x81, 0x3d, 0x94, // .C=.C9..)..,..=. + 0xc3, 0x38, 0xd0, 0xc3, 0x3b, 0xc8, 0x03, 0x1f, 0x98, 0x03, 0x3b, 0xbc, 0x43, 0x38, 0xd0, 0x03, // .8..;.....;.C8.. + 0x1b, 0x80, 0x01, 0x1d, 0xf8, 0x01, 0x1b, 0x80, 0x01, 0x1c, 0xf8, 0x01, 0x12, 0x26, 0xa5, 0x9a, // .............&.. + 0x02, 0x04, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, // ......r..t`.6h.y + 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, // h.r....P.m..zP.m + 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, // ..z0.r..s .m..q. + 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, // .s .m..x..s .m.. + 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, // q`.z0.r...0.r..s + 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, // .m..v@.z`.t.... + 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, // .v..s .m`.s .z0. + 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, // r...`.t..v@.m..x + 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e, // ..q`.z0.r..v@.C. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x06, 0x10, 0x00, // ............<... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00, // .........y. .... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x34, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, // .......4@....... + 0x00, 0x00, 0x30, 0xe4, 0x81, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ..0............ + 0x0b, 0x04, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, // ........2.....L. + 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22, 0x25, 0x30, 0x02, 0x50, 0x0c, 0x65, 0x50, 0x12, // ..&G..C"%0.P.eP. + 0x35, 0x50, 0x04, 0x54, 0x4a, 0xa2, 0x0c, 0x0a, 0x61, 0x04, 0xa0, 0x44, 0x4a, 0xa0, 0x06, 0xc8, // 5P.TJ...a..DJ... + 0xce, 0x00, 0xd0, 0x1d, 0x4b, 0x20, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, // ....K ..y...q... + 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, // ..L.F.....o..M.$ + 0xc6, 0x25, 0x06, 0xc6, 0x45, 0xc6, 0x06, 0xa6, 0xc6, 0x65, 0xe6, 0x06, 0x04, 0x65, 0x8c, 0x86, // .%..E....e...e.. + 0x0c, 0xc7, 0x8c, 0xc6, 0x2c, 0x27, 0x27, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x88, 0x62, 0x82, 0x40, // ....,''eC.L..b.@ + 0x18, 0x1b, 0x84, 0x81, 0xd8, 0x20, 0x10, 0x04, 0x05, 0xb8, 0xb9, 0x09, 0x02, 0x71, 0x6c, 0x18, // ..... .......ql. + 0x0e, 0x84, 0x98, 0x20, 0x58, 0x13, 0x2d, 0xb1, 0x33, 0x33, 0xbc, 0x2f, 0xba, 0x32, 0x3c, 0xa2, // ... X.-.33./.2<. + 0x32, 0x38, 0x3a, 0xb4, 0xa6, 0x39, 0xaa, 0x32, 0x3c, 0xba, 0x3a, 0xb9, 0xb2, 0x09, 0x02, 0x81, // 28:..9.2<.:..... + 0x4c, 0x10, 0x88, 0x64, 0x83, 0x40, 0x34, 0x1b, 0x12, 0x42, 0x59, 0x08, 0x62, 0x60, 0x08, 0x67, // L..d.@4..BY.b`.g + 0x43, 0xf0, 0x6c, 0x20, 0x20, 0x00, 0x00, 0x26, 0x08, 0x02, 0xb0, 0x01, 0xd8, 0x30, 0x10, 0xd3, // C.l ..&.....0.. + 0xb4, 0x21, 0xa0, 0x36, 0x0c, 0x83, 0x54, 0x4d, 0x10, 0x2e, 0x6a, 0x43, 0x70, 0x91, 0x68, 0x0b, // .!.6..TM..jCp.h. + 0x4b, 0x73, 0xe3, 0x32, 0x65, 0xf5, 0x05, 0xf5, 0x36, 0x97, 0x46, 0x97, 0xf6, 0xe6, 0x36, 0x41, // Ks.2e...6.F...6A + 0x28, 0x98, 0x09, 0x42, 0xd1, 0x6c, 0x08, 0x88, 0x09, 0x42, 0xe1, 0x4c, 0x10, 0x8a, 0x67, 0x83, // (..B.l...B.L..g. + 0xc0, 0x30, 0x1b, 0x16, 0x42, 0xdb, 0xb8, 0xce, 0x1b, 0x3c, 0xe2, 0x03, 0x83, 0x0d, 0x41, 0x18, // .0..B....<....A. + 0x10, 0x99, 0xb2, 0xfa, 0x22, 0x2a, 0x83, 0xa3, 0x43, 0x9b, 0x20, 0x14, 0xd0, 0x04, 0xa1, 0x88, // ...."*..C. ..... + 0x26, 0x08, 0x84, 0x32, 0x41, 0x28, 0xa4, 0x0d, 0x02, 0x33, 0x6c, 0x58, 0x88, 0x31, 0xd8, 0xc8, // &..2A(...3lX.1.. + 0xa0, 0xfb, 0x86, 0x32, 0x30, 0x83, 0x33, 0x40, 0x83, 0x0d, 0x41, 0x1a, 0x6c, 0x18, 0xc4, 0x40, // ...20.3@..A.l..@ + 0x0d, 0x80, 0x0d, 0x85, 0x94, 0xad, 0x41, 0x04, 0xd0, 0x30, 0x63, 0x7b, 0x0b, 0xa3, 0x9b, 0x9b, // ......A..0c{.... + 0x20, 0x10, 0x0b, 0x8b, 0x34, 0xb7, 0x39, 0xba, 0x39, 0x1a, 0x73, 0x69, 0x67, 0x5f, 0x6c, 0x64, // ...4.9.9.sig_ld + 0x34, 0xe6, 0xd2, 0xce, 0xbe, 0xe6, 0xe8, 0x88, 0xd0, 0x95, 0xe1, 0x7d, 0xb1, 0xbd, 0x85, 0x91, // 4..........}.... + 0x6d, 0x50, 0xda, 0xc0, 0x0d, 0xde, 0xa0, 0x81, 0x03, 0x37, 0x88, 0x83, 0x41, 0x0e, 0x86, 0x2a, // mP.......7..A..* + 0x6c, 0x6c, 0x76, 0x6d, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x82, 0xa0, 0x0a, 0x19, 0x9e, // llvm.identS..... + 0x8b, 0x5d, 0x99, 0xdc, 0x5c, 0xda, 0x9b, 0xdb, 0x94, 0x80, 0x68, 0x42, 0x86, 0xe7, 0x62, 0x17, // .]........hB..b. + 0xc6, 0x66, 0x57, 0x26, 0x37, 0x25, 0x28, 0xea, 0x90, 0xe1, 0xb9, 0xcc, 0xa1, 0x85, 0x91, 0x95, // .fW&7%(......... + 0xc9, 0x35, 0xbd, 0x91, 0x95, 0xb1, 0x4d, 0x09, 0x90, 0x32, 0x64, 0x78, 0x2e, 0x72, 0x65, 0x73, // .5....M..2dx.res + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, 0x02, 0xa8, 0x12, 0x19, 0x9e, 0x0b, 0x5d, 0x1e, 0x5c, // ourcesS......].. + 0x59, 0x90, 0x9b, 0xdb, 0x1b, 0x5d, 0x18, 0x5d, 0xda, 0x9b, 0xdb, 0xdc, 0x94, 0xa0, 0xaa, 0x43, // Y....].].......C + 0x86, 0xe7, 0x62, 0x97, 0x56, 0x76, 0x97, 0x44, 0x36, 0x45, 0x17, 0x46, 0x57, 0x36, 0x25, 0xb8, // ..b.Vv.D6E.FW6%. + 0xea, 0x90, 0xe1, 0xb9, 0x94, 0xb9, 0xd1, 0xc9, 0xe5, 0x41, 0xbd, 0xa5, 0xb9, 0xd1, 0xcd, 0x4d, // .........A.....M + 0x09, 0xd6, 0xa0, 0x0b, 0x19, 0x9e, 0xcb, 0xd8, 0x5b, 0x9d, 0x1b, 0x5d, 0x99, 0xdc, 0xdc, 0x94, // ........[..].... + 0x40, 0x0e, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, // @...y...L...3... + 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, // ...f..=.C8...B.. + 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, // yx.s.q.......... + 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, // 3.B.......f0.=.C + 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, // 8.....=.C=..=.x. + 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, // tp.{..yH.pp.zp.v + 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, // x.p .........0.n + 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, // 0.....P.3....!.. + 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, // !..a.f0.;..;.C9. + 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, // .<..<..;...v`.{h + 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, // .7h.rh.7..p..p`. + 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, // v(.v..vx.w.._..q + 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, // ..r..y..,....... + 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, // ...0.b.......... + 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, // ...a..!.....a... + 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, // C9.C9.C9.C9..8.C + 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, // 8..;../..<..;..; + 0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87, 0x76, 0x80, 0x87, 0x19, // ....!.|p.z(.v... + 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20, 0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, // .C..... ........ + 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, // ......P.....q .. + 0x13, 0x00, 0x00, 0x00, 0x46, 0x20, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, 0x11, 0xc0, 0x44, 0x84, // ....F ...<....D. + 0x40, 0x33, 0x2c, 0x84, 0x05, 0x4c, 0xc3, 0xe5, 0x3b, 0x8f, 0xbf, 0x38, 0xc0, 0x20, 0x36, 0x0f, // @3,..L..;..8. 6. + 0x35, 0xf9, 0xc5, 0x6d, 0x9b, 0x40, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0xd2, 0xe4, 0x44, 0x04, 0x4a, // 5..m.@5......D.J + 0x4d, 0x0f, 0x35, 0xf9, 0xc5, 0x6d, 0xdb, 0x40, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0x13, 0x71, 0x4d, // M.5..m.@5.....qM + 0x54, 0x44, 0x94, 0x0e, 0x30, 0xf8, 0xc5, 0x6d, 0x1b, 0x00, 0xc1, 0x00, 0x48, 0x03, 0x00, 0x00, // TD..0..m....H... + 0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....HASH........ + 0x65, 0x26, 0xb8, 0xf2, 0xd1, 0x49, 0x49, 0xc1, 0x0a, 0x18, 0xbc, 0x9f, 0x53, 0xd2, 0xa8, 0x27, // e&...II.....S..' + 0x44, 0x58, 0x49, 0x4c, 0x18, 0x06, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x86, 0x01, 0x00, 0x00, // DXIL....`....... + 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // DXIL............ + 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x7d, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, // BC..!...}..... . + 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, // ..........#.A..I + 0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62, // ..29....%......b + 0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, // ..E.B..B..2.8..K + 0x0a, 0x32, 0x52, 0x88, 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, // .2R.H.. CF....2B + 0xe4, 0x48, 0x0e, 0x90, 0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a, // .H...".PAQ...... + 0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, // .)F.Q........... + 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, // ....@.......... + 0x6d, 0x30, 0x86, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, 0x49, 0x18, 0x00, 0x00, // m0..........I... + 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, // ......`B L...... + 0x89, 0x20, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, 0x04, // . ..B...2"H. d.. + 0x93, 0x22, 0xa4, 0x84, 0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8a, 0x8c, // ."...."......L.. + 0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x60, 0x23, 0x00, 0x25, 0x00, 0x14, 0x66, 0x00, 0xe6, 0x08, 0xc0, // ...L.`#.%..f.... + 0x60, 0x8e, 0x00, 0x29, 0xc6, 0x20, 0x84, 0x14, 0x42, 0xa6, 0x18, 0x80, 0x10, 0x52, 0x06, 0xa1, // `..). ..B....R.. + 0x9b, 0x86, 0xcb, 0x9f, 0xb0, 0x87, 0x90, 0xfc, 0x95, 0x90, 0x56, 0x62, 0xf2, 0x8b, 0xdb, 0x46, // ..........Vb...F + 0xc5, 0x18, 0x63, 0x10, 0x2a, 0xf7, 0x0c, 0x97, 0x3f, 0x61, 0x0f, 0x21, 0xf9, 0x21, 0xd0, 0x0c, // ..c.*...?a.!.!.. + 0x0b, 0x81, 0x82, 0x55, 0x14, 0x45, 0x18, 0x21, 0x84, 0x10, 0x42, 0xa8, 0xcd, 0x11, 0x04, 0xc5, // ...U.E.!..B..... + 0x60, 0xa4, 0x10, 0xf2, 0x08, 0x0e, 0x04, 0x0c, 0x23, 0x10, 0xc3, 0x4c, 0x73, 0x30, 0x0e, 0xec, // `.......#..Ls0.. + 0x10, 0x0e, 0xf3, 0x30, 0x0f, 0x6e, 0x40, 0x0b, 0xe5, 0x80, 0x0f, 0xf4, 0x50, 0x0f, 0xf2, 0x50, // ...0.n@.....P..P + 0x0e, 0x72, 0x40, 0x0a, 0xad, 0x30, 0x0b, 0x7c, 0x60, 0x0f, 0xe5, 0x30, 0x0e, 0xf4, 0xf0, 0x0e, // .r@..0.|`..0.... + 0xf2, 0xc0, 0x07, 0xe6, 0xc0, 0x0e, 0xef, 0x10, 0x0e, 0xf4, 0xc0, 0x06, 0x60, 0x40, 0x07, 0x7e, // ............`@.~ + 0xc0, 0x06, 0x60, 0x00, 0x07, 0x7e, 0xa0, 0x07, 0x7a, 0x30, 0x0f, 0xe1, 0xd0, 0x0e, 0xf0, 0xc0, // ..`..~..z0...... + 0x0e, 0xe5, 0xf0, 0x0b, 0xf4, 0x90, 0x0f, 0xf0, 0x50, 0x0e, 0x28, 0x20, 0x33, 0x99, 0xc1, 0x38, // ........P.( 3..8 + 0xb0, 0x43, 0x38, 0xcc, 0xc3, 0x3c, 0xb8, 0x01, 0x2d, 0x94, 0x03, 0x3e, 0xd0, 0x43, 0x3d, 0xc8, // .C8..<..-..>.C=. + 0x43, 0x39, 0xc8, 0x01, 0x29, 0xb4, 0xc2, 0x2c, 0xf0, 0x81, 0x3d, 0x94, 0xc3, 0x38, 0xd0, 0xc3, // C9..)..,..=..8.. + 0x3b, 0xc8, 0x03, 0x1f, 0x98, 0x03, 0x3b, 0xbc, 0x43, 0x38, 0xd0, 0x03, 0x1b, 0x80, 0x01, 0x1d, // ;.....;.C8...... + 0xf8, 0x01, 0x1b, 0x80, 0x01, 0x1c, 0xf8, 0x01, 0x12, 0x26, 0xa5, 0x9a, 0x02, 0x04, 0x00, 0x00, // .........&...... + 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, // ..r..t`.6h.yh.r. + 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, // ...P.m..zP.m..z0 + 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, // .r..s .m..q..s . + 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, // m..x..s .m..q`.z + 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, // 0.r...0.r..s .m. + 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, // .v@.z`.t.....v.. + 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, // s .m`.s .z0.r... + 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, // `.t..v@.m..x..q` + 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e, 0x00, 0x00, 0x00, 0x00, // .z0.r..v@.C..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x06, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........<....... + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....y. ........ + 0x00, 0x18, 0xf2, 0x34, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe4, // ...4@.........0. + 0x81, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0b, 0x04, 0x00, 0x00, // ........... .... + 0x0c, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, // ....2.....L...&G + 0xc6, 0x04, 0x43, 0x22, 0x25, 0x30, 0x02, 0x50, 0x14, 0xc5, 0x50, 0x06, 0x25, 0x51, 0x03, 0x54, // ..C"%0.P..P.%Q.T + 0x4a, 0xa2, 0x0c, 0x0a, 0x61, 0x04, 0xa0, 0x44, 0x4a, 0xa0, 0x06, 0xc8, 0xce, 0x00, 0xd0, 0x1d, // J...a..DJ....... + 0x4b, 0x20, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, // K ..y...R.....L. + 0x46, 0x02, 0x13, 0xc4, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0x06, 0xc6, // F.....o..M.$.%.. + 0x45, 0xc6, 0x06, 0xa6, 0xc6, 0x65, 0xe6, 0x06, 0x04, 0x65, 0x8c, 0x86, 0x0c, 0xc7, 0x8c, 0xc6, // E....e...e...... + 0x2c, 0x27, 0x27, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x88, 0x62, 0x82, 0x40, 0x18, 0x1b, 0x84, 0x81, // ,''eC.L..b.@.... + 0x98, 0x20, 0x10, 0xc7, 0x06, 0x61, 0x30, 0x28, 0xc0, 0xcd, 0x4d, 0x10, 0x08, 0x64, 0xc3, 0x80, // . ...a0(..M..d.. + 0x24, 0xc4, 0x04, 0xc1, 0x9a, 0x08, 0x4c, 0x10, 0x88, 0x64, 0x82, 0x40, 0x28, 0x1b, 0x04, 0xc2, // $.....L..d.@(... + 0xd9, 0x90, 0x10, 0x0b, 0x43, 0x10, 0x43, 0x43, 0x3c, 0x1b, 0x02, 0x68, 0x03, 0x11, 0x01, 0x00, // ....C.CC<..h.... + 0x30, 0x41, 0xb8, 0xa8, 0x0d, 0xc1, 0x34, 0x41, 0x10, 0x00, 0x12, 0x6d, 0x61, 0x69, 0x6e, 0x5c, // 0A....4A...main. + 0xa6, 0xac, 0xbe, 0xa0, 0xde, 0xe6, 0xd2, 0xe8, 0xd2, 0xde, 0xdc, 0x26, 0x08, 0x05, 0x33, 0x41, // ...........&..3A + 0x28, 0x9a, 0x0d, 0x01, 0x31, 0x41, 0x28, 0x9c, 0x09, 0x42, 0xf1, 0x6c, 0x10, 0x9a, 0x66, 0xc3, // (...1A(..B.l..f. + 0x42, 0x5c, 0x58, 0xa6, 0x6d, 0xc3, 0x46, 0x70, 0xdd, 0x86, 0xc0, 0x23, 0x32, 0x65, 0xf5, 0x45, // B.X.m.Fp...#2e.E + 0x54, 0x06, 0x47, 0x87, 0x36, 0x41, 0x28, 0xa0, 0x09, 0x42, 0x11, 0x4d, 0x10, 0x88, 0x65, 0x82, // T.G.6A(..B.M..e. + 0x50, 0x48, 0x1b, 0x84, 0x66, 0xd8, 0xb0, 0x10, 0x60, 0x80, 0x85, 0x81, 0xc6, 0x0d, 0x62, 0x30, // PH..f...`.....b0 + 0x06, 0x64, 0x50, 0x06, 0x1b, 0x02, 0x33, 0xd8, 0x30, 0x7c, 0x67, 0x00, 0x6c, 0x28, 0x2a, 0x0b, // .dP...3.0|g.l(*. + 0x0d, 0x24, 0xa0, 0x0a, 0x1b, 0x9b, 0x5d, 0x9b, 0x4b, 0x1a, 0x59, 0x99, 0x1b, 0xdd, 0x94, 0x20, // .$....].K.Y.... + 0xa8, 0x42, 0x86, 0xe7, 0x62, 0x57, 0x26, 0x37, 0x97, 0xf6, 0xe6, 0x36, 0x25, 0x20, 0x9a, 0x90, // .B..bW&7...6% .. + 0xe1, 0xb9, 0xd8, 0x85, 0xb1, 0xd9, 0x95, 0xc9, 0x4d, 0x09, 0x8c, 0x3a, 0x64, 0x78, 0x2e, 0x73, // ........M..:dx.s + 0x68, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x82, 0xa4, 0x0c, 0x19, 0x9e, // haderModelS..... + 0x8b, 0x5c, 0xd9, 0xdc, 0x5b, 0x9d, 0xdc, 0x58, 0xd9, 0xdc, 0x94, 0x20, 0xaa, 0x43, 0x86, 0xe7, // ....[..X... .C.. + 0x62, 0x97, 0x56, 0x76, 0x97, 0x44, 0x36, 0x45, 0x17, 0x46, 0x57, 0x36, 0x25, 0x98, 0xea, 0x90, // b.Vv.D6E.FW6%... + 0xe1, 0xb9, 0x94, 0xb9, 0xd1, 0xc9, 0xe5, 0x41, 0xbd, 0xa5, 0xb9, 0xd1, 0xcd, 0x4d, 0x09, 0xd0, // .......A.....M.. + 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, // ....y...L...3... + 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, // ...f..=.C8...B.. + 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, // yx.s.q.......... + 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, // 3.B.......f0.=.C + 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, // 8.....=.C=..=.x. + 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, // tp.{..yH.pp.zp.v + 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, // x.p .........0.n + 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, // 0.....P.3....!.. + 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, // !..a.f0.;..;.C9. + 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, // .<..<..;...v`.{h + 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, // .7h.rh.7..p..p`. + 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, // v(.v..vx.w.._..q + 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, // ..r..y..,....... + 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, // ...0.b.......... + 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, // ...a..!.....a... + 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, // C9.C9.C9.C9..8.C + 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, // 8..;../..<..;..; + 0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87, 0x76, 0x80, 0x87, 0x19, // ....!.|p.z(.v... + 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20, 0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, // .C..... ........ + 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, // ......P.....q .. + 0x13, 0x00, 0x00, 0x00, 0x46, 0x20, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, 0x11, 0xc0, 0x44, 0x84, // ....F ...<....D. + 0x40, 0x33, 0x2c, 0x84, 0x05, 0x4c, 0xc3, 0xe5, 0x3b, 0x8f, 0xbf, 0x38, 0xc0, 0x20, 0x36, 0x0f, // @3,..L..;..8. 6. + 0x35, 0xf9, 0xc5, 0x6d, 0x9b, 0x40, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0xd2, 0xe4, 0x44, 0x04, 0x4a, // 5..m.@5......D.J + 0x4d, 0x0f, 0x35, 0xf9, 0xc5, 0x6d, 0xdb, 0x40, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0x13, 0x71, 0x4d, // M.5..m.@5.....qM + 0x54, 0x44, 0x94, 0x0e, 0x30, 0xf8, 0xc5, 0x6d, 0x1b, 0x00, 0xc1, 0x00, 0x48, 0x03, 0x00, 0x00, // TD..0..m....H... + 0x61, 0x20, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c, 0x10, 0x00, 0x00, 0x00, // a ........A,.... + 0x04, 0x00, 0x00, 0x00, 0x44, 0x66, 0x00, 0x0a, 0xa1, 0xe4, 0x8a, 0x30, 0xa0, 0x14, 0xe8, 0x8d, // ....Df.....0.... + 0x00, 0x00, 0x00, 0x00, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x00, 0x5d, 0x04, 0x53, 0x55, 0xc1, // ....#....`.].SU. + 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x18, 0x9b, 0x61, 0x59, 0xcd, 0x31, 0x62, 0x90, 0x00, 0x20, // .A.. ...aY.1b.. + 0x08, 0x06, 0x06, 0x77, 0x5c, 0x17, 0x83, 0x9c, 0x40, 0xe8, 0x04, 0x42, 0x23, 0x06, 0x0d, 0x00, // ...w....@..B#... + 0x82, 0x60, 0xd0, 0x74, 0x48, 0xa1, 0x09, 0xc1, 0xb2, 0x2c, 0xcb, 0x68, 0x42, 0x00, 0x8c, 0x18, // .`.tH....,.hB... + 0x24, 0x00, 0x08, 0x82, 0x01, 0x02, 0x06, 0x09, 0xc7, 0x4d, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, // $........M...... + 0x00, 0x00, 0x00, 0x00, // .... +}; +static const uint8_t fs_resolve_depth_mtl[792] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x16, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, // epthMsTexture... + 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, // ........bgfx_tex + 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, // DepthMs......... + 0x00, 0xbf, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, // .....#include .#in + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, // clude ..using names + 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, // pace metal;..con + 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // stant uint bgfx_ + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x20, 0x5b, 0x5b, 0x66, 0x75, 0x6e, // sampleMask [[fun + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x28, 0x30, // ction_constant(0 + 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x62, 0x6f, // )]];.constant bo + 0x6f, 0x6c, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, // ol bgfx_sampleMa + 0x73, 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x69, 0x73, 0x5f, 0x66, // skEnabled = is_f + 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, // unction_constant + 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x73, 0x61, // _defined(bgfx_sa + 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x29, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, // mpleMask);..stru + 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // ct xlatMtlMain_o + 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x09, 0x75, 0x69, 0x6e, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // ut.{..uint bgfx_ + 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, // metal_sampleMask + 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2c, 0x20, // [[sample_mask, + 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, // function_constan + 0x74, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, // t(bgfx_sampleMas + 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, // kEnabled)]];. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, // float gl_FragDe + 0x70, 0x74, 0x68, 0x20, 0x5b, 0x5b, 0x64, 0x65, 0x70, 0x74, 0x68, 0x28, 0x61, 0x6e, 0x79, 0x29, // pth [[depth(any) + 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, // ]];.};..fragment + 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, // xlatMtlMain_out + 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x74, 0x65, 0x78, // xlatMtlMain(tex + 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x5f, 0x6d, 0x73, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, // ture2d_ms + 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, // bgfx_texDepthMs + 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, // [[texture(0)]], + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // float4 gl_FragC + 0x6f, 0x6f, 0x72, 0x64, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, // oord [[position] + 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // ]).{. xlatMtl + 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, // Main_out out = { + 0x7d, 0x3b, 0x0a, 0x09, 0x69, 0x66, 0x20, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x73, 0x61, 0x6d, // };..if (bgfx_sam + 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x20, // pleMaskEnabled) + 0x7b, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, // { out.bgfx_metal + 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x20, 0x3d, 0x20, 0x62, 0x67, // _sampleMask = bg + 0x66, 0x78, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x3b, 0x20, 0x7d, // fx_sampleMask; } + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . out.gl_Frag + 0x44, 0x65, 0x70, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, // Depth = bgfx_tex + 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x28, 0x75, 0x69, 0x6e, // DepthMs.read(uin + 0x74, 0x32, 0x28, 0x69, 0x6e, 0x74, 0x32, 0x28, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // t2(int2(gl_FragC + 0x6f, 0x6f, 0x72, 0x64, 0x2e, 0x78, 0x79, 0x29, 0x29, 0x2c, 0x20, 0x30, 0x29, 0x2e, 0x78, 0x3b, // oord.xy)), 0).x; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, // . return out; + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x10, 0x00, // .}...... +}; +extern const uint8_t* fs_resolve_depth_pssl; +extern const uint32_t fs_resolve_depth_pssl_size; diff --git a/src/fs_resolve_depth.sc b/src/fs_resolve_depth.sc new file mode 100644 index 000000000..fa80a9680 --- /dev/null +++ b/src/fs_resolve_depth.sc @@ -0,0 +1,13 @@ +/* + * Copyright 2011-2026 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE + */ + +#include "bgfx_shader.sh" + +SAMPLER2DMS(bgfx_texDepthMs, 0); + +void main() +{ + gl_FragDepth = texelFetch(bgfx_texDepthMs, ivec2(gl_FragCoord.xy), 0).x; +} diff --git a/src/fs_resolve_depth_array.bin.h b/src/fs_resolve_depth_array.bin.h new file mode 100644 index 000000000..cdfa5d467 --- /dev/null +++ b/src/fs_resolve_depth_array.bin.h @@ -0,0 +1,440 @@ +static const uint8_t fs_resolve_depth_array_glsl[186] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, // epthMs.......... + 0x85, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, // .....uniform sam + 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x4d, 0x53, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, // pler2DMS bgfx_te + 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x3b, 0x0a, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // xDepthMs;..void + 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x67, 0x6c, 0x5f, // main().{. gl_ + 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, 0x70, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x65, // FragDepth = texe + 0x6c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // lFetch(bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x2c, 0x20, 0x69, 0x76, 0x65, 0x63, 0x32, 0x28, 0x67, 0x6c, // epthMs, ivec2(gl + 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x2e, 0x78, 0x79, 0x29, 0x2c, 0x20, // _FragCoord.xy), + 0x30, 0x29, 0x2e, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 0).x;.}... +}; +static const uint8_t fs_resolve_depth_array_essl[238] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, // epthMs.......... + 0xb9, 0x00, 0x00, 0x00, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x65, // ....precision me + 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x70, 0x72, 0x65, // diump float;.pre + 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, 0x74, // cision highp int + 0x3b, 0x0a, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // ;..uniform highp + 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x4d, 0x53, 0x20, 0x62, 0x67, 0x66, // sampler2DMS bgf + 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x3b, 0x0a, 0x0a, 0x76, // x_texDepthMs;..v + 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, // oid main().{. + 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, 0x70, 0x74, 0x68, 0x20, 0x3d, 0x20, // gl_FragDepth = + 0x74, 0x65, 0x78, 0x65, 0x6c, 0x46, 0x65, 0x74, 0x63, 0x68, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, // texelFetch(bgfx_ + 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x2c, 0x20, 0x69, 0x76, 0x65, 0x63, // texDepthMs, ivec + 0x32, 0x28, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x2e, 0x78, // 2(gl_FragCoord.x + 0x79, 0x29, 0x2c, 0x20, 0x30, 0x29, 0x2e, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // y), 0).x;.}... +}; +static const uint8_t fs_resolve_depth_array_spv[840] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x29, 0x00, // epthMs0.......). + 0x10, 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, // ......#......... + 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, // ........GLSL.std + 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // .450............ + 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // ................ + 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, // main....I...R... + 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, // ................ + 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, // ................ + 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, // ............main + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x08, 0x00, 0x23, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, // ........#...bgfx + 0x5f, 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x54, 0x65, 0x78, 0x74, 0x75, // _texDepthMsTextu + 0x72, 0x65, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x49, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, // re......I...gl_F + 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, // ragCoord........ + 0x52, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, 0x70, 0x74, 0x68, // R...gl_FragDepth + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, // ....G...#...!... + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, // ....G...#..."... + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x49, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, // ....G...I....... + 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x52, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, // ....G...R....... + 0x16, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, // ............!... + 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, // ................ + 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, // ............... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, // ................ + 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, // ............... + 0x0a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, // ................ + 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, // ........ ..."... + 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, // ........;..."... + 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, // #.......+....... + 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x37, 0x00, 0x00, 0x00, // &...........7... + 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x3a, 0x00, 0x00, 0x00, // ............:... + 0x0a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, // ........ ...H... + 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, // ........;...H... + 0x49, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, // I....... ...Q... + 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, // ........;...Q... + 0x52, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, // R.......6....... + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // ................ + 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, // ....=.......$... + 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, // #...=.......J... + 0x49, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x37, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, // I...O...7...r... + 0x4a, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // J...J........... + 0x6e, 0x00, 0x04, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, // n...:...s...r... + 0x51, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, // Q.......t...s... + 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, // ....Q.......u... + 0x73, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, // s.......P....... + 0x76, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, // v...t...u...&... + 0x5f, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, // _...........$... + 0x76, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // v...@...&...Q... + 0x06, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....y........... + 0x3e, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, // >...R...y....... + 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // 8....... +}; +static const uint8_t fs_resolve_depth_array_wgsl[534] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x07, 0x29, 0x00, // epthMs0.......). + 0xdc, 0x01, 0x00, 0x00, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x28, 0x6f, // ....diagnostic(o + 0x66, 0x66, 0x2c, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x75, // ff, derivative_u + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x74, 0x79, 0x29, 0x3b, 0x0a, 0x64, 0x69, 0x61, 0x67, // niformity);.diag + 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x28, 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x73, 0x75, 0x62, 0x67, // nostic(off, subg + 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x74, 0x79, 0x29, // roup_uniformity) + 0x3b, 0x0a, 0x0a, 0x40, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x28, 0x30, 0x75, 0x29, 0x20, 0x40, 0x62, // ;..@group(0u) @b + 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x28, 0x32, 0x75, 0x29, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, // inding(2u) var b + 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x54, 0x65, // gfx_texDepthMsTe + 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, // xture : texture_ + 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x5f, 0x32, 0x64, 0x3c, // multisampled_2d< + 0x66, 0x33, 0x32, 0x3e, 0x3b, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x3c, 0x70, 0x72, 0x69, 0x76, 0x61, // f32>;..var gl_FragDepth + 0x20, 0x3a, 0x20, 0x66, 0x33, 0x32, 0x3b, 0x0a, 0x0a, 0x66, 0x6e, 0x20, 0x6d, 0x61, 0x69, 0x6e, // : f32;..fn main + 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x28, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // _inner(gl_FragCo + 0x6f, 0x72, 0x64, 0x20, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x29, // ord : vec4) + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, 0x70, 0x74, // {. gl_FragDept + 0x68, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x28, // h = textureLoad( + 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x54, // bgfx_texDepthMsT + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x32, 0x3c, 0x69, 0x33, 0x32, // exture, vec2(gl_FragCoord.x + 0x79, 0x29, 0x2c, 0x20, 0x30, 0x69, 0x29, 0x2e, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x40, 0x66, // y), 0i).x;.}..@f + 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x0a, 0x66, 0x6e, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, // ragment.fn main( + 0x40, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // @builtin(positio + 0x6e, 0x29, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x20, // n) gl_FragCoord + 0x3a, 0x20, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x29, 0x20, 0x2d, 0x3e, 0x20, // : vec4) -> + 0x40, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28, 0x66, 0x72, 0x61, 0x67, 0x5f, 0x64, 0x65, // @builtin(frag_de + 0x70, 0x74, 0x68, 0x29, 0x20, 0x66, 0x33, 0x32, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x61, 0x69, // pth) f32 {. mai + 0x6e, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x28, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // n_inner(gl_FragC + 0x6f, 0x6f, 0x72, 0x64, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, // oord);. return + 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, 0x70, 0x74, 0x68, 0x3b, 0x0a, 0x7d, 0x0a, // gl_FragDepth;.}. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... +}; +static const uint8_t fs_resolve_depth_array_dxbc[388] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x00, // epthMs0......... + 0x4c, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xe6, 0xa1, 0x03, 0xf8, 0xf7, 0xf8, 0x10, 0xa4, // L...DXBC........ + 0x7a, 0xad, 0x89, 0xe4, 0x52, 0xba, 0x78, 0x60, 0x01, 0x00, 0x00, 0x00, 0x4c, 0x01, 0x00, 0x00, // z...R.x`....L... + 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, // ....,...`....... + 0x49, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGN,........... + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x00, 0x00, 0x0f, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, // ........SV_POSIT + 0x49, 0x4f, 0x4e, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ION.OSGN,....... + 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .... ........... + 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x0e, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x44, // ............SV_D + 0x45, 0x50, 0x54, 0x48, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xb0, 0x00, 0x00, 0x00, // EPTH....SHEX.... + 0x50, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x58, 0x48, 0x00, 0x04, // P...,...j...XH.. + 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x64, 0x20, 0x00, 0x04, // .p......UU..d .. + 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x02, // 2...........e... + 0x01, 0xc0, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x05, // ....h........... + 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // 2.......F....... + 0x36, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // 6............@.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x2e, 0x00, 0x00, 0x8b, 0x42, 0x02, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0x12, 0x00, 0x10, 0x00, // ....B...CU...... + 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~.. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x04, // .....@......6... + 0x01, 0xc0, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ............>... + 0x00, 0x00, 0x00, 0x00, // .... +}; +static const uint8_t fs_resolve_depth_array_dxil[3640] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x00, // epthMs0......... + 0x00, 0x0e, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x84, 0x79, 0xbe, 0xba, 0x96, 0xef, 0xa1, 0xc7, // ....DXBC.y...... + 0x7f, 0x1c, 0x1a, 0x4f, 0x1b, 0x7a, 0x4d, 0x47, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, // ...O.zMG........ + 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, // ....<...L....... + 0xc4, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0xac, 0x07, 0x00, 0x00, 0xc8, 0x07, 0x00, 0x00, // ....`........... + 0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // SFI0............ + 0x49, 0x53, 0x47, 0x31, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISG14........... + 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....(........... + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x53, 0x56, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x4f, 0x53, 0x47, 0x31, // SV_Position.OSG1 + 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 4............... + 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // (.......A....... + 0xff, 0xff, 0xff, 0xff, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x44, // ............SV_D + 0x65, 0x70, 0x74, 0x68, 0x00, 0x00, 0x00, 0x00, 0x50, 0x53, 0x56, 0x30, 0x94, 0x00, 0x00, 0x00, // epth....PSV0.... + 0x38, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 8............... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, // ................ + 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ................ + 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .main........... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x44, 0x03, // ..............D. + 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x11, // ................ + 0x03, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0x44, 0x06, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, // ....STATD...`... + 0x91, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // ....DXIL........ + 0x2c, 0x06, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, // ,...BC..!....... + 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, // .. ...........#. + 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, // A..I..29....%... + 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, 0x14, // ...b..E.B..B..2. + 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88, 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, // 8..K.2R.H.. CF.. + 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90, 0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, // ..2B.H...".PAQ.. + 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // .....)F.Q....... + 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, // ........@....... + 0xff, 0xff, 0x03, 0x20, 0x6d, 0x30, 0x86, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, // ... m0.......... + 0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06, // I.........`B L.. + 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09, // ..... ..F...2"H. + 0x20, 0x64, 0x85, 0x04, 0x93, 0x22, 0xa4, 0x84, 0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, // d..."...."..... + 0x12, 0x4c, 0x8a, 0x8c, 0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x60, 0x23, 0x00, 0x25, 0x00, 0x14, 0x66, // .L.....L.`#.%..f + 0x00, 0xe6, 0x08, 0xc0, 0x60, 0x8e, 0x00, 0x29, 0xc6, 0x20, 0x84, 0x14, 0x42, 0xa6, 0x18, 0x80, // ....`..). ..B... + 0x10, 0x52, 0x06, 0xa1, 0x9b, 0x86, 0xcb, 0x9f, 0xb0, 0x87, 0x90, 0xfc, 0x95, 0x90, 0x56, 0x62, // .R............Vb + 0xf2, 0x8b, 0xdb, 0x46, 0xc5, 0x18, 0x63, 0x10, 0x2a, 0xf7, 0x0c, 0x97, 0x3f, 0x61, 0x0f, 0x21, // ...F..c.*...?a.! + 0xf9, 0x21, 0xd0, 0x0c, 0x0b, 0x81, 0x82, 0x55, 0x14, 0x45, 0x18, 0x21, 0x84, 0x10, 0x42, 0xa8, // .!.....U.E.!..B. + 0xcd, 0x11, 0x04, 0xc5, 0x60, 0xa4, 0x10, 0xf2, 0x08, 0x0e, 0x04, 0x0c, 0x23, 0x10, 0xc3, 0x4c, // ....`.......#..L + 0x78, 0x30, 0x0e, 0xec, 0x10, 0x0e, 0xf3, 0x30, 0x0f, 0x6e, 0x40, 0x0b, 0xe5, 0x80, 0x0f, 0xf4, // x0.....0.n@..... + 0x50, 0x0f, 0xf2, 0x50, 0x0e, 0x72, 0x40, 0x0a, 0xad, 0x30, 0x0b, 0xa1, 0x20, 0x0f, 0xf2, 0x10, // P..P.r@..0.. ... + 0x0e, 0xf9, 0xc0, 0x07, 0xf6, 0x50, 0x0e, 0xe3, 0x40, 0x0f, 0xef, 0x20, 0x0f, 0x7c, 0x60, 0x0e, // .....P..@.. .|`. + 0xec, 0xf0, 0x0e, 0xe1, 0x40, 0x0f, 0x6c, 0x00, 0x06, 0x74, 0xe0, 0x07, 0x6c, 0x00, 0x06, 0x70, // ....@.l..t..l..p + 0xe0, 0x07, 0x7a, 0xa0, 0x07, 0xf3, 0x10, 0x0e, 0xed, 0x00, 0x0f, 0xec, 0x50, 0x0e, 0xbf, 0x40, // ..z.........P..@ + 0x0f, 0xf9, 0x00, 0x0f, 0xe5, 0x80, 0x02, 0x32, 0xd3, 0x1a, 0x8c, 0x03, 0x3b, 0x84, 0xc3, 0x3c, // .......2....;..< + 0xcc, 0x83, 0x1b, 0xd0, 0x42, 0x39, 0xe0, 0x03, 0x3d, 0xd4, 0x83, 0x3c, 0x94, 0x83, 0x1c, 0x90, // ....B9..=..<.... + 0x42, 0x2b, 0xcc, 0x42, 0x28, 0xc8, 0x83, 0x3c, 0x84, 0x43, 0x3e, 0xf0, 0x81, 0x3d, 0x94, 0xc3, // B+.B(..<.C>..=.. + 0x38, 0xd0, 0xc3, 0x3b, 0xc8, 0x03, 0x1f, 0x98, 0x03, 0x3b, 0xbc, 0x43, 0x38, 0xd0, 0x03, 0x1b, // 8..;.....;.C8... + 0x80, 0x01, 0x1d, 0xf8, 0x01, 0x1b, 0x80, 0x01, 0x1c, 0xf8, 0x01, 0x12, 0x26, 0xa5, 0x9a, 0x02, // ............&... + 0x04, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, // ......r..t`.6h.y + 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, // h.r....P.m..zP.m + 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, // ..z0.r..s .m..q. + 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, // .s .m..x..s .m.. + 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, // q`.z0.r...0.r..s + 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, // .m..v@.z`.t.... + 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, // .v..s .m`.s .z0. + 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, // r...`.t..v@.m..x + 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e, // ..q`.z0.r..v@.C. + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x06, 0x10, 0x00, // ............<... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00, // .........y. .... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x34, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, // .......4@....... + 0x00, 0x00, 0x30, 0xe4, 0x81, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ..0............ + 0x0b, 0x04, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, // ........2.....L. + 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22, 0x25, 0x30, 0x02, 0x50, 0x0c, 0x05, 0x51, 0x12, // ..&G..C"%0.P..Q. + 0x65, 0x50, 0x03, 0x45, 0x40, 0xa5, 0x24, 0xca, 0xa0, 0x10, 0x46, 0x00, 0x4a, 0xa4, 0x04, 0x6a, // eP.E@.$...F.J..j + 0x80, 0xec, 0x0c, 0x00, 0xdd, 0xb1, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, // ............y... + 0x73, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x8f, 0x0c, 0x6f, 0xec, // s.....L.F.....o. + 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0x06, 0xc6, 0x45, 0xc6, 0x06, 0xa6, 0xc6, 0x65, 0xe6, 0x06, // .M.$.%..E....e.. + 0x04, 0x65, 0x8c, 0x86, 0x0c, 0xc7, 0x8c, 0xc6, 0x2c, 0x27, 0x27, 0x65, 0x43, 0x10, 0x4c, 0x10, // .e......,''eC.L. + 0x88, 0x62, 0x82, 0x40, 0x18, 0x1b, 0x84, 0x81, 0xd8, 0x20, 0x10, 0x04, 0x05, 0xb8, 0xb9, 0x09, // .b.@..... ...... + 0x02, 0x71, 0x6c, 0x18, 0x0e, 0x84, 0x98, 0x20, 0x58, 0x14, 0x2d, 0xb1, 0x33, 0x33, 0xbc, 0x2f, // .ql.... X.-.33./ + 0xba, 0x32, 0x3c, 0xa2, 0x32, 0x38, 0x3a, 0xb4, 0xa6, 0x39, 0xaa, 0x32, 0x3c, 0xba, 0x3a, 0xb9, // .2<.28:..9.2<.:. + 0xb2, 0x09, 0x02, 0x81, 0x4c, 0x10, 0x88, 0x64, 0x83, 0x40, 0x34, 0x1b, 0x12, 0x42, 0x59, 0x08, // ....L..d.@4..BY. + 0x62, 0x60, 0x08, 0x67, 0x43, 0xf0, 0x6c, 0x20, 0x20, 0x00, 0x00, 0x26, 0x08, 0x02, 0xb0, 0x01, // b`.gC.l ..&.... + 0xd8, 0x30, 0x10, 0xd3, 0xb4, 0x21, 0xa0, 0x36, 0x0c, 0x83, 0x54, 0x4d, 0x10, 0xae, 0x6a, 0x43, // .0...!.6..TM..jC + 0x70, 0x91, 0x68, 0x0b, 0x4b, 0x73, 0xe3, 0x32, 0x65, 0xf5, 0x05, 0xf5, 0x36, 0x97, 0x46, 0x97, // p.h.Ks.2e...6.F. + 0xf6, 0xe6, 0x36, 0x41, 0x28, 0x9a, 0x09, 0x42, 0xe1, 0x6c, 0x08, 0x88, 0x09, 0x42, 0xf1, 0x4c, // ..6A(..B.l...B.L + 0x10, 0x0a, 0x68, 0x82, 0x40, 0x28, 0x1b, 0x04, 0x30, 0x00, 0x83, 0x0d, 0x0b, 0xa1, 0x6d, 0x5c, // ..h.@(..0.....m. + 0xe7, 0x0d, 0x1e, 0xf1, 0x85, 0xc1, 0x86, 0x40, 0x0c, 0x88, 0x4c, 0x59, 0x7d, 0x11, 0x95, 0xc1, // .......@..LY}... + 0xd1, 0xa1, 0x4d, 0x10, 0x8a, 0x68, 0x82, 0x50, 0x48, 0x13, 0x04, 0x62, 0x99, 0x20, 0x14, 0xd3, // ..M..h.PH..b. .. + 0x06, 0x01, 0x0c, 0x86, 0x0d, 0x0b, 0x41, 0x06, 0x5b, 0x19, 0x74, 0xdf, 0x60, 0x06, 0x67, 0x80, // ......A.[.t.`.g. + 0x06, 0x69, 0xb0, 0x21, 0x50, 0x83, 0x0d, 0xc3, 0x18, 0xac, 0x01, 0xb0, 0xa1, 0x90, 0x32, 0x36, // .i.!P.........26 + 0x88, 0x00, 0x1a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x73, 0x13, 0x04, 0x82, 0x61, 0x91, 0xe6, 0x36, // ...floats...a..6 + 0x47, 0x37, 0x47, 0x63, 0x2e, 0xed, 0xec, 0x8b, 0x8d, 0x8c, 0xc6, 0x5c, 0xda, 0xd9, 0xd7, 0x1c, // G7Gc............ + 0x1d, 0x11, 0xba, 0x32, 0xbc, 0x2f, 0xb6, 0xb7, 0x30, 0xb2, 0x0d, 0x8a, 0x1b, 0xbc, 0x01, 0x1c, // ...2./..0....... + 0x34, 0x71, 0xf0, 0x06, 0x72, 0x30, 0xcc, 0xc1, 0x50, 0x85, 0x8d, 0xcd, 0xae, 0xcd, 0x25, 0x8d, // 4q..r0..P.....%. + 0xac, 0xcc, 0x8d, 0x6e, 0x4a, 0x10, 0x54, 0x21, 0xc3, 0x73, 0xb1, 0x2b, 0x93, 0x9b, 0x4b, 0x7b, // ...nJ.T!.s.+..K{ + 0x73, 0x9b, 0x12, 0x10, 0x4d, 0xc8, 0xf0, 0x5c, 0xec, 0xc2, 0xd8, 0xec, 0xca, 0xe4, 0xa6, 0x04, // s...M........... + 0x45, 0x1d, 0x32, 0x3c, 0x97, 0x39, 0xb4, 0x30, 0xb2, 0x32, 0xb9, 0xa6, 0x37, 0xb2, 0x32, 0xb6, // E.2<.9.0.2..7.2. + 0x29, 0x01, 0x52, 0x86, 0x0c, 0xcf, 0x45, 0xae, 0x6c, 0xee, 0xad, 0x4e, 0x6e, 0xac, 0x6c, 0x6e, // ).R...E.l..Nn.ln + 0x4a, 0x00, 0x55, 0x22, 0xc3, 0x73, 0xa1, 0xcb, 0x83, 0x2b, 0x0b, 0x72, 0x73, 0x7b, 0xa3, 0x0b, // J.U".s...+.rs{.. + 0xa3, 0x4b, 0x7b, 0x73, 0x9b, 0x9b, 0x12, 0x54, 0x75, 0xc8, 0xf0, 0x5c, 0xec, 0xd2, 0xca, 0xee, // .K{s...Tu....... + 0x92, 0xc8, 0xa6, 0xe8, 0xc2, 0xe8, 0xca, 0xa6, 0x04, 0x57, 0x1d, 0x32, 0x3c, 0x97, 0x32, 0x37, // .........W.2<.27 + 0x3a, 0xb9, 0x3c, 0xa8, 0xb7, 0x34, 0x37, 0xba, 0xb9, 0x29, 0x01, 0x1b, 0x74, 0x21, 0xc3, 0x73, // :.<..47..)..t!.s + 0x19, 0x7b, 0xab, 0x73, 0xa3, 0x2b, 0x93, 0x9b, 0x9b, 0x12, 0xcc, 0x01, 0x00, 0x00, 0x00, 0x00, // .{.s.+.......... + 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, // y...L...3......f + 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, // ..=.C8...B..yx.s + 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, // .q..........3.B. + 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, // ......f0.=.C8... + 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, // ..=.C=..=.x.tp.{ + 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, // ..yH.pp.zp.vx.p + 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, // .........0.n0... + 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, // ..P.3....!..!..a + 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, // .f0.;..;.C9..<.. + 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, // <..;...v`.{h.7h. + 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, // rh.7..p..p`.v(.v + 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, // ..vx.w.._..q..r. + 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, // .y..,..........0 + 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, // .b.............a + 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, // ..!.....a...C9.C + 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, // 9.C9.C9..8.C8..; + 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x0c, 0xc4, // ../..<..;..;.... + 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87, 0x76, 0x80, 0x87, 0x19, 0xd1, 0x43, 0x0e, 0xf8, // !.|p.z(.v....C.. + 0xe0, 0x06, 0xe4, 0x20, 0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90, // ... ............ + 0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, // ..P.....q ...... + 0x46, 0x20, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, 0x11, 0xc0, 0x44, 0x84, 0x40, 0x33, 0x2c, 0x84, // F ...<....D.@3,. + 0x05, 0x4c, 0xc3, 0xe5, 0x3b, 0x8f, 0xbf, 0x38, 0xc0, 0x20, 0x36, 0x0f, 0x35, 0xf9, 0xc5, 0x6d, // .L..;..8. 6.5..m + 0x9b, 0x40, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0xd2, 0xe4, 0x44, 0x04, 0x4a, 0x4d, 0x0f, 0x35, 0xf9, // .@5......D.JM.5. + 0xc5, 0x6d, 0xdb, 0x40, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0x13, 0x71, 0x4d, 0x54, 0x44, 0x94, 0x0e, // .m.@5.....qMTD.. + 0x30, 0xf8, 0xc5, 0x6d, 0x1b, 0x00, 0xc1, 0x00, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0..m....H....... + 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf2, 0xe4, 0x04, // HASH............ + 0x70, 0x0b, 0x85, 0xf2, 0xb3, 0x51, 0x7f, 0x6e, 0x4c, 0x51, 0xb2, 0xac, 0x44, 0x58, 0x49, 0x4c, // p....Q.nLQ..DXIL + 0x30, 0x06, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, // 0...`.......DXIL + 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, // ............BC.. + 0x21, 0x0c, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, // !......... ..... + 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39, // ......#.A..I..29 + 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x14, 0x45, 0x02, // ....%......b..E. + 0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88, // B..B..2.8..K.2R. + 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90, // H.. CF....2B.H.. + 0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x29, 0x46, 0x06, // .".PAQ.......)F. + 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, // Q............... + 0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x6d, 0x30, 0x86, 0xff, // @.......... m0.. + 0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, 0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ........I....... + 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, // ..`B L....... .. + 0x46, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, 0x04, 0x93, 0x22, 0xa4, 0x84, // F...2"H. d...".. + 0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8a, 0x8c, 0x0b, 0x84, 0xa4, 0x4c, // .."......L.....L + 0x10, 0x60, 0x23, 0x00, 0x25, 0x00, 0x14, 0x66, 0x00, 0xe6, 0x08, 0xc0, 0x60, 0x8e, 0x00, 0x29, // .`#.%..f....`..) + 0xc6, 0x20, 0x84, 0x14, 0x42, 0xa6, 0x18, 0x80, 0x10, 0x52, 0x06, 0xa1, 0x9b, 0x86, 0xcb, 0x9f, // . ..B....R...... + 0xb0, 0x87, 0x90, 0xfc, 0x95, 0x90, 0x56, 0x62, 0xf2, 0x8b, 0xdb, 0x46, 0xc5, 0x18, 0x63, 0x10, // ......Vb...F..c. + 0x2a, 0xf7, 0x0c, 0x97, 0x3f, 0x61, 0x0f, 0x21, 0xf9, 0x21, 0xd0, 0x0c, 0x0b, 0x81, 0x82, 0x55, // *...?a.!.!.....U + 0x14, 0x45, 0x18, 0x21, 0x84, 0x10, 0x42, 0xa8, 0xcd, 0x11, 0x04, 0xc5, 0x60, 0xa4, 0x10, 0xf2, // .E.!..B.....`... + 0x08, 0x0e, 0x04, 0x0c, 0x23, 0x10, 0xc3, 0x4c, 0x78, 0x30, 0x0e, 0xec, 0x10, 0x0e, 0xf3, 0x30, // ....#..Lx0.....0 + 0x0f, 0x6e, 0x40, 0x0b, 0xe5, 0x80, 0x0f, 0xf4, 0x50, 0x0f, 0xf2, 0x50, 0x0e, 0x72, 0x40, 0x0a, // .n@.....P..P.r@. + 0xad, 0x30, 0x0b, 0xa1, 0x20, 0x0f, 0xf2, 0x10, 0x0e, 0xf9, 0xc0, 0x07, 0xf6, 0x50, 0x0e, 0xe3, // .0.. ........P.. + 0x40, 0x0f, 0xef, 0x20, 0x0f, 0x7c, 0x60, 0x0e, 0xec, 0xf0, 0x0e, 0xe1, 0x40, 0x0f, 0x6c, 0x00, // @.. .|`.....@.l. + 0x06, 0x74, 0xe0, 0x07, 0x6c, 0x00, 0x06, 0x70, 0xe0, 0x07, 0x7a, 0xa0, 0x07, 0xf3, 0x10, 0x0e, // .t..l..p..z..... + 0xed, 0x00, 0x0f, 0xec, 0x50, 0x0e, 0xbf, 0x40, 0x0f, 0xf9, 0x00, 0x0f, 0xe5, 0x80, 0x02, 0x32, // ....P..@.......2 + 0xd3, 0x1a, 0x8c, 0x03, 0x3b, 0x84, 0xc3, 0x3c, 0xcc, 0x83, 0x1b, 0xd0, 0x42, 0x39, 0xe0, 0x03, // ....;..<....B9.. + 0x3d, 0xd4, 0x83, 0x3c, 0x94, 0x83, 0x1c, 0x90, 0x42, 0x2b, 0xcc, 0x42, 0x28, 0xc8, 0x83, 0x3c, // =..<....B+.B(..< + 0x84, 0x43, 0x3e, 0xf0, 0x81, 0x3d, 0x94, 0xc3, 0x38, 0xd0, 0xc3, 0x3b, 0xc8, 0x03, 0x1f, 0x98, // .C>..=..8..;.... + 0x03, 0x3b, 0xbc, 0x43, 0x38, 0xd0, 0x03, 0x1b, 0x80, 0x01, 0x1d, 0xf8, 0x01, 0x1b, 0x80, 0x01, // .;.C8........... + 0x1c, 0xf8, 0x01, 0x12, 0x26, 0xa5, 0x9a, 0x02, 0x04, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, // ....&.........r. + 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, // .t`.6h.yh.r....P + 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, // .m..zP.m..z0.r.. + 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, // s .m..q..s .m..x + 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, // ..s .m..q`.z0.r. + 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, // ..0.r..s .m..v@. + 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, // z`.t.....v..s .m + 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, // `.s .z0.r...`.t. + 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, // .v@.m..x..q`.z0. + 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r..v@.C......... + 0x00, 0x00, 0x00, 0x86, 0x3c, 0x06, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....<........... + 0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x34, // .y. ...........4 + 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe4, 0x81, 0x80, 0x00, 0x18, // @.........0..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0b, 0x04, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, // ....... ........ + 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22, // 2.....L...&G..C" + 0x25, 0x30, 0x02, 0x50, 0x14, 0xc5, 0x50, 0x10, 0x25, 0x51, 0x06, 0x35, 0x40, 0xa5, 0x24, 0xca, // %0.P..P.%Q.5@.$. + 0xa0, 0x10, 0x46, 0x00, 0x4a, 0xa4, 0x04, 0x6a, 0x80, 0xec, 0x0c, 0x00, 0xdd, 0xb1, 0x04, 0x02, // ..F.J..j........ + 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, // ....y...S.....L. + 0x46, 0x02, 0x13, 0xc4, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0x06, 0xc6, // F.....o..M.$.%.. + 0x45, 0xc6, 0x06, 0xa6, 0xc6, 0x65, 0xe6, 0x06, 0x04, 0x65, 0x8c, 0x86, 0x0c, 0xc7, 0x8c, 0xc6, // E....e...e...... + 0x2c, 0x27, 0x27, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x88, 0x62, 0x82, 0x40, 0x18, 0x1b, 0x84, 0x81, // ,''eC.L..b.@.... + 0x98, 0x20, 0x10, 0xc7, 0x06, 0x61, 0x30, 0x28, 0xc0, 0xcd, 0x4d, 0x10, 0x08, 0x64, 0xc3, 0x80, // . ...a0(..M..d.. + 0x24, 0xc4, 0x04, 0xc1, 0xa2, 0x08, 0x4c, 0x10, 0x88, 0x64, 0x82, 0x40, 0x28, 0x1b, 0x04, 0xc2, // $.....L..d.@(... + 0xd9, 0x90, 0x10, 0x0b, 0x43, 0x10, 0x43, 0x43, 0x3c, 0x1b, 0x02, 0x68, 0x03, 0x11, 0x01, 0x00, // ....C.CC<..h.... + 0x30, 0x41, 0xb8, 0xaa, 0x0d, 0xc1, 0x34, 0x41, 0x10, 0x00, 0x12, 0x6d, 0x61, 0x69, 0x6e, 0x5c, // 0A....4A...main. + 0xa6, 0xac, 0xbe, 0xa0, 0xde, 0xe6, 0xd2, 0xe8, 0xd2, 0xde, 0xdc, 0x26, 0x08, 0x45, 0x33, 0x41, // ...........&.E3A + 0x28, 0x9c, 0x0d, 0x01, 0x31, 0x41, 0x28, 0x9e, 0x09, 0x42, 0x01, 0x4d, 0x10, 0x88, 0x65, 0x83, // (...1A(..B.M..e. + 0xd0, 0x75, 0x1b, 0x16, 0xe2, 0xc2, 0x32, 0x6d, 0x1b, 0x36, 0x82, 0xf3, 0x36, 0x04, 0x1f, 0x91, // .u....2m.6..6... + 0x29, 0xab, 0x2f, 0xa2, 0x32, 0x38, 0x3a, 0xb4, 0x09, 0x42, 0x11, 0x4d, 0x10, 0x0a, 0x69, 0x82, // )./.28:..B.M..i. + 0x40, 0x30, 0x13, 0x84, 0x62, 0xda, 0x20, 0x74, 0xc3, 0x86, 0x85, 0x08, 0x03, 0x4c, 0x0c, 0x34, // @0..b. t.....L.4 + 0x6e, 0x18, 0x03, 0x32, 0x28, 0x03, 0x33, 0xd8, 0x10, 0x9c, 0xc1, 0x86, 0x01, 0x0c, 0xd0, 0x00, // n..2(.3......... + 0xd8, 0x50, 0x54, 0x56, 0x1a, 0x48, 0x40, 0x15, 0x36, 0x36, 0xbb, 0x36, 0x97, 0x34, 0xb2, 0x32, // .PTV.H@.66.6.4.2 + 0x37, 0xba, 0x29, 0x41, 0x50, 0x85, 0x0c, 0xcf, 0xc5, 0xae, 0x4c, 0x6e, 0x2e, 0xed, 0xcd, 0x6d, // 7.)AP.....Ln...m + 0x4a, 0x40, 0x34, 0x21, 0xc3, 0x73, 0xb1, 0x0b, 0x63, 0xb3, 0x2b, 0x93, 0x9b, 0x12, 0x18, 0x75, // J@4!.s..c.+....u + 0xc8, 0xf0, 0x5c, 0xe6, 0xd0, 0xc2, 0xc8, 0xca, 0xe4, 0x9a, 0xde, 0xc8, 0xca, 0xd8, 0xa6, 0x04, // ................ + 0x49, 0x19, 0x32, 0x3c, 0x17, 0xb9, 0xb2, 0xb9, 0xb7, 0x3a, 0xb9, 0xb1, 0xb2, 0xb9, 0x29, 0x41, // I.2<.....:....)A + 0x54, 0x87, 0x0c, 0xcf, 0xc5, 0x2e, 0xad, 0xec, 0x2e, 0x89, 0x6c, 0x8a, 0x2e, 0x8c, 0xae, 0x6c, // T.........l....l + 0x4a, 0x30, 0xd5, 0x21, 0xc3, 0x73, 0x29, 0x73, 0xa3, 0x93, 0xcb, 0x83, 0x7a, 0x4b, 0x73, 0xa3, // J0.!.s)s....zKs. + 0x9b, 0x9b, 0x12, 0xa4, 0x01, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, // ........y...L... + 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, // 3......f..=.C8.. + 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, // .B..yx.s.q...... + 0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, // ....3.B.......f0 + 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, // .=.C8.....=.C=.. + 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, // =.x.tp.{..yH.pp. + 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, // zp.vx.p ........ + 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, // .0.n0.....P.3... + 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, // .!..!..a.f0.;..; + 0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, // .C9..<..<..;...v + 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, // `.{h.7h.rh.7..p. + 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, // .p`.v(.v..vx.w.. + 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, // _..q..r..y..,... + 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, // .......0.b...... + 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, // .......a..!..... + 0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, // a...C9.C9.C9.C9. + 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, // .8.C8..;../..<.. + 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87, // ;..;....!.|p.z(. + 0x76, 0x80, 0x87, 0x19, 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20, 0x0e, 0xe7, 0xe0, 0x06, // v....C..... .... + 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x00, 0x00, 0x00, // ..........P..... + 0x71, 0x20, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x46, 0x20, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, // q ......F ...<.. + 0x11, 0xc0, 0x44, 0x84, 0x40, 0x33, 0x2c, 0x84, 0x05, 0x4c, 0xc3, 0xe5, 0x3b, 0x8f, 0xbf, 0x38, // ..D.@3,..L..;..8 + 0xc0, 0x20, 0x36, 0x0f, 0x35, 0xf9, 0xc5, 0x6d, 0x9b, 0x40, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0xd2, // . 6.5..m.@5..... + 0xe4, 0x44, 0x04, 0x4a, 0x4d, 0x0f, 0x35, 0xf9, 0xc5, 0x6d, 0xdb, 0x40, 0x35, 0x5c, 0xbe, 0xf3, // .D.JM.5..m.@5... + 0xf8, 0x13, 0x71, 0x4d, 0x54, 0x44, 0x94, 0x0e, 0x30, 0xf8, 0xc5, 0x6d, 0x1b, 0x00, 0xc1, 0x00, // ..qMTD..0..m.... + 0x48, 0x03, 0x00, 0x00, 0x61, 0x20, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c, // H...a ........A, + 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x44, 0x66, 0x00, 0x0a, 0xa1, 0xe4, 0x8a, 0x30, // ........Df.....0 + 0xa0, 0x14, 0xe8, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x00, 0x61, // ........#....`.a + 0x04, 0x63, 0x59, 0xc1, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x18, 0x9c, 0x71, 0x5d, 0xcd, 0x31, // .cY..A.. ...q].1 + 0x62, 0x90, 0x00, 0x20, 0x08, 0x06, 0x46, 0x77, 0x60, 0x18, 0x83, 0x9c, 0x40, 0xe8, 0x04, 0x42, // b.. ..Fw`...@..B + 0x23, 0x06, 0x0d, 0x00, 0x82, 0x60, 0xd0, 0x78, 0x48, 0xb1, 0x09, 0xc1, 0xb6, 0x2c, 0xcb, 0x68, // #....`.xH....,.h + 0x42, 0x00, 0x8c, 0x18, 0x24, 0x00, 0x08, 0x82, 0x01, 0x12, 0x06, 0x49, 0xd7, 0x4d, 0x01, 0x02, // B...$......I.M.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ +}; +static const uint8_t fs_resolve_depth_array_mtl[792] = +{ + 0x46, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // FSH............. + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x16, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, // .......bgfx_texD + 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, // epthMsTexture... + 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, // ........bgfx_tex + 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, // DepthMs......... + 0x00, 0xbf, 0x02, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, // .....#include .#in + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, // clude ..using names + 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, // pace metal;..con + 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // stant uint bgfx_ + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x20, 0x5b, 0x5b, 0x66, 0x75, 0x6e, // sampleMask [[fun + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x28, 0x30, // ction_constant(0 + 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x62, 0x6f, // )]];.constant bo + 0x6f, 0x6c, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, // ol bgfx_sampleMa + 0x73, 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x69, 0x73, 0x5f, 0x66, // skEnabled = is_f + 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, // unction_constant + 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x73, 0x61, // _defined(bgfx_sa + 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x29, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, // mpleMask);..stru + 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // ct xlatMtlMain_o + 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x09, 0x75, 0x69, 0x6e, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // ut.{..uint bgfx_ + 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, // metal_sampleMask + 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2c, 0x20, // [[sample_mask, + 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, // function_constan + 0x74, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, // t(bgfx_sampleMas + 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, // kEnabled)]];. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x65, // float gl_FragDe + 0x70, 0x74, 0x68, 0x20, 0x5b, 0x5b, 0x64, 0x65, 0x70, 0x74, 0x68, 0x28, 0x61, 0x6e, 0x79, 0x29, // pth [[depth(any) + 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, // ]];.};..fragment + 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, // xlatMtlMain_out + 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x74, 0x65, 0x78, // xlatMtlMain(tex + 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x5f, 0x6d, 0x73, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, // ture2d_ms + 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, // bgfx_texDepthMs + 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, // [[texture(0)]], + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // float4 gl_FragC + 0x6f, 0x6f, 0x72, 0x64, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, // oord [[position] + 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // ]).{. xlatMtl + 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, // Main_out out = { + 0x7d, 0x3b, 0x0a, 0x09, 0x69, 0x66, 0x20, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x73, 0x61, 0x6d, // };..if (bgfx_sam + 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x20, // pleMaskEnabled) + 0x7b, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, // { out.bgfx_metal + 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x20, 0x3d, 0x20, 0x62, 0x67, // _sampleMask = bg + 0x66, 0x78, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x3b, 0x20, 0x7d, // fx_sampleMask; } + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . out.gl_Frag + 0x44, 0x65, 0x70, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x74, 0x65, 0x78, // Depth = bgfx_tex + 0x44, 0x65, 0x70, 0x74, 0x68, 0x4d, 0x73, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x28, 0x75, 0x69, 0x6e, // DepthMs.read(uin + 0x74, 0x32, 0x28, 0x69, 0x6e, 0x74, 0x32, 0x28, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // t2(int2(gl_FragC + 0x6f, 0x6f, 0x72, 0x64, 0x2e, 0x78, 0x79, 0x29, 0x29, 0x2c, 0x20, 0x30, 0x29, 0x2e, 0x78, 0x3b, // oord.xy)), 0).x; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, // . return out; + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x10, 0x00, // .}...... +}; +extern const uint8_t* fs_resolve_depth_array_pssl; +extern const uint32_t fs_resolve_depth_array_pssl_size; diff --git a/src/fs_resolve_depth_array.sc b/src/fs_resolve_depth_array.sc new file mode 100644 index 000000000..3fba4c907 --- /dev/null +++ b/src/fs_resolve_depth_array.sc @@ -0,0 +1,22 @@ +/* + * Copyright 2011-2026 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE + */ + +#include "bgfx_shader.sh" + +#if BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_SPIRV +SAMPLER2DMSARRAY(bgfx_texDepthMs, 0); + +void main() +{ + gl_FragDepth = texelFetch(bgfx_texDepthMs, ivec3(gl_FragCoord.xy, 0), 0).x; +} +#else +SAMPLER2DMS(bgfx_texDepthMs, 0); + +void main() +{ + gl_FragDepth = texelFetch(bgfx_texDepthMs, ivec2(gl_FragCoord.xy), 0).x; +} +#endif // BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_SPIRV diff --git a/src/makefile b/src/makefile index 72c1d95ea..abfd45af7 100644 --- a/src/makefile +++ b/src/makefile @@ -27,6 +27,9 @@ BIN = vs_debugfont.bin.h \ cs_yuv_to_rgb_float.bin.h \ cs_blit_texture_to_buffer.bin.h \ cs_blit_buffer_to_texture.bin.h \ + vs_resolve_depth.bin.h \ + fs_resolve_depth.bin.h \ + fs_resolve_depth_array.bin.h \ .PHONY: all all: $(BIN) @@ -128,6 +131,15 @@ cs_blit_texture_to_buffer.bin.h : cs_blit_texture_to_buffer.sc cs_blit_buffer_to_texture.bin.h : cs_blit_buffer_to_texture.sc $(call shader-embedded-compute) +vs_resolve_depth.bin.h : vs_resolve_depth.sc + $(call shader-embedded, v) + +fs_resolve_depth.bin.h : fs_resolve_depth.sc + $(call shader-embedded, f) + +fs_resolve_depth_array.bin.h : fs_resolve_depth_array.sc + $(call shader-embedded, f) + .PHONY: clean clean: @echo Cleaning... diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 25c0d8d4c..11e0849f3 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -3506,7 +3506,7 @@ namespace bgfx { namespace d3d11 return uav; } - ID3D11ShaderResourceView* getCachedSrv(TextureHandle _handle, uint8_t _firstMip, uint8_t _numMips = 1, uint16_t _firstLayer = 0, uint16_t _numLayers = UINT16_MAX, bool _compute = false, bool _stencil = false, bool _asArray = false, SrgbSelect::Enum _srgb = SrgbSelect::Native) + ID3D11ShaderResourceView* getCachedSrv(TextureHandle _handle, uint8_t _firstMip, uint8_t _numMips = 1, uint16_t _firstLayer = 0, uint16_t _numLayers = UINT16_MAX, bool _compute = false, bool _stencil = false, bool _asArray = false, SrgbSelect::Enum _srgb = SrgbSelect::Native, bool _msaa = false) { const TextureD3D11& texture = m_textures[_handle.idx]; @@ -3524,15 +3524,14 @@ namespace bgfx { namespace d3d11 murmur.add(_compute); murmur.add(_stencil); murmur.add(_srgb); + murmur.add(_msaa); uint32_t hash = murmur.end(); IUnknown** ptr = m_srvUavLru.find(hash); ID3D11ShaderResourceView* srv; if (NULL == ptr) { - const uint32_t msaaQuality = bx::satSub(uint32_t( (texture.m_flags&BGFX_TEXTURE_RT_MSAA_MASK) >> BGFX_TEXTURE_RT_MSAA_SHIFT ), 1u); - const DXGI_SAMPLE_DESC& msaa = s_msaa[msaaQuality]; - const bool msaaSample = 1 < msaa.Count && 0 != (texture.m_flags&BGFX_TEXTURE_MSAA_SAMPLE); + const bool msaaSample = texture.isMsaaSurface() || _msaa; D3D11_SHADER_RESOURCE_VIEW_DESC desc; desc.Format = !_stencil @@ -3602,7 +3601,7 @@ namespace bgfx { namespace d3d11 break; } - DX_CHECK(m_device->CreateShaderResourceView(texture.m_ptr, &desc, &srv) ); + DX_CHECK(m_device->CreateShaderResourceView(_msaa ? texture.m_rt : texture.m_ptr, &desc, &srv) ); m_srvUavLru.add(hash, srv, _handle.idx); } @@ -3812,6 +3811,98 @@ namespace bgfx { namespace d3d11 ; } + void resolveDepth(const TextureD3D11& _texture, uint32_t _layer, uint32_t _numLayers, uint32_t _mip) + { + ID3D11DeviceContext* deviceCtx = m_deviceCtx; + + ID3D11RenderTargetView* rtv[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS] = {}; + ID3D11DepthStencilView* dsv = NULL; + deviceCtx->OMGetRenderTargets(BX_COUNTOF(rtv), rtv, &dsv); + + ID3D11InputLayout* inputLayout = NULL; + deviceCtx->IAGetInputLayout(&inputLayout); + + D3D11_PRIMITIVE_TOPOLOGY topology; + deviceCtx->IAGetPrimitiveTopology(&topology); + + setBlendState(0); + setDepthStencilState(BGFX_STATE_DEPTH_TEST_ALWAYS|BGFX_STATE_WRITE_Z); + setRasterizerState(0); + + ProgramD3D11& program = m_program[g_depthResolve->m_program[DepthResolve::Texture2DArray].idx]; + m_currentProgram = &program; + + deviceCtx->VSSetShader(program.m_vsh->m_vertexShader, NULL, 0); + deviceCtx->PSSetShader(program.m_fsh->m_pixelShader, NULL, 0); + deviceCtx->IASetInputLayout(NULL); + deviceCtx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); + + const D3D11_VIEWPORT vp = + { + .TopLeftX = 0.0f, + .TopLeftY = 0.0f, + .Width = float(bx::max(_texture.m_width >> _mip, 1) ), + .Height = float(bx::max(_texture.m_height >> _mip, 1) ), + .MinDepth = 0.0f, + .MaxDepth = 1.0f, + }; + deviceCtx->RSSetViewports(1, &vp); + + for (uint32_t ii = _layer, end = _layer + _numLayers; ii < end; ++ii) + { + const D3D11_DEPTH_STENCIL_VIEW_DESC dsvd = + { + .Format = s_textureFormat[_texture.m_textureFormat].m_fmtDsv, + .ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DARRAY, + .Flags = 0, + .Texture2DArray = + { + .MipSlice = _mip, + .FirstArraySlice = ii, + .ArraySize = 1, + }, + }; + + ID3D11DepthStencilView* resolveDsv = NULL; + DX_CHECK(m_device->CreateDepthStencilView(_texture.m_ptr, &dsvd, &resolveDsv) ); + + const D3D11_SHADER_RESOURCE_VIEW_DESC srvd = + { + .Format = s_textureFormat[_texture.m_textureFormat].m_fmtSrv, + .ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY, + .Texture2DMSArray = + { + .FirstArraySlice = ii, + .ArraySize = 1, + }, + }; + + ID3D11ShaderResourceView* srv = NULL; + DX_CHECK(m_device->CreateShaderResourceView(_texture.m_rt, &srvd, &srv) ); + + deviceCtx->OMSetRenderTargets(0, NULL, resolveDsv); + deviceCtx->PSSetShaderResources(0, 1, &srv); + deviceCtx->Draw(3, 0); + + DX_RELEASE_I(srv); + DX_RELEASE_I(resolveDsv); + } + + invalidateTextureStage(); + + deviceCtx->OMSetRenderTargets(BX_COUNTOF(rtv), rtv, dsv); + deviceCtx->IASetInputLayout(inputLayout); + deviceCtx->IASetPrimitiveTopology(topology); + + for (uint32_t ii = 0; ii < BX_COUNTOF(rtv); ++ii) + { + DX_RELEASE_I(rtv[ii]); + } + + DX_RELEASE_I(dsv); + DX_RELEASE_I(inputLayout); + } + void clearQuad(const ClearQuad& _clearQuad, const Rect& _rect, const Clear& _clear, const float _palette[][4]) { uint32_t width; @@ -4996,14 +5087,17 @@ namespace bgfx { namespace d3d11 && 0 != (g_caps.formats[m_textureFormat] & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE) ; + const bool depth = bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ); + const bool msaaSample = true && 1 < msaa.Count && 0 != (m_flags&BGFX_TEXTURE_MSAA_SAMPLE) && !writeOnly + && !depth ; const bool needResolve = true && 1 < msaa.Count - && 0 == (m_flags&BGFX_TEXTURE_MSAA_SAMPLE) + && (0 == (m_flags&BGFX_TEXTURE_MSAA_SAMPLE) || depth) && !writeOnly ; @@ -5181,7 +5275,11 @@ namespace bgfx { namespace d3d11 DX_CHECK(s_renderD3D11->m_device->CreateTexture2D(&desc, NULL, &m_rt2d) ); const bool autoGenMips = 0 != (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS); - desc.BindFlags &= ~D3D11_BIND_DEPTH_STENCIL; + if (!depth) + { + desc.BindFlags &= ~D3D11_BIND_DEPTH_STENCIL; + } + if (!autoGenMips) { desc.BindFlags &= ~D3D11_BIND_RENDER_TARGET; @@ -5605,7 +5703,32 @@ namespace bgfx { namespace d3d11 const bool srgbMutable = 0 != (m_flags & BGFX_TEXTURE_SRGB_MUTABLE); const SrgbSelect::Enum srgb = srgbSelect(_flags, BGFX_SAMPLER_SRGB); - if (asArray) + const bool msaa = true + && NULL != m_rt + && 0 != (m_flags & BGFX_TEXTURE_MSAA_SAMPLE) + && (false + || TextureDimension::Count == _dimension + || TextureDimension::Dimension2DMS == _dimension + || TextureDimension::Dimension2DMSArray == _dimension + ) + ; + + if (msaa) + { + ts.m_srv[_stage] = s_renderD3D11->getCachedSrv( + TextureHandle{ s_renderD3D11->m_textures.indexOf(*this) } + , 0 + , 1 + , _firstLayer + , numLayers + , false + , false + , false + , SrgbSelect::Native + , true + ); + } + else if (asArray) { ts.m_srv[_stage] = s_renderD3D11->getCachedSrv( TextureHandle{ s_renderD3D11->m_textures.indexOf(*this) } @@ -5665,12 +5788,14 @@ namespace bgfx { namespace d3d11 ; const bool needResolve = NULL != m_rt && resolvable; - if (needResolve) + if (needResolve + && bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) ) { - const DXGI_FORMAT resolveFormat = bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) - ? s_textureFormat[m_textureFormat].m_fmt - : getSrvFormat(srgbSelect(_resolve, BGFX_ATTACHMENT_SRGB) ) - ; + s_renderD3D11->resolveDepth(*this, _layer, _numLayers, _mip); + } + else if (needResolve) + { + const DXGI_FORMAT resolveFormat = getSrvFormat(srgbSelect(_resolve, BGFX_ATTACHMENT_SRGB) ); for (uint32_t ii = _layer, end = _layer + _numLayers; ii < end; ++ii) { @@ -5703,6 +5828,7 @@ namespace bgfx { namespace d3d11 return true && 1 < s_msaa[msaaQuality].Count && 0 != (m_flags & BGFX_TEXTURE_MSAA_SAMPLE) + && !bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) ; } diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 3b2505b0b..c32d85322 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -1567,7 +1567,7 @@ namespace bgfx { namespace d3d12 ) ); D3D12_DESCRIPTOR_HEAP_DESC dsvDescHeap; - dsvDescHeap.NumDescriptors = BGFX_CONFIG_MAX_FRAME_BUFFERS+1; + dsvDescHeap.NumDescriptors = BGFX_CONFIG_MAX_FRAME_BUFFERS+2; dsvDescHeap.Type = D3D12_DESCRIPTOR_HEAP_TYPE_DSV; dsvDescHeap.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE; dsvDescHeap.NodeMask = 1; @@ -4439,6 +4439,166 @@ namespace bgfx { namespace d3d12 } } + ID3D12PipelineState* getResolveDepthPipelineState(TextureFormat::Enum _format) + { + const ProgramD3D12& program = m_program[g_depthResolve->m_program[DepthResolve::Texture2DArray].idx]; + + bx::HashMurmur2A murmur; + murmur.begin(); + murmur.add(program.m_vsh->m_hash); + murmur.add(program.m_fsh->m_hash); + murmur.add(s_textureFormat[_format].m_fmtDsv); + const uint32_t hash = murmur.end(); + + ID3D12PipelineState* pso = m_pipelineStateCache.find(hash); + + if (NULL == pso) + { + D3D12_GRAPHICS_PIPELINE_STATE_DESC desc = + { + .pRootSignature = m_rootSignature, + .VS = + { + .pShaderBytecode = program.m_vsh->m_code->data, + .BytecodeLength = program.m_vsh->m_code->size, + }, + .PS = + { + .pShaderBytecode = program.m_fsh->m_code->data, + .BytecodeLength = program.m_fsh->m_code->size, + }, + .DS = {}, + .HS = {}, + .GS = {}, + .StreamOutput = {}, + .BlendState = {}, + .SampleMask = UINT32_MAX, + .RasterizerState = {}, + .DepthStencilState = {}, + .InputLayout = {}, + .IBStripCutValue = D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED, + .PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, + .NumRenderTargets = 0, + .RTVFormats = {}, + .DSVFormat = s_textureFormat[_format].m_fmtDsv, + .SampleDesc = s_msaa[0], + .NodeMask = 0, + .CachedPSO = {}, + .Flags = D3D12_PIPELINE_STATE_FLAG_NONE, + }; + + const uint64_t state = BGFX_STATE_DEPTH_TEST_ALWAYS|BGFX_STATE_WRITE_Z; + setBlendState(desc.BlendState, state); + setRasterizerState(desc.RasterizerState, state); + setDepthStencilState(desc.DepthStencilState, state); + + DX_CHECK(m_device->CreateGraphicsPipelineState(&desc + , IID_ID3D12PipelineState + , (void**)&pso + ) ); + + m_pipelineStateCache.add(hash, pso); + } + + return pso; + } + + void resolveDepth(ID3D12GraphicsCommandList* _commandList, TextureD3D12& _texture, uint32_t _layer, uint32_t _numLayers, uint32_t _mip) + { + const D3D12_RESOURCE_STATES state = _texture.setState(_commandList, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); + + setResourceBarrier(_commandList + , _texture.m_singleMsaa + , D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE + , D3D12_RESOURCE_STATE_DEPTH_WRITE + ); + + _commandList->SetPipelineState(getResolveDepthPipelineState(TextureFormat::Enum(_texture.m_textureFormat) ) ); + _commandList->SetGraphicsRootSignature(m_rootSignature); + + ScratchBufferD3D12& scratchBuffer = m_scratchBuffer[m_backBufferColorIdx]; + ID3D12DescriptorHeap* heaps[] = + { + m_samplerAllocator.getHeap(), + scratchBuffer.getHeap(), + }; + _commandList->SetDescriptorHeaps(BX_COUNTOF(heaps), heaps); + + const uint32_t width = bx::max(_texture.m_width >> _mip, 1); + const uint32_t height = bx::max(_texture.m_height >> _mip, 1); + + const D3D12_VIEWPORT vp = + { + .TopLeftX = 0.0f, + .TopLeftY = 0.0f, + .Width = float(width), + .Height = float(height), + .MinDepth = 0.0f, + .MaxDepth = 1.0f, + }; + _commandList->RSSetViewports(1, &vp); + + const D3D12_RECT rc = + { + .left = 0, + .top = 0, + .right = LONG(width), + .bottom = LONG(height), + }; + _commandList->RSSetScissorRects(1, &rc); + + _commandList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST); + + D3D12_CPU_DESCRIPTOR_HANDLE dsvHandle = getCPUHandleHeapStart(m_dsvDescriptorHeap); + dsvHandle.ptr += (kMainFrameBufferIdx+1) * m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_DSV); + + for (uint32_t ii = _layer, end = _layer + _numLayers; ii < end; ++ii) + { + const D3D12_DEPTH_STENCIL_VIEW_DESC dsvd = + { + .Format = s_textureFormat[_texture.m_textureFormat].m_fmtDsv, + .ViewDimension = D3D12_DSV_DIMENSION_TEXTURE2DARRAY, + .Flags = D3D12_DSV_FLAG_NONE, + .Texture2DArray = + { + .MipSlice = _mip, + .FirstArraySlice = ii, + .ArraySize = 1, + }, + }; + m_device->CreateDepthStencilView(_texture.m_singleMsaa, &dsvd, dsvHandle); + + const D3D12_SHADER_RESOURCE_VIEW_DESC srvd = + { + .Format = _texture.getSrvFormat(), + .ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY, + .Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING, + .Texture2DMSArray = + { + .FirstArraySlice = ii, + .ArraySize = 1, + }, + }; + + D3D12_GPU_DESCRIPTOR_HANDLE srvHandle; + scratchBuffer.allocSrv(srvHandle, _texture.m_ptr, srvd); + + _commandList->OMSetRenderTargets(0, NULL, FALSE, &dsvHandle); + _commandList->SetGraphicsRootDescriptorTable(RenderRp::SRV, srvHandle); + _commandList->DrawInstanced(3, 1, 0, 0); + } + + setResourceBarrier(_commandList + , _texture.m_singleMsaa + , D3D12_RESOURCE_STATE_DEPTH_WRITE + , D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE + ); + + _texture.setState(_commandList, state); + + m_computeStateDirty = true; + } + void clearQuad(const Rect& _rect, const Clear& _clear, const float _palette[][4]) { uint32_t width; @@ -4836,6 +4996,39 @@ namespace bgfx { namespace d3d12 const uint8_t numMips = bx::min(_numMips, uint8_t(_texture.m_numMips - _firstMip) ); const uint16_t numLayers = bx::min(_numLayers, uint16_t(_texture.m_numLayers - _firstLayer) ); + const bool msaa = true + && NULL != _texture.m_singleMsaa + && 0 != (_texture.m_flags & BGFX_TEXTURE_MSAA_SAMPLE) + && (false + || TextureDimension::Count == _dimension + || TextureDimension::Dimension2DMS == _dimension + || TextureDimension::Dimension2DMSArray == _dimension + ) + ; + + if (msaa) + { + const bool array = false + || 1 < _texture.m_numLayers + || 0 != _firstLayer + ; + + const D3D12_SHADER_RESOURCE_VIEW_DESC desc = + { + .Format = _texture.getSrvFormat(), + .ViewDimension = array ? D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY : D3D12_SRV_DIMENSION_TEXTURE2DMS, + .Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING, + .Texture2DMSArray = + { + .FirstArraySlice = array ? UINT(_firstLayer) : 0u, + .ArraySize = array ? UINT(numLayers) : 0u, + }, + }; + + allocSrv(_gpuHandle, _texture.m_ptr, desc); + return; + } + const bool srgbMutable = 0 != (_texture.m_flags & BGFX_TEXTURE_SRGB_MUTABLE); const bool fullRange = 0 == _firstMip @@ -6712,9 +6905,11 @@ namespace bgfx { namespace d3d12 const uint32_t msaaQuality = bx::satSub(uint32_t( (m_flags & BGFX_TEXTURE_RT_MSAA_MASK) >> BGFX_TEXTURE_RT_MSAA_SHIFT ), 1u); const DXGI_SAMPLE_DESC& msaa = s_msaa[msaaQuality]; + const bool depth = bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ); + const bool needResolve = true && 1 < msaa.Count - && 0 == (m_flags & BGFX_TEXTURE_MSAA_SAMPLE) + && (0 == (m_flags & BGFX_TEXTURE_MSAA_SAMPLE) || depth) && !writeOnly ; @@ -7113,7 +7308,10 @@ namespace bgfx { namespace d3d12 rd.Alignment = 0; rd.SampleDesc = s_msaa[0]; - rd.Flags &= ~(D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL); + rd.Flags &= depth + ? ~D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET + : ~(D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL) + ; m_singleMsaa = createCommittedResource(device, HeapProperty::Texture, &rd, NULL); @@ -7479,7 +7677,12 @@ namespace bgfx { namespace d3d12 ; bool needResolve = NULL != m_singleMsaa && resolvable; - if (needResolve) + if (needResolve + && bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) ) + { + s_renderD3D12->resolveDepth(_commandList, *this, _layer, _numLayers, _mip); + } + else if (needResolve) { D3D12_RESOURCE_STATES state = setState(_commandList, D3D12_RESOURCE_STATE_RESOLVE_SOURCE); @@ -7564,6 +7767,7 @@ namespace bgfx { namespace d3d12 return true && 1 < s_msaa[msaaQuality].Count && 0 != (m_flags & BGFX_TEXTURE_MSAA_SAMPLE) + && !bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) ; } diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 0e9038381..aba538a09 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -6383,6 +6383,31 @@ namespace bgfx { namespace gl return false; } } + + if (msaaSample + && !writeOnly + && GL_TEXTURE_2D_MULTISAMPLE == m_target + && bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) ) + { + const TextureFormatInfo& tfi = s_textureFormat[m_textureFormat]; + + GL_CHECK(glGenTextures(1, &m_idResolve) ); + BX_ASSERT(0 != m_idResolve, "Failed to generate texture id."); + GL_CHECK(glBindTexture(GL_TEXTURE_2D, m_idResolve) ); + GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST) ); + GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) ); + GL_CHECK(glTexImage2D(GL_TEXTURE_2D + , 0 + , tfi.m_internalFmt + , _width + , _height + , 0 + , tfi.m_fmt + , tfi.m_type + , NULL + ) ); + GL_CHECK(glBindTexture(GL_TEXTURE_2D, 0) ); + } } return true; @@ -6827,6 +6852,12 @@ namespace bgfx { namespace gl GL_CHECK(glDeleteRenderbuffers(1, &m_rbo) ); m_rbo = 0; } + + if (0 != m_idResolve) + { + GL_CHECK(glDeleteTextures(1, &m_idResolve) ); + m_idResolve = 0; + } } void TextureGL::update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem) @@ -7209,6 +7240,11 @@ namespace bgfx { namespace gl GL_CHECK(glActiveTexture(GL_TEXTURE0+_stage) ); GL_CHECK(glBindTexture(target, id) ); + if (0 != m_idResolve) + { + GL_CHECK(glBindTexture(GL_TEXTURE_2D, m_idResolve) ); + } + m_depthStencilTexturing |= 0 != (flags & BGFX_SAMPLER_SAMPLE_STENCIL); if (m_depthStencilTexturing) @@ -7739,7 +7775,10 @@ namespace bgfx { namespace gl } } - needResolve |= (0 != texture.m_rbo) && (0 != texture.m_id); + needResolve |= false + || (0 != texture.m_rbo && 0 != texture.m_id) + || 0 != texture.m_idResolve + ; } } @@ -7797,6 +7836,15 @@ namespace bgfx { namespace gl , at.mip ) ); } + else if (0 != texture.m_idResolve) + { + GL_CHECK(glFramebufferTexture2D(GL_FRAMEBUFFER + , attachmentFor(TextureFormat::Enum(texture.m_textureFormat) ) + , GL_TEXTURE_2D + , texture.m_idResolve + , 0 + ) ); + } } } @@ -8152,7 +8200,12 @@ namespace bgfx { namespace gl const bool writeOnly = 0 != (texture.m_flags&BGFX_TEXTURE_RT_WRITE_ONLY); bimg::TextureFormat::Enum format = bimg::TextureFormat::Enum(texture.m_textureFormat); - if (!bimg::isDepth(format) ) + if (!bimg::isDepth(format) + && 0 == texture.m_rbo) + { + colorIdx++; + } + else if (!bimg::isDepth(format) ) { GL_CHECK(glDisable(GL_SCISSOR_TEST) ); diff --git a/src/renderer_gl.h b/src/renderer_gl.h index cdceea59d..224b883cc 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -1482,6 +1482,7 @@ namespace bgfx { namespace gl TextureGL() : m_id(0) , m_rbo(0) + , m_idResolve(0) , m_target(GL_TEXTURE_2D) , m_fmt(GL_ZERO) , m_type(GL_ZERO) @@ -1532,6 +1533,7 @@ namespace bgfx { namespace gl GLuint m_id; GLuint m_rbo; + GLuint m_idResolve; GLenum m_target; GLenum m_fmt; GLenum m_type; diff --git a/src/renderer_mtl.cpp b/src/renderer_mtl.cpp index 6377b4f76..0c60cdbc8 100644 --- a/src/renderer_mtl.cpp +++ b/src/renderer_mtl.cpp @@ -2689,7 +2689,17 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames if (!stencilOnly) { + const bool resolve = true + && NULL != texture.m_ptrMsaa + && 0 == (texture.m_flags & BGFX_TEXTURE_RT_WRITE_ONLY) + ; + _renderPassDescriptor->depthAttachment()->setTexture(ptr); + _renderPassDescriptor->depthAttachment()->setResolveTexture(resolve + ? texture.m_ptr + : NULL + ); + _renderPassDescriptor->depthAttachment()->setDepthResolveFilter(MTL::MultisampleDepthResolveFilterSample0); setAttachment( (MTL::RenderPassAttachmentDescriptor*)_renderPassDescriptor->depthAttachment(), frameBuffer.m_depthAttachment, texture.m_type, NULL != texture.m_ptrMsaa); } @@ -6453,7 +6463,10 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames ? MTL::LoadActionClear : MTL::LoadActionLoad) ; - depthAttachment->setStoreAction(MTL::StoreActionStore); + depthAttachment->setStoreAction(NULL != depthAttachment->resolveTexture() + ? (m_hasStoreActionStoreAndMultisampleResolve ? MTL::StoreActionStoreAndMultisampleResolve : MTL::StoreActionMultisampleResolve) + : MTL::StoreActionStore + ); } MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment = renderPassDescriptor->stencilAttachment(); @@ -6494,7 +6507,10 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames if (NULL != depthAttachment->texture() ) { depthAttachment->setLoadAction(MTL::LoadActionLoad); - depthAttachment->setStoreAction(MTL::StoreActionStore); + depthAttachment->setStoreAction(NULL != depthAttachment->resolveTexture() + ? (m_hasStoreActionStoreAndMultisampleResolve ? MTL::StoreActionStoreAndMultisampleResolve : MTL::StoreActionMultisampleResolve) + : MTL::StoreActionStore + ); } MTL::RenderPassStencilAttachmentDescriptor* stencilAttachment = renderPassDescriptor->stencilAttachment(); diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index cc741e6c0..ed5e325bd 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -4335,7 +4335,7 @@ VK_IMPORT_DEVICE return sampler; } - VkImageView getCachedImageView(TextureHandle _handle, uint32_t _mip, uint32_t _numMips, VkImageViewType _type, bool _stencil = false, uint32_t _firstLayer = 0, uint32_t _numLayers = UINT32_MAX, uint32_t _samplerFlags = 0) + VkImageView getCachedImageView(TextureHandle _handle, uint32_t _mip, uint32_t _numMips, VkImageViewType _type, bool _stencil = false, uint32_t _firstLayer = 0, uint32_t _numLayers = UINT32_MAX, uint32_t _samplerFlags = 0, bool _msaa = false) { const TextureVK& texture = m_textures[_handle.idx]; @@ -4362,6 +4362,7 @@ VK_IMPORT_DEVICE hash.add(firstLayer); hash.add(numLayers); hash.add(format); + hash.add(_msaa); uint32_t hashKey = hash.end(); VkImageView* viewCached = m_imageViewCache.find(hashKey); @@ -4377,12 +4378,314 @@ VK_IMPORT_DEVICE ; VkImageView view; - VK_CHECK(texture.createView(firstLayer, numLayers, firstMip, numMips, _type, aspectMask, false, &view, format) ); + VK_CHECK(texture.createView(firstLayer, numLayers, firstMip, numMips, _type, aspectMask, false, &view, format, _msaa) ); m_imageViewCache.add(hashKey, view, _handle.idx); return view; } + VkPipeline getResolveDepthPipeline(VkFormat _format, VkImageAspectFlags _aspect, ::VkRenderPass* _renderPass) + { + const ProgramVK& program = m_program[g_depthResolve->m_program[DepthResolve::Texture2DArray].idx]; + + const bool resolve = false; + uint32_t renderPassHashKey = 0; + VK_CHECK(getRenderPass(1, &_format, &_aspect, &resolve, VK_SAMPLE_COUNT_1_BIT, BGFX_CLEAR_NONE, 0, _renderPass, &renderPassHashKey) ); + + bx::HashMurmur2A murmur; + murmur.begin(); + murmur.add(program.m_vsh->m_hash); + murmur.add(program.m_fsh->m_hash); + murmur.add(renderPassHashKey); + const uint32_t hash = murmur.end(); + + VkPipeline pipeline = m_pipelineStateCache.find(hash); + + if (VK_NULL_HANDLE != pipeline) + { + return pipeline; + } + + const VkPipelineShaderStageCreateInfo shaderStages[] = + { + { + .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .stage = VK_SHADER_STAGE_VERTEX_BIT, + .module = program.m_vsh->m_module, + .pName = "main", + .pSpecializationInfo = NULL, + }, + { + .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .stage = VK_SHADER_STAGE_FRAGMENT_BIT, + .module = program.m_fsh->m_module, + .pName = "main", + .pSpecializationInfo = NULL, + }, + }; + + const VkPipelineVertexInputStateCreateInfo vertexInputState = + { + .sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .vertexBindingDescriptionCount = 0, + .pVertexBindingDescriptions = NULL, + .vertexAttributeDescriptionCount = 0, + .pVertexAttributeDescriptions = NULL, + }; + + const VkPipelineInputAssemblyStateCreateInfo inputAssemblyState = + { + .sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, + .primitiveRestartEnable = VK_FALSE, + }; + + const VkPipelineViewportStateCreateInfo viewportState = + { + .sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .viewportCount = 1, + .pViewports = NULL, + .scissorCount = 1, + .pScissors = NULL, + }; + + VkPipelineRasterizationStateCreateInfo rasterizationState; + setRasterizerState(rasterizationState, 0); + + const VkPipelineMultisampleStateCreateInfo multisampleState = + { + .sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .rasterizationSamples = VK_SAMPLE_COUNT_1_BIT, + .sampleShadingEnable = VK_FALSE, + .minSampleShading = 0.0f, + .pSampleMask = NULL, + .alphaToCoverageEnable = VK_FALSE, + .alphaToOneEnable = VK_FALSE, + }; + + VkPipelineDepthStencilStateCreateInfo depthStencilState; + setDepthStencilState(depthStencilState, BGFX_STATE_DEPTH_TEST_ALWAYS|BGFX_STATE_WRITE_Z); + + const VkPipelineColorBlendAttachmentState blendAttachmentState = + { + .blendEnable = VK_FALSE, + .srcColorBlendFactor = VK_BLEND_FACTOR_ONE, + .dstColorBlendFactor = VK_BLEND_FACTOR_ZERO, + .colorBlendOp = VK_BLEND_OP_ADD, + .srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE, + .dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO, + .alphaBlendOp = VK_BLEND_OP_ADD, + .colorWriteMask = 0, + }; + + const VkPipelineColorBlendStateCreateInfo colorBlendState = + { + .sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .logicOpEnable = VK_FALSE, + .logicOp = VK_LOGIC_OP_CLEAR, + .attachmentCount = 1, + .pAttachments = &blendAttachmentState, + .blendConstants = { 0.0f, 0.0f, 0.0f, 0.0f }, + }; + + const VkDynamicState dynamicStates[] = + { + VK_DYNAMIC_STATE_VIEWPORT, + VK_DYNAMIC_STATE_SCISSOR, + }; + + const VkPipelineDynamicStateCreateInfo dynamicState = + { + .sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .dynamicStateCount = BX_COUNTOF(dynamicStates), + .pDynamicStates = dynamicStates, + }; + + const VkGraphicsPipelineCreateInfo graphicsPipeline = + { + .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .stageCount = BX_COUNTOF(shaderStages), + .pStages = shaderStages, + .pVertexInputState = &vertexInputState, + .pInputAssemblyState = &inputAssemblyState, + .pTessellationState = NULL, + .pViewportState = &viewportState, + .pRasterizationState = &rasterizationState, + .pMultisampleState = &multisampleState, + .pDepthStencilState = &depthStencilState, + .pColorBlendState = &colorBlendState, + .pDynamicState = &dynamicState, + .layout = program.m_pipelineLayout, + .renderPass = *_renderPass, + .subpass = 0, + .basePipelineHandle = VK_NULL_HANDLE, + .basePipelineIndex = 0, + }; + + VK_CHECK(vkCreateGraphicsPipelines(m_device, m_pipelineCache, 1, &graphicsPipeline, m_allocatorCb, &pipeline) ); + + m_pipelineStateCache.add(hash, pipeline); + + return pipeline; + } + + void resolveDepth(VkCommandBuffer _commandBuffer, TextureVK& _texture, uint32_t _layer, uint32_t _numLayers, uint32_t _mip) + { + const ProgramVK& program = m_program[g_depthResolve->m_program[DepthResolve::Texture2DArray].idx]; + + ::VkRenderPass renderPass = VK_NULL_HANDLE; + const VkPipeline pipeline = getResolveDepthPipeline(_texture.m_format, _texture.m_aspectFlags, &renderPass); + + _texture.setState(_commandBuffer, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); + _texture.setState(_commandBuffer, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, true); + + const uint32_t width = bx::max(_texture.m_width >> _mip, 1); + const uint32_t height = bx::max(_texture.m_height >> _mip, 1); + + const VkViewport vp = + { + .x = 0.0f, + .y = 0.0f, + .width = float(width), + .height = float(height), + .minDepth = 0.0f, + .maxDepth = 1.0f, + }; + + const VkRect2D rc = + { + .offset = { .x = 0, .y = 0 }, + .extent = { .width = width, .height = height }, + }; + + for (uint32_t ii = _layer, end = _layer + _numLayers; ii < end; ++ii) + { + const VkImageViewCreateInfo ivciMsaa = + { + .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .image = _texture.m_textureImage, + .viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY, + .format = _texture.m_format, + .components = { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY }, + .subresourceRange = + { + .aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT, + .baseMipLevel = 0, + .levelCount = 1, + .baseArrayLayer = ii, + .layerCount = 1, + }, + }; + + const VkImageViewCreateInfo ivciResolve = + { + .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .image = _texture.m_singleMsaaImage, + .viewType = VK_IMAGE_VIEW_TYPE_2D, + .format = _texture.m_format, + .components = { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY }, + .subresourceRange = + { + .aspectMask = _texture.m_aspectFlags, + .baseMipLevel = _mip, + .levelCount = 1, + .baseArrayLayer = ii, + .layerCount = 1, + }, + }; + + VkImageView views[2]; + VK_CHECK(vkCreateImageView(m_device, &ivciMsaa, m_allocatorCb, &views[0]) ); + VK_CHECK(vkCreateImageView(m_device, &ivciResolve, m_allocatorCb, &views[1]) ); + + const VkFramebufferCreateInfo fci = + { + .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, + .pNext = NULL, + .flags = 0, + .renderPass = renderPass, + .attachmentCount = 1, + .pAttachments = &views[1], + .width = width, + .height = height, + .layers = 1, + }; + + VkFramebuffer framebuffer; + VK_CHECK(vkCreateFramebuffer(m_device, &fci, m_allocatorCb, &framebuffer) ); + + const VkDescriptorSet descriptorSet = allocDescriptorSet(program.m_descriptorSetLayout); + + const VkDescriptorImageInfo imageInfo = + { + .sampler = VK_NULL_HANDLE, + .imageView = views[0], + .imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, + }; + + const VkWriteDescriptorSet wds = + { + .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, + .pNext = NULL, + .dstSet = descriptorSet, + .dstBinding = program.m_bindInfo[0].binding, + .dstArrayElement = 0, + .descriptorCount = 1, + .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, + .pImageInfo = &imageInfo, + .pBufferInfo = NULL, + .pTexelBufferView = NULL, + }; + + vkUpdateDescriptorSets(m_device, 1, &wds, 0, NULL); + + const VkRenderPassBeginInfo rpbi = + { + .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, + .pNext = NULL, + .renderPass = renderPass, + .framebuffer = framebuffer, + .renderArea = rc, + .clearValueCount = 0, + .pClearValues = NULL, + }; + + vkCmdBeginRenderPass(_commandBuffer, &rpbi, VK_SUBPASS_CONTENTS_INLINE); + vkCmdBindPipeline(_commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); + vkCmdSetViewport(_commandBuffer, 0, 1, &vp); + vkCmdSetScissor(_commandBuffer, 0, 1, &rc); + vkCmdBindDescriptorSets(_commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, program.m_pipelineLayout, 0, 1, &descriptorSet, 0, NULL); + vkCmdDraw(_commandBuffer, 3, 1, 0, 0); + vkCmdEndRenderPass(_commandBuffer); + + release(framebuffer); + release(views[0]); + release(views[1]); + } + } + VkPipeline getPipeline(ProgramHandle _program) { ProgramVK& program = m_program[_program.idx]; @@ -4903,6 +5206,12 @@ VK_IMPORT_DEVICE : _program.m_textures[bindInfo.index].type ; + const bool msaa = true + && UINT32_MAX != bindInfo.index + && _program.m_textures[bindInfo.index].msaa + && 0 != (texture.m_flags & BGFX_TEXTURE_MSAA_SAMPLE) + ; + const VkImageLayout layout = isReadOnlyDepthStencilLayout(texture.m_currentImageLayout) ? texture.m_currentImageLayout : texture.m_sampledLayout @@ -4921,6 +5230,7 @@ VK_IMPORT_DEVICE , bind.m_firstLayer , bind.m_numLayers , samplerFlags + , msaa ); wds[wdsCount].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; @@ -6229,6 +6539,8 @@ VK_DESTROY case TextureDimension::DimensionCube: return VK_IMAGE_VIEW_TYPE_CUBE; case TextureDimension::DimensionCubeArray: return VK_IMAGE_VIEW_TYPE_CUBE_ARRAY; case TextureDimension::Dimension3D: return VK_IMAGE_VIEW_TYPE_3D; + case TextureDimension::Dimension2DMS: return VK_IMAGE_VIEW_TYPE_2D; + case TextureDimension::Dimension2DMSArray: return VK_IMAGE_VIEW_TYPE_2D_ARRAY; default: return VK_IMAGE_VIEW_TYPE_MAX_ENUM; } }; @@ -6273,7 +6585,11 @@ VK_DESTROY if (VK_IMAGE_VIEW_TYPE_MAX_ENUM != viewType) { m_bindInfo[stage].index = m_numTextures; - m_textures[m_numTextures].type = viewType; + m_textures[m_numTextures] = + { + .type = viewType, + .msaa = false, + }; m_numTextures++; } } @@ -6304,7 +6620,15 @@ VK_DESTROY if (VK_IMAGE_VIEW_TYPE_MAX_ENUM != viewType) { m_bindInfo[stage].index = m_numTextures; - m_textures[m_numTextures].type = viewType; + m_textures[m_numTextures] = + { + .type = viewType, + .msaa = false + || isShaderVerLess(magic, 13) + || TextureDimension::Dimension2DMS == idToTextureDimension(texDimension) + || TextureDimension::Dimension2DMSArray == idToTextureDimension(texDimension) + , + }; m_numTextures++; } @@ -6506,6 +6830,7 @@ VK_DESTROY } m_numTextures = 0; + m_msaaMask = 0; for (uint8_t stage = 0; stage < BX_COUNTOF(m_bindInfo); ++stage) { @@ -6534,6 +6859,7 @@ VK_DESTROY if (UINT32_MAX != index) { m_textures[m_numTextures] = shader->m_textures[index]; + m_msaaMask |= shader->m_textures[index].msaa ? UINT32_C(1) << stage : 0; index = m_numTextures; m_numTextures++; } @@ -7272,8 +7598,10 @@ VK_DESTROY const bool needResolve = true && 1 < m_sampler.Count - && 0 != (ici.usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) - && 0 == (m_flags & BGFX_TEXTURE_MSAA_SAMPLE) + && (false + || (0 != (ici.usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) && 0 == (m_flags & BGFX_TEXTURE_MSAA_SAMPLE) ) + || 0 != (ici.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) + ) && 0 == (m_flags & BGFX_TEXTURE_RT_WRITE_ONLY) ; @@ -7904,7 +8232,11 @@ VK_DESTROY { const VkFormat resolveFormat = getViewFormat(_resolve, BGFX_ATTACHMENT_SRGB); - if (resolveFormat != m_format) + if (0 != (m_aspectFlags & VK_IMAGE_ASPECT_DEPTH_BIT) ) + { + s_renderVK->resolveDepth(_commandBuffer, *this, _layer, numLayers, _mip); + } + else if (resolveFormat != m_format) { resolveRenderPass(_commandBuffer, resolveFormat, _layer, numLayers, _mip); setState(_commandBuffer, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, true); @@ -8310,7 +8642,7 @@ VK_DESTROY return VK_FORMAT_UNDEFINED != format ? format : m_format; } - VkResult TextureVK::createView(uint32_t _layer, uint32_t _numLayers, uint32_t _mip, uint32_t _numMips, VkImageViewType _type, VkImageAspectFlags _aspectMask, bool _renderTarget, ::VkImageView* _view, VkFormat _format) const + VkResult TextureVK::createView(uint32_t _layer, uint32_t _numLayers, uint32_t _mip, uint32_t _numMips, VkImageViewType _type, VkImageAspectFlags _aspectMask, bool _renderTarget, ::VkImageView* _view, VkFormat _format, bool _msaa) const { VkResult result = VK_SUCCESS; @@ -8337,7 +8669,7 @@ VK_DESTROY viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; viewInfo.pNext = NULL; viewInfo.flags = 0; - viewInfo.image = ( (VK_NULL_HANDLE != m_singleMsaaImage) && !_renderTarget) + viewInfo.image = (VK_NULL_HANDLE != m_singleMsaaImage && !_renderTarget && !_msaa) ? m_singleMsaaImage : m_textureImage ; @@ -11095,6 +11427,7 @@ VK_DESTROY submitUniformCache(ucs, view); submitBlit(bs, view); + currentPipeline = VK_NULL_HANDLE; BGFX_VK_PROFILER_END(); formatViewName(viewName, _render, view, " "); @@ -11310,6 +11643,7 @@ VK_DESTROY { submitUniformCache(ucs, view); submitBlit(bs, view); + currentPipeline = VK_NULL_HANDLE; } // renderpass external subpass dependencies handle graphics -> compute and compute -> graphics @@ -11379,6 +11713,7 @@ VK_DESTROY bx::HashMurmur2A hash; hash.begin(); hash.add(program.m_descriptorSetLayout); + hash.add(program.m_msaaMask); hash.add(bindIdx); hash.add(sbo.buffer); hash.add(vsSize); @@ -11739,6 +12074,7 @@ VK_DESTROY bx::HashMurmur2A hash; hash.begin(); hash.add(program.m_descriptorSetLayout); + hash.add(program.m_msaaMask); hash.add(bindIdx); hash.add(sbo.buffer); hash.add(vsSize); diff --git a/src/renderer_vk.h b/src/renderer_vk.h index a5d7a0e3f..7665380dc 100644 --- a/src/renderer_vk.h +++ b/src/renderer_vk.h @@ -537,6 +537,7 @@ VK_DESTROY_FUNC(DescriptorSet); struct TextureBindInfo { VkImageViewType type; + bool msaa; }; struct ShaderVK @@ -601,6 +602,7 @@ VK_DESTROY_FUNC(DescriptorSet); TextureBindInfo m_textures[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; uint8_t m_numTextures; + uint32_t m_msaaMask; PredefinedUniform m_predefined[PredefinedUniform::Count * 2]; uint8_t m_numPredefined; @@ -733,7 +735,7 @@ VK_DESTROY_FUNC(DescriptorSet); void copyBufferToTexture(VkCommandBuffer _commandBuffer, VkBuffer _stagingBuffer, uint32_t _bufferImageCopyCount, VkBufferImageCopy* _bufferImageCopy); void setState(VkCommandBuffer _commandBuffer, VkImageLayout _newImageLayout, bool _singleMsaaImage = false); - VkResult createView(uint32_t _layer, uint32_t _numLayers, uint32_t _mip, uint32_t _numMips, VkImageViewType _type, VkImageAspectFlags _aspectMask, bool _renderTarget, ::VkImageView* _view, VkFormat _format = VK_FORMAT_UNDEFINED) const; + VkResult createView(uint32_t _layer, uint32_t _numLayers, uint32_t _mip, uint32_t _numMips, VkImageViewType _type, VkImageAspectFlags _aspectMask, bool _renderTarget, ::VkImageView* _view, VkFormat _format = VK_FORMAT_UNDEFINED, bool _msaa = false) const; VkFormat getViewFormat(uint32_t _flags, uint32_t _bit) const; diff --git a/src/renderer_webgpu.cpp b/src/renderer_webgpu.cpp index ee8af8d63..554b16785 100644 --- a/src/renderer_webgpu.cpp +++ b/src/renderer_webgpu.cpp @@ -213,6 +213,8 @@ namespace bgfx { namespace wgpu WGPUTextureViewDimension_Cube, WGPUTextureViewDimension_CubeArray, WGPUTextureViewDimension_3D, + WGPUTextureViewDimension_2D, + WGPUTextureViewDimension_2DArray, }; static_assert(TextureDimension::Count == BX_COUNTOF(s_textureDimension) ); @@ -2492,6 +2494,176 @@ WGPU_IMPORT wgpuRelease(blitRenderPassEncoder); } + void resolveDepth(WGPUCommandEncoder _cmdEncoder, TextureHandle _textureHandle, uint32_t _mip) + { + const TextureWGPU& texture = m_textures[_textureHandle.idx]; + const ProgramHandle programHandle = g_depthResolve->m_program[DepthResolve::Texture2D]; + const ProgramWGPU& program = m_program[programHandle.idx]; + + RenderBind renderBind; + renderBind.clear(); + renderBind.m_bind[0].setTexture(_textureHandle, BGFX_SAMPLER_POINT|BGFX_SAMPLER_UVW_CLAMP); + + bx::HashMurmur3 murmur; + murmur.begin(); + murmur.add(programHandle.idx); + murmur.add(texture.m_fmt); + const uint32_t hash = murmur.end(); + + RenderPipeline* renderPipeline = m_renderPipelineCache.find(hash); + + if (NULL == renderPipeline) + { + WGPUBindGroupLayoutEntry entries[2 + BGFX_CONFIG_MAX_TEXTURE_SAMPLERS * 3]; + const uint8_t entryCount = fillBindGroupLayoutEntry(entries, program, renderBind, false); + + const WGPUBindGroupLayoutDescriptor bindGroupLayoutDesc = + { + .nextInChain = NULL, + .label = WGPU_STRING_VIEW_INIT, + .entryCount = entryCount, + .entries = entries, + }; + + WGPUBindGroupLayout bindGroupLayout = WGPU_CHECK(wgpuDeviceCreateBindGroupLayout(m_device, &bindGroupLayoutDesc) ); + + const WGPUPipelineLayoutDescriptor pipelineLayoutDesc = + { + .nextInChain = NULL, + .label = WGPU_STRING_VIEW_INIT, + .bindGroupLayoutCount = 1, + .bindGroupLayouts = &bindGroupLayout, + .immediateSize = 0, + }; + + WGPUPipelineLayout pipelineLayout = WGPU_CHECK(wgpuDeviceCreatePipelineLayout(m_device, &pipelineLayoutDesc) ); + + WGPUDepthStencilState depthStencilState; + setDepthStencilState(depthStencilState + , TextureFormat::Enum(texture.m_textureFormat) + , BGFX_STATE_DEPTH_TEST_ALWAYS|BGFX_STATE_WRITE_Z + , 0 + , false + , false + ); + + const WGPUFragmentState fragmentState = + { + .nextInChain = NULL, + .module = program.m_fsh->getModule(false), + .entryPoint = WGPU_STRING_VIEW_INIT, + .constantCount = 0, + .constants = NULL, + .targetCount = 0, + .targets = NULL, + }; + + const WGPURenderPipelineDescriptor renderPipelineDesc = + { + .nextInChain = NULL, + .label = WGPU_STRING_VIEW_INIT, + .layout = pipelineLayout, + .vertex = + { + .nextInChain = NULL, + .module = program.m_vsh->getModule(false), + .entryPoint = WGPU_STRING_VIEW_INIT, + .constantCount = 0, + .constants = NULL, + .bufferCount = 0, + .buffers = NULL, + }, + .primitive = + { + .nextInChain = NULL, + .topology = WGPUPrimitiveTopology_TriangleList, + .stripIndexFormat = WGPUIndexFormat_Undefined, + .frontFace = WGPUFrontFace_CCW, + .cullMode = WGPUCullMode_None, + .unclippedDepth = false, + }, + .depthStencil = &depthStencilState, + .multisample = + { + .nextInChain = NULL, + .count = 1, + .mask = UINT32_MAX, + .alphaToCoverageEnabled = false, + }, + .fragment = &fragmentState, + }; + + const WGPURenderPipeline pipeline = WGPU_CHECK(wgpuDeviceCreateRenderPipeline(m_device, &renderPipelineDesc) ); + + renderPipeline = m_renderPipelineCache.add( + hash + , { + .bindGroupLayout = bindGroupLayout, + .pipeline = pipeline, + } + , 0 + ); + wgpuRelease(pipelineLayout); + } + + const WGPUTextureViewDescriptor textureViewDesc = + { + .nextInChain = NULL, + .label = WGPU_STRING_VIEW_INIT, + .format = texture.m_fmt, + .dimension = WGPUTextureViewDimension_2D, + .baseMipLevel = _mip, + .mipLevelCount = 1, + .baseArrayLayer = 0, + .arrayLayerCount = 1, + .aspect = WGPUTextureAspect_All, + .usage = WGPUTextureUsage_RenderAttachment, + }; + + WGPUTextureView depthView = WGPU_CHECK(wgpuTextureCreateView(texture.m_texture, &textureViewDesc) ); + + const bool stencil = hasStencil(TextureFormat::Enum(texture.m_textureFormat) ); + + const WGPURenderPassDepthStencilAttachment depthStencilAttachment = + { + .nextInChain = NULL, + .view = depthView, + .depthLoadOp = WGPULoadOp_Load, + .depthStoreOp = WGPUStoreOp_Store, + .depthClearValue = 0.0f, + .depthReadOnly = false, + .stencilLoadOp = stencil ? WGPULoadOp_Load : WGPULoadOp_Undefined, + .stencilStoreOp = stencil ? WGPUStoreOp_Store : WGPUStoreOp_Undefined, + .stencilClearValue = 0, + .stencilReadOnly = false, + }; + + const WGPURenderPassDescriptor renderPassDesc = + { + .nextInChain = NULL, + .label = WGPU_STRING_VIEW_INIT, + .colorAttachmentCount = 0, + .colorAttachments = NULL, + .depthStencilAttachment = &depthStencilAttachment, + .occlusionQuerySet = NULL, + .timestampWrites = NULL, + }; + + ChunkedScratchBufferOffset sbo; + bx::memSet(&sbo, 0, sizeof(sbo) ); + BindGroup bindGroup = createBindGroup(renderPipeline->bindGroupLayout, program, renderBind, sbo, false); + + WGPURenderPassEncoder renderPassEncoder = WGPU_CHECK(wgpuCommandEncoderBeginRenderPass(_cmdEncoder, &renderPassDesc) ); + WGPU_CHECK(wgpuRenderPassEncoderSetPipeline(renderPassEncoder, renderPipeline->pipeline) ); + WGPU_CHECK(wgpuRenderPassEncoderSetBindGroup(renderPassEncoder, 0, bindGroup.bindGroup, bindGroup.numOffsets, sbo.offsets) ); + WGPU_CHECK(wgpuRenderPassEncoderDraw(renderPassEncoder, 3, 1, 0, 0) ); + WGPU_CHECK(wgpuRenderPassEncoderEnd(renderPassEncoder) ); + wgpuRelease(renderPassEncoder); + + release(bindGroup); + wgpuRelease(depthView); + } + bool clearIntegerColor(WGPUCommandEncoder _commandEncoder, const FrameBufferWGPU& _fb, const Rect& _rect, const Clear& _clear, const float _palette[][4]) { if (0 == (_clear.m_flags & BGFX_CLEAR_COLOR) @@ -2955,7 +3127,7 @@ WGPU_IMPORT }; } - void initTextureBinding(WGPUBindGroupLayoutEntry& _out, uint32_t _binding, WGPUShaderStage _visibility, WGPUTextureSampleType _sampleType, WGPUTextureViewDimension _viewDimension) + void initTextureBinding(WGPUBindGroupLayoutEntry& _out, uint32_t _binding, WGPUShaderStage _visibility, WGPUTextureSampleType _sampleType, WGPUTextureViewDimension _viewDimension, bool _multisampled) { _out = { @@ -2970,7 +3142,7 @@ WGPU_IMPORT .nextInChain = NULL, .sampleType = _sampleType, .viewDimension = _viewDimension, - .multisampled = false, + .multisampled = _multisampled, }, .storageTexture = {}, }; @@ -3100,6 +3272,7 @@ WGPU_IMPORT , WGPUTextureViewDimension_Undefined != shaderBind.viewDimension ? shaderBind.viewDimension : m_textures[bind.m_idx].m_viewDimension + , shaderBind.multisampled ); initSamplerBinding( @@ -3706,6 +3879,7 @@ WGPU_IMPORT , Binding::Texture == bind.m_type ? texture.getViewFormat(resolvedFlags, BGFX_SAMPLER_SRGB) : WGPUTextureFormat_Undefined + , shaderBind.multisampled && NULL != texture.m_textureMsaa ), }; @@ -4369,10 +4543,19 @@ WGPU_IMPORT shaderBind.binding = regIndex; shaderBind.samplerBinding = regIndex + kSpirvSamplerShift; - if (hasTexData) + const TextureDimension::Enum dimension = hasTexData + ? idToTextureDimension(texDimension) + : TextureDimension::Count + ; + + if (TextureDimension::Count != dimension) { - shaderBind.viewDimension = s_textureDimension[idToTextureDimension(texDimension)]; + shaderBind.viewDimension = s_textureDimension[dimension]; shaderBind.sampleType = s_textureComponentType[idToTextureComponentType(texComponent)]; + shaderBind.multisampled = false + || TextureDimension::Dimension2DMS == dimension + || TextureDimension::Dimension2DMSArray == dimension + ; } else { @@ -4829,7 +5012,10 @@ WGPU_IMPORT if (needResolve) { - textureDesc.usage = WGPUTextureUsage_RenderAttachment; + textureDesc.usage = 0 + | WGPUTextureUsage_RenderAttachment + | (bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) ? WGPUTextureUsage_TextureBinding : 0) + ; textureDesc.mipLevelCount = 1; textureDesc.sampleCount = m_msaaCount; textureDesc.viewFormatCount = 0; @@ -5181,7 +5367,7 @@ WGPU_IMPORT return WGPUTextureFormat_Undefined != format ? format : m_fmt; } - WGPUTextureView TextureWGPU::getTextureView(uint8_t _baseMipLevel, uint8_t _mipLevelCount, bool _storage, uint16_t _baseArrayLayer, uint16_t _arrayLayerCount, WGPUTextureViewDimension _viewDimension, bool _stencil, WGPUTextureFormat _format) const + WGPUTextureView TextureWGPU::getTextureView(uint8_t _baseMipLevel, uint8_t _mipLevelCount, bool _storage, uint16_t _baseArrayLayer, uint16_t _arrayLayerCount, WGPUTextureViewDimension _viewDimension, bool _stencil, WGPUTextureFormat _format, bool _msaa) const { const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat) ); const bool depthOnly = !_stencil @@ -5209,6 +5395,7 @@ WGPU_IMPORT murmur.add(_viewDimension); murmur.add(_stencil); murmur.add(format); + murmur.add(_msaa); const uint32_t hash = murmur.end(); WGPUTextureView textureView = s_renderWGPU->m_textureViewStateCache.find(hash); @@ -5256,8 +5443,8 @@ WGPU_IMPORT .label = WGPU_STRING_VIEW_INIT, .format = format, .dimension = tvd, - .baseMipLevel = _baseMipLevel, - .mipLevelCount = UINT8_MAX == _mipLevelCount ? WGPU_MIP_LEVEL_COUNT_UNDEFINED : _mipLevelCount, + .baseMipLevel = _msaa ? 0u : _baseMipLevel, + .mipLevelCount = _msaa ? 1u : UINT8_MAX == _mipLevelCount ? WGPU_MIP_LEVEL_COUNT_UNDEFINED : _mipLevelCount, .baseArrayLayer = baseArrayLayer, .arrayLayerCount = arrayLayerCount, .aspect = _stencil @@ -5272,7 +5459,7 @@ WGPU_IMPORT , }; - textureView = WGPU_CHECK(wgpuTextureCreateView(m_texture, &textureViewDesc) ); + textureView = WGPU_CHECK(wgpuTextureCreateView(_msaa ? m_textureMsaa : m_texture, &textureViewDesc) ); s_renderWGPU->m_textureViewStateCache.add(hash, textureView, s_renderWGPU->m_textures.indexOf(*this) ); } @@ -5971,6 +6158,17 @@ WGPU_IMPORT { const Attachment& at = m_attachment[ii]; + if (isValid(at.handle) ) + { + const TextureWGPU& texture = s_renderWGPU->m_textures[at.handle.idx]; + + if (NULL != texture.m_textureMsaa + && bimg::isDepth(bimg::TextureFormat::Enum(texture.m_textureFormat) ) ) + { + s_renderWGPU->resolveDepth(_cmdEncoder, at.handle, at.mip); + } + } + if (isValid(at.handle) && 0 != (at.flags & BGFX_ATTACHMENT_AUTO_GEN_MIPS) ) { diff --git a/src/renderer_webgpu.h b/src/renderer_webgpu.h index f5cec910c..4f6af4593 100644 --- a/src/renderer_webgpu.h +++ b/src/renderer_webgpu.h @@ -498,6 +498,7 @@ namespace wgpu { WGPUTextureSampleType sampleType; WGPUTextureViewDimension viewDimension; WGPUShaderStage shaderStage; + bool multisampled; void clear() { @@ -509,6 +510,7 @@ namespace wgpu { bufferBindingType = WGPUBufferBindingType_Undefined; sampleType = WGPUTextureSampleType_Undefined; viewDimension = WGPUTextureViewDimension_Undefined; + multisampled = false; } }; @@ -647,7 +649,7 @@ namespace wgpu { void clear(uint8_t _mip, uint8_t _numMips, uint16_t _layer, uint16_t _numLayers); WGPUSampler getSamplerState(uint32_t _samplerFlags, uint8_t _lodMin = 0, uint8_t _lodMax = UINT8_MAX) const; - WGPUTextureView getTextureView(uint8_t _baseMipLevel, uint8_t _mipLevelCount, bool _storage, uint16_t _baseArrayLayer = 0, uint16_t _arrayLayerCount = UINT16_MAX, WGPUTextureViewDimension _viewDimension = WGPUTextureViewDimension_Undefined, bool _stencil = false, WGPUTextureFormat _format = WGPUTextureFormat_Undefined) const; + WGPUTextureView getTextureView(uint8_t _baseMipLevel, uint8_t _mipLevelCount, bool _storage, uint16_t _baseArrayLayer = 0, uint16_t _arrayLayerCount = UINT16_MAX, WGPUTextureViewDimension _viewDimension = WGPUTextureViewDimension_Undefined, bool _stencil = false, WGPUTextureFormat _format = WGPUTextureFormat_Undefined, bool _msaa = false) const; WGPUTextureFormat getViewFormat(uint32_t _flags, uint32_t _bit) const; WGPUTexture m_texture; diff --git a/src/shader.cpp b/src/shader.cpp index 5d41f2228..7d748cec5 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -91,6 +91,8 @@ namespace bgfx { TextureDimension::DimensionCube, 0x04 }, { TextureDimension::DimensionCubeArray, 0x05 }, { TextureDimension::Dimension3D, 0x06 }, + { TextureDimension::Dimension2DMS, 0x07 }, + { TextureDimension::Dimension2DMSArray, 0x08 }, }; static_assert(BX_COUNTOF(s_textureDimensionToId) == TextureDimension::Count); diff --git a/src/shader.h b/src/shader.h index 8e3d39d62..b3b1c1f06 100644 --- a/src/shader.h +++ b/src/shader.h @@ -66,6 +66,8 @@ namespace bgfx DimensionCube, DimensionCubeArray, Dimension3D, + Dimension2DMS, + Dimension2DMSArray, Count }; diff --git a/src/vs_resolve_depth.bin.h b/src/vs_resolve_depth.bin.h new file mode 100644 index 000000000..3e7009d13 --- /dev/null +++ b/src/vs_resolve_depth.bin.h @@ -0,0 +1,343 @@ +static const uint8_t vs_resolve_depth_glsl[149] = +{ + 0x56, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // VSH............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // ......z....void + 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x67, 0x6c, 0x5f, // main().{. gl_ + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x28, // Position = vec4( + 0x28, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x44, 0x20, 0x3d, 0x3d, 0x20, // (gl_VertexID == + 0x31, 0x29, 0x20, 0x3f, 0x20, 0x33, 0x2e, 0x30, 0x20, 0x3a, 0x20, 0x28, 0x2d, 0x31, 0x2e, 0x30, // 1) ? 3.0 : (-1.0 + 0x29, 0x2c, 0x20, 0x28, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x44, 0x20, // ), (gl_VertexID + 0x3d, 0x3d, 0x20, 0x32, 0x29, 0x20, 0x3f, 0x20, 0x33, 0x2e, 0x30, 0x20, 0x3a, 0x20, 0x28, 0x2d, // == 2) ? 3.0 : (- + 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // 1.0), 0.0, 1.0); + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}... +}; +static const uint8_t vs_resolve_depth_essl[149] = +{ + 0x56, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // VSH............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // ......z....void + 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x67, 0x6c, 0x5f, // main().{. gl_ + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x28, // Position = vec4( + 0x28, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x44, 0x20, 0x3d, 0x3d, 0x20, // (gl_VertexID == + 0x31, 0x29, 0x20, 0x3f, 0x20, 0x33, 0x2e, 0x30, 0x20, 0x3a, 0x20, 0x28, 0x2d, 0x31, 0x2e, 0x30, // 1) ? 3.0 : (-1.0 + 0x29, 0x2c, 0x20, 0x28, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x44, 0x20, // ), (gl_VertexID + 0x3d, 0x3d, 0x20, 0x32, 0x29, 0x20, 0x3f, 0x20, 0x33, 0x2e, 0x30, 0x20, 0x3a, 0x20, 0x28, 0x2d, // == 2) ? 3.0 : (- + 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // 1.0), 0.0, 1.0); + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}... +}; +static const uint8_t vs_resolve_depth_spv[656] = +{ + 0x56, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // VSH............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, // ......p.....#... + 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, // ......O......... + 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, // ..............GL + 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, // SL.std.450...... + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, // ......main....(. + 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, // ..+............. + 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. + 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, // ......(...gl_Ver + 0x74, 0x65, 0x78, 0x49, 0x44, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x40, 0x65, // texID.....+...@e + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, // ntryPointOutput. + 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x47, 0x00, // gl_Position...G. + 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x47, 0x00, // ..(.......*...G. + 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, // ..+............. + 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... + 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... + 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, // .......... ..... + 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, // ................ + 0x02, 0x00, 0x15, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x00, // ......+......... + 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, // ....@@+......... + 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1b, 0x00, // ......+......... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......+......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1f, 0x00, // ......+......... + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x20, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x01, 0x00, // .....? ...'..... + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x28, 0x00, // ......;...'...(. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x03, 0x00, // ...... ...*..... + 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2b, 0x00, // ......;...*...+. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, // ......6......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x28, 0x00, // ..=.......)...(. + 0x00, 0x00, 0xaa, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x29, 0x00, // ..........I...). + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4a, 0x00, // ..............J. + 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xaa, 0x00, // ..I............. + 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x1b, 0x00, // ......L...)..... + 0x00, 0x00, 0xa9, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4c, 0x00, // ..........M...L. + 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x09, 0x00, // ..........P..... + 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x1e, 0x00, // ..N...J...M..... + 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x4e, 0x00, // ......>...+...N. + 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00, // ......8......... +}; +static const uint8_t vs_resolve_depth_wgsl[426] = +{ + 0x56, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // VSH............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, // ..........diagno + 0x73, 0x74, 0x69, 0x63, 0x28, 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, // stic(off, deriva + 0x74, 0x69, 0x76, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x74, 0x79, 0x29, // tive_uniformity) + 0x3b, 0x0a, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x28, 0x6f, 0x66, 0x66, // ;.diagnostic(off + 0x2c, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x6e, 0x69, 0x66, 0x6f, // , subgroup_unifo + 0x72, 0x6d, 0x69, 0x74, 0x79, 0x29, 0x3b, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x3c, 0x70, 0x72, 0x69, // rmity);..var v : vec4;..fn main_in + 0x6e, 0x65, 0x72, 0x28, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x44, 0x20, // ner(gl_VertexID + 0x3a, 0x20, 0x75, 0x33, 0x32, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x20, 0x3d, 0x20, 0x76, // : u32) {. v = v + 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x28, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, // ec4(select( + 0x2d, 0x31, 0x2e, 0x30, 0x66, 0x2c, 0x20, 0x33, 0x2e, 0x30, 0x66, 0x2c, 0x20, 0x28, 0x67, 0x6c, // -1.0f, 3.0f, (gl + 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x44, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x75, 0x29, // _VertexID == 1u) + 0x29, 0x2c, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x66, 0x2c, // ), select(-1.0f, + 0x20, 0x33, 0x2e, 0x30, 0x66, 0x2c, 0x20, 0x28, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, // 3.0f, (gl_Verte + 0x78, 0x49, 0x44, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x75, 0x29, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, // xID == 2u)), 0.0 + 0x66, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x66, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x40, 0x76, 0x65, // f, 1.0f);.}..@ve + 0x72, 0x74, 0x65, 0x78, 0x0a, 0x66, 0x6e, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x40, 0x62, 0x75, // rtex.fn main(@bu + 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6e, 0x64, // iltin(vertex_ind + 0x65, 0x78, 0x29, 0x20, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x44, 0x20, // ex) gl_VertexID + 0x3a, 0x20, 0x75, 0x33, 0x32, 0x29, 0x20, 0x2d, 0x3e, 0x20, 0x40, 0x62, 0x75, 0x69, 0x6c, 0x74, // : u32) -> @built + 0x69, 0x6e, 0x28, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x20, 0x76, 0x65, 0x63, // in(position) vec + 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x5f, // 4 {. main_ + 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x28, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, // inner(gl_VertexI + 0x44, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x3b, 0x0a, // D);. return v;. + 0x7d, 0x0a, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, // }......... +}; +static const uint8_t vs_resolve_depth_dxbc[374] = +{ + 0x56, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // VSH............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x64, 0x48, // ......X...DXBCdH + 0xe6, 0xb6, 0x81, 0xa0, 0xae, 0xc1, 0x5f, 0x57, 0xdb, 0xd6, 0x4d, 0xa9, 0x9e, 0xf2, 0x01, 0x00, // ......_W..M..... + 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, // ..X.......,...`. + 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, // ......ISGN,..... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // ...... ......... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x53, 0x56, // ..............SV + 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x44, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, // _VertexID.OSGN,. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................ + 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x53, 0x48, // ..SV_POSITION.SH + 0x45, 0x58, 0xbc, 0x00, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x6a, 0x08, // EX....P.../...j. + 0x00, 0x01, 0x60, 0x00, 0x00, 0x04, 0x12, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // ..`............. + 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..g.... ........ + 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x0a, 0x32, 0x00, // ..h....... ...2. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ...............@ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x37, 0x00, 0x00, 0x0f, 0x32, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, // ..7...2 ......F. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, // .......@....@@.. + 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // @@.........@.... + 0x80, 0xbf, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // ..............6. + 0x00, 0x08, 0xc2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // ... .......@.... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, // .............?>. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ...... +}; +static const uint8_t vs_resolve_depth_dxil[2898] = +{ + 0x56, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // VSH............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x0b, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x9a, 0x9b, // ......4...DXBC.. + 0xef, 0x0a, 0x77, 0x9d, 0x6e, 0xa9, 0x26, 0x52, 0x4f, 0xa1, 0x3b, 0xbe, 0x2f, 0x37, 0x01, 0x00, // ..w.n.&RO.;./7.. + 0x00, 0x00, 0x34, 0x0b, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x4c, 0x00, // ..4.......<...L. + 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x24, 0x06, // ..........T...$. + 0x00, 0x00, 0x40, 0x06, 0x00, 0x00, 0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // ..@...SFI0...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, // ......ISG14..... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........(..... + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, // ......SV_VertexI + 0x44, 0x00, 0x4f, 0x53, 0x47, 0x31, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // D.OSG14......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ......(......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x50, 0x53, // ..SV_Position.PS + 0x56, 0x30, 0x88, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // V0....8......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, // ................ + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, // ...........main. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ........A....... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x44, 0x03, 0x03, 0x04, 0x00, 0x00, 0x03, 0x00, // ........D....... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x54, // ..............ST + 0x41, 0x54, 0xc8, 0x04, 0x00, 0x00, 0x60, 0x00, 0x01, 0x00, 0x32, 0x01, 0x00, 0x00, 0x44, 0x58, // AT....`...2...DX + 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00, 0x42, 0x43, // IL............BC + 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x29, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, // ..!...)..... ... + 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, // ........#.A..I.. + 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x10, // 29....%......b.. + 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0x84, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, // E.B..B..2.8..K.2 + 0x42, 0x88, 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, // B.H.. CF....2B.H + 0x0e, 0x90, 0x11, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x21, // ...".PAQ.......! + 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, // F.Q............. + 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x01, 0x00, // ..@.......... .. + 0x00, 0x00, 0x49, 0x18, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x00, // ..I.........`B . + 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x32, 0x22, 0x08, 0x09, 0x20, 0x64, // ... ......2".. d + 0x85, 0x04, 0x13, 0x22, 0xa4, 0x84, 0x04, 0x13, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, // ..."...."......L + 0x88, 0x8c, 0x0b, 0x84, 0x84, 0x4c, 0x10, 0x30, 0x23, 0x00, 0x25, 0x00, 0x8a, 0x39, 0x02, 0x30, // .....L.0#.%..9.0 + 0x98, 0x23, 0x40, 0x8a, 0x31, 0x33, 0x43, 0x43, 0x35, 0x03, 0x50, 0x0c, 0x98, 0x19, 0x3a, 0xc2, // .#@.13CC5.P...:. + 0x81, 0x80, 0x1c, 0x18, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, // ........r..t`.6h + 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, // .yh.r....P.m..zP + 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, // .m..z0.r..s .m.. + 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, // q..s .m..x..s .m + 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, // ..q`.z0.r...0.r. + 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, // .s .m..v@.z`.t.. + 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, // ...v..s .m`.s .z + 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, // 0.r...`.t..v@.m. + 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, // .x..q`.z0.r..v@. + 0x43, 0x9e, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x05, // C.............<. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, // ...........y. .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x02, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x32, 0x1e, // ..............2. + 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x9a, 0x12, 0x18, // ....L...&G..C... + 0x01, 0x28, 0x86, 0x32, 0x28, 0x8f, 0xa2, 0x28, 0x82, 0x42, 0x20, 0x2a, 0x85, 0x12, 0x18, 0x01, // .(.2(..(.B *.... + 0x28, 0x89, 0x32, 0x28, 0x04, 0xda, 0xb1, 0x86, 0x80, 0x18, 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, // (.2(..........y. + 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x8f, 0x0c, // ..^.....L.F..... + 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0x06, 0xc6, 0x45, 0xc6, 0x06, 0xa6, 0xc6, 0x65, // o..M.$.%..E....e + 0xe6, 0x06, 0x04, 0x65, 0x8c, 0x86, 0x0c, 0xc7, 0x8c, 0xc6, 0x2c, 0x27, 0x27, 0x65, 0x43, 0x10, // ...e......,''eC. + 0x4c, 0x10, 0x86, 0x61, 0x82, 0x30, 0x10, 0x1b, 0x84, 0x81, 0xd8, 0x20, 0x10, 0x04, 0x05, 0xbb, // L..a.0..... .... + 0xb9, 0x09, 0xc2, 0x50, 0x6c, 0x18, 0x0e, 0x84, 0x98, 0x20, 0x08, 0xc0, 0x06, 0x60, 0xc3, 0x40, // ...Pl.... ...`.@ + 0x2c, 0xcb, 0x86, 0x80, 0xd9, 0x30, 0x0c, 0x4a, 0x33, 0x41, 0x58, 0xa2, 0x0d, 0xc1, 0x43, 0xa2, // ,....0.J3AX...C. + 0x2d, 0x2c, 0xcd, 0x8d, 0xcb, 0x94, 0xd5, 0x97, 0x55, 0x99, 0x1c, 0x5d, 0x19, 0x5e, 0x12, 0xd1, // -,......U..].^.. + 0x04, 0x81, 0x58, 0x26, 0x08, 0x04, 0xb3, 0x21, 0x20, 0x26, 0x08, 0x44, 0x33, 0x41, 0x18, 0x8c, // ..X&...! &.D3A.. + 0x0d, 0xc2, 0x35, 0x6c, 0x58, 0x08, 0x69, 0xa2, 0x2a, 0x6b, 0xa0, 0x08, 0x0b, 0xdb, 0x10, 0x64, // ..5lX.i.*k.....d + 0x5c, 0xa6, 0xac, 0xbe, 0xa0, 0xde, 0xe6, 0xd2, 0xe8, 0xd2, 0xde, 0xdc, 0x26, 0x08, 0x84, 0x33, // ............&..3 + 0x41, 0x20, 0x9e, 0x09, 0x02, 0x01, 0x4d, 0x10, 0x86, 0x63, 0x83, 0x70, 0x7d, 0x1b, 0x16, 0x62, // A ....M..c.p}..b + 0xe3, 0xba, 0xca, 0x1b, 0x3c, 0xc2, 0x02, 0x83, 0x0d, 0x41, 0x18, 0x6c, 0x18, 0x34, 0x31, 0x00, // ....<....A.l.41. + 0x36, 0x14, 0x4a, 0x34, 0x06, 0x00, 0xc0, 0x22, 0xcd, 0x6d, 0x8e, 0x6e, 0x6e, 0x82, 0x30, 0x20, // 6.J4...".m.nn.0 + 0x24, 0xd2, 0xdc, 0xe8, 0xe6, 0x26, 0x08, 0x43, 0x42, 0x63, 0x2e, 0xed, 0xec, 0x8b, 0x8d, 0x8c, // $....&.CBc...... + 0xc6, 0x5c, 0xda, 0xd9, 0xd7, 0x1c, 0xdd, 0x04, 0x61, 0x50, 0x36, 0x20, 0x65, 0x60, 0x06, 0x67, // ........aP6 e`.g + 0x80, 0x06, 0x69, 0x30, 0xa8, 0xc1, 0x1a, 0x54, 0x61, 0x63, 0xb3, 0x6b, 0x73, 0x49, 0x23, 0x2b, // ..i0...Tac.ksI#+ + 0x73, 0xa3, 0x9b, 0x12, 0x04, 0x55, 0xc8, 0xf0, 0x5c, 0xec, 0xca, 0xe4, 0xe6, 0xd2, 0xde, 0xdc, // s....U.......... + 0xa6, 0x04, 0x44, 0x13, 0x32, 0x3c, 0x17, 0xbb, 0x30, 0x36, 0xbb, 0x32, 0xb9, 0x29, 0x41, 0x51, // ..D.2<..06.2.)AQ + 0x87, 0x0c, 0xcf, 0x65, 0x0e, 0x2d, 0x8c, 0xac, 0x4c, 0xae, 0xe9, 0x8d, 0xac, 0x8c, 0x6d, 0x4a, // ...e.-..L.....mJ + 0x80, 0x54, 0x22, 0xc3, 0x73, 0xa1, 0xcb, 0x83, 0x2b, 0x0b, 0x72, 0x73, 0x7b, 0xa3, 0x0b, 0xa3, // .T".s...+.rs{... + 0x4b, 0x7b, 0x73, 0x9b, 0x9b, 0x12, 0x34, 0x75, 0xc8, 0xf0, 0x5c, 0xec, 0xd2, 0xca, 0xee, 0x92, // K{s...4u........ + 0xc8, 0xa6, 0xe8, 0xc2, 0xe8, 0xca, 0xa6, 0x04, 0x4f, 0x1d, 0x32, 0x3c, 0x97, 0x32, 0x37, 0x3a, // ........O.2<.27: + 0xb9, 0x3c, 0xa8, 0xb7, 0x34, 0x37, 0xba, 0xb9, 0x29, 0xc1, 0x18, 0x74, 0x21, 0xc3, 0x73, 0x19, // .<..47..)..t!.s. + 0x7b, 0xab, 0x73, 0xa3, 0x2b, 0x93, 0x9b, 0x9b, 0x12, 0xac, 0x01, 0x00, 0x00, 0x00, 0x79, 0x18, // {.s.+.........y. + 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, // ..L...3......f.. + 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, // =.C8...B..yx.s.q + 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, // ..........3.B... + 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, // ....f0.=.C8..... + 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, // =.C=..=.x.tp.{.. + 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, // yH.pp.zp.vx.p .. + 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, // .......0.n0..... + 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, // P.3....!..!..a.f + 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, // 0.;..;.C9..<..<. + 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, // .;...v`.{h.7h.rh + 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, // .7..p..p`.v(.v.. + 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, // vx.w.._..q..r..y + 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, // ..,..........0.b + 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, // .............a.. + 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, // !.....a...C9.C9. + 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, // C9.C9..8.C8..;.. + 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, // /..<..;..;....!. + 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87, 0x76, 0x80, 0x87, 0x19, 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, // |p.z(.v....C.... + 0xe4, 0x20, 0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, // . .............. + 0x50, 0x0f, 0xf4, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x16, 0x30, // P.....q .......0 + 0x0d, 0x97, 0xef, 0x3c, 0xfe, 0xe2, 0x00, 0x83, 0xd8, 0x3c, 0xd4, 0xe4, 0x23, 0xb7, 0x6d, 0x02, // ...<.....<..#.m. + 0xd5, 0x70, 0xf9, 0xce, 0xe3, 0x4b, 0x93, 0x13, 0x11, 0x28, 0x35, 0x3d, 0xd4, 0xe4, 0x17, 0xb7, // .p...K...(5=.... + 0x6d, 0x00, 0x04, 0x03, 0x20, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x41, // m... .........HA + 0x53, 0x48, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x4e, 0xf1, 0xbd, 0xd9, 0x90, // SH.........N.... + 0xc7, 0x3f, 0xcd, 0x6d, 0xb5, 0x4f, 0xf7, 0xae, 0x64, 0x02, 0x44, 0x58, 0x49, 0x4c, 0xec, 0x04, // .?.m.O..d.DXIL.. + 0x00, 0x00, 0x60, 0x00, 0x01, 0x00, 0x3b, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, // ..`...;...DXIL.. + 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xd4, 0x04, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, // ..........BC..!. + 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, // ..2..... ....... + 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39, 0x92, 0x01, // ....#.A..I..29.. + 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x10, 0x45, 0x02, 0x42, 0x92, // ..%......b..E.B. + 0x0b, 0x42, 0x84, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x42, 0x88, 0x48, 0x90, // .B..2.8..K.2B.H. + 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90, 0x11, 0x22, // . CF....2B.H..." + 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x21, 0x46, 0x06, 0x51, 0x18, // .PAQ.......!F.Q. + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, // ..............@. + 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x01, 0x00, 0x00, 0x00, 0x49, 0x18, // ......... ....I. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x00, 0x00, 0x00, 0x89, 0x20, // ........`B .... + 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x32, 0x22, 0x08, 0x09, 0x20, 0x64, 0x85, 0x04, 0x13, 0x22, // ......2".. d..." + 0xa4, 0x84, 0x04, 0x13, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x88, 0x8c, 0x0b, 0x84, // ...."......L.... + 0x84, 0x4c, 0x10, 0x34, 0x23, 0x00, 0x25, 0x00, 0x8a, 0x39, 0x02, 0x30, 0x98, 0x23, 0x40, 0x8a, // .L.4#.%..9.0.#@. + 0x31, 0x33, 0x43, 0x43, 0x35, 0x03, 0x50, 0x0c, 0x98, 0x19, 0x3a, 0xc2, 0x81, 0x80, 0x1c, 0x98, // 13CC5.P...:..... + 0x39, 0x82, 0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, // 9.......r..t`.6h + 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, // .yh.r....P.m..zP + 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, // .m..z0.r..s .m.. + 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, // q..s .m..x..s .m + 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, // ..q`.z0.r...0.r. + 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, // .s .m..v@.z`.t.. + 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, // ...v..s .m`.s .z + 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, // 0.r...`.t..v@.m. + 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, // .x..q`.z0.r..v@. + 0x43, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x05, // C.............<. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, // ...........y. .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x02, 0x01, 0x0b, 0x00, 0x00, 0x00, 0x32, 0x1e, // ..............2. + 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x9a, 0x12, 0x18, // ....L...&G..C... + 0x01, 0x28, 0x8a, 0x62, 0x28, 0x83, 0xf2, 0x20, 0x2a, 0x85, 0x12, 0x18, 0x01, 0x28, 0x89, 0x32, // .(.b(.. *....(.2 + 0x28, 0x04, 0xda, 0xb1, 0x86, 0x80, 0x18, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x45, 0x00, // (.........y...E. + 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, // ....L.F.....o..M + 0x0c, 0x24, 0xc6, 0x25, 0x06, 0xc6, 0x45, 0xc6, 0x06, 0xa6, 0xc6, 0x65, 0xe6, 0x06, 0x04, 0x65, // .$.%..E....e...e + 0x8c, 0x86, 0x0c, 0xc7, 0x8c, 0xc6, 0x2c, 0x27, 0x27, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x86, 0x61, // ......,''eC.L..a + 0x82, 0x30, 0x10, 0x1b, 0x84, 0x81, 0x98, 0x20, 0x0c, 0xc5, 0x06, 0x61, 0x30, 0x28, 0xd8, 0xcd, // .0..... ...a0(.. + 0x4d, 0x10, 0x06, 0x63, 0xc3, 0x80, 0x24, 0xc4, 0x04, 0x61, 0x79, 0x36, 0x04, 0xcb, 0x04, 0x41, // M..c..$..ay6...A + 0x00, 0x48, 0xb4, 0x85, 0xa5, 0xb9, 0x71, 0x99, 0xb2, 0xfa, 0xb2, 0x2a, 0x93, 0xa3, 0x2b, 0xc3, // .H....q....*..+. + 0x4b, 0x22, 0x9a, 0x20, 0x10, 0xc9, 0x04, 0x81, 0x50, 0x36, 0x04, 0xc4, 0x04, 0x81, 0x58, 0x26, // K". ....P6....X& + 0x08, 0xc3, 0xb1, 0x41, 0xa0, 0x86, 0x0d, 0x0b, 0xf1, 0x40, 0x91, 0x34, 0x0d, 0x11, 0x31, 0x55, // ...A.....@.4..1U + 0x1b, 0x02, 0x8b, 0xcb, 0x94, 0xd5, 0x17, 0xd4, 0xdb, 0x5c, 0x1a, 0x5d, 0xda, 0x9b, 0xdb, 0x04, // ...........].... + 0x81, 0x60, 0x26, 0x08, 0x44, 0x33, 0x41, 0x20, 0x9c, 0x09, 0xc2, 0x80, 0x6c, 0x10, 0x28, 0x6e, // .`&.D3A ....l.(n + 0xc3, 0x42, 0x60, 0x99, 0x26, 0x6d, 0xc3, 0x46, 0x4c, 0xdd, 0x86, 0xc0, 0xdb, 0x30, 0x5c, 0x1f, // .B`.&m.FL....0.. + 0xb0, 0xa1, 0x68, 0x1c, 0x30, 0x00, 0x80, 0x2a, 0x6c, 0x6c, 0x76, 0x6d, 0x2e, 0x69, 0x64, 0x65, // ..h.0..*llvm.ide + 0x6e, 0x74, 0x53, 0x82, 0xa0, 0x0a, 0x19, 0x9e, 0x8b, 0x5d, 0x99, 0xdc, 0x5c, 0xda, 0x9b, 0xdb, // ntS......]...... + 0x94, 0x80, 0x68, 0x42, 0x86, 0xe7, 0x62, 0x17, 0xc6, 0x66, 0x57, 0x26, 0x37, 0x25, 0x30, 0xea, // ..hB..b..fW&7%0. + 0x90, 0xe1, 0xb9, 0xcc, 0xa1, 0x85, 0x91, 0x95, 0xc9, 0x35, 0xbd, 0x91, 0x95, 0xb1, 0x4d, 0x09, // .........5....M. + 0x92, 0x3a, 0x64, 0x78, 0x2e, 0x76, 0x69, 0x65, 0x77, 0x49, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, // .:dx.viewIdState + 0x53, 0x82, 0xa5, 0x0e, 0x19, 0x9e, 0x4b, 0x99, 0x1b, 0x9d, 0x5c, 0x1e, 0xd4, 0x5b, 0x9a, 0x1b, // S.....K......[.. + 0xdd, 0xdc, 0x94, 0x00, 0x0c, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, // ......y...L...3. + 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, // .....f..=.C8...B + 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, // ..yx.s.q........ + 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, // ..3.B.......f0.= + 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, // .C8.....=.C=..=. + 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, // x.tp.{..yH.pp.zp + 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, // .vx.p .........0 + 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, // .n0.....P.3....! + 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, // ..!..a.f0.;..;.C + 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, // 9..<..<..;...v`. + 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, // {h.7h.rh.7..p..p + 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, // `.v(.v..vx.w.._. + 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, // .q..r..y..,..... + 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, // .....0.b........ + 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, // .....a..!.....a. + 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, // ..C9.C9.C9.C9..8 + 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, // .C8..;../..<..;. + 0x03, 0x3b, 0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87, 0x76, 0x80, // .;....!.|p.z(.v. + 0x87, 0x19, 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20, 0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, // ...C..... ...... + 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x00, 0x00, 0x00, 0x71, 0x20, // ........P.....q + 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x16, 0x30, 0x0d, 0x97, 0xef, 0x3c, 0xfe, 0xe2, 0x00, 0x83, // .......0...<.... + 0xd8, 0x3c, 0xd4, 0xe4, 0x23, 0xb7, 0x6d, 0x02, 0xd5, 0x70, 0xf9, 0xce, 0xe3, 0x4b, 0x93, 0x13, // .<..#.m..p...K.. + 0x11, 0x28, 0x35, 0x3d, 0xd4, 0xe4, 0x17, 0xb7, 0x6d, 0x00, 0x04, 0x03, 0x20, 0x0d, 0x00, 0x00, // .(5=....m... ... + 0x00, 0x00, 0x61, 0x20, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c, 0x10, 0x00, // ..a .. .....A,.. + 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x34, 0xa5, 0x50, 0x08, 0x33, 0x00, 0x45, 0x40, 0x54, 0x04, // ......4.P.3.E@T. + 0x74, 0x63, 0x04, 0x20, 0x08, 0x82, 0x24, 0x18, 0x8c, 0x11, 0x80, 0x20, 0x08, 0xe2, 0xbf, 0x30, // tc. ..$.... ...0 + 0x02, 0x30, 0x46, 0x00, 0x82, 0x20, 0x88, 0x7f, 0x00, 0x00, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, // .0F.. ....#....` + 0x50, 0x60, 0x48, 0x55, 0x39, 0xc7, 0x70, 0x43, 0x70, 0x81, 0xc1, 0x74, 0x83, 0x51, 0x04, 0xc3, // P`HU9.pCp..t.Q.. + 0x0d, 0x43, 0x02, 0x06, 0xd3, 0x0d, 0xc8, 0x11, 0x8c, 0x18, 0x24, 0x00, 0x08, 0x82, 0x01, 0xc2, // .C........$..... + 0x39, 0x9a, 0x36, 0x0d, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x80, 0x70, 0x8e, 0xa6, 0x51, 0xc1, // 9.6.#....`.p..Q. + 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x20, 0x9c, 0xa3, 0x69, 0xca, 0x31, 0x62, 0x90, 0x00, 0x20, // .A.. . ..i.1b.. + 0x08, 0x06, 0x08, 0xe7, 0x68, 0x5a, 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....hZd ........ + 0x00, 0x00, // .. +}; +static const uint8_t vs_resolve_depth_mtl[409] = +{ + 0x56, 0x53, 0x48, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // VSH............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, // ......y...#inclu + 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, // de .#include ..using + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, // namespace metal; + 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // ..struct xlatMtl + 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // Main_out.{. f + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // loat4 gl_Positio + 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, // n [[position]];. + 0x7d, 0x3b, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // };..vertex xlatM + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // tlMain_out xlatM + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x75, 0x69, 0x6e, 0x74, 0x20, 0x67, 0x6c, 0x5f, 0x56, // tlMain(uint gl_V + 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x5b, 0x5b, 0x76, 0x65, 0x72, // ertexIndex [[ver + 0x74, 0x65, 0x78, 0x5f, 0x69, 0x64, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tex_id]]).{. + 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, // xlatMtlMain_out + 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, // out = {};. ou + 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, // t.gl_Position = + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x28, 0x67, 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, // float4((gl_Verte + 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x75, 0x29, 0x20, 0x3f, 0x20, // xIndex == 1u) ? + 0x33, 0x2e, 0x30, 0x20, 0x3a, 0x20, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x28, 0x67, // 3.0 : (-1.0), (g + 0x6c, 0x5f, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x3d, 0x3d, // l_VertexIndex == + 0x20, 0x32, 0x75, 0x29, 0x20, 0x3f, 0x20, 0x33, 0x2e, 0x30, 0x20, 0x3a, 0x20, 0x28, 0x2d, 0x31, // 2u) ? 3.0 : (-1 + 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, // .0), 0.0, 1.0);. + 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, // return out;. + 0x7d, 0x0a, 0x0a, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00, // }........ +}; +extern const uint8_t* vs_resolve_depth_pssl; +extern const uint32_t vs_resolve_depth_pssl_size; diff --git a/src/vs_resolve_depth.sc b/src/vs_resolve_depth.sc new file mode 100644 index 000000000..4bb9b7e06 --- /dev/null +++ b/src/vs_resolve_depth.sc @@ -0,0 +1,11 @@ +/* + * Copyright 2011-2026 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE + */ + +#include "bgfx_shader.sh" + +void main() +{ + gl_Position = vec4(gl_VertexID == 1 ? 3.0 : -1.0, gl_VertexID == 2 ? 3.0 : -1.0, 0.0, 1.0); +} diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index 0147fc747..d6d623e40 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -14,7 +14,7 @@ #include namespace stl = tinystl; -#define BGFX_SHADER_BIN_VERSION 12 +#define BGFX_SHADER_BIN_VERSION 13 #define BGFX_CHUNK_MAGIC_CSH BX_MAKEFOURCC('C', 'S', 'H', BGFX_SHADER_BIN_VERSION) #define BGFX_CHUNK_MAGIC_FSH BX_MAKEFOURCC('F', 'S', 'H', BGFX_SHADER_BIN_VERSION) #define BGFX_CHUNK_MAGIC_VSH BX_MAKEFOURCC('V', 'S', 'H', BGFX_SHADER_BIN_VERSION) @@ -399,7 +399,7 @@ namespace bgfx return UniformType::Count; } - uint8_t spirvDimToTextureDimensionId(uint32_t _dim, bool _arrayed) + uint8_t spirvDimToTextureDimensionId(uint32_t _dim, bool _arrayed, bool _multisampled) { switch (_dim) { @@ -407,6 +407,14 @@ namespace bgfx return textureDimensionToId(TextureDimension::Dimension1D); case 1: // spv::Dim::Dim2D + if (_multisampled) + { + return textureDimensionToId(_arrayed + ? TextureDimension::Dimension2DMSArray + : TextureDimension::Dimension2DMS + ); + } + return textureDimensionToId(_arrayed ? TextureDimension::Dimension2DArray : TextureDimension::Dimension2D @@ -425,7 +433,7 @@ namespace bgfx break; } - return textureDimensionToId(TextureDimension::Count); + return 0; } int32_t writef(bx::WriterI* _writer, const char* _format, ...) diff --git a/tools/shaderc/shaderc.h b/tools/shaderc/shaderc.h index 1ab4f4c5a..8ef835bc9 100644 --- a/tools/shaderc/shaderc.h +++ b/tools/shaderc/shaderc.h @@ -102,9 +102,9 @@ namespace bgfx const char* getUniformTypeName(UniformType::Enum _enum); UniformType::Enum nameToUniformTypeEnum(const char* _name); - /// Converts a SPIR-V `spv::Dim` (plus the arrayed flag) into the texture + /// Converts a SPIR-V `spv::Dim` (plus the arrayed and multisampled flags) into the texture /// dimension id stored in `Uniform::texDimension`. - uint8_t spirvDimToTextureDimensionId(uint32_t _dim, bool _arrayed); + uint8_t spirvDimToTextureDimensionId(uint32_t _dim, bool _arrayed, bool _multisampled); struct Uniform { diff --git a/tools/shaderc/shaderc_dxil.cpp b/tools/shaderc/shaderc_dxil.cpp index 914333383..7170b6507 100644 --- a/tools/shaderc/shaderc_dxil.cpp +++ b/tools/shaderc/shaderc_dxil.cpp @@ -170,13 +170,17 @@ namespace bgfx { namespace dxil return TextureDimension::Dimension1D; case D3D_SRV_DIMENSION_TEXTURE2D: - case D3D_SRV_DIMENSION_TEXTURE2DMS: return TextureDimension::Dimension2D; case D3D_SRV_DIMENSION_TEXTURE2DARRAY: - case D3D_SRV_DIMENSION_TEXTURE2DMSARRAY: return TextureDimension::Dimension2DArray; + case D3D_SRV_DIMENSION_TEXTURE2DMS: + return TextureDimension::Dimension2DMS; + + case D3D_SRV_DIMENSION_TEXTURE2DMSARRAY: + return TextureDimension::Dimension2DMSArray; + case D3D_SRV_DIMENSION_TEXTURE3D: return TextureDimension::Dimension3D; @@ -387,7 +391,14 @@ namespace bgfx { namespace dxil BX_TRACE("Bound:"); - std::unordered_map textureDimension; + struct TextureBinding + { + uint8_t dimension; + uint16_t regIndex; + uint16_t regCount; + }; + + std::unordered_map textureBinding; for (uint32_t ii = 0; ii < desc.BoundResources; ++ii) { @@ -402,8 +413,12 @@ namespace bgfx { namespace dxil if (!end.isEmpty() && TextureDimension::Count != dimension) { - textureDimension[std::string(bindDesc.Name, end.getPtr() - bindDesc.Name)] = - textureDimensionToId(dimension); + textureBinding[std::string(bindDesc.Name, end.getPtr() - bindDesc.Name)] = + { + .dimension = textureDimensionToId(dimension), + .regIndex = uint16_t(bindDesc.BindPoint), + .regCount = uint16_t(bindDesc.BindCount), + }; } } } @@ -443,11 +458,12 @@ namespace bgfx { namespace dxil un.regIndex = uint16_t(bindDesc.BindPoint); un.regCount = uint16_t(bindDesc.BindCount); - const auto it = textureDimension.find(un.name); + const auto it = textureBinding.find(un.name); - if (it != textureDimension.end() ) + if (it != textureBinding.end() ) { - un.texDimension = it->second; + un.texDimension = it->second.dimension; + textureBinding.erase(it); } _uniforms.push_back(un); @@ -456,6 +472,39 @@ namespace bgfx { namespace dxil } } + for (uint32_t ii = 0; ii < desc.BoundResources; ++ii) + { + D3D12_SHADER_INPUT_BIND_DESC bindDesc; + + if (SUCCEEDED(_shaderReflection->GetResourceBindingDesc(ii, &bindDesc) ) + && D3D_SIT_TEXTURE == bindDesc.Type) + { + const bx::StringView end = bx::strFind(bindDesc.Name, "Texture"); + + if (end.isEmpty() ) + { + continue; + } + + const std::string name(bindDesc.Name, end.getPtr() - bindDesc.Name); + const auto it = textureBinding.find(name); + + if (it != textureBinding.end() ) + { + Uniform un; + un.name = name; + un.type = UniformType::Enum(kUniformSamplerBit | UniformType::Sampler); + un.num = 1; + un.regIndex = it->second.regIndex; + un.regCount = it->second.regCount; + un.texDimension = it->second.dimension; + + _uniforms.push_back(un); + textureBinding.erase(it); + } + } + } + return true; } diff --git a/tools/shaderc/shaderc_glsl.cpp b/tools/shaderc/shaderc_glsl.cpp index f08f7a865..134b1cce4 100644 --- a/tools/shaderc/shaderc_glsl.cpp +++ b/tools/shaderc/shaderc_glsl.cpp @@ -344,7 +344,7 @@ namespace bgfx { namespace glsl un.num = 1; un.regIndex = 0; un.regCount = 1; - un.texDimension = spirvDimToTextureDimensionId(uint32_t(type.image.dim), type.image.arrayed); + un.texDimension = spirvDimToTextureDimensionId(uint32_t(type.image.dim), type.image.arrayed, type.image.ms); uniforms.push_back(un); } diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index 6290bfe5c..f4a866f6b 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -324,13 +324,17 @@ namespace bgfx { namespace hlsl return TextureDimension::Dimension1D; case D3D_SRV_DIMENSION_TEXTURE2D: - case D3D_SRV_DIMENSION_TEXTURE2DMS: return TextureDimension::Dimension2D; case D3D_SRV_DIMENSION_TEXTURE2DARRAY: - case D3D_SRV_DIMENSION_TEXTURE2DMSARRAY: return TextureDimension::Dimension2DArray; + case D3D_SRV_DIMENSION_TEXTURE2DMS: + return TextureDimension::Dimension2DMS; + + case D3D_SRV_DIMENSION_TEXTURE2DMSARRAY: + return TextureDimension::Dimension2DMSArray; + case D3D_SRV_DIMENSION_TEXTURE3D: return TextureDimension::Dimension3D; @@ -477,7 +481,14 @@ namespace bgfx { namespace hlsl BX_TRACE("Bound:"); - std::unordered_map textureDimension; + struct TextureBinding + { + uint8_t dimension; + uint16_t regIndex; + uint16_t regCount; + }; + + std::unordered_map textureBinding; for (uint32_t ii = 0; ii < desc.BoundResources; ++ii) { @@ -492,8 +503,12 @@ namespace bgfx { namespace hlsl if (!end.isEmpty() && TextureDimension::Count != dimension) { - textureDimension[std::string(bindDesc.Name, end.getPtr() - bindDesc.Name)] = - textureDimensionToId(dimension); + textureBinding[std::string(bindDesc.Name, end.getPtr() - bindDesc.Name)] = + { + .dimension = textureDimensionToId(dimension), + .regIndex = uint16_t(bindDesc.BindPoint), + .regCount = uint16_t(bindDesc.BindCount), + }; } } } @@ -533,11 +548,12 @@ namespace bgfx { namespace hlsl un.regIndex = uint16_t(bindDesc.BindPoint); un.regCount = uint16_t(bindDesc.BindCount); - const auto it = textureDimension.find(un.name); + const auto it = textureBinding.find(un.name); - if (it != textureDimension.end() ) + if (it != textureBinding.end() ) { - un.texDimension = it->second; + un.texDimension = it->second.dimension; + textureBinding.erase(it); } _uniforms.push_back(un); @@ -546,6 +562,39 @@ namespace bgfx { namespace hlsl } } + for (uint32_t ii = 0; ii < desc.BoundResources; ++ii) + { + D3D11_SHADER_INPUT_BIND_DESC bindDesc; + + if (SUCCEEDED(reflect->GetResourceBindingDesc(ii, &bindDesc) ) + && D3D_SIT_TEXTURE == bindDesc.Type) + { + const bx::StringView end = bx::strFind(bindDesc.Name, "Texture"); + + if (end.isEmpty() ) + { + continue; + } + + const std::string name(bindDesc.Name, end.getPtr() - bindDesc.Name); + const auto it = textureBinding.find(name); + + if (it != textureBinding.end() ) + { + Uniform un; + un.name = name; + un.type = UniformType::Enum(kUniformSamplerBit | UniformType::Sampler); + un.num = 1; + un.regIndex = it->second.regIndex; + un.regCount = it->second.regCount; + un.texDimension = it->second.dimension; + + _uniforms.push_back(un); + textureBinding.erase(it); + } + } + } + if (NULL != reflect) { reflect->Release(); diff --git a/tools/shaderc/shaderc_metal.cpp b/tools/shaderc/shaderc_metal.cpp index 640922ccb..022bb3b94 100644 --- a/tools/shaderc/shaderc_metal.cpp +++ b/tools/shaderc/shaderc_metal.cpp @@ -662,7 +662,7 @@ namespace bgfx { namespace metal un.num = 0; // needed? un.regIndex = 0; // needed? un.regCount = 0; // needed? - un.texDimension = spirvDimToTextureDimensionId(uint32_t(type.image.dim), type.image.arrayed); + un.texDimension = spirvDimToTextureDimensionId(uint32_t(type.image.dim), type.image.arrayed, type.image.ms); uniforms.push_back(un); } diff --git a/tools/shaderc/shaderc_spirv.cpp b/tools/shaderc/shaderc_spirv.cpp index 1738e0105..4db1817e0 100644 --- a/tools/shaderc/shaderc_spirv.cpp +++ b/tools/shaderc/shaderc_spirv.cpp @@ -201,13 +201,21 @@ namespace bgfx { namespace spirv } } - bgfx::TextureDimension::Enum SpirvDimToTextureViewDimension(spv::Dim _dim, bool _arrayed) + bgfx::TextureDimension::Enum SpirvDimToTextureViewDimension(spv::Dim _dim, bool _arrayed, bool _multisampled) { switch (_dim) { case spv::Dim::Dim1D: return bgfx::TextureDimension::Dimension1D; case spv::Dim::Dim2D: + if (_multisampled) + { + return _arrayed + ? bgfx::TextureDimension::Dimension2DMSArray + : bgfx::TextureDimension::Dimension2DMS + ; + } + return _arrayed ? bgfx::TextureDimension::Dimension2DArray : bgfx::TextureDimension::Dimension2D @@ -806,7 +814,7 @@ namespace bgfx { namespace spirv ); un.texComponent = textureComponentTypeToId(SpirvCrossBaseTypeToFormatType(componentType, imageType.depth) ); - un.texDimension = textureDimensionToId(SpirvDimToTextureViewDimension(imageType.dim, imageType.arrayed) ); + un.texDimension = textureDimensionToId(SpirvDimToTextureViewDimension(imageType.dim, imageType.arrayed, imageType.ms) ); un.texFormat = uint16_t(s_textureFormats[imageType.format]); un.regIndex = uint16_t(binding_index); @@ -835,7 +843,7 @@ namespace bgfx { namespace spirv un.type = type; un.texComponent = textureComponentTypeToId(SpirvCrossBaseTypeToFormatType(componentType, imageType.depth) ); - un.texDimension = textureDimensionToId(SpirvDimToTextureViewDimension(imageType.dim, imageType.arrayed) ); + un.texDimension = textureDimensionToId(SpirvDimToTextureViewDimension(imageType.dim, imageType.arrayed, imageType.ms) ); un.texFormat = uint16_t(s_textureFormats[imageType.format]); un.regIndex = uint16_t(binding_index); diff --git a/tools/shaderc/shaderc_wgsl.cpp b/tools/shaderc/shaderc_wgsl.cpp index 2ae73a60d..30bca84ae 100644 --- a/tools/shaderc/shaderc_wgsl.cpp +++ b/tools/shaderc/shaderc_wgsl.cpp @@ -7,8 +7,6 @@ #if SHADERC_CONFIG_HAS_TINT && SHADERC_CONFIG_HAS_GLSLANG -#include // std::cout - BX_PRAGMA_DIAGNOSTIC_PUSH() BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4100) // error C4100: 'inclusionDepth' : unreferenced formal parameter BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4265) // error C4265: 'spv::spirvbin_t': class has virtual functions, but destructor is not virtual @@ -190,15 +188,24 @@ namespace bgfx { namespace wgsl return bgfx::TextureComponentType::Float; } - bgfx::TextureDimension::Enum spirvDimToTextureViewDimension(spv::Dim _dim, bool _textureArray) + bgfx::TextureDimension::Enum spirvDimToTextureViewDimension(spv::Dim _dim, bool _textureArray, bool _multisampled) { switch (_dim) { case spv::Dim::Dim1D: return bgfx::TextureDimension::Dimension1D; - case spv::Dim::Dim2D: return _textureArray - ? bgfx::TextureDimension::Dimension2DArray - : bgfx::TextureDimension::Dimension2D - ; + case spv::Dim::Dim2D: + if (_multisampled) + { + return _textureArray + ? bgfx::TextureDimension::Dimension2DMSArray + : bgfx::TextureDimension::Dimension2DMS + ; + } + + return _textureArray + ? bgfx::TextureDimension::Dimension2DArray + : bgfx::TextureDimension::Dimension2D + ; case spv::Dim::Dim3D: return bgfx::TextureDimension::Dimension3D; case spv::Dim::DimCube: return _textureArray @@ -831,7 +838,7 @@ namespace bgfx { namespace wgsl ); un.texComponent = textureComponentTypeToId(spirvCrossBaseTypeToFormatType(componentType, imageType.depth) ); - un.texDimension = textureDimensionToId(spirvDimToTextureViewDimension(imageType.dim, imageType.arrayed) ); + un.texDimension = textureDimensionToId(spirvDimToTextureViewDimension(imageType.dim, imageType.arrayed, imageType.ms) ); un.texFormat = uint16_t(s_textureFormats[imageType.format]); un.regIndex = uint16_t(binding_index); @@ -861,7 +868,7 @@ namespace bgfx { namespace wgsl un.type = type; un.texComponent = textureComponentTypeToId(spirvCrossBaseTypeToFormatType(componentType, imageType.depth) ); - un.texDimension = textureDimensionToId(spirvDimToTextureViewDimension(imageType.dim, imageType.arrayed) ); + un.texDimension = textureDimensionToId(spirvDimToTextureViewDimension(imageType.dim, imageType.arrayed, imageType.ms) ); un.texFormat = uint16_t(s_textureFormats[imageType.format]); un.texFormat |= 0 | (spv::AccessQualifierReadOnly == imageType.access ? kAccessRead : 0)