[Chore] (MG_Backend/DirectVulkan): add indexBufferView field for draw cmds

This commit is contained in:
2026-03-18 13:25:10 +08:00
parent 2ecba4d70c
commit bc018c9513
3 changed files with 10 additions and 6 deletions
@@ -67,8 +67,8 @@ namespace MobileGL::MG_Backend::DirectVulkan {
DrawIndexedCmd payload{};
payload.mode = mode;
payload.indexType = type;
payload.indexByteOffset = reinterpret_cast<SizeT>(indices);
payload.indexBufferView.indexType = type;
payload.indexBufferView.indexByteOffset = reinterpret_cast<SizeT>(indices);
payload.indexCount = count;
payload.instanceCount = 1;
@@ -107,8 +107,8 @@ namespace MobileGL::MG_Backend::DirectVulkan {
MOBILEGL_ASSERT(MG_State::pGLContext, "DirectVulkan::DrawElementsBaseVertex called with null GL context");
DrawIndexedCmd payload{};
payload.mode = mode;
payload.indexType = type;
payload.indexByteOffset = reinterpret_cast<SizeT>(indices);
payload.indexBufferView.indexType = type;
payload.indexBufferView.indexByteOffset = reinterpret_cast<SizeT>(indices);
payload.indexCount = count;
payload.instanceCount = 1;
payload.firstIndex = 0;
@@ -1269,7 +1269,7 @@ void main() {
auto& frame = m_frameContext.GetCurrent();
SetupDraw(frame, payload.mode, DrawSetupAspect::IndexBuffer,
payload.indexType, payload.indexByteOffset, payload.indexCount);
payload.indexBufferView.indexType, payload.indexBufferView.indexByteOffset, payload.indexCount);
MOBILEGL_ASSERT(frame.isCommandRecording, "%s: frame recording was not started", __func__);
@@ -54,9 +54,13 @@ namespace MobileGL::MG_Backend::DirectVulkan {
Uint32 firstInstance = 0;
};
struct DrawIndexedCmd: public DrawBaseCmd {
struct IndexBufferView {
GLenum indexType = GL_UNSIGNED_SHORT;
SizeT indexByteOffset = 0;
};
struct DrawIndexedCmd: public DrawBaseCmd {
IndexBufferView indexBufferView;
Uint32 indexCount = 0;
Uint32 instanceCount = 1;