mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Misc] (MG_State/Drawing): minor optimizations
This commit is contained in:
@@ -541,12 +541,13 @@ 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()) {
|
auto it = MG_State_T::bufferState->buffers_.find(bufferID);
|
||||||
|
if (it == MG_State_T::bufferState->buffers_.end()) {
|
||||||
MG_Util::Debug::LogW("Buffer ID %u not found in bufferState. Skipping update.", bufferID);
|
MG_Util::Debug::LogW("Buffer ID %u not found in bufferState. Skipping update.", bufferID);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& bufferObj = MG_State_T::bufferState->buffers_[bufferID];
|
auto& bufferObj = it->second;
|
||||||
if (pBuffer && bufferObj.isDynamic && !bufferObj.data.empty()) {
|
if (pBuffer && bufferObj.isDynamic && !bufferObj.data.empty()) {
|
||||||
void* pMappedData = nullptr;
|
void* pMappedData = nullptr;
|
||||||
MG_Util::Debug::LogD("Mapping dynamic buffer %u for data update.", bufferID);
|
MG_Util::Debug::LogD("Mapping dynamic buffer %u for data update.", bufferID);
|
||||||
|
|||||||
Reference in New Issue
Block a user