Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

refactor(render): drop the unused MatSprite transient stream

yhh5e5c264d78c0
diff --git a/src/esengine/renderer/GfxEnums.hpp b/src/esengine/renderer/GfxEnums.hpp
index f769c8ab6..bd3f0038d 100644
--- a/src/esengine/renderer/GfxEnums.hpp
+++ b/src/esengine/renderer/GfxEnums.hpp
@@ -71,10 +71,9 @@ enum class LayoutId : u8 {
Batch = 0,
ParticleInstance = 1, ///< Instanced: a static unit quad + a per-particle instance stream.
Shape = 2,
- MatSprite = 3,
};
-static constexpr u32 LAYOUT_COUNT = 4;
+static constexpr u32 LAYOUT_COUNT = 3;
// =============================================================================
// Data Type (vertex attributes, index type, pixel data type)
diff --git a/src/esengine/renderer/TransientBufferPool.cpp b/src/esengine/renderer/TransientBufferPool.cpp
index 3173f4b23..9f95b4485 100644
--- a/src/esengine/renderer/TransientBufferPool.cpp
+++ b/src/esengine/renderer/TransientBufferPool.cpp
@@ -17,7 +17,7 @@ void TransientBufferPool::init(u32 initialVertexBytes, u32 initialIndexCount) {
initial_vertex_bytes_ = initialVertexBytes;
initial_index_count_ = initialIndexCount;
- for (auto layout : {LayoutId::Batch, LayoutId::ParticleInstance, LayoutId::Shape, LayoutId::MatSprite}) {
+ for (auto layout : {LayoutId::Batch, LayoutId::ParticleInstance, LayoutId::Shape}) {
setupStream(layout);
}
@@ -246,13 +246,6 @@ void TransientBufferPool::setupStream(LayoutId layout) {
desc.attributes[2] = {2, 4, GfxDataType::Float, false, 16, 0};
desc.attributes[3] = {3, 4, GfxDataType::Float, false, 32, 0};
break;
- case LayoutId::MatSprite:
- desc.attributeCount = 3;
- desc.strides[0] = 32;
- desc.attributes[0] = {0, 2, GfxDataType::Float, false, 0, 0};
- desc.attributes[1] = {1, 2, GfxDataType::Float, false, 8, 0};
- desc.attributes[2] = {2, 4, GfxDataType::Float, false, 16, 0};
- break;
default:
break;
}