mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Chore] (MG_Backend/DirectVulkan): add indexBufferView field for draw cmds
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user