[Fix] (Diligent/Buffer): Create dynamic buffer in glDraw*.

This commit is contained in:
BZLZHH
2025-06-08 13:35:32 +08:00
parent 848f110658
commit 292c7eeecf
4 changed files with 172 additions and 82 deletions
+2
View File
@@ -74,6 +74,8 @@ GLenum BufferState::CommitStorage(GLenum target, GLsizeiptr size, const void* da
BufferObject& obj = buffers_[it->second];
MG_Util::Debug::LogD("MG_State: Buffer: CommitStorage get buffer object %u at target 0x%x",it->second,target);
obj.usage = usage;
obj.isDynamic = (usage == GL_DYNAMIC_DRAW || usage == GL_DYNAMIC_READ ||
usage == GL_DYNAMIC_COPY || usage == GL_STREAM_DRAW);
obj.data.resize(size);
if (data) {
memcpy(obj.data.data(), data, size);
+1
View File
@@ -18,6 +18,7 @@ public:
bool dirty = false; // TODO: encapsulate this with an public API to RHI
bool isMapped = false;
bool generated = false;
bool isDynamic = false;
GLenum accessMode = GL_READ_WRITE;
GLintptr mapOffset = 0;
GLsizeiptr mapLength = 0;