mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 13:00:32 +00:00
Fetch initial buffer contents for dirty resources in GL
* Huge hack, but it works for now...
This commit is contained in:
@@ -32,3 +32,18 @@ bool GLResourceManager::SerialisableResource(ResourceId id, GLResourceRecord *re
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GLResourceManager::Prepare_InitialState(GLResource res)
|
||||
{
|
||||
if(res.Namespace == eResBuffer)
|
||||
{
|
||||
GLResourceRecord *record = GetResourceRecord(res);
|
||||
|
||||
GLint length;
|
||||
m_GL->glGetNamedBufferParameterivEXT(res.name, eGL_BUFFER_SIZE, &length);
|
||||
|
||||
m_GL->glGetNamedBufferSubDataEXT(res.name, 0, length, record->GetDataPtr());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -140,8 +140,8 @@ class GLResourceManager : public ResourceManager<GLResource, GLResourceRecord>
|
||||
bool ResourceTypeRelease(GLResource res) { return true; }
|
||||
|
||||
bool Need_InitialState(GLResource res) { return false; }
|
||||
bool Need_InitialStateChunk(GLResource res) { return false; }
|
||||
bool Prepare_InitialState(GLResource res) { return true; }
|
||||
bool Need_InitialStateChunk(GLResource res) { return res.Namespace != eResBuffer; }
|
||||
bool Prepare_InitialState(GLResource res);
|
||||
bool Serialise_InitialState(GLResource res) { return true; }
|
||||
void Create_InitialState(ResourceId id, GLResource live, bool hasData) { }
|
||||
void Apply_InitialState(GLResource live, GLResource initial, uint32_t count) { }
|
||||
|
||||
Reference in New Issue
Block a user