diff --git a/modules/BgfxRenderer/CMakeLists.txt b/modules/BgfxRenderer/CMakeLists.txt index 4c9b777..06cead2 100644 --- a/modules/BgfxRenderer/CMakeLists.txt +++ b/modules/BgfxRenderer/CMakeLists.txt @@ -18,7 +18,8 @@ FetchContent_Declare( ) # bgfx options -set(BGFX_BUILD_TOOLS OFF CACHE BOOL "" FORCE) +set(BGFX_BUILD_TOOLS ON CACHE BOOL "" FORCE) # Need shaderc for shader compilation +set(BGFX_BUILD_TOOLS_SHADER ON CACHE BOOL "" FORCE) set(BGFX_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(BGFX_INSTALL OFF CACHE BOOL "" FORCE) set(BGFX_CUSTOM_TARGETS OFF CACHE BOOL "" FORCE) @@ -105,3 +106,121 @@ if(APPLE) "-framework Metal" ) endif() + +# ============================================================================ +# Shader Compilation +# ============================================================================ + +set(BGFX_SHADER_INCLUDE_DIR ${bgfx_SOURCE_DIR}/bgfx/src) +set(SHADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Shaders) + +# Function to compile a shader +function(compile_bgfx_shader SHADER_NAME SHADER_TYPE OUTPUT_VAR) + set(INPUT_FILE ${SHADER_DIR}/${SHADER_NAME}.sc) + set(OUTPUT_DIR ${SHADER_DIR}) + set(VARYING_DEF ${SHADER_DIR}/varying.def.sc) + + # Output files for each platform + set(OUTPUT_SPIRV ${OUTPUT_DIR}/${SHADER_NAME}_spirv.bin) + set(OUTPUT_GLSL ${OUTPUT_DIR}/${SHADER_NAME}_glsl.bin) + set(OUTPUT_ESSL ${OUTPUT_DIR}/${SHADER_NAME}_essl.bin) + set(OUTPUT_DX11 ${OUTPUT_DIR}/${SHADER_NAME}_dx11.bin) + set(OUTPUT_MTL ${OUTPUT_DIR}/${SHADER_NAME}_mtl.bin) + + if(SHADER_TYPE STREQUAL "vertex") + set(SHADER_MODEL vs_5_0) + set(SHADER_PROFILE 430) + else() + set(SHADER_MODEL ps_5_0) + set(SHADER_PROFILE 430) + endif() + + # Compile for Vulkan (SPIR-V) + add_custom_command( + OUTPUT ${OUTPUT_SPIRV} + COMMAND shaderc + -f ${INPUT_FILE} + -o ${OUTPUT_SPIRV} + --type ${SHADER_TYPE} + --platform linux + --profile spirv + -i ${BGFX_SHADER_INCLUDE_DIR} + --varyingdef ${VARYING_DEF} + DEPENDS ${INPUT_FILE} ${VARYING_DEF} shaderc + COMMENT "Compiling ${SHADER_NAME} for SPIR-V" + ) + + # Compile for OpenGL + add_custom_command( + OUTPUT ${OUTPUT_GLSL} + COMMAND shaderc + -f ${INPUT_FILE} + -o ${OUTPUT_GLSL} + --type ${SHADER_TYPE} + --platform linux + --profile ${SHADER_PROFILE} + -i ${BGFX_SHADER_INCLUDE_DIR} + --varyingdef ${VARYING_DEF} + DEPENDS ${INPUT_FILE} ${VARYING_DEF} shaderc + COMMENT "Compiling ${SHADER_NAME} for GLSL" + ) + + # Compile for OpenGL ES + add_custom_command( + OUTPUT ${OUTPUT_ESSL} + COMMAND shaderc + -f ${INPUT_FILE} + -o ${OUTPUT_ESSL} + --type ${SHADER_TYPE} + --platform android + -i ${BGFX_SHADER_INCLUDE_DIR} + --varyingdef ${VARYING_DEF} + DEPENDS ${INPUT_FILE} ${VARYING_DEF} shaderc + COMMENT "Compiling ${SHADER_NAME} for ESSL" + ) + + # Compile for DirectX 11 + add_custom_command( + OUTPUT ${OUTPUT_DX11} + COMMAND shaderc + -f ${INPUT_FILE} + -o ${OUTPUT_DX11} + --type ${SHADER_TYPE} + --platform windows + --profile ${SHADER_MODEL} + -i ${BGFX_SHADER_INCLUDE_DIR} + --varyingdef ${VARYING_DEF} + DEPENDS ${INPUT_FILE} ${VARYING_DEF} shaderc + COMMENT "Compiling ${SHADER_NAME} for DX11" + ) + + # Compile for Metal + add_custom_command( + OUTPUT ${OUTPUT_MTL} + COMMAND shaderc + -f ${INPUT_FILE} + -o ${OUTPUT_MTL} + --type ${SHADER_TYPE} + --platform osx + --profile metal + -i ${BGFX_SHADER_INCLUDE_DIR} + --varyingdef ${VARYING_DEF} + DEPENDS ${INPUT_FILE} ${VARYING_DEF} shaderc + COMMENT "Compiling ${SHADER_NAME} for Metal" + ) + + set(${OUTPUT_VAR} ${OUTPUT_SPIRV} ${OUTPUT_GLSL} ${OUTPUT_ESSL} ${OUTPUT_DX11} ${OUTPUT_MTL} PARENT_SCOPE) +endfunction() + +# Compile sprite shaders +compile_bgfx_shader(vs_sprite vertex VS_SPRITE_OUTPUTS) +compile_bgfx_shader(fs_sprite fragment FS_SPRITE_OUTPUTS) + +# Custom target to compile all shaders +add_custom_target(compile_shaders + DEPENDS ${VS_SPRITE_OUTPUTS} ${FS_SPRITE_OUTPUTS} + COMMENT "Compiling all BgfxRenderer shaders" +) + +# Make BgfxRenderer depend on shaders (optional, enable if you want auto-compilation) +# add_dependencies(BgfxRenderer compile_shaders) diff --git a/modules/BgfxRenderer/Frame/FramePacket.h b/modules/BgfxRenderer/Frame/FramePacket.h index 2d24c57..aa180cb 100644 --- a/modules/BgfxRenderer/Frame/FramePacket.h +++ b/modules/BgfxRenderer/Frame/FramePacket.h @@ -11,15 +11,30 @@ class FrameAllocator; // Sprite Instance Data // ============================================================================ +// GPU Instance data - must match shader layout (5 x vec4 = 80 bytes) +// i_data0: x, y, scaleX, scaleY +// i_data1: rotation, u0, v0, u1 +// i_data2: v1, textureId (as float), layer (as float), padding +// i_data3: reserved +// i_data4: r, g, b, a (color as floats 0-1) struct SpriteInstance { + // i_data0 float x, y; // Position float scaleX, scaleY; // Scale + // i_data1 float rotation; // Radians - float u0, v0, u1, v1; // UVs in atlas - uint32_t color; // RGBA packed - uint16_t textureId; // Index in texture array - uint16_t layer; // Z-order + float u0, v0, u1; // UV start + end x + // i_data2 + float v1; // UV end y + float textureId; // As float for GPU compatibility + float layer; // Z-order as float + float padding0; + // i_data3 + float reserved[4]; // Reserved for future use + // i_data4 + float r, g, b, a; // Color as floats (0-1) }; +static_assert(sizeof(SpriteInstance) == 80, "SpriteInstance must be 80 bytes for GPU instancing"); // ============================================================================ // Tilemap Chunk Data diff --git a/modules/BgfxRenderer/Passes/SpritePass.cpp b/modules/BgfxRenderer/Passes/SpritePass.cpp index 68f453f..77c8f45 100644 --- a/modules/BgfxRenderer/Passes/SpritePass.cpp +++ b/modules/BgfxRenderer/Passes/SpritePass.cpp @@ -11,13 +11,14 @@ SpritePass::SpritePass(rhi::ShaderHandle shader) void SpritePass::setup(rhi::IRHIDevice& device) { // Create quad vertex buffer (unit quad, instanced) - // Positions: 4 vertices for a quad + // Layout must match shader: a_position (vec3) + a_color0 (vec4) + // Note: Color is white (1,1,1,1) - actual color comes from instance data float quadVertices[] = { - // pos.x, pos.y, uv.x, uv.y - 0.0f, 0.0f, 0.0f, 0.0f, // bottom-left - 1.0f, 0.0f, 1.0f, 0.0f, // bottom-right - 1.0f, 1.0f, 1.0f, 1.0f, // top-right - 0.0f, 1.0f, 0.0f, 1.0f, // top-left + // pos.x, pos.y, pos.z, r, g, b, a + 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, // bottom-left + 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, // bottom-right + 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, // top-right + 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, // top-left }; rhi::BufferDesc vbDesc; @@ -25,6 +26,7 @@ void SpritePass::setup(rhi::IRHIDevice& device) { vbDesc.size = sizeof(quadVertices); vbDesc.data = quadVertices; vbDesc.dynamic = false; + vbDesc.layout = rhi::BufferDesc::PosColor; // Match shader: a_position + a_color0 m_quadVB = device.createBuffer(vbDesc); // Create index buffer @@ -48,8 +50,18 @@ void SpritePass::setup(rhi::IRHIDevice& device) { instDesc.dynamic = true; m_instanceBuffer = device.createBuffer(instDesc); - // Create texture sampler uniform - m_textureSampler = device.createUniform("s_texture", 1); + // Create texture sampler uniform (must match shader: s_texColor) + m_textureSampler = device.createUniform("s_texColor", 1); + + // Create default white 1x1 texture (used when no texture is bound) + uint32_t whitePixel = 0xFFFFFFFF; // RGBA white + rhi::TextureDesc texDesc; + texDesc.width = 1; + texDesc.height = 1; + texDesc.format = rhi::TextureDesc::RGBA8; + texDesc.data = &whitePixel; + texDesc.dataSize = sizeof(whitePixel); + m_defaultTexture = device.createTexture(texDesc); } void SpritePass::shutdown(rhi::IRHIDevice& device) { @@ -57,6 +69,7 @@ void SpritePass::shutdown(rhi::IRHIDevice& device) { device.destroy(m_quadIB); device.destroy(m_instanceBuffer); device.destroy(m_textureSampler); + device.destroy(m_defaultTexture); // Note: m_shader is owned by ShaderManager, not destroyed here } @@ -91,6 +104,9 @@ void SpritePass::execute(const FramePacket& frame, rhi::IRHIDevice& device, rhi: cmd.setIndexBuffer(m_quadIB); cmd.setInstanceBuffer(m_instanceBuffer, 0, static_cast(batchSize)); + // Bind default texture (TODO: support per-sprite textures via texture array) + cmd.setTexture(0, m_defaultTexture, m_textureSampler); + // Submit draw call cmd.drawInstanced(6, static_cast(batchSize)); // 6 indices per quad cmd.submit(0, m_shader, 0); diff --git a/modules/BgfxRenderer/Passes/SpritePass.h b/modules/BgfxRenderer/Passes/SpritePass.h index bf0f3a0..ac40cee 100644 --- a/modules/BgfxRenderer/Passes/SpritePass.h +++ b/modules/BgfxRenderer/Passes/SpritePass.h @@ -31,6 +31,7 @@ private: rhi::BufferHandle m_quadIB; rhi::BufferHandle m_instanceBuffer; rhi::UniformHandle m_textureSampler; + rhi::TextureHandle m_defaultTexture; // White 1x1 texture fallback static constexpr uint32_t MAX_SPRITES_PER_BATCH = 10000; }; diff --git a/modules/BgfxRenderer/RHI/BgfxDevice.cpp b/modules/BgfxRenderer/RHI/BgfxDevice.cpp index 049d24e..c34f034 100644 --- a/modules/BgfxRenderer/RHI/BgfxDevice.cpp +++ b/modules/BgfxRenderer/RHI/BgfxDevice.cpp @@ -105,22 +105,27 @@ public: BufferHandle result; if (desc.type == BufferDesc::Vertex) { - if (desc.dynamic) { - // Dynamic vertex buffer - create with initial size (will resize on update) - // Use 1-byte vertex layout to treat as raw bytes - bgfx::VertexLayout layout; + // Build vertex layout based on layout type + bgfx::VertexLayout layout; + if (desc.layout == BufferDesc::PosColor) { + // vec3 position + vec4 color (7 floats = 28 bytes per vertex) + layout.begin() + .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float) + .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Float, true) // normalized + .end(); + } else { + // Raw bytes - use 1-byte layout layout.begin().add(bgfx::Attrib::Position, 1, bgfx::AttribType::Uint8).end(); + } + + if (desc.dynamic) { bgfx::DynamicVertexBufferHandle dvb = bgfx::createDynamicVertexBuffer( - desc.size, // number of 1-byte "vertices" = size in bytes + desc.layout == BufferDesc::PosColor ? desc.size / layout.getStride() : desc.size, layout, BGFX_BUFFER_ALLOW_RESIZE ); - // Store as dynamic (high bit set) result.id = dvb.idx | 0x8000; } else { - // Static vertex buffer with data - bgfx::VertexLayout layout; - layout.begin().add(bgfx::Attrib::Position, 1, bgfx::AttribType::Uint8).end(); bgfx::VertexBufferHandle vb = bgfx::createVertexBuffer( desc.data ? bgfx::copy(desc.data, desc.size) : bgfx::makeRef(s_emptyBuffer, 1), layout @@ -141,11 +146,21 @@ public: result.id = ib.idx; } } else { // Instance buffer - treated as dynamic vertex buffer - // For instance buffers, use same approach as dynamic vertex + // Instance buffer layout: 5 x vec4 = 80 bytes per instance + // i_data0 (TEXCOORD7), i_data1 (TEXCOORD6), i_data2 (TEXCOORD5), + // i_data3 (TEXCOORD4), i_data4 (TEXCOORD3) bgfx::VertexLayout layout; - layout.begin().add(bgfx::Attrib::Position, 1, bgfx::AttribType::Uint8).end(); + layout.begin() + .add(bgfx::Attrib::TexCoord7, 4, bgfx::AttribType::Float) // i_data0: pos.xy, scale.xy + .add(bgfx::Attrib::TexCoord6, 4, bgfx::AttribType::Float) // i_data1: rotation, uv0.xy, unused + .add(bgfx::Attrib::TexCoord5, 4, bgfx::AttribType::Float) // i_data2: uv1.xy, unused, unused + .add(bgfx::Attrib::TexCoord4, 4, bgfx::AttribType::Float) // i_data3: reserved + .add(bgfx::Attrib::TexCoord3, 4, bgfx::AttribType::Float) // i_data4: color rgba + .end(); + // 80 bytes per instance + uint32_t instanceCount = desc.size / 80; bgfx::DynamicVertexBufferHandle dvb = bgfx::createDynamicVertexBuffer( - desc.size, + instanceCount, layout, BGFX_BUFFER_ALLOW_RESIZE ); diff --git a/modules/BgfxRenderer/RHI/RHITypes.h b/modules/BgfxRenderer/RHI/RHITypes.h index c29faab..37913ee 100644 --- a/modules/BgfxRenderer/RHI/RHITypes.h +++ b/modules/BgfxRenderer/RHI/RHITypes.h @@ -94,6 +94,12 @@ struct BufferDesc { const void* data = nullptr; bool dynamic = false; enum Type : uint8_t { Vertex, Index, Instance } type = Vertex; + // For Vertex buffers, specify the layout type + enum Layout : uint8_t { + Raw, // Raw bytes (no layout - legacy) + PosColor, // vec3 position + vec4 color (for sprites) + InstanceData // Instance buffer (36 bytes per instance) + } layout = Raw; }; struct ShaderDesc { diff --git a/modules/BgfxRenderer/Scene/SceneCollector.cpp b/modules/BgfxRenderer/Scene/SceneCollector.cpp index 48b7872..11b6b4a 100644 --- a/modules/BgfxRenderer/Scene/SceneCollector.cpp +++ b/modules/BgfxRenderer/Scene/SceneCollector.cpp @@ -160,18 +160,32 @@ void SceneCollector::clear() { void SceneCollector::parseSprite(const IDataNode& data) { SpriteInstance sprite; + // i_data0 sprite.x = static_cast(data.getDouble("x", 0.0)); sprite.y = static_cast(data.getDouble("y", 0.0)); sprite.scaleX = static_cast(data.getDouble("scaleX", 1.0)); sprite.scaleY = static_cast(data.getDouble("scaleY", 1.0)); + // i_data1 sprite.rotation = static_cast(data.getDouble("rotation", 0.0)); sprite.u0 = static_cast(data.getDouble("u0", 0.0)); sprite.v0 = static_cast(data.getDouble("v0", 0.0)); sprite.u1 = static_cast(data.getDouble("u1", 1.0)); + // i_data2 sprite.v1 = static_cast(data.getDouble("v1", 1.0)); - sprite.color = static_cast(data.getInt("color", 0xFFFFFFFF)); - sprite.textureId = static_cast(data.getInt("textureId", 0)); - sprite.layer = static_cast(data.getInt("layer", 0)); + sprite.textureId = static_cast(data.getInt("textureId", 0)); + sprite.layer = static_cast(data.getInt("layer", 0)); + sprite.padding0 = 0.0f; + // i_data3 (reserved) + sprite.reserved[0] = 0.0f; + sprite.reserved[1] = 0.0f; + sprite.reserved[2] = 0.0f; + sprite.reserved[3] = 0.0f; + // i_data4 (color as floats) + uint32_t color = static_cast(data.getInt("color", 0xFFFFFFFF)); + sprite.r = static_cast((color >> 24) & 0xFF) / 255.0f; + sprite.g = static_cast((color >> 16) & 0xFF) / 255.0f; + sprite.b = static_cast((color >> 8) & 0xFF) / 255.0f; + sprite.a = static_cast(color & 0xFF) / 255.0f; m_sprites.push_back(sprite); } diff --git a/modules/BgfxRenderer/Shaders/ShaderManager.cpp b/modules/BgfxRenderer/Shaders/ShaderManager.cpp index 7c14bad..742a819 100644 --- a/modules/BgfxRenderer/Shaders/ShaderManager.cpp +++ b/modules/BgfxRenderer/Shaders/ShaderManager.cpp @@ -4,6 +4,8 @@ // Embedded shader bytecode #include "vs_color.bin.h" #include "fs_color.bin.h" +#include "vs_sprite.bin.h" +#include "fs_sprite.bin.h" namespace grove { @@ -94,15 +96,53 @@ void ShaderManager::loadBuiltinShaders(rhi::IRHIDevice& device, const std::strin if (colorProgram.isValid()) { m_programs["color"] = colorProgram; - // Alias for sprites (same shader for now) - m_programs["sprite"] = colorProgram; m_programs["debug"] = colorProgram; } - // TODO: Add more specialized shaders as needed: - // - "sprite_textured" for textured sprites - // - "text" for text rendering - // - "particle" for particle systems + // Load sprite instancing shader + loadSpriteShader(device, rendererName); +} + +void ShaderManager::loadSpriteShader(rhi::IRHIDevice& device, const std::string& rendererName) { + const uint8_t* vsData = nullptr; + uint32_t vsSize = 0; + const uint8_t* fsData = nullptr; + uint32_t fsSize = 0; + + if (rendererName == "OpenGL") { + vsData = vs_sprite_glsl; + vsSize = sizeof(vs_sprite_glsl); + fsData = fs_sprite_glsl; + fsSize = sizeof(fs_sprite_glsl); + } else if (rendererName == "Vulkan") { + vsData = vs_sprite_spv; + vsSize = sizeof(vs_sprite_spv); + fsData = fs_sprite_spv; + fsSize = sizeof(fs_sprite_spv); + } else if (rendererName == "Metal") { + vsData = vs_sprite_mtl; + vsSize = sizeof(vs_sprite_mtl); + fsData = fs_sprite_mtl; + fsSize = sizeof(fs_sprite_mtl); + } else { + // Fallback to Vulkan (most common in WSL2) + vsData = vs_sprite_spv; + vsSize = sizeof(vs_sprite_spv); + fsData = fs_sprite_spv; + fsSize = sizeof(fs_sprite_spv); + } + + rhi::ShaderDesc shaderDesc; + shaderDesc.vsData = vsData; + shaderDesc.vsSize = vsSize; + shaderDesc.fsData = fsData; + shaderDesc.fsSize = fsSize; + + rhi::ShaderHandle spriteProgram = device.createShader(shaderDesc); + + if (spriteProgram.isValid()) { + m_programs["sprite"] = spriteProgram; + } } } // namespace grove diff --git a/modules/BgfxRenderer/Shaders/ShaderManager.h b/modules/BgfxRenderer/Shaders/ShaderManager.h index 8697ae6..fb1b5f6 100644 --- a/modules/BgfxRenderer/Shaders/ShaderManager.h +++ b/modules/BgfxRenderer/Shaders/ShaderManager.h @@ -57,6 +57,7 @@ public: private: void loadBuiltinShaders(rhi::IRHIDevice& device, const std::string& rendererName); + void loadSpriteShader(rhi::IRHIDevice& device, const std::string& rendererName); std::unordered_map m_programs; bool m_initialized = false; diff --git a/modules/BgfxRenderer/Shaders/compiled/fs_sprite.glsl.bin b/modules/BgfxRenderer/Shaders/compiled/fs_sprite.glsl.bin new file mode 100644 index 0000000..5e70bb2 Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/fs_sprite.glsl.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/fs_sprite.mtl.bin b/modules/BgfxRenderer/Shaders/compiled/fs_sprite.mtl.bin new file mode 100644 index 0000000..a54cf7a Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/fs_sprite.mtl.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/fs_sprite.spirv.bin b/modules/BgfxRenderer/Shaders/compiled/fs_sprite.spirv.bin new file mode 100644 index 0000000..fd5a51b Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/fs_sprite.spirv.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/fs_sprite_glsl.bin b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_glsl.bin new file mode 100644 index 0000000..e66e327 Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_glsl.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/fs_sprite_glsl.bin.inc b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_glsl.bin.inc new file mode 100644 index 0000000..b69ca93 --- /dev/null +++ b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_glsl.bin.inc @@ -0,0 +1,20 @@ +unsigned char fs_sprite_glsl_bin[] = { + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, + 0x00, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, + 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, + 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, + 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, + 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, + 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, + 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, + 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, + 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, + 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00 +}; +unsigned int fs_sprite_glsl_bin_len = 204; diff --git a/modules/BgfxRenderer/Shaders/compiled/fs_sprite_mtl.bin b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_mtl.bin new file mode 100644 index 0000000..3c5b198 Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_mtl.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/fs_sprite_mtl.bin.inc b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_mtl.bin.inc new file mode 100644 index 0000000..a6594e9 --- /dev/null +++ b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_mtl.bin.inc @@ -0,0 +1,57 @@ +unsigned char fs_sprite_mtl_bin[] = { + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x11, 0x01, 0xff, 0xff, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, + 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x23, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, + 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, + 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, + 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, + 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, + 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, + 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, + 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, + 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, + 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, + 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, + 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, + 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, + 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, + 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, + 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, + 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, + 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, + 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, + 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, + 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, + 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, + 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, + 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, + 0x6f, 0x72, 0x64, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, 0x00 +}; +unsigned int fs_sprite_mtl_bin_len = 644; diff --git a/modules/BgfxRenderer/Shaders/compiled/fs_sprite_spirv.bin b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_spirv.bin new file mode 100644 index 0000000..d863400 Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_spirv.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/fs_sprite_spirv.bin.inc b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_spirv.bin.inc new file mode 100644 index 0000000..d8e59ec --- /dev/null +++ b/modules/BgfxRenderer/Shaders/compiled/fs_sprite_spirv.bin.inc @@ -0,0 +1,75 @@ +unsigned char fs_sprite_spirv_bin[] = { + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x34, + 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, + 0x00, 0x08, 0x00, 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, + 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, + 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, 0x00, 0x05, 0x00, 0x07, 0x00, 0x23, + 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x51, 0x00, 0x00, 0x00, 0x76, + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, + 0x00, 0x05, 0x00, 0x55, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x62, + 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, + 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, + 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, + 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x1e, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, + 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4d, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x55, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x61, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 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, 0x06, + 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, + 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x52, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, + 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x27, + 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, + 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x56, + 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x86, + 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, + 0x00, 0x03, 0x00, 0x62, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0xfd, + 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +unsigned int fs_sprite_spirv_bin_len = 863; diff --git a/modules/BgfxRenderer/Shaders/compiled/vs_sprite.glsl.bin b/modules/BgfxRenderer/Shaders/compiled/vs_sprite.glsl.bin new file mode 100644 index 0000000..b48923f Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/vs_sprite.glsl.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/vs_sprite.mtl.bin b/modules/BgfxRenderer/Shaders/compiled/vs_sprite.mtl.bin new file mode 100644 index 0000000..f36e2ac Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/vs_sprite.mtl.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/vs_sprite.spirv.bin b/modules/BgfxRenderer/Shaders/compiled/vs_sprite.spirv.bin new file mode 100644 index 0000000..7912c05 Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/vs_sprite.spirv.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/vs_sprite_glsl.bin b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_glsl.bin new file mode 100644 index 0000000..4477190 Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_glsl.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/vs_sprite_glsl.bin.inc b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_glsl.bin.inc new file mode 100644 index 0000000..13b5e55 --- /dev/null +++ b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_glsl.bin.inc @@ -0,0 +1,80 @@ +unsigned char vs_sprite_glsl_bin[] = { + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, + 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, + 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, + 0x03, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x31, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x32, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x34, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, + 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, + 0x67, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, + 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, + 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, + 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, + 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x72, 0x6f, 0x74, 0x61, 0x74, + 0x65, 0x64, 0x50, 0x6f, 0x73, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, + 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, + 0x32, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x69, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x31, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, + 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, + 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, + 0x20, 0x3d, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x69, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x31, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, + 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, + 0x20, 0x28, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, + 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, + 0x20, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x73, 0x5f, + 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, + 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, + 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x74, 0x6d, + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x74, + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x3b, 0x0a, 0x20, + 0x20, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x73, 0x5f, + 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, + 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, + 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x6d, + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x74, + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, + 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, + 0x5f, 0x35, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, + 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x2e, 0x78, + 0x79, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, + 0x64, 0x50, 0x6f, 0x73, 0x5f, 0x31, 0x20, 0x2a, 0x20, 0x69, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x30, 0x2e, 0x7a, 0x77, 0x29, 0x20, 0x2b, 0x20, 0x69, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x30, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, + 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, + 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, + 0x5f, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x20, 0x3d, + 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x31, 0x2e, 0x77, 0x3b, 0x0a, + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x79, + 0x20, 0x3d, 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x32, 0x2e, 0x78, + 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, + 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, 0x20, 0x28, 0x69, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x31, 0x2e, 0x79, 0x7a, 0x2c, 0x20, 0x74, + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2c, 0x20, 0x61, 0x5f, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x29, 0x3b, + 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, + 0x3d, 0x20, 0x28, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, + 0x2a, 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x34, 0x29, 0x3b, 0x0a, + 0x7d, 0x0a, 0x0a, 0x00 +}; +unsigned int vs_sprite_glsl_bin_len = 916; diff --git a/modules/BgfxRenderer/Shaders/compiled/vs_sprite_mtl.bin b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_mtl.bin new file mode 100644 index 0000000..4115bd9 Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_mtl.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/vs_sprite_mtl.bin.inc b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_mtl.bin.inc new file mode 100644 index 0000000..9296dbc --- /dev/null +++ b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_mtl.bin.inc @@ -0,0 +1,111 @@ +unsigned char vs_sprite_mtl_bin[] = { + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, + 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, + 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, + 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, + 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, + 0x62, 0x3e, 0x0a, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, + 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, + 0x3e, 0x0a, 0x0a, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, + 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x5f, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x76, + 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, + 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, + 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, + 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, + 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, + 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, 0x6f, 0x6c, + 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, + 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, 0x6e, 0x74, + 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, + 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, + 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, + 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, + 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, + 0x6f, 0x61, 0x74, 0x34, 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x30, + 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x31, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x28, 0x33, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x32, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x28, 0x34, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x69, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x34, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x28, 0x36, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, + 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, + 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, + 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, + 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, + 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, + 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, + 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, + 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, + 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x34, 0x38, 0x20, + 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x69, 0x6e, 0x2e, 0x69, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x31, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x35, 0x30, 0x20, + 0x3d, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x69, 0x6e, 0x2e, 0x69, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x31, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x32, 0x35, 0x33, + 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, 0x66, 0x6c, + 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x29, 0x3b, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, + 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, + 0x66, 0x6d, 0x61, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x66, + 0x6d, 0x61, 0x28, 0x5f, 0x32, 0x35, 0x33, 0x2e, 0x78, 0x2c, 0x20, 0x5f, + 0x32, 0x34, 0x38, 0x2c, 0x20, 0x2d, 0x28, 0x5f, 0x32, 0x35, 0x33, 0x2e, + 0x79, 0x20, 0x2a, 0x20, 0x5f, 0x32, 0x35, 0x30, 0x29, 0x29, 0x2c, 0x20, + 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x32, 0x35, 0x33, 0x2e, 0x78, 0x2c, 0x20, + 0x5f, 0x32, 0x35, 0x30, 0x2c, 0x20, 0x5f, 0x32, 0x35, 0x33, 0x2e, 0x79, + 0x20, 0x2a, 0x20, 0x5f, 0x32, 0x34, 0x38, 0x29, 0x29, 0x2c, 0x20, 0x69, + 0x6e, 0x2e, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x30, 0x2e, 0x7a, 0x77, + 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x30, + 0x2e, 0x78, 0x79, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, + 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, + 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, 0x6f, 0x6c, + 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x69, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x6f, 0x75, 0x74, 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, + 0x6d, 0x69, 0x78, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x69, + 0x6e, 0x2e, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x31, 0x2e, 0x79, 0x7a, + 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x69, 0x6e, + 0x2e, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x31, 0x2e, 0x77, 0x2c, 0x20, + 0x69, 0x6e, 0x2e, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x32, 0x2e, 0x78, + 0x29, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x07, 0x05, 0x00, 0x01, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x40, 0x00 +}; +unsigned int vs_sprite_mtl_bin_len = 1295; diff --git a/modules/BgfxRenderer/Shaders/compiled/vs_sprite_spirv.bin b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_spirv.bin new file mode 100644 index 0000000..7fd7a1c Binary files /dev/null and b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_spirv.bin differ diff --git a/modules/BgfxRenderer/Shaders/compiled/vs_sprite_spirv.bin.inc b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_spirv.bin.inc new file mode 100644 index 0000000..ea7549f --- /dev/null +++ b/modules/BgfxRenderer/Shaders/compiled/vs_sprite_spirv.bin.inc @@ -0,0 +1,179 @@ +unsigned char vs_sprite_spirv_bin[] = { + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, + 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, + 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x08, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, + 0x00, 0x08, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, + 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, + 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x9c, + 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xa8, + 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xc2, + 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, 0x00, 0x05, 0x00, 0x06, 0x00, 0x77, + 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x77, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, + 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x79, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x95, + 0x00, 0x00, 0x00, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x61, + 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x05, + 0x00, 0x04, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x69, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x30, 0x00, 0x05, 0x00, 0x04, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x69, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x31, 0x00, 0x05, 0x00, 0x04, 0x00, 0xa2, + 0x00, 0x00, 0x00, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x32, 0x00, 0x05, + 0x00, 0x04, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x69, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x34, 0x00, 0x05, 0x00, 0x0a, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x40, + 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x09, 0x00, 0xbe, + 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0xc2, + 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x74, + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x00, 0x00, 0x48, + 0x00, 0x04, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, + 0x00, 0x05, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x77, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x79, + 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x95, 0x00, 0x00, 0x00, 0x1e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x99, + 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x1e, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xa2, + 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbe, + 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, + 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x11, + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x15, + 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, + 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0x2c, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x54, + 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x2b, + 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0x76, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x77, + 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x94, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x98, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x98, + 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0x9f, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x94, + 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xba, + 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xc1, + 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, + 0x00, 0x05, 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, 0x0f, 0x00, 0x00, 0x00, 0x96, + 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x11, + 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x3d, + 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x9c, + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xa0, + 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x3d, + 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xa8, + 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xea, + 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x07, + 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x9d, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, + 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xa0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, + 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xf2, + 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, + 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xa0, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, + 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0xf8, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xee, + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0xfa, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xee, + 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfc, + 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x54, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, + 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0xfd, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0xfa, + 0x00, 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x58, + 0x01, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x58, + 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, + 0x01, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, + 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0d, 0x01, 0x00, 0x00, 0xfd, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x0d, 0x01, 0x00, 0x00, 0xf8, + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x09, + 0x01, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x50, + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0x06, + 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, + 0x00, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xea, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, + 0x01, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, + 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x16, + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x19, + 0x01, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x41, + 0x00, 0x05, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x1b, 0x01, 0x00, 0x00, 0x79, + 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x1b, 0x01, 0x00, 0x00, 0x90, + 0x00, 0x05, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x1a, + 0x01, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x21, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf2, + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x24, + 0x01, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x4f, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x9a, + 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x33, + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x21, + 0x01, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x85, + 0x00, 0x05, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x2b, 0x01, 0x00, 0x00, 0x96, + 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xbb, + 0x00, 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xbe, + 0x00, 0x00, 0x00, 0x2b, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xc2, + 0x00, 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, + 0x00, 0x01, 0x00, 0x00, 0x07, 0x05, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x40, 0x00 +}; +unsigned int vs_sprite_spirv_bin_len = 2109; diff --git a/modules/BgfxRenderer/Shaders/fs_sprite.bin.h b/modules/BgfxRenderer/Shaders/fs_sprite.bin.h new file mode 100644 index 0000000..a7ba024 --- /dev/null +++ b/modules/BgfxRenderer/Shaders/fs_sprite.bin.h @@ -0,0 +1,157 @@ +// Auto-generated shader bytecode - sprite fragment shader with texture support +// Supports: SPIRV (Vulkan), GLSL (OpenGL), Metal + +static const uint8_t fs_sprite_spv[] = { + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x34, + 0x03, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, + 0x00, 0x08, 0x00, 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, + 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x62, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, + 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, 0x00, 0x05, 0x00, 0x07, 0x00, 0x23, + 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x51, 0x00, 0x00, 0x00, 0x76, + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, + 0x00, 0x05, 0x00, 0x55, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x62, + 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, + 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, + 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, + 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x1e, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, + 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4d, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x55, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x61, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 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, 0x06, + 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, + 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x52, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, + 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x27, + 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, + 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x56, + 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x86, + 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, + 0x00, 0x03, 0x00, 0x62, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0xfd, + 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +static const unsigned int fs_sprite_spv_len = sizeof(fs_sprite_spv); + +static const uint8_t fs_sprite_glsl[] = { + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, + 0x00, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, + 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, + 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, + 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, + 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, + 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, + 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, + 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, + 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, + 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00 +}; +static const unsigned int fs_sprite_glsl_len = sizeof(fs_sprite_glsl); + +static const uint8_t fs_sprite_mtl[] = { + 0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x11, 0x01, 0xff, 0xff, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, + 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x23, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, + 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, + 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, + 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, + 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, + 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, + 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, + 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, + 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, + 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, + 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, + 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, + 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, + 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, + 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, + 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, + 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, + 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, + 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, + 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, + 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, + 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, + 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, + 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, + 0x6f, 0x72, 0x64, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x76, + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, 0x00 +}; +static const unsigned int fs_sprite_mtl_len = sizeof(fs_sprite_mtl); diff --git a/modules/BgfxRenderer/Shaders/fs_sprite.sc b/modules/BgfxRenderer/Shaders/fs_sprite.sc new file mode 100644 index 0000000..c771c8b --- /dev/null +++ b/modules/BgfxRenderer/Shaders/fs_sprite.sc @@ -0,0 +1,12 @@ +$input v_color0, v_texcoord0 + +#include + +SAMPLER2D(s_texColor, 0); + +void main() +{ + // Sample texture and multiply by vertex/instance color + vec4 texColor = texture2D(s_texColor, v_texcoord0); + gl_FragColor = texColor * v_color0; +} diff --git a/modules/BgfxRenderer/Shaders/varying.def.sc b/modules/BgfxRenderer/Shaders/varying.def.sc index 699eef3..53bda2c 100644 --- a/modules/BgfxRenderer/Shaders/varying.def.sc +++ b/modules/BgfxRenderer/Shaders/varying.def.sc @@ -1,8 +1,10 @@ -// Varying definitions for bgfx shaders - -vec4 v_color0 : COLOR0 = vec4(1.0, 1.0, 1.0, 1.0); +vec4 v_color0 : COLOR0 = vec4(1.0, 1.0, 1.0, 1.0); vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0); -vec3 a_position : POSITION; -vec4 a_color0 : COLOR0; -vec2 a_texcoord0 : TEXCOORD0; +vec3 a_position : POSITION; +vec4 a_color0 : COLOR0; +vec4 i_data0 : TEXCOORD7; +vec4 i_data1 : TEXCOORD6; +vec4 i_data2 : TEXCOORD5; +vec4 i_data3 : TEXCOORD4; +vec4 i_data4 : TEXCOORD3; diff --git a/modules/BgfxRenderer/Shaders/vs_sprite.bin.h b/modules/BgfxRenderer/Shaders/vs_sprite.bin.h new file mode 100644 index 0000000..4d17c8d --- /dev/null +++ b/modules/BgfxRenderer/Shaders/vs_sprite.bin.h @@ -0,0 +1,375 @@ +// Auto-generated shader bytecode - sprite vertex shader with texture support +// Supports: SPIRV (Vulkan), GLSL (OpenGL), Metal + +static const uint8_t vs_sprite_spv[] = { + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, + 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, + 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x08, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, + 0x00, 0x08, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, + 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, + 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x9c, + 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xa8, + 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xc2, + 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, 0x00, 0x05, 0x00, 0x06, 0x00, 0x77, + 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x77, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, + 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x79, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x95, + 0x00, 0x00, 0x00, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, + 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x99, 0x00, 0x00, 0x00, 0x61, + 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x05, + 0x00, 0x04, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x69, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x30, 0x00, 0x05, 0x00, 0x04, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x69, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x31, 0x00, 0x05, 0x00, 0x04, 0x00, 0xa2, + 0x00, 0x00, 0x00, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x32, 0x00, 0x05, + 0x00, 0x04, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x69, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x34, 0x00, 0x05, 0x00, 0x0a, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x40, + 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x09, 0x00, 0xbe, + 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0xc2, + 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x74, + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x00, 0x00, 0x48, + 0x00, 0x04, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, + 0x00, 0x05, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x77, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x79, + 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x95, 0x00, 0x00, 0x00, 0x1e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x99, + 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x1e, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xa2, + 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x0b, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xbe, + 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, + 0x00, 0x04, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, + 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, + 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, + 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x11, + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x15, + 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, + 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0x2c, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x54, + 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x2b, + 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0x76, 0x00, 0x00, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x77, + 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x94, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x98, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x98, + 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0x9f, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x94, + 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0x94, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xba, + 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, + 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xc1, + 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, + 0x00, 0x05, 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, 0x0f, 0x00, 0x00, 0x00, 0x96, + 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x11, + 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x3d, + 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x9c, + 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xa0, + 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x3d, + 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xa8, + 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xea, + 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x07, + 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x9d, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, + 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xa0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, + 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xf2, + 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, + 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xa0, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, + 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0xf8, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xee, + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0xfa, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xee, + 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfc, + 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x54, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, + 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0xfd, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0xfa, + 0x00, 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x58, + 0x01, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x58, + 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, + 0x01, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, + 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0d, 0x01, 0x00, 0x00, 0xfd, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x0d, 0x01, 0x00, 0x00, 0xf8, + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x09, + 0x01, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x50, + 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0x06, + 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, + 0x00, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xea, + 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, + 0x01, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, + 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x16, + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0f, + 0x00, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x19, + 0x01, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x41, + 0x00, 0x05, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x1b, 0x01, 0x00, 0x00, 0x79, + 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x76, + 0x00, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x1b, 0x01, 0x00, 0x00, 0x90, + 0x00, 0x05, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x1a, + 0x01, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x21, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf2, + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x24, + 0x01, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x4f, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x9a, + 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x33, + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x21, + 0x01, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x85, + 0x00, 0x05, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x2b, 0x01, 0x00, 0x00, 0x96, + 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xbb, + 0x00, 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xbe, + 0x00, 0x00, 0x00, 0x2b, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xc2, + 0x00, 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, + 0x00, 0x01, 0x00, 0x00, 0x07, 0x05, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x40, 0x00 +}; +static const unsigned int vs_sprite_spv_len = sizeof(vs_sprite_spv); + +static const uint8_t vs_sprite_glsl[] = { + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, + 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, + 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, + 0x03, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x31, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x32, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x34, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, + 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, + 0x67, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, + 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, + 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, + 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, + 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x72, 0x6f, 0x74, 0x61, 0x74, + 0x65, 0x64, 0x50, 0x6f, 0x73, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, + 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, + 0x32, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x69, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x31, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, + 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, + 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, + 0x20, 0x3d, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x69, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x31, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, + 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, + 0x20, 0x28, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, + 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, + 0x20, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x73, 0x5f, + 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, + 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, + 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x74, 0x6d, + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x74, + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x3b, 0x0a, 0x20, + 0x20, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x73, 0x5f, + 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, + 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, + 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x6d, + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x74, + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, + 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, + 0x5f, 0x35, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, + 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x2e, 0x78, + 0x79, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, + 0x64, 0x50, 0x6f, 0x73, 0x5f, 0x31, 0x20, 0x2a, 0x20, 0x69, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x30, 0x2e, 0x7a, 0x77, 0x29, 0x20, 0x2b, 0x20, 0x69, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x30, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, + 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, + 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, + 0x5f, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x20, 0x3d, + 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x31, 0x2e, 0x77, 0x3b, 0x0a, + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x79, + 0x20, 0x3d, 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x32, 0x2e, 0x78, + 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, + 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, 0x20, 0x28, 0x69, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x31, 0x2e, 0x79, 0x7a, 0x2c, 0x20, 0x74, + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2c, 0x20, 0x61, 0x5f, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x29, 0x3b, + 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, + 0x3d, 0x20, 0x28, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, + 0x2a, 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x34, 0x29, 0x3b, 0x0a, + 0x7d, 0x0a, 0x0a, 0x00 +}; +static const unsigned int vs_sprite_glsl_len = sizeof(vs_sprite_glsl); + +static const uint8_t vs_sprite_mtl[] = { + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, + 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, + 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, + 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, + 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, + 0x62, 0x3e, 0x0a, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, + 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, + 0x3e, 0x0a, 0x0a, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, + 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x5f, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x76, + 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, + 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, + 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, + 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, + 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, + 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, 0x6f, 0x6c, + 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, + 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, 0x6e, 0x74, + 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, + 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, + 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, + 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, + 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, + 0x6f, 0x61, 0x74, 0x34, 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x30, + 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x31, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x28, 0x33, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x69, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x32, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x28, 0x34, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x69, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x34, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x28, 0x36, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, + 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, + 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, + 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, + 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, + 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, + 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, + 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, + 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, + 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x34, 0x38, 0x20, + 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x69, 0x6e, 0x2e, 0x69, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x31, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x32, 0x35, 0x30, 0x20, + 0x3d, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x69, 0x6e, 0x2e, 0x69, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x31, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x32, 0x35, 0x33, + 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, 0x66, 0x6c, + 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x29, 0x3b, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, + 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, + 0x66, 0x6d, 0x61, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x66, + 0x6d, 0x61, 0x28, 0x5f, 0x32, 0x35, 0x33, 0x2e, 0x78, 0x2c, 0x20, 0x5f, + 0x32, 0x34, 0x38, 0x2c, 0x20, 0x2d, 0x28, 0x5f, 0x32, 0x35, 0x33, 0x2e, + 0x79, 0x20, 0x2a, 0x20, 0x5f, 0x32, 0x35, 0x30, 0x29, 0x29, 0x2c, 0x20, + 0x66, 0x6d, 0x61, 0x28, 0x5f, 0x32, 0x35, 0x33, 0x2e, 0x78, 0x2c, 0x20, + 0x5f, 0x32, 0x35, 0x30, 0x2c, 0x20, 0x5f, 0x32, 0x35, 0x33, 0x2e, 0x79, + 0x20, 0x2a, 0x20, 0x5f, 0x32, 0x34, 0x38, 0x29, 0x29, 0x2c, 0x20, 0x69, + 0x6e, 0x2e, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x30, 0x2e, 0x7a, 0x77, + 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x30, + 0x2e, 0x78, 0x79, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, + 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, + 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, 0x6f, 0x6c, + 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x69, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x6f, 0x75, 0x74, 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, + 0x6d, 0x69, 0x78, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x69, + 0x6e, 0x2e, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x31, 0x2e, 0x79, 0x7a, + 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x69, 0x6e, + 0x2e, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x31, 0x2e, 0x77, 0x2c, 0x20, + 0x69, 0x6e, 0x2e, 0x69, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x32, 0x2e, 0x78, + 0x29, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x07, 0x05, 0x00, 0x01, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x40, 0x00 +}; +static const unsigned int vs_sprite_mtl_len = sizeof(vs_sprite_mtl); diff --git a/modules/BgfxRenderer/Shaders/vs_sprite.sc b/modules/BgfxRenderer/Shaders/vs_sprite.sc new file mode 100644 index 0000000..f8891ce --- /dev/null +++ b/modules/BgfxRenderer/Shaders/vs_sprite.sc @@ -0,0 +1,45 @@ +$input a_position, a_color0, i_data0, i_data1, i_data2, i_data3, i_data4 +$output v_color0, v_texcoord0 + +#include + +// Instanced sprite shader with texture support +// Instance data layout (5 x vec4 = 80 bytes): +// i_data0: x, y, scaleX, scaleY +// i_data1: rotation, u0, v0, u1 +// i_data2: v1, textureId, layer, padding +// i_data3: reserved +// i_data4: r, g, b, a (color) + +void main() +{ + // Extract transform from instance data + vec2 pos = i_data0.xy; + vec2 scale = i_data0.zw; + float rot = i_data1.x; + + // Extract UVs from instance data + float u0 = i_data1.y; + float v0 = i_data1.z; + float u1 = i_data1.w; + float v1 = i_data2.x; + + float c = cos(rot); + float s = sin(rot); + + // Transform vertex (quad is 0-1, center at 0.5) + vec2 localPos = a_position.xy - vec2(0.5, 0.5); + vec2 rotatedPos; + rotatedPos.x = localPos.x * c - localPos.y * s; + rotatedPos.y = localPos.x * s + localPos.y * c; + vec2 worldPos = rotatedPos * scale + pos; + + gl_Position = mul(u_viewProj, vec4(worldPos, 0.0, 1.0)); + + // Interpolate UVs based on vertex position in quad (0-1) + // a_position.xy is the vertex position (0,0), (1,0), (1,1), (0,1) + v_texcoord0 = mix(vec2(u0, v0), vec2(u1, v1), a_position.xy); + + // Color = vertex color * instance color + v_color0 = a_color0 * i_data4; +} diff --git a/tests/integration/test_20_bgfx_rhi.cpp b/tests/integration/test_20_bgfx_rhi.cpp index 9c7007f..f6d4c2b 100644 --- a/tests/integration/test_20_bgfx_rhi.cpp +++ b/tests/integration/test_20_bgfx_rhi.cpp @@ -389,14 +389,20 @@ void test_sprite_instance_struct() { sprite.v0 = 0.0f; sprite.u1 = 1.0f; sprite.v1 = 1.0f; - sprite.color = 0xFFFFFFFF; - sprite.textureId = 5; - sprite.layer = 10; + sprite.textureId = 5.0f; + sprite.layer = 10.0f; + sprite.padding0 = 0.0f; + sprite.reserved[0] = sprite.reserved[1] = sprite.reserved[2] = sprite.reserved[3] = 0.0f; + sprite.r = 1.0f; + sprite.g = 1.0f; + sprite.b = 1.0f; + sprite.a = 1.0f; ASSERT(sprite.x == 50.0f); ASSERT(sprite.scaleX == 2.0f); - ASSERT(sprite.textureId == 5); - ASSERT(sprite.layer == 10); + ASSERT(sprite.textureId == 5.0f); + ASSERT(sprite.layer == 10.0f); + ASSERT(sizeof(SpriteInstance) == 80); // Must be 80 bytes for GPU } // ============================================================================