mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Fix] (Diligent/Drawing): Fix vertex in glMultiDrawElements,
This commit is contained in:
@@ -530,6 +530,11 @@ namespace MG_GL::GL {
|
|||||||
|
|
||||||
// Update data for all dynamic buffers
|
// Update data for all dynamic buffers
|
||||||
for (auto& [bufferID, pBuffer] : MG_Diligent::g_BufferMap) {
|
for (auto& [bufferID, pBuffer] : MG_Diligent::g_BufferMap) {
|
||||||
|
if (MG_State_T::bufferState->buffers_.find(bufferID) == MG_State_T::bufferState->buffers_.end()) {
|
||||||
|
MG_Util::Debug::LogW("Buffer ID %u not found in bufferState. Skipping update.", bufferID);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
auto& bufferObj = MG_State_T::bufferState->buffers_[bufferID];
|
auto& bufferObj = MG_State_T::bufferState->buffers_[bufferID];
|
||||||
if (pBuffer && bufferObj.isDynamic && !bufferObj.data.empty()) {
|
if (pBuffer && bufferObj.isDynamic && !bufferObj.data.empty()) {
|
||||||
void* pMappedData = nullptr;
|
void* pMappedData = nullptr;
|
||||||
@@ -708,6 +713,12 @@ namespace MG_GL::GL {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MG_Diligent::g_pContext->SetIndexBuffer(
|
||||||
|
pIndexBuffer,
|
||||||
|
0,
|
||||||
|
Diligent::RESOURCE_STATE_TRANSITION_MODE_TRANSITION
|
||||||
|
);
|
||||||
|
|
||||||
Diligent::VALUE_TYPE indexType = ConvertGLTypeToDiligent(type);
|
Diligent::VALUE_TYPE indexType = ConvertGLTypeToDiligent(type);
|
||||||
Diligent::Uint32 indexSize = 0;
|
Diligent::Uint32 indexSize = 0;
|
||||||
switch (indexType) {
|
switch (indexType) {
|
||||||
@@ -720,6 +731,7 @@ namespace MG_GL::GL {
|
|||||||
|
|
||||||
std::vector<DrawIndexedArguments> indirectCmds;
|
std::vector<DrawIndexedArguments> indirectCmds;
|
||||||
indirectCmds.reserve(drawcount);
|
indirectCmds.reserve(drawcount);
|
||||||
|
indirectCmds.clear();
|
||||||
for (GLsizei i = 0; i < drawcount; ++i) {
|
for (GLsizei i = 0; i < drawcount; ++i) {
|
||||||
if (count[i] <= 0) continue;
|
if (count[i] <= 0) continue;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user