mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
Restructure some internal vertex buffer binding code to be closer to how graphics APIs actually behave.
This commit is contained in:
@@ -332,7 +332,7 @@ void SpriteBatch::draw(Graphics *gfx, const Matrix4 &m)
|
||||
array_buf->unmap();
|
||||
|
||||
Attributes attributes;
|
||||
Buffers buffers;
|
||||
BufferBindings buffers;
|
||||
|
||||
{
|
||||
buffers.set(0, array_buf, 0);
|
||||
@@ -374,9 +374,10 @@ void SpriteBatch::draw(Graphics *gfx, const Matrix4 &m)
|
||||
uint16 offset = (uint16) mesh->getAttributeOffset(it.second.index);
|
||||
uint16 stride = (uint16) mesh->getVertexStride();
|
||||
|
||||
attributes.set(attributeindex, format.type, format.components, offset, stride, activebuffers);
|
||||
attributes.set(attributeindex, format.type, (uint8) format.components, offset, activebuffers);
|
||||
attributes.setBufferLayout(activebuffers, stride);
|
||||
|
||||
// TODO: Ideally we want to reuse buffers with the same stride+step.
|
||||
// TODO: We should reuse buffer bindings with the same buffer+stride+step.
|
||||
buffers.set(activebuffers, mesh->vertexBuffer, 0);
|
||||
activebuffers++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user