mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Fix] (Diligent/Buffer): Create dynamic buffer in glDraw*.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user