RHI: Fix view type signatures in CommandList abstraction

- Unified RHICommandList interface to use RHIResourceView* for all view types
- Fixed OpenGLCommandList override signatures (SetVertexBuffers, SetIndexBuffer, etc.)
- Fixed D3D12CommandList by removing duplicate SetVertexBuffer methods
- Updated OpenGLCommandList.cpp to match new signatures
- Build and all 845 tests pass
This commit is contained in:
2026-03-24 23:41:57 +08:00
parent 7a66913f2b
commit 1e88beacb8
10 changed files with 505 additions and 44 deletions

View File

@@ -609,17 +609,6 @@ void OpenGLCommandList::SetPipelineState(RHIPipelineState* pipelineState) {
}
}
void OpenGLCommandList::SetVertexBuffer(uint32_t slot, RHIResourceView* buffer, uint64_t offset) {
if (!buffer) return;
OpenGLResourceView* view = static_cast<OpenGLResourceView*>(buffer);
if (!view->IsValid()) return;
GLuint glBuffer = view->GetBuffer();
glBindBuffer(GL_ARRAY_BUFFER, glBuffer);
glVertexAttribPointer(slot, 4, GL_FLOAT, GL_FALSE, 0, reinterpret_cast<void*>(static_cast<uintptr_t>(offset)));
glEnableVertexAttribArray(slot);
}
void OpenGLCommandList::SetVertexBuffers(uint32_t startSlot, uint32_t count, RHIResourceView** buffers, const uint64_t* offsets, const uint32_t* strides) {
for (uint32_t i = 0; i < count; i++) {
if (!buffers[i]) continue;