bind vertex buffers
Some checks are pending
codespell / Check for spelling errors (push) Waiting to run
suyu verify / Verify Format (push) Waiting to run
suyu verify / test build (push) Blocked by required conditions
suyu verify / android (push) Blocked by required conditions

This commit is contained in:
Samuliak 2024-10-05 15:40:10 +02:00
parent 89ff6909a9
commit c24e3c23ff
No known key found for this signature in database
2 changed files with 10 additions and 6 deletions

View file

@ -93,14 +93,18 @@ void BufferCacheRuntime::BindQuadIndexBuffer(PrimitiveTopology topology, u32 fir
// TODO: bind quad index buffer // TODO: bind quad index buffer
} }
void BufferCacheRuntime::BindVertexBuffer(size_t stage, u32 index, MTL::Buffer* buffer, u32 offset, void BufferCacheRuntime::BindVertexBuffer(u32 index, MTL::Buffer* buffer, u32 offset, u32 size,
u32 size, u32 stride) { u32 stride) {
// TODO: use stride // TODO: use stride?
BindBuffer(stage, MAX_METAL_BUFFERS - index - 1, buffer, offset, size); BindBuffer(0, MAX_METAL_BUFFERS - index - 1, buffer, offset, size);
} }
void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings) { void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings) {
// TODO: implement for (u32 index = 0; index < bindings.buffers.size(); ++index) {
auto handle = bindings.buffers[index]->Handle();
// TODO: set stride?
BindVertexBuffer(index, handle, bindings.offsets[index], bindings.sizes[index], 0);
}
} }
void BufferCacheRuntime::BindBuffer(size_t stage, u32 binding_index, MTL::Buffer* buffer, void BufferCacheRuntime::BindBuffer(size_t stage, u32 binding_index, MTL::Buffer* buffer,

View file

@ -110,7 +110,7 @@ public:
void BindQuadIndexBuffer(PrimitiveTopology topology, u32 first, u32 count); void BindQuadIndexBuffer(PrimitiveTopology topology, u32 first, u32 count);
void BindVertexBuffer(size_t stage, u32 index, MTL::Buffer* buffer, u32 offset, u32 size, void BindVertexBuffer(u32 index, MTL::Buffer* buffer, u32 offset, u32 size,
u32 stride); u32 stride);
void BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings); void BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bindings);