mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
forcing all glBufferData calls into resource record isn't right
* glBufferData isn't only used for creation, it is often used to upload new data to a buffer, which means that during the captured frame any 're-create' type calls should go into the context record.
This commit is contained in:
@@ -529,6 +529,16 @@ void WrappedOpenGL::glNamedBufferDataEXT(GLuint buffer, GLsizeiptr size, const v
|
||||
|
||||
Chunk *chunk = scope.Get();
|
||||
|
||||
// if we've already created this is a renaming/data updating call. It should go in
|
||||
// the frame record so we can 'update' the buffer as it goes in the frame.
|
||||
// if we haven't created the buffer at all, it could be a mid-frame create and we
|
||||
// should place it in the resource record, to happen before the frame.
|
||||
if(m_State == WRITING_CAPFRAME && record->GetDataPtr())
|
||||
{
|
||||
// we could perhaps substitute this for a 'fake' glBufferSubData chunk?
|
||||
m_ContextRecord->AddChunk(chunk);
|
||||
}
|
||||
else
|
||||
{
|
||||
record->AddChunk(chunk);
|
||||
record->SetDataPtr(chunk->GetData());
|
||||
@@ -634,6 +644,16 @@ void WrappedOpenGL::glBufferData(GLenum target, GLsizeiptr size, const void *dat
|
||||
|
||||
Chunk *chunk = scope.Get();
|
||||
|
||||
// if we've already created this is a renaming/data updating call. It should go in
|
||||
// the frame record so we can 'update' the buffer as it goes in the frame.
|
||||
// if we haven't created the buffer at all, it could be a mid-frame create and we
|
||||
// should place it in the resource record, to happen before the frame.
|
||||
if(m_State == WRITING_CAPFRAME && record->GetDataPtr())
|
||||
{
|
||||
// we could perhaps substitute this for a 'fake' glBufferSubData chunk?
|
||||
m_ContextRecord->AddChunk(chunk);
|
||||
}
|
||||
else
|
||||
{
|
||||
record->AddChunk(chunk);
|
||||
record->SetDataPtr(chunk->GetData());
|
||||
|
||||
Reference in New Issue
Block a user