1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

2D: Switch to VBOs for instance data

- Add support for vertex bindings and UMA vertex buffers in D3D12.
- Simplify 2D instance params and move more into per-batch data to save
  bandwidth

Co-authored-by: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com>
Co-authored-by: Clay John <claynjohn@gmail.com>
Co-authored-by: A Thousand Ships <96648715+athousandships@users.noreply.github.com>
This commit is contained in:
Stuart Carnie
2025-11-07 05:50:02 +11:00
parent bad1287b62
commit 90c0e6acca
25 changed files with 893 additions and 256 deletions

View File

@@ -549,6 +549,7 @@ public:
};
struct VertexAttribute {
uint32_t binding = UINT32_MAX; // Attribute buffer binding index. When set to UINT32_MAX, it uses the index of the attribute in the layout.
uint32_t location = 0; // Shader location.
uint32_t offset = 0;
DataFormat format = DATA_FORMAT_MAX;
@@ -556,6 +557,18 @@ public:
VertexFrequency frequency = VERTEX_FREQUENCY_VERTEX;
};
struct VertexAttributeBinding {
uint32_t stride = 0;
VertexFrequency frequency = VERTEX_FREQUENCY_VERTEX;
VertexAttributeBinding() = default;
VertexAttributeBinding(uint32_t p_stride, VertexFrequency p_frequency) :
stride(p_stride),
frequency(p_frequency) {}
};
typedef HashMap<uint32_t, VertexAttributeBinding> VertexAttributeBindingsMap;
/*********************/
/**** FRAMEBUFFER ****/
/*********************/