From b7d0751baa2463476668da2b87d80fd1e64ae3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 29 Oct 2026 16:54:09 -0700 Subject: [PATCH] Texture blit fixes. (#4106) --- bindings/bf/bgfx.bf | 8 + bindings/c3/bgfx.c3 | 8 + bindings/cs/bgfx.cs | 8 + bindings/d/package.d | 8 + .../java/io/github/bkaradzic/bgfx/Bgfx.java | 8 + bindings/py/bgfx.pyi | 8 + bindings/zig/bgfx.zig | 12 + include/bgfx/bgfx.h | 8 + include/bgfx/c99/bgfx.h | 8 + scripts/bgfx.idl | 8 + src/bgfx.cpp | 37 ++ src/bgfx_p.h | 2 + src/cs_blit_buffer_to_texture_uint.bin.h | 610 +++++++++++++++++ src/cs_blit_buffer_to_texture_uint.sc | 33 + src/cs_blit_texture_to_buffer_uint.bin.h | 615 ++++++++++++++++++ src/cs_blit_texture_to_buffer_uint.sc | 35 + src/makefile | 8 + src/renderer_d3d11.cpp | 227 ++++++- src/renderer_d3d12.cpp | 33 +- src/renderer_gl.cpp | 225 ++++++- src/renderer_mtl.cpp | 152 ++++- src/renderer_vk.cpp | 35 +- src/renderer_webgpu.cpp | 56 +- 23 files changed, 2063 insertions(+), 89 deletions(-) create mode 100644 src/cs_blit_buffer_to_texture_uint.bin.h create mode 100644 src/cs_blit_buffer_to_texture_uint.sc create mode 100644 src/cs_blit_texture_to_buffer_uint.bin.h create mode 100644 src/cs_blit_texture_to_buffer_uint.sc diff --git a/bindings/bf/bgfx.bf b/bindings/bf/bgfx.bf index 5bcf7eaeb..16a7e418e 100644 --- a/bindings/bf/bgfx.bf +++ b/bindings/bf/bgfx.bf @@ -5247,6 +5247,10 @@ public static class bgfx /// /// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. /// + /// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + /// be blitted whole: both sides start at the origin of mips of the same size, and + /// the copy covers the whole mip. + /// /// /// /// View id. @@ -5997,6 +6001,10 @@ public static class bgfx /// /// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. /// + /// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + /// be blitted whole: both sides start at the origin of mips of the same size, and + /// the copy covers the whole mip. + /// /// /// /// View id. diff --git a/bindings/c3/bgfx.c3 b/bindings/c3/bgfx.c3 index 63a70dea2..cab81bbc9 100644 --- a/bindings/c3/bgfx.c3 +++ b/bindings/c3/bgfx.c3 @@ -3778,6 +3778,10 @@ extern fn void encoder_discard(Encoder* _this, char _flags) @cname("bgfx_encoder // // @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. // +// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only +// be blitted whole: both sides start at the origin of mips of the same size, and +// the copy covers the whole mip. +// // _id : `View id.` // _dst : `Destination texture region.` // _src : `Source texture region.` @@ -4269,6 +4273,10 @@ extern fn void discard(char _flags) @cname("bgfx_discard"); // // @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. // +// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only +// be blitted whole: both sides start at the origin of mips of the same size, and +// the copy covers the whole mip. +// // _id : `View id.` // _dst : `Destination texture region.` // _src : `Source texture region.` diff --git a/bindings/cs/bgfx.cs b/bindings/cs/bgfx.cs index dbc536c98..559a09571 100644 --- a/bindings/cs/bgfx.cs +++ b/bindings/cs/bgfx.cs @@ -5194,6 +5194,10 @@ public static partial class bgfx /// /// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. /// + /// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + /// be blitted whole: both sides start at the origin of mips of the same size, and + /// the copy covers the whole mip. + /// /// /// /// View id. @@ -5944,6 +5948,10 @@ public static partial class bgfx /// /// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. /// + /// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + /// be blitted whole: both sides start at the origin of mips of the same size, and + /// the copy covers the whole mip. + /// /// /// /// View id. diff --git a/bindings/d/package.d b/bindings/d/package.d index de97102ee..96f4ee539 100644 --- a/bindings/d/package.d +++ b/bindings/d/package.d @@ -2465,6 +2465,10 @@ extern(C++, "bgfx") struct Encoder{ Attention: Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. + Attention: A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + be blitted whole: both sides start at the origin of mips of the same size, and + the copy covers the whole mip. + Params: id = View id. dst = Destination texture region. @@ -4611,6 +4615,10 @@ mixin(joinFnBinds((){ * * Attention: Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. * + * Attention: A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + * be blitted whole: both sides start at the origin of mips of the same size, and + * the copy covers the whole mip. + * Params: id = View id. dst = Destination texture region. diff --git a/bindings/java/io/github/bkaradzic/bgfx/Bgfx.java b/bindings/java/io/github/bkaradzic/bgfx/Bgfx.java index 094a87675..6be30e026 100644 --- a/bindings/java/io/github/bkaradzic/bgfx/Bgfx.java +++ b/bindings/java/io/github/bkaradzic/bgfx/Bgfx.java @@ -3309,6 +3309,10 @@ public final class Bgfx { * draw commands are executed after blit and compute commands. *

* Attention: Destination texture must be created with {@code BGFX_TEXTURE_BLIT_DST} flag. + *

+ * Attention: A depth texture, or one created with {@code BGFX_TEXTURE_MSAA_SAMPLE}, can only + * be blitted whole: both sides start at the origin of mips of the same size, and + * the copy covers the whole mip. * @param _id View id. * @param _dst Destination texture region. * @param _src Source texture region. @@ -13075,6 +13079,10 @@ public final class Bgfx { * draw commands are executed after blit and compute commands. *

* Attention: Destination texture must be created with {@code BGFX_TEXTURE_BLIT_DST} flag. + *

+ * Attention: A depth texture, or one created with {@code BGFX_TEXTURE_MSAA_SAMPLE}, can only + * be blitted whole: both sides start at the origin of mips of the same size, and + * the copy covers the whole mip. * @param _id View id. * @param _dst Destination texture region. * @param _src Source texture region. diff --git a/bindings/py/bgfx.pyi b/bindings/py/bgfx.pyi index c5d64d282..e91eb1e8b 100644 --- a/bindings/py/bgfx.pyi +++ b/bindings/py/bgfx.pyi @@ -3102,6 +3102,10 @@ def bgfx_encoder_discard(_this: Optional[Union[Encoder, _Pointer[Encoder], ctype # # @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. # +# @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only +# be blitted whole: both sides start at the origin of mips of the same size, and +# the copy covers the whole mip. +# def bgfx_encoder_blit(_this: Optional[Union[Encoder, _Pointer[Encoder], ctypes.Array]], _id: int, _dst: Optional[Union[TextureRegion, _Pointer[TextureRegion], ctypes.Array]], _src: Optional[Union[TextureRegion, _Pointer[TextureRegion], ctypes.Array]], /) -> None: ... # Blit buffer region between two buffers. @@ -3469,6 +3473,10 @@ def bgfx_discard(_flags: int, /) -> None: ... # # @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. # +# @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only +# be blitted whole: both sides start at the origin of mips of the same size, and +# the copy covers the whole mip. +# def bgfx_blit(_id: int, _dst: Optional[Union[TextureRegion, _Pointer[TextureRegion], ctypes.Array]], _src: Optional[Union[TextureRegion, _Pointer[TextureRegion], ctypes.Array]], /) -> None: ... # Blit buffer region between two buffers. diff --git a/bindings/zig/bgfx.zig b/bindings/zig/bgfx.zig index de5a59592..757c21349 100644 --- a/bindings/zig/bgfx.zig +++ b/bindings/zig/bgfx.zig @@ -2389,6 +2389,10 @@ pub const Init = extern struct { /// /// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. /// + /// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + /// be blitted whole: both sides start at the origin of mips of the same size, and + /// the copy covers the whole mip. + /// /// View id. /// Destination texture region. /// Source texture region. @@ -4188,6 +4192,10 @@ extern fn bgfx_encoder_discard(self: ?*Encoder, _flags: u8) void; /// /// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. /// +/// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only +/// be blitted whole: both sides start at the origin of mips of the same size, and +/// the copy covers the whole mip. +/// /// View id. /// Destination texture region. /// Source texture region. @@ -4823,6 +4831,10 @@ extern fn bgfx_discard(_flags: u8) void; /// /// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. /// +/// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only +/// be blitted whole: both sides start at the origin of mips of the same size, and +/// the copy covers the whole mip. +/// /// View id. /// Destination texture region. /// Source texture region. diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h index 8dbe2670c..34665ec88 100644 --- a/include/bgfx/bgfx.h +++ b/include/bgfx/bgfx.h @@ -2105,6 +2105,10 @@ namespace bgfx /// /// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. /// + /// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + /// be blitted whole: both sides start at the origin of mips of the same size, and + /// the copy covers the whole mip. + /// /// @attention C99's equivalent binding is `bgfx_encoder_blit`. /// void blit( @@ -5308,6 +5312,10 @@ namespace bgfx /// /// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. /// + /// @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + /// be blitted whole: both sides start at the origin of mips of the same size, and + /// the copy covers the whole mip. + /// /// @attention C99's equivalent binding is `bgfx_blit`. /// void blit( diff --git a/include/bgfx/c99/bgfx.h b/include/bgfx/c99/bgfx.h index 312e3296d..92117aecf 100644 --- a/include/bgfx/c99/bgfx.h +++ b/include/bgfx/c99/bgfx.h @@ -3718,6 +3718,10 @@ BGFX_C_API void bgfx_encoder_discard(bgfx_encoder_t* _this, uint8_t _flags); * * @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. * + * @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + * be blitted whole: both sides start at the origin of mips of the same size, and + * the copy covers the whole mip. + * * @param[in] _id View id. * @param[in] _dst Destination texture region. * @param[in] _src Source texture region. @@ -4450,6 +4454,10 @@ BGFX_C_API void bgfx_discard(uint8_t _flags); * * @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. * + * @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only + * be blitted whole: both sides start at the origin of mips of the same size, and + * the copy covers the whole mip. + * * @param[in] _id View id. * @param[in] _dst Destination texture region. * @param[in] _src Source texture region. diff --git a/scripts/bgfx.idl b/scripts/bgfx.idl index 24a324b20..9449cda09 100644 --- a/scripts/bgfx.idl +++ b/scripts/bgfx.idl @@ -3294,6 +3294,10 @@ func.Encoder.discard { section = "Miscellaneous" } --- --- @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. --- +--- @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only +--- be blitted whole: both sides start at the origin of mips of the same size, and +--- the copy covers the whole mip. +--- func.Encoder.blit { section = "Blit" } "void" .id "ViewId" --- View id. @@ -3965,6 +3969,10 @@ func.discard { section = "Miscellaneous" } --- --- @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag. --- +--- @attention A depth texture, or one created with `BGFX_TEXTURE_MSAA_SAMPLE`, can only +--- be blitted whole: both sides start at the origin of mips of the same size, and +--- the copy covers the whole mip. +--- func.blit { section = "Blit" } "void" .id "ViewId" --- View id. diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 6ccb43a90..6c7bb56f3 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -494,6 +494,8 @@ namespace bgfx #if BGFX_CONFIG_BLIT_FALLBACK # include "cs_blit_texture_to_buffer.bin.h" # include "cs_blit_buffer_to_texture.bin.h" +# include "cs_blit_texture_to_buffer_uint.bin.h" +# include "cs_blit_buffer_to_texture_uint.bin.h" #endif // BGFX_CONFIG_BLIT_FALLBACK static const EmbeddedShader s_embeddedShaders[] = @@ -530,6 +532,8 @@ namespace bgfx #if BGFX_CONFIG_BLIT_FALLBACK BGFX_EMBEDDED_SHADER(cs_blit_texture_to_buffer), BGFX_EMBEDDED_SHADER(cs_blit_buffer_to_texture), + BGFX_EMBEDDED_SHADER(cs_blit_texture_to_buffer_uint), + BGFX_EMBEDDED_SHADER(cs_blit_buffer_to_texture_uint), #endif // BGFX_CONFIG_BLIT_FALLBACK BGFX_EMBEDDED_SHADER_END() @@ -1098,6 +1102,8 @@ namespace bgfx { "cs_blit_texture_to_buffer", "cs_blit_buffer_to_texture", + "cs_blit_texture_to_buffer_uint", + "cs_blit_buffer_to_texture_uint", }; for (uint32_t ii = 0; ii < BX_COUNTOF(m_program); ++ii) @@ -5421,6 +5427,11 @@ namespace bgfx , dstWidth, dstHeight, dstDepth ); + const uint32_t srcMipWidth = srcWidth; + const uint32_t srcMipHeight = srcHeight; + const uint32_t dstMipWidth = dstWidth; + const uint32_t dstMipHeight = dstHeight; + srcWidth = clampRegionExtent(srcWidth, _src.x, _src.width ); srcHeight = clampRegionExtent(srcHeight, _src.y, _src.height); srcDepth = clampRegionExtent(srcDepth, _src.z, _src.depth ); @@ -5432,6 +5443,32 @@ namespace bgfx uint16_t height = uint16_t(bx::min(srcHeight, dstHeight) ); const uint16_t depth = uint16_t(bx::min(srcDepth, dstDepth) ); + if (false + || src.isDepth() + || dst.isDepth() + || 0 != ( (src.m_flags | dst.m_flags) & BGFX_TEXTURE_MSAA_SAMPLE) ) + { + const bool whole = true + && 0 == (_src.x | _src.y | _dst.x | _dst.y) + && srcMipWidth == dstMipWidth + && srcMipHeight == dstMipHeight + && width == srcMipWidth + && height == srcMipHeight + ; + + BX_ASSERT(whole + , "Blit of a depth or BGFX_TEXTURE_MSAA_SAMPLE texture must copy the whole mip (src %dx%d at (%d, %d), dst %dx%d at (%d, %d), size %dx%d)." + , srcMipWidth, srcMipHeight, _src.x, _src.y + , dstMipWidth, dstMipHeight, _dst.x, _dst.y + , width, height + ); + + if (!whole) + { + return; + } + } + alignTextureRegion(width, height, TextureFormat::Enum(src.m_format) ); const BlitItem item = diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 8ee20dcfe..a52723e64 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -1060,6 +1060,8 @@ namespace bgfx { TextureToBuffer, BufferToTexture, + TextureToBufferUint, + BufferToTextureUint, Count }; diff --git a/src/cs_blit_buffer_to_texture_uint.bin.h b/src/cs_blit_buffer_to_texture_uint.bin.h new file mode 100644 index 000000000..e7fee710a --- /dev/null +++ b/src/cs_blit_buffer_to_texture_uint.bin.h @@ -0,0 +1,610 @@ +static const uint8_t cs_blit_buffer_to_texture_uint_glsl[1087] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x09, 0x04, 0x00, 0x00, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, // .....layout(loca + 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x78, 0x20, 0x3d, 0x20, 0x38, 0x2c, 0x20, 0x6c, 0x6f, // l_size_x = 8, lo + 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x79, 0x20, 0x3d, 0x20, 0x38, 0x2c, 0x20, // cal_size_y = 8, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x7a, 0x20, 0x3d, 0x20, 0x31, // local_size_z = 1 + 0x29, 0x20, 0x69, 0x6e, 0x3b, 0x0a, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x62, 0x69, // ) in;..layout(bi + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x73, 0x74, 0x64, 0x34, 0x33, // nding = 0, std43 + 0x30, 0x29, 0x20, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x75, 0x66, 0x66, // 0) readonly buff + 0x65, 0x72, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x42, // er bgfx_blitSrcB + 0x75, 0x66, 0x66, 0x65, 0x72, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x76, 0x65, 0x63, // uffer.{. uvec + 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x5b, 0x5d, // 4 bgfx_blitSrc[] + 0x3b, 0x0a, 0x7d, 0x20, 0x5f, 0x39, 0x38, 0x3b, 0x0a, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // ;.} _98;..unifor + 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // m vec4 bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x32, 0x5d, 0x3b, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, // Region[2];.layou + 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, // t(location = 0, + 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x72, 0x67, 0x62, // binding = 0, rgb + 0x61, 0x33, 0x32, 0x75, 0x69, 0x29, 0x20, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x77, // a32ui) uniform w + 0x72, 0x69, 0x74, 0x65, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x75, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x32, // riteonly uimage2 + 0x44, 0x41, 0x72, 0x72, 0x61, 0x79, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // DArray bgfx_blit + 0x44, 0x73, 0x74, 0x3b, 0x0a, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, // Dst;..void main( + 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, // ).{. do. { + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x20, 0x5f, // . ivec3 _ + 0x31, 0x35, 0x20, 0x3d, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, // 15 = ivec3(gl_Gl + 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, // obalInvocationID + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x5f, // );. int _ + 0x32, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x31, 0x35, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 20 = _15.x;. + 0x20, 0x20, 0x20, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x20, 0x5f, 0x33, 0x33, 0x20, 0x3d, 0x20, // ivec3 _33 = + 0x69, 0x76, 0x65, 0x63, 0x33, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, // ivec3(bgfx_blitR + 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, // egion[1].xyz);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x5f, 0x33, 0x35, 0x20, // bool _35 + 0x3d, 0x20, 0x5f, 0x32, 0x30, 0x20, 0x3e, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x2e, 0x78, 0x3b, 0x0a, // = _20 >= _33.x;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x5f, 0x34, 0x38, // bool _48 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x21, 0x5f, // ;. if (!_ + 0x33, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // 35). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x38, 0x20, 0x3d, 0x20, // _48 = + 0x5f, 0x31, 0x35, 0x2e, 0x79, 0x20, 0x3e, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x2e, 0x79, 0x3b, 0x0a, // _15.y >= _33.y;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, // else. { + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x38, // . _48 + 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _35;. + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x5f, // }. bool _ + 0x36, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // 60;. if ( + 0x21, 0x5f, 0x34, 0x38, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // !_48). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x30, 0x20, // _60 + 0x3d, 0x20, 0x5f, 0x31, 0x35, 0x2e, 0x7a, 0x20, 0x3e, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x2e, 0x7a, // = _15.z >= _33.z + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // ;. }. + 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // {. _ + 0x36, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 60 = _48;. + 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // }. if ( + 0x5f, 0x36, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // _60). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, // break + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // ;. }. + 0x20, 0x20, 0x20, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x28, 0x62, // imageStore(b + 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x2c, 0x20, 0x69, 0x76, 0x65, // gfx_blitDst, ive + 0x63, 0x33, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, // c3(bgfx_blitRegi + 0x6f, 0x6e, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x5f, 0x31, 0x35, // on[0].xyz) + _15 + 0x2c, 0x20, 0x5f, 0x39, 0x38, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, // , _98.bgfx_blitS + 0x72, 0x63, 0x5b, 0x28, 0x28, 0x5f, 0x31, 0x35, 0x2e, 0x7a, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, // rc[((_15.z * int + 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, // (bgfx_blitRegion + 0x5b, 0x31, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x31, 0x35, 0x2e, 0x79, // [1].w)) + (_15.y + 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // * int(bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x30, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x29, 0x20, 0x2b, // Region[0].w))) + + 0x20, 0x5f, 0x32, 0x30, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _20]);. + 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, // break;. } whi + 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // le(false);.}... +}; +static const uint8_t cs_blit_buffer_to_texture_uint_essl[1093] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x0f, 0x04, 0x00, 0x00, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, // .....layout(loca + 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x78, 0x20, 0x3d, 0x20, 0x38, 0x2c, 0x20, 0x6c, 0x6f, // l_size_x = 8, lo + 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x79, 0x20, 0x3d, 0x20, 0x38, 0x2c, 0x20, // cal_size_y = 8, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x7a, 0x20, 0x3d, 0x20, 0x31, // local_size_z = 1 + 0x29, 0x20, 0x69, 0x6e, 0x3b, 0x0a, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x62, 0x69, // ) in;..layout(bi + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x73, 0x74, 0x64, 0x34, 0x33, // nding = 0, std43 + 0x30, 0x29, 0x20, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x75, 0x66, 0x66, // 0) readonly buff + 0x65, 0x72, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x42, // er bgfx_blitSrcB + 0x75, 0x66, 0x66, 0x65, 0x72, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x76, 0x65, 0x63, // uffer.{. uvec + 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x5b, 0x5d, // 4 bgfx_blitSrc[] + 0x3b, 0x0a, 0x7d, 0x20, 0x5f, 0x39, 0x38, 0x3b, 0x0a, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // ;.} _98;..unifor + 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // m vec4 bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x32, 0x5d, 0x3b, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, // Region[2];.layou + 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, // t(location = 0, + 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x72, 0x67, 0x62, // binding = 0, rgb + 0x61, 0x33, 0x32, 0x75, 0x69, 0x29, 0x20, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x77, // a32ui) uniform w + 0x72, 0x69, 0x74, 0x65, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x75, // riteonly highp u + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x32, 0x44, 0x41, 0x72, 0x72, 0x61, 0x79, 0x20, 0x62, 0x67, 0x66, // image2DArray bgf + 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x3b, 0x0a, 0x0a, 0x76, 0x6f, 0x69, 0x64, // x_blitDst;..void + 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, // main().{. do + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, // . {. i + 0x76, 0x65, 0x63, 0x33, 0x20, 0x5f, 0x31, 0x35, 0x20, 0x3d, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, // vec3 _15 = ivec3 + 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, // (gl_GlobalInvoca + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // tionID);. + 0x20, 0x69, 0x6e, 0x74, 0x20, 0x5f, 0x32, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x31, 0x35, 0x2e, 0x78, // int _20 = _15.x + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x20, // ;. ivec3 + 0x5f, 0x33, 0x33, 0x20, 0x3d, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x28, 0x62, 0x67, 0x66, 0x78, // _33 = ivec3(bgfx + 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x5d, 0x2e, 0x78, // _blitRegion[1].x + 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x6f, // yz);. boo + 0x6c, 0x20, 0x5f, 0x33, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x32, 0x30, 0x20, 0x3e, 0x3d, 0x20, 0x5f, // l _35 = _20 >= _ + 0x33, 0x33, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, // 33.x;. bo + 0x6f, 0x6c, 0x20, 0x5f, 0x34, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ol _48;. + 0x69, 0x66, 0x20, 0x28, 0x21, 0x5f, 0x33, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // if (!_35). + 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x5f, 0x34, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x31, 0x35, 0x2e, 0x79, 0x20, 0x3e, 0x3d, 0x20, 0x5f, // _48 = _15.y >= _ + 0x33, 0x33, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // 33.y;. }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x5f, 0x34, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x35, 0x3b, 0x0a, 0x20, 0x20, // _48 = _35;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x5f, 0x36, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // bool _60;. + 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x21, 0x5f, 0x34, 0x38, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // if (!_48). + 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x5f, 0x36, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x31, 0x35, 0x2e, 0x7a, 0x20, 0x3e, 0x3d, // _60 = _15.z >= + 0x20, 0x5f, 0x33, 0x33, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _33.z;. + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, // }. else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x38, 0x3b, 0x0a, // _60 = _48;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x36, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // if (_60). + 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x53, // }. imageS + 0x74, 0x6f, 0x72, 0x65, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, // tore(bgfx_blitDs + 0x74, 0x2c, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, // t, ivec3(bgfx_bl + 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, // itRegion[0].xyz) + 0x20, 0x2b, 0x20, 0x5f, 0x31, 0x35, 0x2c, 0x20, 0x5f, 0x39, 0x38, 0x2e, 0x62, 0x67, 0x66, 0x78, // + _15, _98.bgfx + 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x5b, 0x28, 0x28, 0x5f, 0x31, 0x35, 0x2e, 0x7a, // _blitSrc[((_15.z + 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // * int(bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x20, 0x2b, 0x20, // Region[1].w)) + + 0x28, 0x5f, 0x31, 0x35, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x62, 0x67, 0x66, // (_15.y * int(bgf + 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x30, 0x5d, 0x2e, // x_blitRegion[0]. + 0x77, 0x29, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x30, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // w))) + _20]);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, // break;. + 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, // } while(false); + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}... +}; +static const uint8_t cs_blit_buffer_to_texture_uint_spv[2081] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x01, 0x00, // ..bgfx_blitDst.. + 0x00, 0x02, 0x00, 0x03, 0x00, 0x02, 0x03, 0x54, 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, // .......T..bgfx_b + 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x41, 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, // litSrcA......... + 0x00, 0xb8, 0x07, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, // .......#........ + 0x00, 0xdc, 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, // .........GLSL.st + 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // d.450........... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x06, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x10, 0x00, 0x06, // .main....u...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // ................ + 0x00, 0x01, 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, 0x00, // .........main... + 0x00, 0x05, 0x00, 0x06, 0x00, 0x27, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // .....'...Uniform + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x27, 0x00, 0x00, // Block........'.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, // .....bgfx_blitRe + 0x67, 0x69, 0x6f, 0x6e, 0x00, 0x05, 0x00, 0x03, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // gion.....)...... + 0x00, 0x05, 0x00, 0x06, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, // ....._...bgfx_bl + 0x69, 0x74, 0x44, 0x73, 0x74, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x67, 0x00, 0x00, // itDst........g.. + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x00, 0x00, 0x00, // .bgfx_blitSrc... + 0x00, 0x06, 0x00, 0x05, 0x00, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x64, 0x61, // .....g.......@da + 0x74, 0x61, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x69, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta.......i...bgf + 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x08, // x_blitSrc....... + 0x00, 0x75, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, // .u...gl_GlobalIn + 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // vocationID...G.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .&...........G.. + 0x00, 0x27, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x27, 0x00, 0x00, // .'.......H...'.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .....#.......G.. + 0x00, 0x29, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .)...!.......G.. + 0x00, 0x29, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .)...".......G.. + 0x00, 0x5f, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5f, 0x00, 0x00, // ._.......G..._.. + 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5f, 0x00, 0x00, // .!.......G..._.. + 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x66, 0x00, 0x00, // .".......G...f.. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x67, 0x00, 0x00, // .........G...g.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....H...g...... + 0x00, 0x18, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....H...g...... + 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x69, 0x00, 0x00, // .#.......G...i.. + 0x00, 0x18, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // .....G...i...!.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, // .....G...i...".. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x75, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, // .....G...u...... + 0x00, 0x1c, 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, 0x19, 0x00, 0x09, 0x00, 0x07, 0x00, 0x00, // . .............. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, // ................ + 0x00, 0x09, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, // ..... .......... + 0x00, 0x0a, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, // ................ + 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .............+.. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, // ................ + 0x00, 0x23, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, // .#... .......$.. + 0x00, 0x23, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, // .#.......+...... + 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, // .%...........&.. + 0x00, 0x24, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x27, 0x00, 0x00, // .$...%.......'.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .&... ...(...... + 0x00, 0x27, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, // .'...;...(...).. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .....+.......*.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // .....+.......+.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .........,...#.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ..... ...-...... + 0x00, 0x24, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x33, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .$.......3...+.. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .....5.......+.. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .....N....... .. + 0x00, 0x4f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .O.......#... .. + 0x00, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .^...........;.. + 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x03, // .^..._.......... + 0x00, 0x66, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x67, 0x00, 0x00, // .f...........g.. + 0x00, 0x66, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x68, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .f... ...h...... + 0x00, 0x67, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x68, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, // .g...;...h...i.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ..... ...o...... + 0x00, 0x0c, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ..... ...t...... + 0x00, 0x0a, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x74, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, // .....;...t...u.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xdb, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ..... .......... + 0x00, 0x09, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .....6.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, // ................ + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, // .=.......v...u.. + 0x00, 0xf7, 0x00, 0x03, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, // ................ + 0x00, 0x1f, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x9b, 0x00, 0x00, // ................ + 0x00, 0x41, 0x00, 0x05, 0x00, 0xdb, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, // .A...........u.. + 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, // .....=.......... + 0x00, 0x9d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, // .....A...-...... + 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .)...*...+...=.. + 0x00, 0x24, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, // .$...........O.. + 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, // .,.............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, // .............n.. + 0x00, 0x0a, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, // .............Q.. + 0x00, 0x09, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0xaf, 0x00, 0x05, 0x00, 0x33, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, // .....3.......... + 0x00, 0xa3, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, // .....A.......... + 0x00, 0x75, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, // .u...5...=...... + 0x00, 0xa6, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, // .........Q...... + 0x00, 0xab, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x05, // ................ + 0x00, 0x33, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, // .3.............. + 0x00, 0xa6, 0x00, 0x05, 0x00, 0x33, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, // .....3.......... + 0x00, 0xac, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0xdb, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, // .....A.......... + 0x00, 0x75, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, // .u...%...=...... + 0x00, 0xaf, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, // .........Q...... + 0x00, 0xb4, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x05, // ................ + 0x00, 0x33, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, // .3.............. + 0x00, 0xa6, 0x00, 0x05, 0x00, 0x33, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, // .....3.......... + 0x00, 0xb5, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0xfa, 0x00, 0x04, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xb7, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb7, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xd4, 0x00, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x4f, 0x00, 0x00, // .........A...O.. + 0x00, 0xbb, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // .....)...*...+.. + 0x00, 0x4e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, // .N...=...#...... + 0x00, 0xbb, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, // .....n.......... + 0x00, 0xbc, 0x00, 0x00, 0x00, 0x84, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, // ................ + 0x00, 0xaf, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x4f, 0x00, 0x00, // .........A...O.. + 0x00, 0xc1, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .....)...*...*.. + 0x00, 0x4e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, // .N...=...#...... + 0x00, 0xc1, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, // .....n.......... + 0x00, 0xc2, 0x00, 0x00, 0x00, 0x84, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, // ................ + 0x00, 0xa6, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, // ................ + 0x00, 0xc5, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, // ................ + 0x00, 0x09, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, // ................ + 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, // .A...-.......).. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, // .*...*...=...$.. + 0x00, 0xca, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x2c, 0x00, 0x00, // .........O...,.. + 0x00, 0xcb, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, // .........n...... + 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, // ................ + 0x00, 0xce, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .........v...=.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // ........._...A.. + 0x00, 0x6f, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .o.......i...*.. + 0x00, 0xc8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, // .....=.......... + 0x00, 0xd1, 0x00, 0x00, 0x00, 0x63, 0x00, 0x04, 0x00, 0xd0, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, // .....c.......... + 0x00, 0xd2, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xd4, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0xd4, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // .........8..... + 0x00, // . +}; +static const uint8_t cs_blit_buffer_to_texture_uint_wgsl[1172] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x01, 0x00, // ..bgfx_blitDst.. + 0x00, 0x02, 0x00, 0x03, 0x00, 0x02, 0x03, 0x54, 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, // .......T..bgfx_b + 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x41, 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, // litSrcA......... + 0x00, 0x29, 0x04, 0x00, 0x00, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x28, // .)...diagnostic( + 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, // off, derivative_ + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x74, 0x79, 0x29, 0x3b, 0x0a, 0x64, 0x69, 0x61, // uniformity);.dia + 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x28, 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x73, 0x75, 0x62, // gnostic(off, sub + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x74, 0x79, // group_uniformity + 0x29, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x55, 0x6e, 0x69, 0x66, 0x6f, // );..struct Unifo + 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x62, 0x67, 0x66, 0x78, // rmBlock {. bgfx + 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x20, 0x3a, 0x20, 0x61, 0x72, // _blitRegion : ar + 0x72, 0x61, 0x79, 0x3c, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x20, 0x32, // ray, 2 + 0x75, 0x3e, 0x2c, 0x0a, 0x7d, 0x0a, 0x0a, 0x40, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x28, 0x30, 0x75, // u>,.}..@group(0u + 0x29, 0x20, 0x40, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x28, 0x30, 0x75, 0x29, 0x20, 0x76, // ) @binding(0u) v + 0x61, 0x72, 0x3c, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x3e, 0x20, 0x76, 0x20, 0x3a, 0x20, // ar v : + 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0a, 0x0a, 0x40, // UniformBlock;..@ + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x28, 0x30, 0x75, 0x29, 0x20, 0x40, 0x62, 0x69, 0x6e, 0x64, 0x69, // group(0u) @bindi + 0x6e, 0x67, 0x28, 0x32, 0x75, 0x29, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // ng(2u) var bgfx_ + 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x20, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // blitDst : textur + 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x32, 0x64, 0x5f, 0x61, 0x72, 0x72, // e_storage_2d_arr + 0x61, 0x79, 0x3c, 0x72, 0x67, 0x62, 0x61, 0x33, 0x32, 0x75, 0x69, 0x6e, 0x74, 0x2c, 0x20, 0x77, // ay;..struct b + 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x20, 0x7b, 0x0a, 0x20, 0x20, // gfx_blitSrc {. + 0x6d, 0x20, 0x3a, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x75, // m : array>,.}..@group( + 0x30, 0x75, 0x29, 0x20, 0x40, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x28, 0x33, 0x75, 0x29, // 0u) @binding(3u) + 0x20, 0x76, 0x61, 0x72, 0x3c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x72, 0x65, // var bgfx_blitSrc + 0x5f, 0x31, 0x20, 0x3a, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, // _1 : bgfx_blitSr + 0x63, 0x3b, 0x0a, 0x0a, 0x40, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x40, 0x77, 0x6f, // c;..@compute @wo + 0x72, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x28, 0x38, 0x75, 0x2c, // rkgroup_size(8u, + 0x20, 0x38, 0x75, 0x2c, 0x20, 0x31, 0x75, 0x29, 0x0a, 0x66, 0x6e, 0x20, 0x6d, 0x61, 0x69, 0x6e, // 8u, 1u).fn main + 0x28, 0x40, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, // (@builtin(global + 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x29, 0x20, // _invocation_id) + 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, // gl_GlobalInvocat + 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x20, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x75, 0x33, 0x32, // ionID : vec3) {. let v_1 = + 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x69, 0x33, 0x32, 0x3e, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, // vec3(gl_Gl + 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, // obalInvocationID + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x28, 0x30, 0x75, 0x29, 0x20, // );. switch(0u) + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x20, 0x7b, // {. default: { + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x76, 0x5f, 0x32, 0x20, 0x3d, // . let v_2 = + 0x20, 0x76, 0x5f, 0x31, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, // v_1.x;. le + 0x74, 0x20, 0x76, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x69, 0x33, 0x32, // t v_3 = vec3(v.bgfx_blitReg + 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x69, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ion[1i].xyz);. + 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x76, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x76, 0x5f, // let v_4 = v_ + 0x31, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x76, // 1.y;. let v + 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x31, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // _5 = v_1.z;. + 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x32, 0x20, 0x3e, 0x3d, 0x20, // if ((((v_2 >= + 0x76, 0x5f, 0x33, 0x2e, 0x78, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x76, 0x5f, 0x34, 0x20, 0x3e, 0x3d, // v_3.x) | (v_4 >= + 0x20, 0x76, 0x5f, 0x33, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x76, 0x5f, 0x35, 0x20, // v_3.y)) | (v_5 + 0x3e, 0x3d, 0x20, 0x76, 0x5f, 0x33, 0x2e, 0x7a, 0x29, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, // >= v_3.z))) {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, // break;. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x76, // }. let v + 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x35, 0x20, 0x2a, 0x20, 0x69, 0x33, // _6 = (((v_5 * i3 + 0x32, 0x28, 0x76, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, // 2(v.bgfx_blitReg + 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x69, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x76, // ion[1i].w)) + (v + 0x5f, 0x34, 0x20, 0x2a, 0x20, 0x69, 0x33, 0x32, 0x28, 0x76, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, // _4 * i32(v.bgfx_ + 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x30, 0x69, 0x5d, 0x2e, 0x77, // blitRegion[0i].w + 0x29, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x76, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ))) + v_2);. + 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x76, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x65, 0x63, // let v_7 = (vec + 0x33, 0x3c, 0x69, 0x33, 0x32, 0x3e, 0x28, 0x76, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, // 3(v.bgfx_bl + 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x30, 0x69, 0x5d, 0x2e, 0x78, 0x79, 0x7a, // itRegion[0i].xyz + 0x29, 0x20, 0x2b, 0x20, 0x76, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ) + v_1);. + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x28, 0x62, 0x67, 0x66, // textureStore(bgf + 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x2c, 0x20, 0x76, 0x5f, 0x37, 0x2e, 0x78, // x_blitDst, v_7.x + 0x79, 0x2c, 0x20, 0x76, 0x5f, 0x37, 0x2e, 0x7a, 0x2c, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, // y, v_7.z, bgfx_b + 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x5f, 0x31, 0x2e, 0x6d, 0x5b, 0x76, 0x5f, 0x36, 0x5d, 0x29, // litSrc_1.m[v_6]) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x7d, 0x0a, 0x00, 0x00, // ;. }. }.}... + 0x20, 0x00, 0x20, 0x00, // . . +}; +static const uint8_t cs_blit_buffer_to_texture_uint_dxbc[581] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x0c, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x95, 0x6a, 0x9d, 0x8d, 0x8e, 0x9f, 0xaf, // .....DXBC.j..... + 0xd6, 0xb8, 0x44, 0x05, 0x98, 0x85, 0x4c, 0x74, 0x29, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, // ..D...Lt)....... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, // .....,...<...L.. + 0x00, 0x49, 0x53, 0x47, 0x4e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISGN........... + 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .OSGN........... + 0x00, 0x53, 0x48, 0x45, 0x58, 0xb8, 0x01, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x6e, 0x00, 0x00, // .SHEX....P...n.. + 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .j...Y...F. .... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x58, 0x08, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, // .....X....p..... + 0x00, 0x44, 0x44, 0x00, 0x00, 0x9c, 0x40, 0x00, 0x04, 0x00, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00, // .DD...@......... + 0x00, 0x44, 0x44, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x02, 0x72, 0x00, 0x02, 0x00, 0x68, 0x00, 0x00, // .DD.._...r...h.. + 0x02, 0x02, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x04, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .........r...... + 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // .F. .........!.. + 0x06, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x02, 0x00, 0x46, 0x02, 0x10, // .r.......F...F.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....<.......... + 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, // .<...........*.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x04, // ................ + 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, // .........>...... + 0x01, 0x1b, 0x00, 0x00, 0x06, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, // .............:. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x06, 0xf2, 0x00, 0x10, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x89, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....6. ........ + 0x00, 0x26, 0x00, 0x00, 0x07, 0x00, 0xd0, 0x00, 0x00, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .&......."...... + 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x23, 0x00, 0x00, // .............#.. + 0x08, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x10, // .........*...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // ................ + 0x06, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x0a, 0x00, 0x02, 0x00, 0x1e, 0x00, 0x00, 0x06, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x96, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0a, 0x02, 0x00, 0x2d, 0x00, 0x00, // .........F...-.. + 0x89, 0x42, 0x00, 0x00, 0x80, 0x03, 0x11, 0x11, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .B.............. + 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, // .........F~..... + 0x00, 0xa4, 0x00, 0x00, 0x07, 0xf2, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .............F.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, // .....F.......>.. + 0x01, 0x00, 0x00, 0x20, 0x00, // ... . +}; +static const uint8_t cs_blit_buffer_to_texture_uint_dxil[2177] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x48, 0x08, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x14, 0x24, 0xbc, 0x58, 0x54, 0xd0, 0x45, // .H...DXBC.$.XT.E + 0xa7, 0xba, 0xb9, 0xf5, 0x65, 0xb7, 0x17, 0x36, 0xee, 0x01, 0x00, 0x00, 0x00, 0x48, 0x08, 0x00, // ....e..6.....H.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, // .....<...L...... + 0x00, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x60, 0x01, 0x00, // .l.......D...`.. + 0x00, 0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .SFI0........... + 0x00, 0x49, 0x53, 0x47, 0x31, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISG1........... + 0x00, 0x4f, 0x53, 0x47, 0x31, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .OSG1........... + 0x00, 0x50, 0x53, 0x56, 0x30, 0x9c, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .PSV0....8...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0xff, 0xff, 0xff, 0xff, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x4c, 0x44, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, // .....ILDN,.....$ + 0x00, 0x35, 0x31, 0x62, 0x36, 0x39, 0x34, 0x34, 0x63, 0x35, 0x34, 0x64, 0x64, 0x61, 0x38, 0x39, // .51b6944c54dda89 + 0x38, 0x66, 0x31, 0x39, 0x66, 0x36, 0x36, 0x61, 0x36, 0x38, 0x32, 0x38, 0x30, 0x34, 0x65, 0x33, // 8f19f66a682804e3 + 0x32, 0x2e, 0x70, 0x64, 0x62, 0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, // 2.pdb....HASH... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0xb6, 0x94, 0x4c, 0x54, 0xdd, 0xa8, 0x98, 0xf1, 0x9f, 0x66, // .....Q..LT.....f + 0xa6, 0x82, 0x80, 0x4e, 0x32, 0x44, 0x58, 0x49, 0x4c, 0xe0, 0x06, 0x00, 0x00, 0x60, 0x00, 0x05, // ...N2DXIL....`.. + 0x00, 0xb8, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, // .....DXIL....... + 0x00, 0xc8, 0x06, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0xaf, 0x01, 0x00, // .....BC..!...... + 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, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, // .A..I..29....%.. + 0x19, 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x18, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xc4, 0x10, 0x32, // ....b..E.B..B..2 + 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x62, 0x88, 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, // .8..K.2b.H.. CF. + 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90, 0x11, 0x23, 0xc4, 0x50, 0x41, 0x51, 0x81, // ...2B.H...#.PAQ. + 0x8c, 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x31, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, // ......1F.Q...... + 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d, 0x86, 0xf0, 0xff, // .........@...... + 0xff, 0xff, 0xff, 0x03, 0x20, 0x01, 0xd5, 0x06, 0x62, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x01, 0x90, // .... ...b....... + 0x00, 0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, // .I.........`B L. + 0x06, 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x32, 0x22, 0x88, // ...... ..N...2". + 0x09, 0x20, 0x64, 0x85, 0x04, 0x13, 0x23, 0xa4, 0x84, 0x04, 0x13, 0x23, 0xe3, 0x84, 0xa1, 0x90, // . d...#....#.... + 0x14, 0x12, 0x4c, 0x8c, 0x8c, 0x0b, 0x84, 0xc4, 0x4c, 0x10, 0x80, 0xc1, 0x08, 0x40, 0x09, 0x00, // ..L.....L....@.. + 0x0a, 0xe6, 0x08, 0xc0, 0xa0, 0x0c, 0xc3, 0x30, 0x10, 0x71, 0xd3, 0x70, 0xf9, 0x13, 0xf6, 0x10, // .......0.q.p.... + 0x92, 0xbf, 0x12, 0xd2, 0x4a, 0x4c, 0x3e, 0x72, 0xdb, 0xa8, 0x18, 0x86, 0x61, 0x18, 0xe6, 0x08, // ....JL>r....a... + 0x10, 0x3a, 0xee, 0x19, 0x2e, 0x7f, 0xc2, 0x1e, 0x42, 0xf2, 0x43, 0xa0, 0x19, 0x16, 0x02, 0x05, // .:......B.C..... + 0x48, 0x29, 0x8c, 0x21, 0x19, 0x06, 0x52, 0xca, 0x02, 0x0c, 0xc9, 0x30, 0x0c, 0xc3, 0x30, 0x0c, // H).!..R....0..0. + 0x07, 0x31, 0x33, 0x00, 0x47, 0x0d, 0x97, 0x3f, 0x61, 0x0f, 0x21, 0xf9, 0xdc, 0x46, 0x15, 0x2b, // .13.G..?a.!..F.+ + 0x31, 0xf9, 0xc5, 0x6d, 0x23, 0xc2, 0x71, 0x1c, 0xa7, 0x10, 0xcf, 0x90, 0x0c, 0x04, 0xcd, 0x11, // 1..m#.q......... + 0x04, 0xc5, 0x48, 0x86, 0x63, 0x18, 0x24, 0x9a, 0x06, 0x02, 0x86, 0x11, 0x88, 0x61, 0x26, 0x33, // ..H.c.$......a&3 + 0x18, 0x07, 0x76, 0x08, 0x87, 0x79, 0x98, 0x07, 0x37, 0x10, 0x85, 0x7a, 0x30, 0x07, 0x73, 0x28, // ..v..y..7..z0.s( + 0x07, 0x79, 0xe0, 0x03, 0x7b, 0x28, 0x87, 0x71, 0xa0, 0x87, 0x77, 0x90, 0x07, 0x3e, 0xa8, 0x07, // .y..{(.q..w..>.. + 0x77, 0x98, 0x87, 0x74, 0x38, 0x07, 0x77, 0x28, 0x07, 0x72, 0x00, 0x83, 0x74, 0x70, 0x07, 0x7a, // w..t8.w(.r..tp.z + 0x60, 0x03, 0x30, 0xa0, 0x03, 0x3f, 0x00, 0x03, 0x3f, 0x40, 0x81, 0x45, 0xd7, 0x4c, 0x70, 0x30, // `.0..?..?@.E.Lp0 + 0x0e, 0xec, 0x10, 0x0e, 0xf3, 0x30, 0x0f, 0x6e, 0x20, 0x0b, 0xb7, 0x40, 0x0b, 0xe5, 0x80, 0x0f, // .....0.n ..@.... + 0xf4, 0x50, 0x0f, 0xf2, 0x50, 0x0e, 0x72, 0x40, 0x0a, 0xa1, 0x20, 0x0f, 0xf2, 0x10, 0x0e, 0xf9, // .P..P.r@.. ..... + 0xc0, 0x07, 0xf6, 0x50, 0x0e, 0xe3, 0x40, 0x0f, 0xef, 0x20, 0x0f, 0x7c, 0x50, 0x0f, 0xee, 0x30, // ...P..@.. .|P..0 + 0x0f, 0xe9, 0x70, 0x0e, 0xee, 0x50, 0x0e, 0xe4, 0x00, 0x06, 0xe9, 0xe0, 0x0e, 0xf4, 0xc0, 0x06, // ..p..P.......... + 0x60, 0x40, 0x07, 0x7e, 0x00, 0x06, 0x7e, 0x80, 0x02, 0x8b, 0xb2, 0x61, 0x04, 0xc2, 0x49, 0x81, // `@.~..~....a..I. + 0x6d, 0x26, 0x84, 0x0c, 0x4e, 0x81, 0x1d, 0xde, 0x41, 0x1c, 0xc2, 0x81, 0x1d, 0xe6, 0x01, 0x05, // m&..N...A....... + 0x1c, 0x75, 0x53, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, // .uS....r..t`.6h. + 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, // yh.r....P.m..zP. + 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, // m..z0.r..s .m..q + 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, // ..s .m..x..s .m. + 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, // .q`.z0.r...0.r.. + 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, // s .m..v@.z`.t... + 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, // ..v..s .m`.s .z0 + 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, // .r...`.t..v@.m.. + 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, // x..q`.z0.r..v@.C + 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x04, 0x10, // .............<.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x14, 0x20, 0x00, 0x04, 0x00, // ..........y. ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x30, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, // ........0@...... + 0x00, 0x00, 0x00, 0x30, 0xe4, 0x81, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...0............ + 0x60, 0xc8, 0x33, 0x01, 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x16, 0x08, // `.3.. .......@.. + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, // .....2.....L...& + 0x47, 0xc6, 0x04, 0x43, 0x1a, 0x4a, 0x60, 0x04, 0xa0, 0x28, 0x8a, 0xa1, 0x14, 0xca, 0xa1, 0x80, // G..C.J`..(...... + 0x0a, 0xa1, 0x20, 0x48, 0x1a, 0x01, 0x20, 0x6c, 0x06, 0x80, 0xb4, 0x19, 0x00, 0xf2, 0x66, 0x00, // .. H.. l......f. + 0x00, 0x79, 0x18, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, // .y...A.....L.F.. + 0xc4, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0x06, 0xc6, 0x45, 0xc6, 0x06, // ...o..M.$.%..E.. + 0xa6, 0xc6, 0x65, 0xe6, 0x06, 0x04, 0x65, 0x8c, 0x86, 0x0c, 0xc7, 0x8c, 0xc6, 0x2c, 0x27, 0x27, // ..e...e......,'' + 0x65, 0x43, 0x10, 0x4c, 0x10, 0x06, 0x63, 0x82, 0x30, 0x1c, 0x1b, 0x84, 0x81, 0x98, 0x20, 0x0c, // eC.L..c.0..... . + 0xc8, 0x06, 0x61, 0x30, 0x28, 0x8c, 0xcd, 0x4d, 0x10, 0x86, 0x64, 0xc3, 0x80, 0x24, 0xc4, 0x04, // ..a0(..M..d..$.. + 0x01, 0x83, 0x08, 0x4c, 0x10, 0x06, 0x65, 0x83, 0x40, 0x34, 0x1b, 0x12, 0x62, 0x61, 0x08, 0x62, // ...L..e.@4..ba.b + 0x30, 0x08, 0x67, 0x43, 0xf0, 0x4c, 0x10, 0xb4, 0x68, 0x82, 0x30, 0x2c, 0x13, 0x04, 0xe9, 0xd9, // 0.gC.L..h.0,.... + 0xb0, 0x10, 0x11, 0x43, 0x10, 0x83, 0x34, 0x4d, 0x93, 0xb3, 0x21, 0xa0, 0x26, 0x08, 0x9e, 0x34, // ...C..4M..!.&..4 + 0x41, 0x18, 0x98, 0x0d, 0x08, 0x61, 0x31, 0x04, 0x31, 0x5c, 0xc0, 0x86, 0x00, 0xdb, 0x40, 0x40, // A....a1.1.....@@ + 0x55, 0x06, 0x4c, 0x10, 0x04, 0x80, 0x44, 0x5b, 0x58, 0x9a, 0xdb, 0x04, 0x61, 0x68, 0x26, 0x08, // U.L...D[X...ah&. + 0x83, 0xb3, 0x61, 0xf0, 0xbc, 0x61, 0x83, 0xd0, 0x7d, 0x1b, 0x8a, 0x8d, 0x03, 0x34, 0x30, 0xa8, // ..a..a..}....40. + 0xc2, 0xc6, 0x66, 0xd7, 0xe6, 0x92, 0x46, 0x56, 0xe6, 0x46, 0x37, 0x25, 0x08, 0xaa, 0x90, 0xe1, // ..f...FV.F7%.... + 0xb9, 0xd8, 0x95, 0xc9, 0xcd, 0xa5, 0xbd, 0xb9, 0x4d, 0x09, 0x88, 0x26, 0x64, 0x78, 0x2e, 0x76, // ........M..&dx.v + 0x61, 0x6c, 0x76, 0x65, 0x72, 0x53, 0x02, 0xa3, 0x0e, 0x19, 0x9e, 0xcb, 0x1c, 0x5a, 0x18, 0x59, // alverS.......Z.Y + 0x99, 0x5c, 0xd3, 0x1b, 0x59, 0x19, 0xdb, 0x94, 0x20, 0x29, 0x43, 0x86, 0xe7, 0x22, 0x57, 0x36, // ....Y... )C.."W6 + 0xf7, 0x56, 0x27, 0x37, 0x56, 0x36, 0x37, 0x25, 0xc8, 0xea, 0x90, 0xe1, 0xb9, 0x94, 0xb9, 0xd1, // .V'7V67%........ + 0xc9, 0xe5, 0x41, 0xbd, 0xa5, 0xb9, 0xd1, 0xcd, 0x4d, 0x09, 0xc0, 0x00, 0x00, 0x79, 0x18, 0x00, // ..A.....M....y.. + 0x00, 0x51, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, // .Q...3......f..= + 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, // .C8...B..yx.s.q. + 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, // .........3.B.... + 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, // ...f0.=.C8.....= + 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, // .C=..=.x.tp.{..y + 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, // H.pp.zp.vx.p ... + 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, // ......0.n0.....P + 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, // .3....!..!..a.f0 + 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, // .;..;.C9..<..<.. + 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, // ;...v`.{h.7h.rh. + 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, // 7..p..p`.v(.v..v + 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, // x.w.._..q..r..y. + 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, // .,..........0.b. + 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, // ............a..! + 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, // .....a...C9.C9.C + 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, // 9.C9..8.C8..;../ + 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, 0xe4, // p.z(.v....C..... + 0x20, 0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, // ..............P + 0x0f, 0xf4, 0x30, 0x83, 0x81, 0xc8, 0x01, 0x1f, 0xdc, 0x40, 0x1c, 0xe4, 0xa1, 0x1c, 0xc2, 0x61, // ..0......@.....a + 0x1d, 0xdc, 0x40, 0x1c, 0xe4, 0x01, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x18, 0x00, 0x00, // ..@......q ..... + 0x00, 0x26, 0x40, 0x0d, 0x97, 0xef, 0x3c, 0x7e, 0x40, 0x15, 0x05, 0x11, 0x95, 0x0e, 0x30, 0xf8, // .&@...<~@.....0. + 0xc8, 0x6d, 0x1b, 0xc1, 0x36, 0x5c, 0xbe, 0xf3, 0xf8, 0x42, 0x40, 0x15, 0x05, 0x11, 0x95, 0x0e, // .m..6....B@..... + 0x30, 0x94, 0x84, 0x01, 0x08, 0x98, 0x5f, 0xdc, 0xb6, 0x15, 0x48, 0xc3, 0xe5, 0x3b, 0x8f, 0x2f, // 0....._...H..;./ + 0x44, 0x04, 0x30, 0x11, 0x21, 0xd0, 0x0c, 0x0b, 0x61, 0x03, 0xd6, 0x70, 0xf9, 0xce, 0xe3, 0x4f, // D.0.!...a..p...O + 0xc4, 0x35, 0x51, 0x11, 0xc1, 0x4e, 0x4e, 0x44, 0xf8, 0xc8, 0x6d, 0x5b, 0x80, 0x34, 0x5c, 0xbe, // .5Q..NND..m[.4.. + 0xf3, 0xf8, 0xd3, 0x11, 0x11, 0xc0, 0x20, 0x0e, 0x3e, 0x72, 0xdb, 0x06, 0x40, 0x30, 0x00, 0xd2, // ...... .>r..@0.. + 0x00, 0x61, 0x20, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x13, 0x04, 0x45, 0x2c, 0x10, 0x00, 0x00, // .a ..D.....E,... + 0x00, 0x06, 0x00, 0x00, 0x00, 0x34, 0x94, 0x5c, 0xe9, 0x06, 0x94, 0x5d, 0x11, 0x14, 0x62, 0xc0, // .....4.....]..b. + 0x0c, 0x40, 0x19, 0x06, 0xd0, 0x51, 0x02, 0x23, 0x00, 0x45, 0x50, 0x1e, 0x00, 0x23, 0x06, 0x09, // .@...Q.#.EP..#.. + 0x00, 0x82, 0x60, 0x30, 0x65, 0x0b, 0x71, 0x5d, 0xcf, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x4c, // ..`0e.q]..A.. .L + 0x1a, 0x43, 0x60, 0x18, 0x34, 0x62, 0x90, 0x00, 0x20, 0x08, 0x06, 0xd3, 0xd6, 0x10, 0x59, 0x16, // .C`.4b.. .....Y. + 0x8d, 0x18, 0x18, 0x00, 0x08, 0x82, 0x01, 0x01, 0x06, 0x8d, 0x36, 0x62, 0x60, 0x00, 0x20, 0x08, // ..........6b`. . + 0x06, 0x44, 0x18, 0x38, 0xdc, 0x88, 0x81, 0x01, 0x80, 0x20, 0x18, 0x10, 0x62, 0xf0, 0x34, 0x23, // .D.8..... ..b.4# + 0x06, 0x07, 0x00, 0x82, 0x60, 0x00, 0x81, 0xc1, 0x43, 0x78, 0xa3, 0x09, 0x01, 0x70, 0xc1, 0x40, // ....`...Cx...p.@ + 0xc3, 0x0d, 0x46, 0x80, 0x06, 0xb3, 0x0c, 0x01, 0x11, 0x8c, 0x26, 0x10, 0xc1, 0x05, 0x03, 0x0d, // ..F.......&..... + 0x37, 0x20, 0x01, 0x1a, 0xcc, 0x32, 0x08, 0x44, 0x30, 0x9a, 0x70, 0x08, 0x17, 0x0c, 0x34, 0xdc, // 7 ...2.D0.p...4. + 0xa0, 0x04, 0x68, 0x30, 0xcb, 0x30, 0x10, 0xc1, 0x68, 0x82, 0x32, 0x5c, 0x30, 0x90, 0x05, 0x8d, // ..h0.0..h.2.0... + 0x08, 0x46, 0x0c, 0x0e, 0x00, 0x04, 0xc1, 0x00, 0x6a, 0x03, 0x2e, 0x52, 0x83, 0xd1, 0x84, 0x60, // .F......j..R...` + 0xb8, 0x60, 0x20, 0x0b, 0x24, 0x11, 0x54, 0x41, 0x41, 0x05, 0x02, 0x8c, 0x18, 0x20, 0x00, 0x08, // .` .$.TAA.... .. + 0x82, 0x81, 0x52, 0x07, 0x60, 0x80, 0x05, 0xdf, 0x68, 0x42, 0x00, 0x8c, 0x26, 0x08, 0xc1, 0x68, // ..R.`...hB..&..h + 0xc2, 0x20, 0x8c, 0x26, 0x10, 0xc3, 0x68, 0xc2, 0x02, 0x8c, 0x26, 0x30, 0xc1, 0x68, 0x42, 0x23, // . .&..h...&0.hB# + 0xdc, 0x30, 0xd0, 0x0d, 0x03, 0xdd, 0x30, 0x50, 0x0d, 0x61, 0x00, 0x35, 0x84, 0x01, 0xd4, 0x10, // .0....0P.a.5.... + 0x06, 0x30, 0x62, 0xe0, 0x00, 0x20, 0x08, 0x06, 0x8c, 0x28, 0xb0, 0xc1, 0x19, 0x0c, 0x42, 0xd0, // .0b.. ...(....B. + 0x30, 0x8b, 0x82, 0x06, 0xb3, 0x04, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // 0.............. + 0x00, // . +}; +static const uint8_t cs_blit_buffer_to_texture_uint_mtl[1129] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x01, 0x01, // ..bgfx_blitDst.. + 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x01, 0x00, 0x12, // ................ + 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, // ...#include .#incl + 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, // ude ..using namespa + 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, // ce metal;..struc + 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // t _Global.{. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // float4 bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x32, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, // Region[2];.};..s + 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, // truct bgfx_blitS + 0x72, 0x63, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x34, 0x20, 0x5f, // rc.{. uint4 _ + 0x64, 0x61, 0x74, 0x61, 0x5b, 0x31, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x6b, 0x65, 0x72, // data[1];.};..ker + 0x6e, 0x65, 0x6c, 0x20, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // nel void xlatMtl + 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, // Main(constant _G + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, // lobal& _mtl_u [[ + 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, // buffer(0)]], con + 0x73, 0x74, 0x20, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, // st device bgfx_b + 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x26, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, // litSrc& bgfx_bli + 0x74, 0x53, 0x72, 0x63, 0x5f, 0x31, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // tSrc_1 [[buffer( + 0x31, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x5f, // 1)]], texture2d_ + 0x61, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x75, 0x69, 0x6e, 0x74, 0x2c, 0x20, 0x61, 0x63, 0x63, 0x65, // array bgfx_ + 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // blitDst [[textur + 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x20, 0x67, 0x6c, // e(0)]], uint3 gl + 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, // _GlobalInvocatio + 0x6e, 0x49, 0x44, 0x20, 0x5b, 0x5b, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x70, 0x6f, 0x73, // nID [[thread_pos + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x5f, 0x67, 0x72, 0x69, 0x64, 0x5d, 0x5d, 0x29, // ition_in_grid]]) + 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // .{. do. {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x20, 0x5f, 0x31, 0x36, // int3 _16 + 0x32, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // 2 = int3(_mtl_u. + 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, // bgfx_blitRegion[ + 0x31, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 1].xyz);. + 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x28, 0x69, 0x6e, 0x74, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, // if (((int(gl_Gl + 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, // obalInvocationID + 0x2e, 0x78, 0x29, 0x20, 0x3e, 0x3d, 0x20, 0x5f, 0x31, 0x36, 0x32, 0x2e, 0x78, 0x29, 0x20, 0x7c, // .x) >= _162.x) | + 0x7c, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, // | (int(gl_Global + 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x2e, 0x79, 0x29, 0x20, // InvocationID.y) + 0x3e, 0x3d, 0x20, 0x5f, 0x31, 0x36, 0x32, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x7c, 0x7c, 0x20, 0x28, // >= _162.y)) || ( + 0x69, 0x6e, 0x74, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, // int(gl_GlobalInv + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x2e, 0x7a, 0x29, 0x20, 0x3e, 0x3d, 0x20, // ocationID.z) >= + 0x5f, 0x31, 0x36, 0x32, 0x2e, 0x7a, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _162.z)). + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, // {. b + 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // reak;. }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x20, 0x5f, 0x32, 0x30, // int3 _20 + 0x36, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // 6 = int3(_mtl_u. + 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, // bgfx_blitRegion[ + 0x30, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x28, 0x67, // 0].xyz) + int3(g + 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, // l_GlobalInvocati + 0x6f, 0x6e, 0x49, 0x44, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, // onID);. b + 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x2e, 0x77, 0x72, 0x69, 0x74, // gfx_blitDst.writ + 0x65, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x5f, 0x31, // e(bgfx_blitSrc_1 + 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x28, 0x28, 0x69, 0x6e, 0x74, 0x28, 0x67, 0x6c, 0x5f, // ._data[((int(gl_ + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, // GlobalInvocation + 0x49, 0x44, 0x2e, 0x7a, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // ID.z) * int(_mtl + 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, // _u.bgfx_blitRegi + 0x6f, 0x6e, 0x5b, 0x31, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x69, 0x6e, 0x74, // on[1].w)) + (int + 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, // (gl_GlobalInvoca + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, 0x28, // tionID.y) * int( + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // _mtl_u.bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x30, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x29, 0x20, 0x2b, // Region[0].w))) + + 0x20, 0x69, 0x6e, 0x74, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, // int(gl_GlobalIn + 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x2e, 0x78, 0x29, 0x5d, 0x2c, 0x20, // vocationID.x)], + 0x75, 0x69, 0x6e, 0x74, 0x32, 0x28, 0x5f, 0x32, 0x30, 0x36, 0x2e, 0x78, 0x79, 0x29, 0x2c, 0x20, // uint2(_206.xy), + 0x75, 0x69, 0x6e, 0x74, 0x28, 0x5f, 0x32, 0x30, 0x36, 0x2e, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, // uint(_206.z));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, // break;. + 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, // } while(false) + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // ;.}....0. +}; +extern const uint8_t* cs_blit_buffer_to_texture_uint_pssl; +extern const uint32_t cs_blit_buffer_to_texture_uint_pssl_size; diff --git a/src/cs_blit_buffer_to_texture_uint.sc b/src/cs_blit_buffer_to_texture_uint.sc new file mode 100644 index 000000000..9489b6c66 --- /dev/null +++ b/src/cs_blit_buffer_to_texture_uint.sc @@ -0,0 +1,33 @@ +/* + * Copyright 2011-2026 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE + */ + +#include "bgfx_compute.sh" + +BUFFER_RO(bgfx_blitSrc, uvec4, 0); +UIMAGE2D_ARRAY_WO(bgfx_blitDst, rgba32ui, 0); + +uniform vec4 bgfx_blitRegion[2]; + +#define bgfx_dstOrigin ivec3(bgfx_blitRegion[0].xyz) +#define bgfx_blitSize ivec3(bgfx_blitRegion[1].xyz) +#define bgfx_blitRowPitch int(bgfx_blitRegion[0].w) +#define bgfx_blitSlicePitch int(bgfx_blitRegion[1].w) + +NUM_THREADS(8, 8, 1) +void main() +{ + ivec3 coord = ivec3(gl_GlobalInvocationID.xyz); + + if (coord.x >= bgfx_blitSize.x + || coord.y >= bgfx_blitSize.y + || coord.z >= bgfx_blitSize.z) + { + return; + } + + int index = coord.z * bgfx_blitSlicePitch + coord.y * bgfx_blitRowPitch + coord.x; + + imageStore(bgfx_blitDst, bgfx_dstOrigin + coord, bgfx_blitSrc[index]); +} diff --git a/src/cs_blit_texture_to_buffer_uint.bin.h b/src/cs_blit_texture_to_buffer_uint.bin.h new file mode 100644 index 000000000..a19cf91be --- /dev/null +++ b/src/cs_blit_texture_to_buffer_uint.bin.h @@ -0,0 +1,615 @@ +static const uint8_t cs_blit_texture_to_buffer_uint_glsl[1089] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x0b, 0x04, 0x00, 0x00, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, // .....layout(loca + 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x78, 0x20, 0x3d, 0x20, 0x38, 0x2c, 0x20, 0x6c, 0x6f, // l_size_x = 8, lo + 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x79, 0x20, 0x3d, 0x20, 0x38, 0x2c, 0x20, // cal_size_y = 8, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x7a, 0x20, 0x3d, 0x20, 0x31, // local_size_z = 1 + 0x29, 0x20, 0x69, 0x6e, 0x3b, 0x0a, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x62, 0x69, // ) in;..layout(bi + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x73, 0x74, 0x64, 0x34, 0x33, // nding = 0, std43 + 0x30, 0x29, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x75, 0x66, // 0) writeonly buf + 0x66, 0x65, 0x72, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, // fer bgfx_blitDst + 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x76, 0x65, // Buffer.{. uve + 0x63, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x5b, // c4 bgfx_blitDst[ + 0x5d, 0x3b, 0x0a, 0x7d, 0x20, 0x5f, 0x31, 0x30, 0x31, 0x3b, 0x0a, 0x0a, 0x75, 0x6e, 0x69, 0x66, // ];.} _101;..unif + 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, // orm vec4 bgfx_bl + 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x32, 0x5d, 0x3b, 0x0a, 0x6c, 0x61, 0x79, // itRegion[2];.lay + 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x30, // out(location = 0 + 0x2c, 0x20, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x72, // , binding = 0, r + 0x67, 0x62, 0x61, 0x33, 0x32, 0x75, 0x69, 0x29, 0x20, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // gba32ui) uniform + 0x20, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x75, 0x69, 0x6d, 0x61, 0x67, 0x65, // readonly uimage + 0x32, 0x44, 0x41, 0x72, 0x72, 0x61, 0x79, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, // 2DArray bgfx_bli + 0x74, 0x53, 0x72, 0x63, 0x3b, 0x0a, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // tSrc;..void main + 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, // ().{. do. + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x20, // {. ivec3 + 0x5f, 0x31, 0x35, 0x20, 0x3d, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x28, 0x67, 0x6c, 0x5f, 0x47, // _15 = ivec3(gl_G + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, // lobalInvocationI + 0x44, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, // D);. int + 0x5f, 0x32, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x31, 0x35, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, // _20 = _15.x;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x20, 0x5f, 0x33, 0x33, 0x20, 0x3d, // ivec3 _33 = + 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // ivec3(bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, // Region[1].xyz);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x5f, 0x33, 0x35, // bool _35 + 0x20, 0x3d, 0x20, 0x5f, 0x32, 0x30, 0x20, 0x3e, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x2e, 0x78, 0x3b, // = _20 >= _33.x; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x5f, 0x34, // . bool _4 + 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x21, // 8;. if (! + 0x5f, 0x33, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // _35). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x38, 0x20, 0x3d, // _48 = + 0x20, 0x5f, 0x31, 0x35, 0x2e, 0x79, 0x20, 0x3e, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x2e, 0x79, 0x3b, // _15.y >= _33.y; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // . }. + 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, // {. _4 + 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 8 = _35;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, // }. bool + 0x5f, 0x36, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // _60;. if + 0x28, 0x21, 0x5f, 0x34, 0x38, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, // (!_48). { + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x30, // . _60 + 0x20, 0x3d, 0x20, 0x5f, 0x31, 0x35, 0x2e, 0x7a, 0x20, 0x3e, 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x2e, // = _15.z >= _33. + 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // z;. }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x5f, 0x36, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // _60 = _48;. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // }. if + 0x28, 0x5f, 0x36, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // (_60). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, // brea + 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // k;. }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x31, 0x30, 0x31, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, // _101.bgfx_b + 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x5b, 0x28, 0x28, 0x5f, 0x31, 0x35, 0x2e, 0x7a, 0x20, 0x2a, // litDst[((_15.z * + 0x20, 0x69, 0x6e, 0x74, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, // int(bgfx_blitRe + 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, // gion[1].w)) + (_ + 0x31, 0x35, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, // 15.y * int(bgfx_ + 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x30, 0x5d, 0x2e, 0x77, 0x29, // blitRegion[0].w) + 0x29, 0x29, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x69, 0x6d, 0x61, 0x67, // )) + _20] = imag + 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, // eLoad(bgfx_blitS + 0x72, 0x63, 0x2c, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, // rc, ivec3(bgfx_b + 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x79, 0x7a, // litRegion[0].xyz + 0x29, 0x20, 0x2b, 0x20, 0x5f, 0x31, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ) + _15);. + 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, // break;. } w + 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // hile(false);.}.. + 0x00, // . +}; +static const uint8_t cs_blit_texture_to_buffer_uint_essl[1095] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x11, 0x04, 0x00, 0x00, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, // .....layout(loca + 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x78, 0x20, 0x3d, 0x20, 0x38, 0x2c, 0x20, 0x6c, 0x6f, // l_size_x = 8, lo + 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x79, 0x20, 0x3d, 0x20, 0x38, 0x2c, 0x20, // cal_size_y = 8, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x7a, 0x20, 0x3d, 0x20, 0x31, // local_size_z = 1 + 0x29, 0x20, 0x69, 0x6e, 0x3b, 0x0a, 0x0a, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x62, 0x69, // ) in;..layout(bi + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x73, 0x74, 0x64, 0x34, 0x33, // nding = 0, std43 + 0x30, 0x29, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x75, 0x66, // 0) writeonly buf + 0x66, 0x65, 0x72, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, // fer bgfx_blitDst + 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x76, 0x65, // Buffer.{. uve + 0x63, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x5b, // c4 bgfx_blitDst[ + 0x5d, 0x3b, 0x0a, 0x7d, 0x20, 0x5f, 0x31, 0x30, 0x31, 0x3b, 0x0a, 0x0a, 0x75, 0x6e, 0x69, 0x66, // ];.} _101;..unif + 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, // orm vec4 bgfx_bl + 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x32, 0x5d, 0x3b, 0x0a, 0x6c, 0x61, 0x79, // itRegion[2];.lay + 0x6f, 0x75, 0x74, 0x28, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x30, // out(location = 0 + 0x2c, 0x20, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x72, // , binding = 0, r + 0x67, 0x62, 0x61, 0x33, 0x32, 0x75, 0x69, 0x29, 0x20, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // gba32ui) uniform + 0x20, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // readonly highp + 0x75, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x32, 0x44, 0x41, 0x72, 0x72, 0x61, 0x79, 0x20, 0x62, 0x67, // uimage2DArray bg + 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x3b, 0x0a, 0x0a, 0x76, 0x6f, 0x69, // fx_blitSrc;..voi + 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, // d main().{. d + 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // o. {. + 0x69, 0x76, 0x65, 0x63, 0x33, 0x20, 0x5f, 0x31, 0x35, 0x20, 0x3d, 0x20, 0x69, 0x76, 0x65, 0x63, // ivec3 _15 = ivec + 0x33, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, // 3(gl_GlobalInvoc + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ationID);. + 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x5f, 0x32, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x31, 0x35, 0x2e, // int _20 = _15. + 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, // x;. ivec3 + 0x20, 0x5f, 0x33, 0x33, 0x20, 0x3d, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x28, 0x62, 0x67, 0x66, // _33 = ivec3(bgf + 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x5d, 0x2e, // x_blitRegion[1]. + 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, // xyz);. bo + 0x6f, 0x6c, 0x20, 0x5f, 0x33, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x32, 0x30, 0x20, 0x3e, 0x3d, 0x20, // ol _35 = _20 >= + 0x5f, 0x33, 0x33, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, // _33.x;. b + 0x6f, 0x6f, 0x6c, 0x20, 0x5f, 0x34, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ool _48;. + 0x20, 0x69, 0x66, 0x20, 0x28, 0x21, 0x5f, 0x33, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // if (!_35). + 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x5f, 0x34, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x31, 0x35, 0x2e, 0x79, 0x20, 0x3e, 0x3d, 0x20, // _48 = _15.y >= + 0x5f, 0x33, 0x33, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // _33.y;. } + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, // . else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x35, 0x3b, 0x0a, 0x20, // _48 = _35;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x5f, 0x36, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // bool _60;. + 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x21, 0x5f, 0x34, 0x38, 0x29, 0x0a, 0x20, 0x20, 0x20, // if (!_48). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x5f, 0x36, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x31, 0x35, 0x2e, 0x7a, 0x20, 0x3e, // _60 = _15.z > + 0x3d, 0x20, 0x5f, 0x33, 0x33, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _33.z;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, // }. else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x38, 0x3b, // _60 = _48; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // . }. + 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x36, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // if (_60). + 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x31, 0x30, 0x31, 0x2e, // }. _101. + 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x5b, 0x28, 0x28, 0x5f, // bgfx_blitDst[((_ + 0x31, 0x35, 0x2e, 0x7a, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, // 15.z * int(bgfx_ + 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x5d, 0x2e, 0x77, 0x29, // blitRegion[1].w) + 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x31, 0x35, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, // ) + (_15.y * int + 0x28, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, // (bgfx_blitRegion + 0x5b, 0x30, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x30, 0x5d, 0x20, // [0].w))) + _20] + 0x3d, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x28, 0x62, 0x67, 0x66, 0x78, // = imageLoad(bgfx + 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x2c, 0x20, 0x69, 0x76, 0x65, 0x63, 0x33, 0x28, // _blitSrc, ivec3( + 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, // bgfx_blitRegion[ + 0x30, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x5f, 0x31, 0x35, 0x29, 0x3b, 0x0a, // 0].xyz) + _15);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, // break;. + 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x61, 0x6c, 0x73, 0x65, // } while(false + 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // );.}... +}; +static const uint8_t cs_blit_texture_to_buffer_uint_spv[2049] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x20, 0x00, // ..bgfx_blitSrc . + 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x03, 0x54, 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, // .......T..bgfx_b + 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x01, 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, // litDst.......... + 0x00, 0x98, 0x07, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, // .......#........ + 0x00, 0xdb, 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, // .........GLSL.st + 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // d.450........... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x06, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x10, 0x00, 0x06, // .main....u...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // ................ + 0x00, 0x01, 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, 0x00, // .........main... + 0x00, 0x05, 0x00, 0x06, 0x00, 0x26, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // .....&...Uniform + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x26, 0x00, 0x00, // Block........&.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, // .....bgfx_blitRe + 0x67, 0x69, 0x6f, 0x6e, 0x00, 0x05, 0x00, 0x03, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // gion.....(...... + 0x00, 0x05, 0x00, 0x06, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, // .....M...bgfx_bl + 0x69, 0x74, 0x53, 0x72, 0x63, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x6c, 0x00, 0x00, // itSrc........l.. + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x00, 0x00, 0x00, // .bgfx_blitDst... + 0x00, 0x06, 0x00, 0x05, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x64, 0x61, // .....l.......@da + 0x74, 0x61, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ta.......n...bgf + 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x08, // x_blitDst....... + 0x00, 0x75, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, // .u...gl_GlobalIn + 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // vocationID...G.. + 0x00, 0x25, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .%...........G.. + 0x00, 0x26, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x26, 0x00, 0x00, // .&.......H...&.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .....#.......G.. + 0x00, 0x28, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .(...!.......G.. + 0x00, 0x28, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .(...".......G.. + 0x00, 0x4d, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .M...!.......G.. + 0x00, 0x4d, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .M...".......G.. + 0x00, 0x6b, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .k...........G.. + 0x00, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x6c, 0x00, 0x00, // .l.......H...l.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .....#.......G.. + 0x00, 0x6e, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .n...!.......G.. + 0x00, 0x6e, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .n...".......G.. + 0x00, 0x75, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, // .u.............. + 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, 0x15, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ......... ...... + 0x00, 0x17, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ + 0x00, 0x17, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .+.............. + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .+.............. + 0x00, 0x16, 0x00, 0x03, 0x00, 0x22, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, // ....."... ...... + 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .#...".......+.. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, // .....$.......... + 0x00, 0x25, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, // .%...#...$...... + 0x00, 0x26, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // .&...%... ...'.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // .....&...;...'.. + 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, // .(.......+...... + 0x00, 0x29, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x2a, 0x00, 0x00, // .)...........*.. + 0x00, 0x22, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, // ."....... ...+.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x31, 0x00, 0x00, // .....#.......1.. + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .+.......3...... + 0x00, 0x19, 0x00, 0x09, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....K.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..... ...L...... + 0x00, 0x4b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, // .K...;...L...M.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // .....+.......[.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ..... .......... + 0x00, 0x22, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x03, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, // .".......k...... + 0x00, 0x1e, 0x00, 0x03, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .....l...k... .. + 0x00, 0x6d, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .m.......l...;.. + 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .m...n....... .. + 0x00, 0x71, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .q........... .. + 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, // .t...........;.. + 0x00, 0x74, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .t...u....... .. + 0x00, 0xda, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, // .............6.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, // .........=...... + 0x00, 0x76, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xd4, 0x00, 0x00, // .v...u.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x03, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0xda, 0x00, 0x00, // .........A...... + 0x00, 0x9d, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .....u.......=.. + 0x00, 0x09, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0x2b, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, // .+.......(...... + 0x00, 0x29, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, // .)...=...#...... + 0x00, 0x9f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x2a, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, // .....O...*...... + 0x00, 0xa0, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, // .....n.......... + 0x00, 0xa1, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, // .....Q.......... + 0x00, 0xa2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x05, 0x00, 0x31, 0x00, 0x00, // .............1.. + 0x00, 0xa4, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, // .............A.. + 0x00, 0xda, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, // .........u...3.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, // .=.............. + 0x00, 0x51, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, // .Q.............. + 0x00, 0x01, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x05, 0x00, 0x31, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, // .........1...... + 0x00, 0xa6, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x05, 0x00, 0x31, 0x00, 0x00, // .............1.. + 0x00, 0xad, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, // .............A.. + 0x00, 0xda, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, // .........u...$.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, // .=.............. + 0x00, 0x51, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, // .Q.............. + 0x00, 0x02, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x05, 0x00, 0x31, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, // .........1...... + 0x00, 0xaf, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x05, 0x00, 0x31, 0x00, 0x00, // .............1.. + 0x00, 0xb6, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, // ................ + 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xb6, 0x00, 0x00, // ................ + 0x00, 0xb7, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb7, 0x00, 0x00, // ................ + 0x00, 0xf9, 0x00, 0x02, 0x00, 0xd4, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb8, 0x00, 0x00, // ................ + 0x00, 0x41, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // .A...+.......(.. + 0x00, 0x18, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, // .........=...#.. + 0x00, 0xba, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x2a, 0x00, 0x00, // .........O...*.. + 0x00, 0xbb, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, // .........n...... + 0x00, 0xbc, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, // ................ + 0x00, 0xbe, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .........v...=.. + 0x00, 0x4b, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x07, // .K.......M..._.. + 0x00, 0x0c, 0x00, 0x00, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, // ................ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x5c, 0x00, 0x00, // .........A...... + 0x00, 0xc3, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, // .....(.......).. + 0x00, 0x5b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, // .[...=..."...... + 0x00, 0xc3, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, // .....n.......... + 0x00, 0xc4, 0x00, 0x00, 0x00, 0x84, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, // ................ + 0x00, 0xaf, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x5c, 0x00, 0x00, // .........A...... + 0x00, 0xc9, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, // .....(.......... + 0x00, 0x5b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, // .[...=..."...... + 0x00, 0xc9, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, // .....n.......... + 0x00, 0xca, 0x00, 0x00, 0x00, 0x84, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, // ................ + 0x00, 0xa6, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, // ................ + 0x00, 0xcd, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, // ................ + 0x00, 0x09, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, // ................ + 0x00, 0x41, 0x00, 0x06, 0x00, 0x71, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, // .A...q.......n.. + 0x00, 0x18, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xd3, 0x00, 0x00, // .........>...... + 0x00, 0xd9, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xd4, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0xd4, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // .........8..... + 0x00, // . +}; +static const uint8_t cs_blit_texture_to_buffer_uint_wgsl[1160] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x20, 0x00, // ..bgfx_blitSrc . + 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x03, 0x54, 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, // .......T..bgfx_b + 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x01, 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, // litDst.......... + 0x00, 0x1d, 0x04, 0x00, 0x00, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x28, // .....diagnostic( + 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, // off, derivative_ + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x74, 0x79, 0x29, 0x3b, 0x0a, 0x64, 0x69, 0x61, // uniformity);.dia + 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x28, 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x73, 0x75, 0x62, // gnostic(off, sub + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x74, 0x79, // group_uniformity + 0x29, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x55, 0x6e, 0x69, 0x66, 0x6f, // );..struct Unifo + 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x62, 0x67, 0x66, 0x78, // rmBlock {. bgfx + 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x20, 0x3a, 0x20, 0x61, 0x72, // _blitRegion : ar + 0x72, 0x61, 0x79, 0x3c, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x20, 0x32, // ray, 2 + 0x75, 0x3e, 0x2c, 0x0a, 0x7d, 0x0a, 0x0a, 0x40, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x28, 0x30, 0x75, // u>,.}..@group(0u + 0x29, 0x20, 0x40, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x28, 0x30, 0x75, 0x29, 0x20, 0x76, // ) @binding(0u) v + 0x61, 0x72, 0x3c, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x3e, 0x20, 0x76, 0x20, 0x3a, 0x20, // ar v : + 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0a, 0x0a, 0x40, // UniformBlock;..@ + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x28, 0x30, 0x75, 0x29, 0x20, 0x40, 0x62, 0x69, 0x6e, 0x64, 0x69, // group(0u) @bindi + 0x6e, 0x67, 0x28, 0x32, 0x75, 0x29, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // ng(2u) var bgfx_ + 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x20, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // blitSrc : textur + 0x65, 0x5f, 0x32, 0x64, 0x5f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x75, 0x33, 0x32, 0x3e, 0x3b, // e_2d_array; + 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, // ..struct bgfx_bl + 0x69, 0x74, 0x44, 0x73, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x20, 0x3a, 0x20, 0x61, 0x72, // itDst {. m : ar + 0x72, 0x61, 0x79, 0x3c, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x75, 0x33, 0x32, 0x3e, 0x3e, 0x2c, 0x0a, // ray>,. + 0x7d, 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, 0x33, 0x75, 0x29, 0x20, 0x76, 0x61, 0x72, 0x3c, 0x73, // inding(3u) var bgfx_blitDst + 0x5f, 0x31, 0x20, 0x3a, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, // _1 : bgfx_blitDs + 0x74, 0x3b, 0x0a, 0x0a, 0x40, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x40, 0x77, 0x6f, // t;..@compute @wo + 0x72, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x28, 0x38, 0x75, 0x2c, // rkgroup_size(8u, + 0x20, 0x38, 0x75, 0x2c, 0x20, 0x31, 0x75, 0x29, 0x0a, 0x66, 0x6e, 0x20, 0x6d, 0x61, 0x69, 0x6e, // 8u, 1u).fn main + 0x28, 0x40, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, // (@builtin(global + 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x29, 0x20, // _invocation_id) + 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, // gl_GlobalInvocat + 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x20, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x75, 0x33, 0x32, // ionID : vec3) {. let v_1 = + 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x69, 0x33, 0x32, 0x3e, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, // vec3(gl_Gl + 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, // obalInvocationID + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x28, 0x30, 0x75, 0x29, 0x20, // );. switch(0u) + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x20, 0x7b, // {. default: { + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x76, 0x5f, 0x32, 0x20, 0x3d, // . let v_2 = + 0x20, 0x76, 0x5f, 0x31, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, // v_1.x;. le + 0x74, 0x20, 0x76, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x69, 0x33, 0x32, // t v_3 = vec3(v.bgfx_blitReg + 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x69, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ion[1i].xyz);. + 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x76, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x76, 0x5f, // let v_4 = v_ + 0x31, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x76, // 1.y;. let v + 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x31, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // _5 = v_1.z;. + 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x32, 0x20, 0x3e, 0x3d, 0x20, // if ((((v_2 >= + 0x76, 0x5f, 0x33, 0x2e, 0x78, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x76, 0x5f, 0x34, 0x20, 0x3e, 0x3d, // v_3.x) | (v_4 >= + 0x20, 0x76, 0x5f, 0x33, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x76, 0x5f, 0x35, 0x20, // v_3.y)) | (v_5 + 0x3e, 0x3d, 0x20, 0x76, 0x5f, 0x33, 0x2e, 0x7a, 0x29, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, // >= v_3.z))) {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, // break;. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x76, // }. let v + 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x69, 0x33, 0x32, 0x3e, 0x28, // _6 = (vec3( + 0x76, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, // v.bgfx_blitRegio + 0x6e, 0x5b, 0x30, 0x69, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x76, 0x5f, 0x31, // n[0i].xyz) + v_1 + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x76, 0x5f, 0x37, // );. let v_7 + 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x28, 0x62, // = textureLoad(b + 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x2c, 0x20, 0x76, 0x5f, 0x36, // gfx_blitSrc, v_6 + 0x2e, 0x78, 0x79, 0x2c, 0x20, 0x76, 0x5f, 0x36, 0x2e, 0x7a, 0x2c, 0x20, 0x30, 0x69, 0x29, 0x3b, // .xy, v_6.z, 0i); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // . bgfx_blit + 0x44, 0x73, 0x74, 0x5f, 0x31, 0x2e, 0x6d, 0x5b, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x35, 0x20, 0x2a, // Dst_1.m[(((v_5 * + 0x20, 0x69, 0x33, 0x32, 0x28, 0x76, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // i32(v.bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x31, 0x69, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x20, 0x2b, // Region[1i].w)) + + 0x20, 0x28, 0x76, 0x5f, 0x34, 0x20, 0x2a, 0x20, 0x69, 0x33, 0x32, 0x28, 0x76, 0x2e, 0x62, 0x67, // (v_4 * i32(v.bg + 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x30, 0x69, // fx_blitRegion[0i + 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x76, 0x5f, 0x32, 0x29, 0x5d, 0x20, 0x3d, // ].w))) + v_2)] = + 0x20, 0x76, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x7d, 0x0a, // v_7;. }. }. + 0x7d, 0x0a, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, // }... . . +}; +static const uint8_t cs_blit_texture_to_buffer_uint_dxbc[601] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x20, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x9d, 0x6e, 0x53, 0x8d, 0xe8, 0x3d, 0xd5, // . ...DXBC.nS..=. + 0xc5, 0xf5, 0xfd, 0x89, 0x65, 0x34, 0xf0, 0x3f, 0x25, 0x01, 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, // ....e4.?%.... .. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, // .....,...<...L.. + 0x00, 0x49, 0x53, 0x47, 0x4e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISGN........... + 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .OSGN........... + 0x00, 0x53, 0x48, 0x45, 0x58, 0xcc, 0x01, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x73, 0x00, 0x00, // .SHEX....P...s.. + 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .j...Y...F. .... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x58, 0x40, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, // .....X@...p..... + 0x00, 0x44, 0x44, 0x00, 0x00, 0x9c, 0x08, 0x00, 0x04, 0x00, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00, // .DD............. + 0x00, 0x44, 0x44, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x02, 0x72, 0x00, 0x02, 0x00, 0x68, 0x00, 0x00, // .DD.._...r...h.. + 0x02, 0x02, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x04, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .........r...... + 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // .F. .........!.. + 0x06, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x02, 0x00, 0x46, 0x02, 0x10, // .r.......F...F.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....<.......... + 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x3c, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, // .<...........*.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x04, // ................ + 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, // .........>...... + 0x01, 0x1b, 0x00, 0x00, 0x06, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, // .............F. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, // .............r.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x02, // .....F.......F.. + 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, // .6............@. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x89, 0x02, 0x02, 0x00, 0x80, 0x03, 0x11, 0x11, // .....-.......... + 0x00, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, // .........F...... + 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x06, 0x12, 0x00, 0x10, // .F~............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....:. ........ + 0x00, 0x26, 0x00, 0x00, 0x07, 0x00, 0xd0, 0x00, 0x00, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .&......."...... + 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x23, 0x00, 0x00, // .:...........#.. + 0x08, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x10, // .........*...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // ................ + 0x06, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x0a, 0x00, 0x02, 0x00, 0xa4, 0x00, 0x00, 0x07, 0xf2, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, // .........F...... + 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, // .>..... . +}; +static const uint8_t cs_blit_texture_to_buffer_uint_dxil[2281] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0xb0, 0x08, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x57, 0xd6, 0xf2, 0x92, 0xd8, 0xb0, 0x1f, // .....DXBCW...... + 0xd5, 0xde, 0x8d, 0x25, 0x04, 0x0d, 0x54, 0xdc, 0x46, 0x01, 0x00, 0x00, 0x00, 0xb0, 0x08, 0x00, // ...%..T.F....... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, // .....<...L...... + 0x00, 0x6c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x60, 0x01, 0x00, // .l.......D...`.. + 0x00, 0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .SFI0........... + 0x00, 0x49, 0x53, 0x47, 0x31, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISG1........... + 0x00, 0x4f, 0x53, 0x47, 0x31, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .OSG1........... + 0x00, 0x50, 0x53, 0x56, 0x30, 0x9c, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .PSV0....8...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0xff, 0xff, 0xff, 0xff, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x4c, 0x44, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, // .....ILDN,.....$ + 0x00, 0x64, 0x61, 0x36, 0x32, 0x64, 0x61, 0x39, 0x39, 0x31, 0x62, 0x63, 0x63, 0x34, 0x65, 0x34, // .da62da991bcc4e4 + 0x38, 0x62, 0x33, 0x65, 0x33, 0x33, 0x36, 0x36, 0x62, 0x35, 0x61, 0x37, 0x62, 0x36, 0x35, 0x64, // 8b3e3366b5a7b65d + 0x65, 0x2e, 0x70, 0x64, 0x62, 0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, // e.pdb....HASH... + 0x00, 0x00, 0x00, 0x00, 0x00, 0xda, 0x62, 0xda, 0x99, 0x1b, 0xcc, 0x4e, 0x48, 0xb3, 0xe3, 0x36, // ......b....NH..6 + 0x6b, 0x5a, 0x7b, 0x65, 0xde, 0x44, 0x58, 0x49, 0x4c, 0x48, 0x07, 0x00, 0x00, 0x60, 0x00, 0x05, // kZ{e.DXILH...`.. + 0x00, 0xd2, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, // .....DXIL....... + 0x00, 0x30, 0x07, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0xc9, 0x01, 0x00, // .0...BC..!...... + 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, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, // .A..I..29....%.. + 0x19, 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x18, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xc4, 0x10, 0x32, // ....b..E.B..B..2 + 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x62, 0x88, 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, // .8..K.2b.H.. CF. + 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90, 0x11, 0x23, 0xc4, 0x50, 0x41, 0x51, 0x81, // ...2B.H...#.PAQ. + 0x8c, 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x31, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, // ......1F.Q...... + 0x00, 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, // .... m0......... + 0x00, 0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, // .I.........`B L. + 0x06, 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x32, 0x22, 0x88, // ...... ..f...2". + 0x09, 0x20, 0x64, 0x85, 0x04, 0x13, 0x23, 0xa4, 0x84, 0x04, 0x13, 0x23, 0xe3, 0x84, 0xa1, 0x90, // . d...#....#.... + 0x14, 0x12, 0x4c, 0x8c, 0x8c, 0x0b, 0x84, 0xc4, 0x4c, 0x10, 0x84, 0xc1, 0x08, 0x40, 0x09, 0x00, // ..L.....L....@.. + 0x0a, 0xe6, 0x08, 0xc0, 0xa0, 0x0c, 0xc3, 0x30, 0x10, 0x31, 0x47, 0x80, 0x90, 0x71, 0xcf, 0x70, // .......0.1G..q.p + 0xf9, 0x13, 0xf6, 0x10, 0x92, 0x1f, 0x02, 0xcd, 0xb0, 0x10, 0x28, 0x38, 0x8a, 0x02, 0x0c, 0xc8, // ..........(8.... + 0x30, 0x0c, 0xc3, 0x30, 0x18, 0x94, 0xdc, 0x34, 0x5c, 0xfe, 0x84, 0x3d, 0x84, 0xe4, 0xaf, 0x84, // 0..0...4...=.... + 0xb4, 0x12, 0x93, 0x8f, 0xdc, 0x36, 0x2a, 0x86, 0x61, 0x18, 0x86, 0xa2, 0x2c, 0x03, 0x32, 0x0c, // .....6*.a...,.2. + 0xc3, 0x30, 0x0c, 0x03, 0x31, 0x33, 0x00, 0x47, 0x0d, 0x97, 0x3f, 0x61, 0x0f, 0x21, 0xf9, 0xdc, // .0..13.G..?a.!.. + 0x46, 0x15, 0x2b, 0x31, 0xf9, 0xc5, 0x6d, 0x23, 0xc2, 0x71, 0x1c, 0xa7, 0x10, 0xcf, 0x80, 0x0c, // F.+1..m#.q...... + 0x04, 0xcd, 0x11, 0x04, 0xc5, 0x40, 0x06, 0x63, 0x18, 0x24, 0x9a, 0x06, 0x02, 0x86, 0x11, 0x88, // .....@.c.$...... + 0x61, 0xa6, 0x3c, 0x18, 0x07, 0x76, 0x08, 0x87, 0x79, 0x98, 0x07, 0x37, 0xa0, 0x85, 0x72, 0xc0, // a.<..v..y..7..r. + 0x07, 0x7a, 0xa8, 0x07, 0x79, 0x28, 0x07, 0x39, 0x20, 0x85, 0x50, 0x90, 0x07, 0x79, 0x08, 0x87, // .z..y(.9 .P..y.. + 0x7c, 0xe0, 0x03, 0x7b, 0x28, 0x87, 0x71, 0xa0, 0x87, 0x77, 0x90, 0x07, 0x3e, 0xa8, 0x07, 0x77, // |..{(.q..w..>..w + 0x98, 0x87, 0x74, 0x38, 0x07, 0x77, 0x28, 0x07, 0x72, 0x00, 0x83, 0x74, 0x70, 0x07, 0x7a, 0x60, // ..t8.w(.r..tp.z` + 0x03, 0x30, 0xa0, 0x03, 0x3f, 0x00, 0x03, 0x3f, 0xd0, 0x03, 0x3d, 0x68, 0x87, 0x74, 0x80, 0x87, // .0..?..?..=h.t.. + 0x79, 0xf8, 0x05, 0x7a, 0xc8, 0x07, 0x78, 0x28, 0x07, 0x14, 0x0c, 0x33, 0xb9, 0xc1, 0x38, 0xb0, // y..z..x(...3..8. + 0x43, 0x38, 0xcc, 0xc3, 0x3c, 0xb8, 0x01, 0x2d, 0x94, 0x03, 0x3e, 0xd0, 0x43, 0x3d, 0xc8, 0x43, // C8..<..-..>.C=.C + 0x39, 0xc8, 0x01, 0x29, 0x84, 0x82, 0x3c, 0xc8, 0x43, 0x38, 0xe4, 0x03, 0x1f, 0xd8, 0x43, 0x39, // 9..)..<.C8....C9 + 0x8c, 0x03, 0x3d, 0xbc, 0x83, 0x3c, 0xf0, 0x41, 0x3d, 0xb8, 0xc3, 0x3c, 0xa4, 0xc3, 0x39, 0xb8, // ..=..<.A=..<..9. + 0x43, 0x39, 0x90, 0x03, 0x18, 0xa4, 0x83, 0x3b, 0xd0, 0x03, 0x1b, 0x80, 0x01, 0x1d, 0xf8, 0x01, // C9.....;........ + 0x18, 0xf8, 0x01, 0x12, 0xac, 0x8b, 0xb0, 0x99, 0xd0, 0x60, 0x1c, 0xd8, 0x21, 0x1c, 0xe6, 0x61, // .........`..!..a + 0x1e, 0xdc, 0x40, 0x16, 0x6e, 0x41, 0x14, 0xea, 0xc1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0x81, 0x0f, // ..@.nA.......... + 0xec, 0xa1, 0x1c, 0xc6, 0x81, 0x1e, 0xde, 0x41, 0x1e, 0xf8, 0xa0, 0x1e, 0xdc, 0x61, 0x1e, 0xd2, // .......A.....a.. + 0xe1, 0x1c, 0xdc, 0xa1, 0x1c, 0xc8, 0x01, 0x0c, 0xd2, 0xc1, 0x1d, 0xe8, 0x81, 0x0d, 0xc0, 0x80, // ................ + 0x0e, 0xfc, 0x00, 0x0c, 0xfc, 0x00, 0x05, 0x16, 0x69, 0xc3, 0x08, 0x84, 0x93, 0x02, 0xdc, 0x4c, // ........i......L + 0x08, 0x19, 0x9c, 0x02, 0x3b, 0xbc, 0x83, 0x38, 0x84, 0x03, 0x3b, 0xcc, 0x03, 0x0a, 0x3a, 0xf2, // ....;..8..;...:. + 0xa6, 0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, // .......r..t`.6h. + 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, // yh.r....P.m..zP. + 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, // m..z0.r..s .m..q + 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, // ..s .m..x..s .m. + 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, // .q`.z0.r...0.r.. + 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, // s .m..v@.z`.t... + 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, // ..v..s .m`.s .z0 + 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, // .r...`.t..v@.m.. + 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, // x..q`.z0.r..v@.C + 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x04, 0x10, // .............<.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x12, 0x20, 0x00, 0x04, 0x00, // ..........y. ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x30, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, // ........0@...... + 0x00, 0x00, 0x00, 0x30, 0xe4, 0x81, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...0............ + 0x60, 0xc8, 0x33, 0x01, 0x01, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x16, 0x08, // `.3..0.......@.. + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, // .....2.....L...& + 0x47, 0xc6, 0x04, 0x43, 0x1a, 0x4a, 0x60, 0x04, 0xa0, 0x28, 0x8a, 0xa1, 0x1c, 0x4a, 0xa1, 0x80, // G..C.J`..(...J.. + 0x0a, 0xa1, 0x20, 0x48, 0x1a, 0x01, 0xa0, 0x6c, 0x06, 0x80, 0xb6, 0x19, 0x00, 0xfa, 0x66, 0x00, // .. H...l......f. + 0x00, 0x79, 0x18, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, // .y...A.....L.F.. + 0xc4, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0x06, 0xc6, 0x45, 0xc6, 0x06, // ...o..M.$.%..E.. + 0xa6, 0xc6, 0x65, 0xe6, 0x06, 0x04, 0x65, 0x8c, 0x86, 0x0c, 0xc7, 0x8c, 0xc6, 0x2c, 0x27, 0x27, // ..e...e......,'' + 0x65, 0x43, 0x10, 0x4c, 0x10, 0x06, 0x63, 0x82, 0x30, 0x1c, 0x1b, 0x84, 0x81, 0x98, 0x20, 0x0c, // eC.L..c.0..... . + 0xc8, 0x06, 0x61, 0x30, 0x28, 0x8c, 0xcd, 0x4d, 0x10, 0x86, 0x64, 0xc3, 0x80, 0x24, 0xc4, 0x04, // ..a0(..M..d..$.. + 0x21, 0x83, 0x08, 0x4c, 0x10, 0x06, 0x65, 0x82, 0x30, 0x2c, 0x1b, 0x04, 0xc2, 0xd9, 0x90, 0x10, // !..L..e.0,...... + 0x0b, 0x43, 0x10, 0x43, 0x43, 0x3c, 0x1b, 0x02, 0x68, 0x82, 0xb0, 0x45, 0x13, 0x04, 0xe9, 0xd9, // .C.CC<..h..E.... + 0xb0, 0x10, 0x12, 0x43, 0x10, 0x83, 0x31, 0x4d, 0xd3, 0xb3, 0x21, 0xa0, 0x26, 0x08, 0x9f, 0x34, // ...C..1M..!.&..4 + 0x41, 0x18, 0x98, 0x0d, 0x08, 0x61, 0x31, 0x04, 0x31, 0x5c, 0xc0, 0x86, 0x00, 0xdb, 0x40, 0x44, // A....a1.1.....@D + 0x55, 0x06, 0x4c, 0x10, 0x04, 0x80, 0x44, 0x5b, 0x58, 0x9a, 0xdb, 0x04, 0x61, 0x68, 0x26, 0x08, // U.L...D[X...ah&. + 0x83, 0xb3, 0x61, 0xf0, 0xbc, 0x61, 0x83, 0xd0, 0x7d, 0x1b, 0x8a, 0x8d, 0x03, 0x34, 0x30, 0xa8, // ..a..a..}....40. + 0xc2, 0xc6, 0x66, 0xd7, 0xe6, 0x92, 0x46, 0x56, 0xe6, 0x46, 0x37, 0x25, 0x08, 0xaa, 0x90, 0xe1, // ..f...FV.F7%.... + 0xb9, 0xd8, 0x95, 0xc9, 0xcd, 0xa5, 0xbd, 0xb9, 0x4d, 0x09, 0x88, 0x26, 0x64, 0x78, 0x2e, 0x76, // ........M..&dx.v + 0x61, 0x6c, 0x76, 0x65, 0x72, 0x53, 0x02, 0xa3, 0x0e, 0x19, 0x9e, 0xcb, 0x1c, 0x5a, 0x18, 0x59, // alverS.......Z.Y + 0x99, 0x5c, 0xd3, 0x1b, 0x59, 0x19, 0xdb, 0x94, 0x20, 0x29, 0x43, 0x86, 0xe7, 0x22, 0x57, 0x36, // ....Y... )C.."W6 + 0xf7, 0x56, 0x27, 0x37, 0x56, 0x36, 0x37, 0x25, 0xc8, 0xea, 0x90, 0xe1, 0xb9, 0x94, 0xb9, 0xd1, // .V'7V67%........ + 0xc9, 0xe5, 0x41, 0xbd, 0xa5, 0xb9, 0xd1, 0xcd, 0x4d, 0x09, 0xc0, 0x00, 0x00, 0x79, 0x18, 0x00, // ..A.....M....y.. + 0x00, 0x51, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, // .Q...3......f..= + 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, // .C8...B..yx.s.q. + 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, // .........3.B.... + 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, // ...f0.=.C8.....= + 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, // .C=..=.x.tp.{..y + 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, // H.pp.zp.vx.p ... + 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, // ......0.n0.....P + 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, // .3....!..!..a.f0 + 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, // .;..;.C9..<..<.. + 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, // ;...v`.{h.7h.rh. + 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, // 7..p..p`.v(.v..v + 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, // x.w.._..q..r..y. + 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, // .,..........0.b. + 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, // ............a..! + 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, // .....a...C9.C9.C + 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, // 9.C9..8.C8..;../ + 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, 0xe4, // p.z(.v....C..... + 0x20, 0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, // ..............P + 0x0f, 0xf4, 0x30, 0x83, 0x81, 0xc8, 0x01, 0x1f, 0xdc, 0x40, 0x1c, 0xe4, 0xa1, 0x1c, 0xc2, 0x61, // ..0......@.....a + 0x1d, 0xdc, 0x40, 0x1c, 0xe4, 0x01, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x18, 0x00, 0x00, // ..@......q ..... + 0x00, 0x26, 0x50, 0x0d, 0x97, 0xef, 0x3c, 0x7e, 0x40, 0x15, 0x05, 0x11, 0xb1, 0x93, 0x13, 0x11, // .&P...<~@....... + 0x3e, 0x72, 0xdb, 0x46, 0xb0, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, 0x50, 0x45, 0x41, 0x44, 0xa5, // >r.F....<..PEAD. + 0x03, 0x0c, 0x25, 0x61, 0x00, 0x02, 0xe6, 0x17, 0xb7, 0x6d, 0x05, 0xd2, 0x70, 0xf9, 0xce, 0xe3, // ..%a.....m..p... + 0x0b, 0x11, 0x01, 0x4c, 0x44, 0x08, 0x34, 0xc3, 0x42, 0xd8, 0x40, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, // ...LD.4.B.@5.... + 0x13, 0x71, 0x4d, 0x54, 0x44, 0x94, 0x0e, 0x30, 0xf8, 0xc8, 0x6d, 0x5b, 0x80, 0x34, 0x5c, 0xbe, // .qMTD..0..m[.4.. + 0xf3, 0xf8, 0xd3, 0x11, 0x11, 0xc0, 0x20, 0x0e, 0x3e, 0x72, 0xdb, 0x06, 0x40, 0x30, 0x00, 0xd2, // ...... .>r..@0.. + 0x00, 0x61, 0x20, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x13, 0x04, 0x45, 0x2c, 0x10, 0x00, 0x00, // .a ..F.....E,... + 0x00, 0x06, 0x00, 0x00, 0x00, 0x34, 0xcc, 0x00, 0x94, 0x5c, 0xe9, 0x06, 0x94, 0x5d, 0x11, 0x14, // .....4.......].. + 0x61, 0x40, 0x29, 0x06, 0x90, 0x51, 0x02, 0x23, 0x00, 0x45, 0x50, 0x1e, 0x00, 0x23, 0x06, 0x09, // a@)..Q.#.EP..#.. + 0x00, 0x82, 0x60, 0x30, 0x65, 0x0a, 0x71, 0x5d, 0xcf, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x4c, // ..`0e.q]..A.. .L + 0xda, 0x42, 0x60, 0x18, 0x34, 0x62, 0x90, 0x00, 0x20, 0x08, 0x06, 0xd3, 0xc6, 0x10, 0x59, 0x16, // .B`.4b.. .....Y. + 0x8d, 0x18, 0x18, 0x00, 0x08, 0x82, 0x01, 0x01, 0x06, 0x8c, 0x36, 0x62, 0x60, 0x00, 0x20, 0x08, // ..........6b`. . + 0x06, 0x44, 0x18, 0x34, 0xdc, 0x88, 0x81, 0x01, 0x80, 0x20, 0x18, 0x10, 0x62, 0xe0, 0x30, 0x23, // .D.4..... ..b.0# + 0x06, 0x07, 0x00, 0x82, 0x60, 0x00, 0x81, 0x81, 0x43, 0x78, 0xa3, 0x09, 0x01, 0x70, 0xc1, 0x40, // ....`...Cx...p.@ + 0xc3, 0x0d, 0x46, 0x80, 0x06, 0xb3, 0x0c, 0x01, 0x11, 0x8c, 0x26, 0x10, 0xc1, 0x05, 0x03, 0x0d, // ..F.......&..... + 0x37, 0x20, 0x01, 0x1a, 0xcc, 0x32, 0x08, 0x44, 0x30, 0x9a, 0x70, 0x08, 0x17, 0x0c, 0x34, 0xdc, // 7 ...2.D0.p...4. + 0xa0, 0x04, 0x68, 0x30, 0xcb, 0x30, 0x10, 0xc1, 0x88, 0xc1, 0x01, 0x80, 0x20, 0x18, 0x40, 0x6a, // ..h0.0...... .@j + 0x80, 0x39, 0x67, 0x30, 0x9a, 0x10, 0x00, 0xa3, 0x09, 0x42, 0x30, 0x9a, 0x30, 0x08, 0x37, 0x0c, // .9g0.....B0.0.7. + 0x74, 0xc3, 0x40, 0x37, 0x0c, 0x54, 0x03, 0x05, 0x35, 0x50, 0x50, 0x03, 0x05, 0x23, 0x06, 0x0d, // t.@7.T..5PP..#.. + 0x00, 0x82, 0x60, 0xc0, 0xd4, 0x01, 0x18, 0x64, 0x71, 0x30, 0x08, 0x41, 0x19, 0x94, 0x41, 0x19, // ..`....dq0.A..A. + 0x8c, 0x26, 0x04, 0xc0, 0x68, 0x82, 0x10, 0x8c, 0x26, 0x0c, 0xc2, 0x68, 0x02, 0x31, 0x8c, 0x26, // .&..h...&..h.1.& + 0x64, 0xc3, 0x05, 0x03, 0x59, 0xc0, 0x89, 0x60, 0x34, 0x41, 0x1a, 0x2e, 0x18, 0xc8, 0x02, 0x30, // d...Y..`4A.....0 + 0x10, 0x41, 0x11, 0x62, 0x00, 0x15, 0x08, 0x30, 0x62, 0xd0, 0x00, 0x20, 0x08, 0x06, 0xc9, 0x28, // .A.b...0b.. ...( + 0xb0, 0xc1, 0x19, 0x04, 0x72, 0xc0, 0x2c, 0x4a, 0x82, 0x06, 0xb3, 0x04, 0x04, 0x02, 0x00, 0x00, // ....r.,J........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, // ....... . +}; +static const uint8_t cs_blit_texture_to_buffer_uint_mtl[1135] = +{ + 0x43, 0x53, 0x48, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // CSH............. + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0f, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // .......bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, // Region.......... + 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x01, 0x01, // ..bgfx_blitSrc.. + 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, // ..........bgfx_b + 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // litSrc.......... + 0x00, 0x08, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, // ...........#incl + 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, // ude .#include ..using + 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, // namespace metal + 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, // ;..struct _Globa + 0x6c, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, // l.{. float4 b + 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x32, // gfx_blitRegion[2 + 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x62, 0x67, // ];.};..struct bg + 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, // fx_blitDst.{. + 0x20, 0x75, 0x69, 0x6e, 0x74, 0x34, 0x20, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x31, 0x5d, 0x3b, // uint4 _data[1]; + 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x20, 0x76, 0x6f, 0x69, 0x64, // .};..kernel void + 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x63, 0x6f, 0x6e, // xlatMtlMain(con + 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, // stant _Global& _ + 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, // mtl_u [[buffer(0 + 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x20, 0x62, 0x67, 0x66, 0x78, // )]], device bgfx + 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x26, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, // _blitDst& bgfx_b + 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x5f, 0x31, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, // litDst_1 [[buffe + 0x72, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, // r(1)]], texture2 + 0x64, 0x5f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x75, 0x69, 0x6e, 0x74, 0x3e, 0x20, 0x62, 0x67, // d_array bg + 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, // fx_blitSrc [[tex + 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x33, // ture(0)]], uint3 + 0x20, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, // gl_GlobalInvoca + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x20, 0x5b, 0x5b, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, // tionID [[thread_ + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x5f, 0x67, 0x72, 0x69, 0x64, // position_in_grid + 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, // ]]).{. do. + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x20, // {. int3 + 0x5f, 0x31, 0x36, 0x32, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // _162 = int3(_mtl + 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, // _u.bgfx_blitRegi + 0x6f, 0x6e, 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // on[1].xyz);. + 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x28, 0x69, 0x6e, 0x74, 0x28, 0x67, 0x6c, // if (((int(gl + 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, // _GlobalInvocatio + 0x6e, 0x49, 0x44, 0x2e, 0x78, 0x29, 0x20, 0x3e, 0x3d, 0x20, 0x5f, 0x31, 0x36, 0x32, 0x2e, 0x78, // nID.x) >= _162.x + 0x29, 0x20, 0x7c, 0x7c, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, // ) || (int(gl_Glo + 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x2e, // balInvocationID. + 0x79, 0x29, 0x20, 0x3e, 0x3d, 0x20, 0x5f, 0x31, 0x36, 0x32, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x7c, // y) >= _162.y)) | + 0x7c, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, // | (int(gl_Global + 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x2e, 0x7a, 0x29, 0x20, // InvocationID.z) + 0x3e, 0x3d, 0x20, 0x5f, 0x31, 0x36, 0x32, 0x2e, 0x7a, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // >= _162.z)). + 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // break;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x20, // }. int3 + 0x5f, 0x31, 0x39, 0x30, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // _190 = int3(_mtl + 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, // _u.bgfx_blitRegi + 0x6f, 0x6e, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x69, 0x6e, 0x74, // on[0].xyz) + int + 0x33, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, // 3(gl_GlobalInvoc + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ationID);. + 0x20, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x44, 0x73, 0x74, 0x5f, 0x31, // bgfx_blitDst_1 + 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x28, 0x28, 0x69, 0x6e, 0x74, 0x28, 0x67, 0x6c, 0x5f, // ._data[((int(gl_ + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, // GlobalInvocation + 0x49, 0x44, 0x2e, 0x7a, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // ID.z) * int(_mtl + 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x52, 0x65, 0x67, 0x69, // _u.bgfx_blitRegi + 0x6f, 0x6e, 0x5b, 0x31, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x69, 0x6e, 0x74, // on[1].w)) + (int + 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, // (gl_GlobalInvoca + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x74, 0x28, // tionID.y) * int( + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, // _mtl_u.bgfx_blit + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5b, 0x30, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x29, 0x20, 0x2b, // Region[0].w))) + + 0x20, 0x69, 0x6e, 0x74, 0x28, 0x67, 0x6c, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, // int(gl_GlobalIn + 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x2e, 0x78, 0x29, 0x5d, 0x20, 0x3d, // vocationID.x)] = + 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x62, 0x6c, 0x69, 0x74, 0x53, 0x72, 0x63, 0x2e, 0x72, 0x65, // bgfx_blitSrc.re + 0x61, 0x64, 0x28, 0x75, 0x69, 0x6e, 0x74, 0x32, 0x28, 0x5f, 0x31, 0x39, 0x30, 0x2e, 0x78, 0x79, // ad(uint2(_190.xy + 0x29, 0x2c, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x28, 0x5f, 0x31, 0x39, 0x30, 0x2e, 0x7a, 0x29, 0x2c, // ), uint(_190.z), + 0x20, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, // 0);. bre + 0x61, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, // ak;. } while( + 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // false);.}....0. +}; +extern const uint8_t* cs_blit_texture_to_buffer_uint_pssl; +extern const uint32_t cs_blit_texture_to_buffer_uint_pssl_size; diff --git a/src/cs_blit_texture_to_buffer_uint.sc b/src/cs_blit_texture_to_buffer_uint.sc new file mode 100644 index 000000000..700ead1b6 --- /dev/null +++ b/src/cs_blit_texture_to_buffer_uint.sc @@ -0,0 +1,35 @@ +/* + * Copyright 2011-2026 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE + */ + +#include "bgfx_compute.sh" + +UIMAGE2D_ARRAY_RO(bgfx_blitSrc, rgba32ui, 0); +BUFFER_WO(bgfx_blitDst, uvec4, 0); + +uniform vec4 bgfx_blitRegion[2]; + +#define bgfx_srcOrigin ivec3(bgfx_blitRegion[0].xyz) +#define bgfx_blitSize ivec3(bgfx_blitRegion[1].xyz) +#define bgfx_blitRowPitch int(bgfx_blitRegion[0].w) +#define bgfx_blitSlicePitch int(bgfx_blitRegion[1].w) + +NUM_THREADS(8, 8, 1) +void main() +{ + ivec3 coord = ivec3(gl_GlobalInvocationID.xyz); + + if (coord.x >= bgfx_blitSize.x + || coord.y >= bgfx_blitSize.y + || coord.z >= bgfx_blitSize.z) + { + return; + } + + uvec4 color = imageLoad(bgfx_blitSrc, bgfx_srcOrigin + coord); + + int index = coord.z * bgfx_blitSlicePitch + coord.y * bgfx_blitRowPitch + coord.x; + + bgfx_blitDst[index] = color; +} diff --git a/src/makefile b/src/makefile index abfd45af7..8e5cc4c37 100644 --- a/src/makefile +++ b/src/makefile @@ -27,6 +27,8 @@ 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 \ + cs_blit_texture_to_buffer_uint.bin.h \ + cs_blit_buffer_to_texture_uint.bin.h \ vs_resolve_depth.bin.h \ fs_resolve_depth.bin.h \ fs_resolve_depth_array.bin.h \ @@ -131,6 +133,12 @@ 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) +cs_blit_texture_to_buffer_uint.bin.h : cs_blit_texture_to_buffer_uint.sc + $(call shader-embedded-compute) + +cs_blit_buffer_to_texture_uint.bin.h : cs_blit_buffer_to_texture_uint.sc + $(call shader-embedded-compute) + vs_resolve_depth.bin.h : vs_resolve_depth.sc $(call shader-embedded, v) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 87b05c6f0..1f63eccfd 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -2294,6 +2294,7 @@ namespace bgfx { namespace d3d11 } void blitBufferTexture(const BlitItem& _blit); + void blitBufferTextureLayer(const BlitItem& _blit); void submitBlit(BlitState& _bs, uint16_t _view); void submitUniformCache(UniformCacheState& _ucs, uint16_t _view); @@ -5679,8 +5680,8 @@ namespace bgfx { namespace d3d11 { const uint32_t blockW = blockInfo.blockWidth; const uint32_t blockH = blockInfo.blockHeight; - const uint32_t alignedW = bx::max(blockW, bx::alignUp(_rect.m_width, blockW) ); - const uint32_t alignedH = bx::max(blockH, bx::alignUp(_rect.m_height, blockH) ); + const uint32_t alignedW = bx::max(blockW, bx::strideAlign(_rect.m_width, blockW) ); + const uint32_t alignedH = bx::max(blockH, bx::strideAlign(_rect.m_height, blockH) ); box.right = box.left + alignedW; box.bottom = box.top + alignedH; rectPitch = (alignedW / blockW) * blockInfo.blockSize; @@ -6897,24 +6898,113 @@ namespace bgfx { namespace d3d11 } } + struct UintFormat + { + DXGI_FORMAT format; + DXGI_FORMAT uintFormat; + + static int32_t cmpFn(const void* _lhs, const void* _rhs) + { + const DXGI_FORMAT lhs = ( (const UintFormat*)(_lhs) )->format; + const DXGI_FORMAT rhs = ( (const UintFormat*)(_rhs) )->format; + return (lhs > rhs) - (lhs < rhs); + } + }; + + static constexpr UintFormat s_uintFormat[] = + { + { DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT }, + { DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_UINT }, + { DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_UINT }, + { DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_UINT }, + { DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT }, + { DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_UINT }, + { DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UINT }, + { DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UINT }, + { DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_R8G8B8A8_UINT }, + { DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_R16G16_UINT }, + { DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_R16G16_UINT }, + { DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT }, + { DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_UINT }, + { DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_R8G8_UINT }, + { DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_R8G8_UINT }, + { DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT }, + { DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_UINT }, + { DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_UINT }, + { DXGI_FORMAT_R8_SINT, DXGI_FORMAT_R8_UINT }, + }; + static_assert(bx::isSorted(s_uintFormat, BX_COUNTOF(s_uintFormat), [](const UintFormat& _lhs, const UintFormat& _rhs) { return _lhs.format <= _rhs.format; }) ); + + static DXGI_FORMAT getUintFormat(DXGI_FORMAT _format) + { + const int32_t idx = bx::binarySearch(_format, s_uintFormat, BX_COUNTOF(s_uintFormat), sizeof(UintFormat), UintFormat::cmpFn); + + return 0 <= idx + ? s_uintFormat[idx].uintFormat + : DXGI_FORMAT_UNKNOWN + ; + } + void RendererContextD3D11::blitBufferTexture(const BlitItem& _blit) { const bool toBuffer = _blit.m_dst.isBuffer(); + BlitItem layer = _blit; + layer.m_depth = 1; + + for (uint32_t ii = 0, num = bx::max(1, _blit.m_depth); ii < num; ++ii) + { + blitBufferTextureLayer(layer); + + if (toBuffer) + { + ++layer.m_srcZ; + layer.m_dstOffset += _blit.m_slicePitch; + } + else + { + ++layer.m_dstZ; + layer.m_srcOffset += _blit.m_slicePitch; + } + } + } + + void RendererContextD3D11::blitBufferTextureLayer(const BlitItem& _blit) + { + const bool toBuffer = _blit.m_dst.isBuffer(); + const TextureD3D11& texture = m_textures[(toBuffer ? _blit.m_src : _blit.m_dst).idx]; const BufferD3D11& buffer = getBuffer(toBuffer ? _blit.m_dst : _blit.m_src); const bimg::TextureFormat::Enum format = bimg::TextureFormat::Enum(texture.m_textureFormat); + const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(format); + const bool compressed = bimg::isCompressed(format); - if (bimg::isCompressed(format) - || bimg::isDepth(format) ) + const DXGI_FORMAT uintFormat = compressed + ? (8 == blockInfo.blockSize ? DXGI_FORMAT_R32G32_UINT : DXGI_FORMAT_R32G32B32A32_UINT) + : getUintFormat(texture.getSrvFormat() ) + ; + const bool raw = DXGI_FORMAT_UNKNOWN != uintFormat; + const bool aliased = raw && uintFormat != texture.getSrvFormat(); + + if (bimg::isDepth(format) ) { - BX_WARN(false, "Blit between buffer and texture is not supported for compressed or depth formats."); + BX_WARN(false, "Blit between buffer and texture is not supported for depth formats."); return; } - if (0 == (g_caps.formats[texture.m_textureFormat] & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE) ) + if (compressed + && 8 != blockInfo.blockSize + && 16 != blockInfo.blockSize) + { + BX_WARN(false, "Blit between buffer and texture is not supported for texture format %s.", bimg::getName(format) ); + + return; + } + + if (!aliased + && 0 == (g_caps.formats[texture.m_textureFormat] & BGFX_CAPS_FORMAT_TEXTURE_IMAGE_WRITE) ) { BX_WARN(false, "Blit between buffer and texture is not supported for texture format %s.", bimg::getName(format) ); @@ -6933,9 +7023,9 @@ namespace bgfx { namespace d3d11 return; } - const ProgramHandle prog = g_blitFallback->m_program[toBuffer - ? BlitFallback::TextureToBuffer - : BlitFallback::BufferToTexture + const ProgramHandle prog = g_blitFallback->m_program[raw + ? (toBuffer ? BlitFallback::TextureToBufferUint : BlitFallback::BufferToTextureUint) + : (toBuffer ? BlitFallback::TextureToBuffer : BlitFallback::BufferToTexture) ]; if (!isValid(prog) ) @@ -6943,7 +7033,12 @@ namespace bgfx { namespace d3d11 return; } - const uint32_t bpp = bimg::getBitsPerPixel(format) / 8; + const uint32_t blockW = bx::max(1, blockInfo.blockWidth); + const uint32_t blockH = bx::max(1, blockInfo.blockHeight); + const uint32_t width = (_blit.m_width + blockW - 1) / blockW; + const uint32_t height = (_blit.m_height + blockH - 1) / blockH; + + const uint32_t bpp = compressed ? blockInfo.blockSize : bimg::getBitsPerPixel(format) / 8; const uint32_t offset = toBuffer ? _blit.m_dstOffset : _blit.m_srcOffset; if (0 != offset % bpp @@ -6959,9 +7054,61 @@ namespace bgfx { namespace d3d11 return; } - const DXGI_FORMAT dxgiFormat = texture.getSrvFormat(); - const DXGI_FORMAT uavFormat = texture.getUavFormat(); - const uint32_t numElements = (_blit.m_rowPitch * _blit.m_height) / bpp; + const DXGI_FORMAT dxgiFormat = raw ? uintFormat : texture.getSrvFormat(); + const DXGI_FORMAT uavFormat = raw ? uintFormat : texture.getUavFormat(); + const uint32_t numElements = (_blit.m_rowPitch * height) / bpp; + + ID3D11DeviceContext* deviceCtx = m_deviceCtx; + + ID3D11Texture2D* staging = NULL; + + if (aliased) + { + const D3D11_TEXTURE2D_DESC desc = + { + .Width = width, + .Height = height, + .MipLevels = 1, + .ArraySize = 1, + .Format = uintFormat, + .SampleDesc = { .Count = 1, .Quality = 0 }, + .Usage = D3D11_USAGE_DEFAULT, + .BindFlags = D3D11_BIND_SHADER_RESOURCE|D3D11_BIND_UNORDERED_ACCESS, + .CPUAccessFlags = 0, + .MiscFlags = 0, + }; + + DX_CHECK(m_device->CreateTexture2D(&desc, NULL, &staging) ); + + if (NULL == staging) + { + return; + } + + if (toBuffer) + { + const D3D11_BOX box = + { + .left = _blit.m_srcX, + .top = _blit.m_srcY, + .front = 0, + .right = _blit.m_srcX + width*blockW, + .bottom = _blit.m_srcY + height*blockH, + .back = 1, + }; + + deviceCtx->CopySubresourceRegion( + staging + , 0 + , 0 + , 0 + , 0 + , texture.m_ptr + , _blit.m_srcMip + _blit.m_srcZ*texture.m_numMips + , &box + ); + } + } ID3D11ShaderResourceView* srv = NULL; ID3D11UnorderedAccessView* uav = NULL; @@ -6971,12 +7118,12 @@ namespace bgfx { namespace d3d11 D3D11_SHADER_RESOURCE_VIEW_DESC srvd = {}; srvd.Format = dxgiFormat; srvd.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DARRAY; - srvd.Texture2DArray.MostDetailedMip = _blit.m_srcMip; + srvd.Texture2DArray.MostDetailedMip = aliased ? 0 : _blit.m_srcMip; srvd.Texture2DArray.MipLevels = 1; - srvd.Texture2DArray.FirstArraySlice = _blit.m_srcZ; + srvd.Texture2DArray.FirstArraySlice = aliased ? 0 : _blit.m_srcZ; srvd.Texture2DArray.ArraySize = 1; - DX_CHECK(m_device->CreateShaderResourceView(texture.m_ptr, &srvd, &srv) ); + DX_CHECK(m_device->CreateShaderResourceView(aliased ? staging : texture.m_ptr, &srvd, &srv) ); D3D11_UNORDERED_ACCESS_VIEW_DESC uavd = {}; uavd.Format = uavFormat; @@ -6999,11 +7146,11 @@ namespace bgfx { namespace d3d11 D3D11_UNORDERED_ACCESS_VIEW_DESC uavd = {}; uavd.Format = uavFormat; uavd.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2DARRAY; - uavd.Texture2DArray.MipSlice = _blit.m_dstMip; - uavd.Texture2DArray.FirstArraySlice = _blit.m_dstZ; + uavd.Texture2DArray.MipSlice = aliased ? 0 : _blit.m_dstMip; + uavd.Texture2DArray.FirstArraySlice = aliased ? 0 : _blit.m_dstZ; uavd.Texture2DArray.ArraySize = 1; - DX_CHECK(m_device->CreateUnorderedAccessView(texture.m_ptr, &uavd, &uav) ); + DX_CHECK(m_device->CreateUnorderedAccessView(aliased ? staging : texture.m_ptr, &uavd, &uav) ); } if (NULL == srv @@ -7011,6 +7158,7 @@ namespace bgfx { namespace d3d11 { DX_RELEASE(srv, 0); DX_RELEASE(uav, 0); + DX_RELEASE(staging, 0); return; } @@ -7019,18 +7167,16 @@ namespace bgfx { namespace d3d11 const float params[8] = { - float(toBuffer ? _blit.m_srcX : _blit.m_dstX), - float(toBuffer ? _blit.m_srcY : _blit.m_dstY), + aliased ? 0.0f : float(toBuffer ? _blit.m_srcX : _blit.m_dstX), + aliased ? 0.0f : float(toBuffer ? _blit.m_srcY : _blit.m_dstY), 0.0f, float(_blit.m_rowPitch / bpp), - float(_blit.m_width), - float(_blit.m_height), + float(width), + float(height), 1.0f, 0.0f, }; - ID3D11DeviceContext* deviceCtx = m_deviceCtx; - deviceCtx->CSSetShader(shader.m_computeShader, NULL, 0); deviceCtx->CSSetShaderResources(0, 1, &srv); deviceCtx->CSSetUnorderedAccessViews(0, 1, &uav, NULL); @@ -7042,8 +7188,8 @@ namespace bgfx { namespace d3d11 } deviceCtx->Dispatch( - bx::strideAlign(_blit.m_width, 8) / 8 - , bx::strideAlign(_blit.m_height, 8) / 8 + bx::strideAlign(width, 8) / 8 + , bx::strideAlign(height, 8) / 8 , 1 ); @@ -7057,6 +7203,33 @@ namespace bgfx { namespace d3d11 DX_RELEASE(srv, 0); DX_RELEASE(uav, 0); + + if (aliased + && !toBuffer) + { + const D3D11_BOX box = + { + .left = 0, + .top = 0, + .front = 0, + .right = width, + .bottom = height, + .back = 1, + }; + + deviceCtx->CopySubresourceRegion( + texture.m_ptr + , _blit.m_dstMip + _blit.m_dstZ*texture.m_numMips + , _blit.m_dstX + , _blit.m_dstY + , 0 + , staging + , 0 + , &box + ); + } + + DX_RELEASE(staging, 0); } void RendererContextD3D11::submitBlit(BlitState& _bs, uint16_t _view) diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index bc486c1ac..749ffeedc 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -2578,8 +2578,8 @@ namespace bgfx { namespace d3d12 const uint32_t blockWidth = bx::max(1, blockInfo.blockWidth); const uint32_t blockHeight = bx::max(1, blockInfo.blockHeight); - const uint32_t alignedWidth = bx::alignUp(srcWidth, blockWidth); - const uint32_t alignedHeight = bx::alignUp(srcHeight, blockHeight); + const uint32_t alignedWidth = bx::strideAlign(srcWidth, blockWidth); + const uint32_t alignedHeight = bx::strideAlign(srcHeight, blockHeight); layout.Footprint.Width = alignedWidth; layout.Footprint.Height = alignedHeight; @@ -7774,8 +7774,8 @@ namespace bgfx { namespace d3d12 const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat) ); const uint32_t blockW = blockInfo.blockWidth; const uint32_t blockH = blockInfo.blockHeight; - boxWidth = bx::max(blockW, bx::alignUp(_rect.m_width, blockW) ); - boxHeight = bx::max(blockH, bx::alignUp(_rect.m_height, blockH) ); + boxWidth = bx::max(blockW, bx::strideAlign(_rect.m_width, blockW) ); + boxHeight = bx::max(blockH, bx::strideAlign(_rect.m_height, blockH) ); rectPitch = (boxWidth / blockW) * blockInfo.blockSize; } @@ -9858,6 +9858,21 @@ namespace bgfx { namespace d3d12 const bool depthStencil = bimg::isDepth(bimg::TextureFormat::Enum(src.m_textureFormat) ); + const bool sameTexture = true + && blit.m_src.idx == blit.m_dst.idx + && srcLocation.SubresourceIndex != dstLocation.SubresourceIndex + ; + + if (sameTexture) + { + setResourceBarrier(m_commandList + , dst.m_ptr + , D3D12_RESOURCE_STATE_COPY_SOURCE + , D3D12_RESOURCE_STATE_COPY_DEST + , dstLocation.SubresourceIndex + ); + } + m_commandList->CopyTextureRegion( &dstLocation , blit.m_dstX @@ -9867,6 +9882,16 @@ namespace bgfx { namespace d3d12 , depthStencil ? NULL : &box ); + if (sameTexture) + { + setResourceBarrier(m_commandList + , dst.m_ptr + , D3D12_RESOURCE_STATE_COPY_DEST + , D3D12_RESOURCE_STATE_COPY_SOURCE + , dstLocation.SubresourceIndex + ); + } + if (hasStencilPlane(TextureFormat::Enum(src.m_textureFormat) ) && hasStencilPlane(TextureFormat::Enum(dst.m_textureFormat) ) ) { diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 57cdd942b..beadfffa6 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -3656,16 +3656,21 @@ namespace bgfx { namespace gl { GL_CHECK(glBindTexture(texture.m_target, texture.m_id) ); + const GLenum target = GL_TEXTURE_CUBE_MAP == texture.m_target + ? GL_TEXTURE_CUBE_MAP_POSITIVE_X + _layer + : texture.m_target + ; + if (compressed) { - GL_CHECK(glGetCompressedTexImage(texture.m_target + GL_CHECK(glGetCompressedTexImage(target , _mip , _data ) ); } else { - GL_CHECK(glGetTexImage(texture.m_target + GL_CHECK(glGetTexImage(target , _mip , texture.m_fmt , texture.m_type @@ -8938,6 +8943,137 @@ namespace bgfx { namespace gl return true; } + static void compressedTexSubImage( + const TextureGL& _dst + , uint8_t _mip + , uint32_t _x + , uint32_t _y + , uint32_t _z + , uint32_t _width + , uint32_t _height + , uint32_t _depth + , uint32_t _size + , const void* _data + ) + { + if (GL_TEXTURE_3D == _dst.m_target + || GL_TEXTURE_2D_ARRAY == _dst.m_target + || GL_TEXTURE_CUBE_MAP_ARRAY == _dst.m_target) + { + GL_CHECK(glCompressedTexSubImage3D(_dst.m_target + , _mip + , _x + , _y + , _z + , _width + , _height + , _depth + , _dst.m_internalFmt + , _size + , _data + ) ); + + return; + } + + const uint32_t sliceSize = _size/_depth; + + for (uint32_t ii = 0; ii < _depth; ++ii) + { + GL_CHECK(glCompressedTexSubImage2D(GL_TEXTURE_CUBE_MAP == _dst.m_target + ? GL_TEXTURE_CUBE_MAP_POSITIVE_X + _z + ii + : _dst.m_target + , _mip + , _x + , _y + , _width + , _height + , _dst.m_internalFmt + , sliceSize + , (const uint8_t*)_data + ii*sliceSize + ) ); + } + } + + static bool blitCompressedRegion( + const BlitItem& _bi + , const TextureGL& _src + , const TextureGL& _dst + , bimg::TextureFormat::Enum _format + ) + { + if (GL_ZERO == _dst.m_internalFmt + || NULL == glGetCompressedTextureSubImage) + { + return false; + } + + const bimg::ImageBlockInfo& info = bimg::getBlockInfo(_format); + + const uint32_t blockW = bx::max(1, info.blockWidth); + const uint32_t blockH = bx::max(1, info.blockHeight); + const uint32_t blockSize = info.blockSize; + + if (0 != _bi.m_srcX % blockW + || 0 != _bi.m_srcY % blockH + || 0 != _bi.m_dstX % blockW + || 0 != _bi.m_dstY % blockH) + { + return false; + } + + const uint32_t srcMipW = bx::max(1, _src.m_width >> _bi.m_srcMip); + const uint32_t srcMipH = bx::max(1, _src.m_height >> _bi.m_srcMip); + const uint32_t dstMipW = bx::max(1, _dst.m_width >> _bi.m_dstMip); + const uint32_t dstMipH = bx::max(1, _dst.m_height >> _bi.m_dstMip); + + const uint32_t copyW = bx::min(_bi.m_width, bx::min(srcMipW - _bi.m_srcX, dstMipW - _bi.m_dstX) ); + const uint32_t copyH = bx::min(_bi.m_height, bx::min(srcMipH - _bi.m_srcY, dstMipH - _bi.m_dstY) ); + + const uint32_t numBlocksX = (copyW + blockW - 1)/blockW; + const uint32_t numBlocksY = (copyH + blockH - 1)/blockH; + const uint32_t depth = bx::max(1, _bi.m_depth); + + if (0 == numBlocksX + || 0 == numBlocksY) + { + return false; + } + + const uint32_t size = numBlocksX*numBlocksY*blockSize*depth; + uint8_t* blocks = (uint8_t*)bx::alloc(g_allocator, size); + + GL_CHECK(glGetCompressedTextureSubImage(_src.m_id + , _bi.m_srcMip + , _bi.m_srcX + , _bi.m_srcY + , _bi.m_srcZ + , bx::min(numBlocksX*blockW, srcMipW - _bi.m_srcX) + , bx::min(numBlocksY*blockH, srcMipH - _bi.m_srcY) + , depth + , size + , blocks + ) ); + + GL_CHECK(glBindTexture(_dst.m_target, _dst.m_id) ); + compressedTexSubImage(_dst + , _bi.m_dstMip + , _bi.m_dstX + , _bi.m_dstY + , _bi.m_dstZ + , bx::min(numBlocksX*blockW, dstMipW - _bi.m_dstX) + , bx::min(numBlocksY*blockH, dstMipH - _bi.m_dstY) + , depth + , size + , blocks + ); + GL_CHECK(glBindTexture(_dst.m_target, 0) ); + + bx::free(g_allocator, blocks); + + return true; + } + static void blitBuffer(GLuint _src, GLuint _dst, const BlitItem& _bi) { if (NULL == glCopyBufferSubData) @@ -8976,6 +9112,48 @@ namespace bgfx { namespace gl GL_CHECK(glPixelStorei(GL_UNPACK_ALIGNMENT, 1) ); GL_CHECK(glBindTexture(_dst.m_target, _dst.m_id) ); + const bimg::TextureFormat::Enum format = bimg::TextureFormat::Enum(_dst.m_textureFormat); + + if (bimg::isCompressed(format) ) + { + const bimg::ImageBlockInfo& info = bimg::getBlockInfo(format); + + const uint32_t blockW = bx::max(1, info.blockWidth); + const uint32_t blockH = bx::max(1, info.blockHeight); + const uint32_t mipW = bx::max(1, _dst.m_width >> _bi.m_dstMip); + const uint32_t mipH = bx::max(1, _dst.m_height >> _bi.m_dstMip); + const uint32_t width = bx::min(_bi.m_width, mipW - _bi.m_dstX); + const uint32_t height = bx::min(_bi.m_height, mipH - _bi.m_dstY); + const uint32_t numRows = (height + blockH - 1)/blockH; + const uint32_t rowBytes = (width + blockW - 1)/blockW*info.blockSize; + + for (uint32_t slice = 0, depth = bx::max(1, _bi.m_depth); slice < depth; ++slice) + { + for (uint32_t row = 0; row < numRows; ++row) + { + const uint32_t y = _bi.m_dstY + row*blockH; + + compressedTexSubImage(_dst + , _bi.m_dstMip + , _bi.m_dstX + , y + , _bi.m_dstZ + slice + , width + , bx::min(blockH, mipH - y) + , 1 + , rowBytes + , (const GLvoid*)uintptr_t(_bi.m_srcOffset + slice*_bi.m_slicePitch + row*_bi.m_rowPitch) + ); + } + } + + GL_CHECK(glBindTexture(_dst.m_target, 0) ); + GL_CHECK(glPixelStorei(GL_UNPACK_ALIGNMENT, 4) ); + GL_CHECK(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0) ); + + return; + } + uint32_t rowLength, imageHeight; calcTextureRegionTexelPitch( rowLength @@ -9044,6 +9222,47 @@ namespace bgfx { namespace gl GL_CHECK(glBindBuffer(GL_PIXEL_PACK_BUFFER, _dst) ); GL_CHECK(glPixelStorei(GL_PACK_ALIGNMENT, 1) ); + const bimg::TextureFormat::Enum format = bimg::TextureFormat::Enum(_src.m_textureFormat); + + if (bimg::isCompressed(format) ) + { + const bimg::ImageBlockInfo& info = bimg::getBlockInfo(format); + + const uint32_t blockW = bx::max(1, info.blockWidth); + const uint32_t blockH = bx::max(1, info.blockHeight); + const uint32_t mipW = bx::max(1, _src.m_width >> _bi.m_srcMip); + const uint32_t mipH = bx::max(1, _src.m_height >> _bi.m_srcMip); + const uint32_t width = bx::min(_bi.m_width, mipW - _bi.m_srcX); + const uint32_t height = bx::min(_bi.m_height, mipH - _bi.m_srcY); + const uint32_t numRows = (height + blockH - 1)/blockH; + const uint32_t rowBytes = (width + blockW - 1)/blockW*info.blockSize; + + for (uint32_t slice = 0, depth = bx::max(1, _bi.m_depth); slice < depth; ++slice) + { + for (uint32_t row = 0; row < numRows; ++row) + { + const uint32_t y = _bi.m_srcY + row*blockH; + + GL_CHECK(glGetCompressedTextureSubImage(_src.m_id + , _bi.m_srcMip + , _bi.m_srcX + , y + , _bi.m_srcZ + slice + , width + , bx::min(blockH, mipH - y) + , 1 + , rowBytes + , (GLvoid*)uintptr_t(_bi.m_dstOffset + slice*_bi.m_slicePitch + row*_bi.m_rowPitch) + ) ); + } + } + + GL_CHECK(glPixelStorei(GL_PACK_ALIGNMENT, 4) ); + GL_CHECK(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0) ); + + return; + } + uint32_t rowLength, imageHeight; calcTextureRegionTexelPitch( rowLength @@ -9147,7 +9366,7 @@ namespace bgfx { namespace gl || !isCompressedRegionCopyable(bi.m_dstX, width, dstMipWidth, blockW) || !isCompressedRegionCopyable(bi.m_srcY, height, srcMipHeight, blockH) || !isCompressedRegionCopyable(bi.m_dstY, height, dstMipHeight, blockH) ) - && blitCompressed2D(bi, src, dst, format) ) + && (blitCompressedRegion(bi, src, dst, format) || blitCompressed2D(bi, src, dst, format) ) ) { continue; } diff --git a/src/renderer_mtl.cpp b/src/renderer_mtl.cpp index 5b168c27e..acd49533b 100644 --- a/src/renderer_mtl.cpp +++ b/src/renderer_mtl.cpp @@ -4758,9 +4758,9 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames else { const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat) ); - const uint32_t blockW = blockInfo.blockWidth; - const uint32_t alignedW = bx::max(blockW, bx::alignUp(_rect.m_width, blockW) ); - rectpitch = (alignedW / blockW)*blockInfo.blockSize; + const uint32_t blockW = blockInfo.blockWidth; + const uint32_t numBlocksX = bx::max(1, (_rect.m_width + blockW - 1) / blockW); + rectpitch = numBlocksX*blockInfo.blockSize; } } const bool convert = m_textureFormat != m_requestedFormat; @@ -6223,17 +6223,25 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames const uint32_t depth = bx::max(blit.m_depth, 1); const bool is3D = MTL::TextureType3D == dstTex.m_ptr->textureType(); - m_blitCommandEncoder->copyFromBuffer( - srcBuf.m_ptr - , blit.m_srcOffset - , blit.m_rowPitch - , blit.m_slicePitch - , MTL::Size::Make(blit.m_width, blit.m_height, is3D ? depth : 1) - , dstTex.m_ptr - , is3D ? 0 : blit.m_dstZ - , blit.m_dstMip - , MTL::Origin::Make(blit.m_dstX, blit.m_dstY, is3D ? blit.m_dstZ : 0) - ); + const uint32_t dstMipWidth = bx::max(1, dstTex.m_ptr->width() >> blit.m_dstMip); + const uint32_t dstMipHeight = bx::max(1, dstTex.m_ptr->height() >> blit.m_dstMip); + const uint32_t width = bx::min(blit.m_width, dstMipWidth - blit.m_dstX); + const uint32_t height = bx::min(blit.m_height, dstMipHeight - blit.m_dstY); + + for (uint32_t ii = 0, num = is3D ? 1 : depth; ii < num; ++ii) + { + m_blitCommandEncoder->copyFromBuffer( + srcBuf.m_ptr + , blit.m_srcOffset + ii * blit.m_slicePitch + , blit.m_rowPitch + , blit.m_slicePitch + , MTL::Size::Make(width, height, is3D ? depth : 1) + , dstTex.m_ptr + , is3D ? 0 : blit.m_dstZ + ii + , blit.m_dstMip + , MTL::Origin::Make(blit.m_dstX, blit.m_dstY, is3D ? blit.m_dstZ : 0) + ); + } continue; } @@ -6253,17 +6261,20 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames const uint32_t depth = bx::max(blit.m_depth, 1); const bool is3D = MTL::TextureType3D == srcTex.m_ptr->textureType(); - m_blitCommandEncoder->copyFromTexture( - srcTex.m_ptr - , is3D ? 0 : blit.m_srcZ - , blit.m_srcMip - , MTL::Origin::Make(blit.m_srcX, blit.m_srcY, is3D ? blit.m_srcZ : 0) - , MTL::Size::Make(blit.m_width, blit.m_height, is3D ? depth : 1) - , dstBuf.m_ptr - , blit.m_dstOffset - , blit.m_rowPitch - , blit.m_slicePitch - ); + for (uint32_t ii = 0, num = is3D ? 1 : depth; ii < num; ++ii) + { + m_blitCommandEncoder->copyFromTexture( + srcTex.m_ptr + , is3D ? 0 : blit.m_srcZ + ii + , blit.m_srcMip + , MTL::Origin::Make(blit.m_srcX, blit.m_srcY, is3D ? blit.m_srcZ : 0) + , MTL::Size::Make(blit.m_width, blit.m_height, is3D ? depth : 1) + , dstBuf.m_ptr + , blit.m_dstOffset + ii * blit.m_slicePitch + , blit.m_rowPitch + , blit.m_slicePitch + ); + } #if BX_PLATFORM_OSX if (m_hasSynchronizeResource @@ -6306,17 +6317,86 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames } else { - m_blitCommandEncoder->copyFromTexture( - src.m_ptr - , blit.m_srcZ - , blit.m_srcMip - , MTL::Origin::Make(blit.m_srcX, blit.m_srcY, 0) - , MTL::Size::Make(blit.m_width, blit.m_height, 1) - , dst.m_ptr - , blit.m_dstZ - , blit.m_dstMip - , MTL::Origin::Make(blit.m_dstX, blit.m_dstY, 0) - ); + const bimg::TextureFormat::Enum format = bimg::TextureFormat::Enum(src.m_textureFormat); + const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(format); + const uint32_t srcMipWidth = bx::max(1, src.m_ptr->width() >> blit.m_srcMip); + const uint32_t srcMipHeight = bx::max(1, src.m_ptr->height() >> blit.m_srcMip); + const bool subBlock = bimg::isCompressed(format) + && (srcMipWidth < blockInfo.blockWidth + || srcMipHeight < blockInfo.blockHeight) + ; + + if (subBlock) + { + const uint32_t numBlocksX = (blit.m_width + blockInfo.blockWidth - 1) / blockInfo.blockWidth; + const uint32_t numBlocksY = (blit.m_height + blockInfo.blockHeight - 1) / blockInfo.blockHeight; + const uint32_t rowPitch = numBlocksX * blockInfo.blockSize; + const uint32_t size = rowPitch * numBlocksY; + + MTL::Buffer* staging = m_device->newBuffer(size, MTL::ResourceStorageModePrivate); + + m_blitCommandEncoder->copyFromTexture( + src.m_ptr + , blit.m_srcZ + , blit.m_srcMip + , MTL::Origin::Make(blit.m_srcX, blit.m_srcY, 0) + , MTL::Size::Make(blit.m_width, blit.m_height, 1) + , staging + , 0 + , rowPitch + , size + ); + + const uint32_t dstMipWidth = bx::max(1, dst.m_ptr->width() >> blit.m_dstMip); + const uint32_t dstMipHeight = bx::max(1, dst.m_ptr->height() >> blit.m_dstMip); + const uint32_t width = bx::min(blit.m_width, dstMipWidth - blit.m_dstX); + const uint32_t height = bx::min(blit.m_height, dstMipHeight - blit.m_dstY); + + m_blitCommandEncoder->copyFromBuffer( + staging + , 0 + , rowPitch + , size + , MTL::Size::Make(width, height, 1) + , dst.m_ptr + , blit.m_dstZ + , blit.m_dstMip + , MTL::Origin::Make(blit.m_dstX, blit.m_dstY, 0) + ); + + MTL_RELEASE_DEFERRED(staging); + } + else + { + m_blitCommandEncoder->copyFromTexture( + src.m_ptr + , blit.m_srcZ + , blit.m_srcMip + , MTL::Origin::Make(blit.m_srcX, blit.m_srcY, 0) + , MTL::Size::Make(blit.m_width, blit.m_height, 1) + , dst.m_ptr + , blit.m_dstZ + , blit.m_dstMip + , MTL::Origin::Make(blit.m_dstX, blit.m_dstY, 0) + ); + + if (NULL != src.m_ptrMsaa + && NULL != dst.m_ptrMsaa + && src.m_ptrMsaa->sampleCount() == dst.m_ptrMsaa->sampleCount() ) + { + m_blitCommandEncoder->copyFromTexture( + src.m_ptrMsaa + , blit.m_srcZ + , blit.m_srcMip + , MTL::Origin::Make(blit.m_srcX, blit.m_srcY, 0) + , MTL::Size::Make(blit.m_width, blit.m_height, 1) + , dst.m_ptrMsaa + , blit.m_dstZ + , blit.m_dstMip + , MTL::Origin::Make(blit.m_dstX, blit.m_dstY, 0) + ); + } + } #if BX_PLATFORM_OSX if (m_hasSynchronizeResource && readBack && MTL::StorageModeManaged == dst.m_ptr->storageMode() ) diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index a36350619..3364a0b75 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -11238,6 +11238,11 @@ VK_DESTROY const bool is3D = VK_IMAGE_VIEW_TYPE_3D == texture.m_type; const uint32_t depth = bx::max(1, blit.m_depth); const uint16_t z = toBuffer ? blit.m_srcZ : blit.m_dstZ; + const uint8_t mip = toBuffer ? blit.m_srcMip : blit.m_dstMip; + const uint16_t x = toBuffer ? blit.m_srcX : blit.m_dstX; + const uint16_t y = toBuffer ? blit.m_srcY : blit.m_dstY; + const uint32_t mipWidth = bx::max(1, texture.m_width >> mip); + const uint32_t mipHeight = bx::max(1, texture.m_height >> mip); uint32_t rowLength, imageHeight; calcTextureRegionTexelPitch( @@ -11256,20 +11261,20 @@ VK_DESTROY .imageSubresource = { .aspectMask = texture.m_aspectFlags, - .mipLevel = toBuffer ? blit.m_srcMip : blit.m_dstMip, + .mipLevel = mip, .baseArrayLayer = is3D ? 0u : uint32_t(z), .layerCount = is3D ? 1u : depth, }, .imageOffset = { - .x = toBuffer ? blit.m_srcX : blit.m_dstX, - .y = toBuffer ? blit.m_srcY : blit.m_dstY, + .x = x, + .y = y, .z = is3D ? z : 0, }, .imageExtent = { - .width = blit.m_width, - .height = blit.m_height, + .width = bx::min(blit.m_width, mipWidth - x), + .height = bx::min(blit.m_height, mipHeight - y), .depth = is3D ? depth : 1, }, }; @@ -11397,16 +11402,26 @@ VK_DESTROY const bimg::ImageBlockInfo& srcBlockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(src.m_textureFormat) ); const bimg::ImageBlockInfo& dstBlockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(dst.m_textureFormat) ); - const bool stageCompressed3D = true + const auto isBlockRegion = [&](const bimg::ImageBlockInfo& _blockInfo, const VkOffset3D& _offset, uint32_t _mipWidth, uint32_t _mipHeight) + { + return true + && (0 == copyInfo.extent.width % _blockInfo.blockWidth || uint32_t(_offset.x) + copyInfo.extent.width == _mipWidth ) + && (0 == copyInfo.extent.height % _blockInfo.blockHeight || uint32_t(_offset.y) + copyInfo.extent.height == _mipHeight) + ; + }; + + const bool stageCompressed = true && !resolve && !srcSingleMsaa && blit.m_src.idx != blit.m_dst.idx && bimg::isCompressed(bimg::TextureFormat::Enum(src.m_textureFormat) ) && ( (isSrc3D && (0 != srcMipWidth % srcBlockInfo.blockWidth || 0 != srcMipHeight % srcBlockInfo.blockHeight) ) - || (isDst3D && (0 != dstMipWidth % dstBlockInfo.blockWidth || 0 != dstMipHeight % dstBlockInfo.blockHeight) ) ) + || (isDst3D && (0 != dstMipWidth % dstBlockInfo.blockWidth || 0 != dstMipHeight % dstBlockInfo.blockHeight) ) + || !isBlockRegion(srcBlockInfo, copyInfo.srcOffset, srcMipWidth, srcMipHeight) + || !isBlockRegion(dstBlockInfo, copyInfo.dstOffset, dstMipWidth, dstMipHeight) ) ; - if (stageCompressed3D) + if (stageCompressed) { const uint32_t numBlocksX = (copyInfo.extent.width + srcBlockInfo.blockWidth - 1) / srcBlockInfo.blockWidth; const uint32_t numBlocksY = (copyInfo.extent.height + srcBlockInfo.blockHeight - 1) / srcBlockInfo.blockHeight; @@ -11423,8 +11438,8 @@ VK_DESTROY .imageOffset = copyInfo.srcOffset, .imageExtent = { - .width = copyInfo.extent.width, - .height = copyInfo.extent.height, + .width = bx::min(numBlocksX * srcBlockInfo.blockWidth, srcMipWidth - blit.m_srcX), + .height = bx::min(numBlocksY * srcBlockInfo.blockHeight, srcMipHeight - blit.m_srcY), .depth = isSrc3D ? depth : 1, }, }; diff --git a/src/renderer_webgpu.cpp b/src/renderer_webgpu.cpp index c142b6273..d5519e393 100644 --- a/src/renderer_webgpu.cpp +++ b/src/renderer_webgpu.cpp @@ -1915,8 +1915,8 @@ WGPU_IMPORT const uint32_t blockWidth = bx::max(1, blockInfo.blockWidth); const uint32_t blockHeight = bx::max(1, blockInfo.blockHeight); - const uint32_t srcWidth = bx::alignUp(bx::max(1, texture.m_width >> _mip), blockWidth); - const uint32_t srcHeight = bx::alignUp(bx::max(1, texture.m_height >> _mip), blockHeight); + const uint32_t srcWidth = bx::strideAlign(bx::max(1, texture.m_width >> _mip), blockWidth); + const uint32_t srcHeight = bx::strideAlign(bx::max(1, texture.m_height >> _mip), blockHeight); const uint32_t numRows = srcHeight/blockHeight; const uint32_t dstPitch = (srcWidth/blockWidth)*blockInfo.blockSize; @@ -3583,6 +3583,12 @@ WGPU_IMPORT sampleType = WGPUTextureSampleType_Uint; } + if (shaderBind.multisampled + && WGPUTextureSampleType_Float == sampleType) + { + sampleType = WGPUTextureSampleType_UnfilterableFloat; + } + WGPUSamplerBindingType samplerBindingType = WGPUSamplerBindingType_Filtering; switch (sampleType) { @@ -5399,7 +5405,13 @@ WGPU_IMPORT { textureDesc.usage = 0 | WGPUTextureUsage_RenderAttachment - | (bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) ? WGPUTextureUsage_TextureBinding : 0) + | (false + || bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) + || 0 != (m_flags&BGFX_TEXTURE_MSAA_SAMPLE) + ? WGPUTextureUsage_TextureBinding + : 0 + ) + | (0 != (m_flags&BGFX_TEXTURE_MSAA_SAMPLE) ? WGPUTextureUsage_CopySrc|WGPUTextureUsage_CopyDst : 0) ; textureDesc.mipLevelCount = 1; textureDesc.sampleCount = m_msaaCount; @@ -5627,7 +5639,7 @@ WGPU_IMPORT if (bimg::isCompressed(bimg::TextureFormat::Enum(m_textureFormat) ) ) { - const uint32_t alignedWidth = bx::max(blockInfo.blockWidth, bx::alignUp(_rect.m_width, blockInfo.blockWidth) ); + const uint32_t alignedWidth = bx::max(blockInfo.blockWidth, bx::strideAlign(_rect.m_width, blockInfo.blockWidth) ); rectPitch = (alignedWidth / blockInfo.blockWidth) * blockInfo.blockSize; } @@ -5647,11 +5659,11 @@ WGPU_IMPORT srcData = temp; } - const uint32_t mipWidth = bx::alignUp(bx::max(1u, m_width >> _mip), blockInfo.blockWidth); - const uint32_t mipHeight = bx::alignUp(bx::max(1u, m_height >> _mip), blockInfo.blockHeight); + const uint32_t mipWidth = bx::strideAlign(bx::max(1u, m_width >> _mip), blockInfo.blockWidth); + const uint32_t mipHeight = bx::strideAlign(bx::max(1u, m_height >> _mip), blockInfo.blockHeight); - const uint32_t rectWidth = bx::alignUp(_rect.m_width, blockInfo.blockWidth); - const uint32_t rectHeight = bx::alignUp(_rect.m_height, blockInfo.blockHeight); + const uint32_t rectWidth = bx::strideAlign(_rect.m_width, blockInfo.blockWidth); + const uint32_t rectHeight = bx::strideAlign(_rect.m_height, blockInfo.blockHeight); const uint32_t width = bx::min(rectWidth, mipWidth - bx::min(_rect.m_x, mipWidth ) ); const uint32_t height = bx::min(rectHeight, mipHeight - bx::min(_rect.m_y, mipHeight) ); @@ -7221,7 +7233,7 @@ WGPU_IMPORT const WGPUExtent3D copySize = { - .width = bx::alignUp(_blit.m_width, blockWidth), + .width = bx::strideAlign(_blit.m_width, blockWidth), .height = copyRows*blockHeight, .depthOrArrayLayers = copyDepth, }; @@ -7294,6 +7306,32 @@ WGPU_IMPORT .depthOrArrayLayers = bx::max(1, blit.m_depth), } ); + + if (NULL != src.m_textureMsaa + && NULL != dst.m_textureMsaa + && src.m_msaaCount == dst.m_msaaCount + && 0 != (src.m_flags & dst.m_flags & BGFX_TEXTURE_MSAA_SAMPLE) ) + { + s_renderWGPU->m_cmd.copyTextureToTexture( + { + .texture = src.m_textureMsaa, + .mipLevel = 0, + .origin = { .x = 0, .y = 0, .z = blit.m_srcZ }, + .aspect = WGPUTextureAspect_All, + }, + { + .texture = dst.m_textureMsaa, + .mipLevel = 0, + .origin = { .x = 0, .y = 0, .z = blit.m_dstZ }, + .aspect = WGPUTextureAspect_All, + }, + { + .width = blit.m_width, + .height = blit.m_height, + .depthOrArrayLayers = bx::max(1, blit.m_depth), + } + ); + } } }