mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-13 10:11:02 +00:00
Add resources to list while capframing, that would be dirtied when idle
This commit is contained in:
@@ -696,8 +696,6 @@ WrappedOpenGL::WrappedOpenGL(const char *logfile, const GLHookSet &funcs)
|
||||
m_ActiveConditional = false;
|
||||
m_ActiveFeedback = false;
|
||||
|
||||
m_DisplayListRecord = NULL;
|
||||
|
||||
#if defined(RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
|
||||
@@ -152,7 +152,7 @@ class WrappedOpenGL : public IFrameCapturer
|
||||
ResourceId m_ContextResourceID;
|
||||
GLResourceRecord *m_ContextRecord;
|
||||
|
||||
GLResourceRecord *m_DisplayListRecord;
|
||||
set<ResourceId> m_MissingTracks;
|
||||
|
||||
GLResourceManager *m_ResourceManager;
|
||||
|
||||
|
||||
@@ -289,13 +289,14 @@ void WrappedOpenGL::glBindBuffer(GLenum target, GLuint buffer)
|
||||
}
|
||||
|
||||
// immediately consider buffers bound to transform feedbacks/SSBOs/atomic counters as dirty
|
||||
if(m_State == WRITING_IDLE &&
|
||||
(target == eGL_TRANSFORM_FEEDBACK_BUFFER ||
|
||||
if(target == eGL_TRANSFORM_FEEDBACK_BUFFER ||
|
||||
target == eGL_SHADER_STORAGE_BUFFER ||
|
||||
target == eGL_ATOMIC_COUNTER_BUFFER)
|
||||
)
|
||||
{
|
||||
GetResourceManager()->MarkDirtyResource(r->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(r->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(r->GetResourceID());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -741,6 +742,7 @@ void WrappedOpenGL::glNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, GLsi
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(chunk);
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -782,7 +784,10 @@ void WrappedOpenGL::glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr s
|
||||
Chunk *chunk = scope.Get();
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(chunk);
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
else
|
||||
{
|
||||
record->AddChunk(chunk);
|
||||
@@ -845,6 +850,7 @@ void WrappedOpenGL::glNamedCopyBufferSubDataEXT(GLuint readBuffer, GLuint writeB
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(chunk);
|
||||
m_MissingTracks.insert(writerecord->GetResourceID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -898,6 +904,7 @@ void WrappedOpenGL::glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, G
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(chunk);
|
||||
m_MissingTracks.insert(writerecord->GetResourceID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -995,13 +1002,14 @@ void WrappedOpenGL::glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
|
||||
}
|
||||
|
||||
// immediately consider buffers bound to transform feedbacks/SSBOs/atomic counters as dirty
|
||||
if(m_State == WRITING_IDLE &&
|
||||
(target == eGL_TRANSFORM_FEEDBACK_BUFFER ||
|
||||
target == eGL_SHADER_STORAGE_BUFFER ||
|
||||
target == eGL_ATOMIC_COUNTER_BUFFER)
|
||||
)
|
||||
if(r && (target == eGL_TRANSFORM_FEEDBACK_BUFFER ||
|
||||
target == eGL_SHADER_STORAGE_BUFFER ||
|
||||
target == eGL_ATOMIC_COUNTER_BUFFER))
|
||||
{
|
||||
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffer));
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
m_MissingTracks.insert(r->GetResourceID());
|
||||
else
|
||||
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffer));
|
||||
}
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
@@ -1097,15 +1105,16 @@ void WrappedOpenGL::glBindBufferRange(GLenum target, GLuint index, GLuint buffer
|
||||
|
||||
cd.m_FeedbackRecord->AddChunk(scope.Get());
|
||||
}
|
||||
|
||||
|
||||
// immediately consider buffers bound to transform feedbacks/SSBOs/atomic counters as dirty
|
||||
if(m_State == WRITING_IDLE &&
|
||||
(target == eGL_TRANSFORM_FEEDBACK_BUFFER ||
|
||||
target == eGL_SHADER_STORAGE_BUFFER ||
|
||||
target == eGL_ATOMIC_COUNTER_BUFFER)
|
||||
)
|
||||
if(r && (target == eGL_TRANSFORM_FEEDBACK_BUFFER ||
|
||||
target == eGL_SHADER_STORAGE_BUFFER ||
|
||||
target == eGL_ATOMIC_COUNTER_BUFFER))
|
||||
{
|
||||
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffer));
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
m_MissingTracks.insert(r->GetResourceID());
|
||||
else
|
||||
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffer));
|
||||
}
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
@@ -1162,10 +1171,12 @@ void WrappedOpenGL::glBindBuffersBase(GLenum target, GLuint first, GLsizei count
|
||||
{
|
||||
size_t idx = BufferIdx(target);
|
||||
|
||||
GLResourceRecord *r = NULL;
|
||||
|
||||
if(buffers[0] == 0)
|
||||
cd.m_BufferRecord[idx] = NULL;
|
||||
r = cd.m_BufferRecord[idx] = NULL;
|
||||
else
|
||||
cd.m_BufferRecord[idx] = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffers[0]));
|
||||
r = cd.m_BufferRecord[idx] = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffers[0]));
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
@@ -1178,10 +1189,16 @@ void WrappedOpenGL::glBindBuffersBase(GLenum target, GLuint first, GLsizei count
|
||||
target == eGL_SHADER_STORAGE_BUFFER ||
|
||||
target == eGL_TRANSFORM_FEEDBACK_BUFFER)
|
||||
refType = eFrameRef_Write;
|
||||
|
||||
|
||||
for(GLsizei i=0; i < count; i++)
|
||||
{
|
||||
if(buffers[i])
|
||||
GetResourceManager()->MarkResourceFrameReferenced(GetResourceManager()->GetID(BufferRes(GetCtx(), buffers[i])), refType);
|
||||
{
|
||||
ResourceId id = GetResourceManager()->GetID(BufferRes(GetCtx(), buffers[i]));
|
||||
GetResourceManager()->MarkResourceFrameReferenced(id, refType);
|
||||
m_MissingTracks.insert(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0; i < count; i++)
|
||||
@@ -1219,16 +1236,17 @@ void WrappedOpenGL::glBindBuffersBase(GLenum target, GLuint first, GLsizei count
|
||||
cd.m_FeedbackRecord->AddChunk(scope.Get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// immediately consider buffers bound to transform feedbacks/SSBOs/atomic counters as dirty
|
||||
if(m_State == WRITING_IDLE &&
|
||||
(target == eGL_TRANSFORM_FEEDBACK_BUFFER ||
|
||||
target == eGL_SHADER_STORAGE_BUFFER ||
|
||||
target == eGL_ATOMIC_COUNTER_BUFFER)
|
||||
)
|
||||
if(r && (target == eGL_TRANSFORM_FEEDBACK_BUFFER ||
|
||||
target == eGL_SHADER_STORAGE_BUFFER ||
|
||||
target == eGL_ATOMIC_COUNTER_BUFFER))
|
||||
{
|
||||
for(int i=0; i < count; i++)
|
||||
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffers[i]));
|
||||
if(m_State == WRITING_IDLE)
|
||||
{
|
||||
for(int i=0; i < count; i++)
|
||||
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffers[i]));
|
||||
}
|
||||
}
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
@@ -1315,27 +1333,35 @@ void WrappedOpenGL::glBindBuffersRange(GLenum target, GLuint first, GLsizei coun
|
||||
refType = eFrameRef_Write;
|
||||
|
||||
for(GLsizei i=0; i < count; i++)
|
||||
if(buffers[i])
|
||||
GetResourceManager()->MarkResourceFrameReferenced(GetResourceManager()->GetID(BufferRes(GetCtx(), buffers[i])), refType);
|
||||
}
|
||||
|
||||
for(int i=0; i < count; i++)
|
||||
{
|
||||
GLResourceRecord *r = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffers[i]));
|
||||
|
||||
// it's legal to re-type buffers, generate another BindBuffer chunk to rename
|
||||
if(r->datatype != target)
|
||||
{
|
||||
Chunk *chunk = NULL;
|
||||
|
||||
if(buffers[i])
|
||||
{
|
||||
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);
|
||||
Serialise_glBindBuffer(target, buffers[i]);
|
||||
|
||||
chunk = scope.Get();
|
||||
ResourceId id = GetResourceManager()->GetID(BufferRes(GetCtx(), buffers[i]));
|
||||
GetResourceManager()->MarkResourceFrameReferenced(id, refType);
|
||||
m_MissingTracks.insert(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i=0; i < count; i++)
|
||||
{
|
||||
GLResourceRecord *r = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffers[i]));
|
||||
|
||||
r->AddChunk(chunk);
|
||||
// it's legal to re-type buffers, generate another BindBuffer chunk to rename
|
||||
if(r->datatype != target)
|
||||
{
|
||||
Chunk *chunk = NULL;
|
||||
|
||||
{
|
||||
SCOPED_SERIALISE_CONTEXT(BIND_BUFFER);
|
||||
Serialise_glBindBuffer(target, buffers[i]);
|
||||
|
||||
chunk = scope.Get();
|
||||
}
|
||||
|
||||
r->AddChunk(chunk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1354,16 +1380,17 @@ void WrappedOpenGL::glBindBuffersRange(GLenum target, GLuint first, GLsizei coun
|
||||
cd.m_FeedbackRecord->AddChunk(scope.Get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// immediately consider buffers bound to transform feedbacks/SSBOs/atomic counters as dirty
|
||||
if(m_State == WRITING_IDLE &&
|
||||
(target == eGL_TRANSFORM_FEEDBACK_BUFFER ||
|
||||
target == eGL_SHADER_STORAGE_BUFFER ||
|
||||
target == eGL_ATOMIC_COUNTER_BUFFER)
|
||||
)
|
||||
if(target == eGL_TRANSFORM_FEEDBACK_BUFFER ||
|
||||
target == eGL_SHADER_STORAGE_BUFFER ||
|
||||
target == eGL_ATOMIC_COUNTER_BUFFER)
|
||||
{
|
||||
for(int i=0; i < count; i++)
|
||||
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffers[i]));
|
||||
if(m_State == WRITING_IDLE)
|
||||
{
|
||||
for(int i=0; i < count; i++)
|
||||
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffers[i]));
|
||||
}
|
||||
}
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
@@ -1382,14 +1409,18 @@ void WrappedOpenGL::glInvalidateBufferData(GLuint buffer)
|
||||
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffer));
|
||||
else
|
||||
m_MissingTracks.insert(GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
|
||||
}
|
||||
|
||||
void WrappedOpenGL::glInvalidateBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr length)
|
||||
{
|
||||
m_Real.glInvalidateBufferSubData(buffer, offset, length);
|
||||
|
||||
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(BufferRes(GetCtx(), buffer));
|
||||
else
|
||||
m_MissingTracks.insert(GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
@@ -1950,7 +1981,10 @@ GLboolean WrappedOpenGL::glUnmapNamedBufferEXT(GLuint buffer)
|
||||
{
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
|
||||
auto status = record->Map.status;
|
||||
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
|
||||
GLboolean ret = GL_TRUE;
|
||||
|
||||
switch(status)
|
||||
@@ -1963,7 +1997,11 @@ GLboolean WrappedOpenGL::glUnmapNamedBufferEXT(GLuint buffer)
|
||||
break;
|
||||
case GLResourceRecord::Mapped_Ignore_Real:
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
RDCERR("Failed to cap frame - uncapped Map/Unmap");
|
||||
{
|
||||
RDCERR("Failed to cap frame - we saw an Unmap() that we didn't capture the corresponding Map() for");
|
||||
m_SuccessfulCapture = false;
|
||||
m_FailureReason = CaptureFailed_UncappedUnmap;
|
||||
}
|
||||
// need to do the real unmap
|
||||
ret = m_Real.glUnmapNamedBufferEXT(buffer);
|
||||
break;
|
||||
@@ -2125,13 +2163,17 @@ void WrappedOpenGL::glFlushMappedNamedBufferRangeEXT(GLuint buffer, GLintptr off
|
||||
{
|
||||
if(record)
|
||||
{
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
|
||||
if(record->Map.status == GLResourceRecord::Unmapped)
|
||||
{
|
||||
RDCWARN("Unmapped buffer being flushed, ignoring");
|
||||
}
|
||||
else if(record->Map.status == GLResourceRecord::Mapped_Ignore_Real)
|
||||
{
|
||||
RDCERR("Failed to cap frame - uncapped Map/Unmap being flushed");
|
||||
RDCERR("Failed to cap frame - we saw an FlushMappedBuffer() that we didn't capture the corresponding Map() for");
|
||||
m_SuccessfulCapture = false;
|
||||
m_FailureReason = CaptureFailed_UncappedUnmap;
|
||||
}
|
||||
else if(record->Map.status == GLResourceRecord::Mapped_Write)
|
||||
{
|
||||
|
||||
@@ -3663,6 +3663,7 @@ void WrappedOpenGL::glClearTexImage(GLuint texture, GLint level, GLenum format,
|
||||
Serialise_glClearTexImage(texture, level, format, type, data);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(GetResourceManager()->GetID(TextureRes(GetCtx(), texture)));
|
||||
}
|
||||
else if(m_State == WRITING_IDLE)
|
||||
{
|
||||
@@ -3760,6 +3761,7 @@ void WrappedOpenGL::glClearTexSubImage(GLuint texture, GLint level, GLint xoffse
|
||||
Serialise_glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(GetResourceManager()->GetID(TextureRes(GetCtx(), texture)));
|
||||
}
|
||||
else if(m_State == WRITING_IDLE)
|
||||
{
|
||||
|
||||
@@ -168,7 +168,10 @@ void WrappedOpenGL::glNamedFramebufferTextureEXT(GLuint framebuffer, GLenum atta
|
||||
if(texture != 0 && GetResourceManager()->HasResourceRecord(TextureRes(GetCtx(), texture)))
|
||||
{
|
||||
ResourceRecord *texrecord = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(texrecord->GetResourceID());
|
||||
}
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
@@ -213,7 +216,10 @@ void WrappedOpenGL::glFramebufferTexture(GLenum target, GLenum attachment, GLuin
|
||||
if(texture != 0 && GetResourceManager()->HasResourceRecord(TextureRes(GetCtx(), texture)))
|
||||
{
|
||||
ResourceRecord *texrecord = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(texrecord->GetResourceID());
|
||||
}
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
@@ -286,7 +292,10 @@ void WrappedOpenGL::glNamedFramebufferTexture1DEXT(GLuint framebuffer, GLenum at
|
||||
if(texture != 0 && GetResourceManager()->HasResourceRecord(TextureRes(GetCtx(), texture)))
|
||||
{
|
||||
ResourceRecord *texrecord = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(texrecord->GetResourceID());
|
||||
}
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
@@ -333,7 +342,10 @@ void WrappedOpenGL::glFramebufferTexture1D(GLenum target, GLenum attachment, GLe
|
||||
if(texture != 0 && GetResourceManager()->HasResourceRecord(TextureRes(GetCtx(), texture)))
|
||||
{
|
||||
ResourceRecord *texrecord = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(texrecord->GetResourceID());
|
||||
}
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
@@ -406,7 +418,10 @@ void WrappedOpenGL::glNamedFramebufferTexture2DEXT(GLuint framebuffer, GLenum at
|
||||
if(texture != 0 && GetResourceManager()->HasResourceRecord(TextureRes(GetCtx(), texture)))
|
||||
{
|
||||
ResourceRecord *texrecord = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(texrecord->GetResourceID());
|
||||
}
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
@@ -453,7 +468,10 @@ void WrappedOpenGL::glFramebufferTexture2D(GLenum target, GLenum attachment, GLe
|
||||
if(texture != 0 && GetResourceManager()->HasResourceRecord(TextureRes(GetCtx(), texture)))
|
||||
{
|
||||
ResourceRecord *texrecord = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(texrecord->GetResourceID());
|
||||
}
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
@@ -527,7 +545,10 @@ void WrappedOpenGL::glNamedFramebufferTexture3DEXT(GLuint framebuffer, GLenum at
|
||||
if(texture != 0 && GetResourceManager()->HasResourceRecord(TextureRes(GetCtx(), texture)))
|
||||
{
|
||||
ResourceRecord *texrecord = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(texrecord->GetResourceID());
|
||||
}
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
@@ -574,7 +595,10 @@ void WrappedOpenGL::glFramebufferTexture3D(GLenum target, GLenum attachment, GLe
|
||||
if(texture != 0 && GetResourceManager()->HasResourceRecord(TextureRes(GetCtx(), texture)))
|
||||
{
|
||||
ResourceRecord *texrecord = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(texrecord->GetResourceID());
|
||||
}
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
@@ -753,7 +777,10 @@ void WrappedOpenGL::glNamedFramebufferTextureLayerEXT(GLuint framebuffer, GLenum
|
||||
if(texture != 0 && GetResourceManager()->HasResourceRecord(TextureRes(GetCtx(), texture)))
|
||||
{
|
||||
ResourceRecord *texrecord = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(texrecord->GetResourceID());
|
||||
}
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
@@ -800,7 +827,10 @@ void WrappedOpenGL::glFramebufferTextureLayer(GLenum target, GLenum attachment,
|
||||
if(texture != 0 && GetResourceManager()->HasResourceRecord(TextureRes(GetCtx(), texture)))
|
||||
{
|
||||
ResourceRecord *texrecord = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(texrecord->GetResourceID());
|
||||
else
|
||||
m_MissingTracks.insert(texrecord->GetResourceID());
|
||||
}
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
@@ -953,8 +983,8 @@ void WrappedOpenGL::glReadBuffer(GLenum mode)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(drawrecord)
|
||||
GetResourceManager()->MarkDirtyResource(drawrecord->GetResourceID());
|
||||
if(readrecord)
|
||||
GetResourceManager()->MarkDirtyResource(readrecord->GetResourceID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -674,6 +674,7 @@ void WrappedOpenGL::Common_glGenerateTextureMipmapEXT(GLResourceRecord *record,
|
||||
Serialise_glGenerateTextureMipmapEXT(record->Resource.name, target);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
else if(m_State == WRITING_IDLE)
|
||||
{
|
||||
@@ -719,6 +720,8 @@ void WrappedOpenGL::glInvalidateTexImage(GLuint texture, GLint level)
|
||||
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(TextureRes(GetCtx(), texture));
|
||||
else
|
||||
m_MissingTracks.insert(GetResourceManager()->GetID(TextureRes(GetCtx(), texture)));
|
||||
}
|
||||
|
||||
void WrappedOpenGL::glInvalidateTexSubImage(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth)
|
||||
@@ -727,6 +730,8 @@ void WrappedOpenGL::glInvalidateTexSubImage(GLuint texture, GLint level, GLint x
|
||||
|
||||
if(m_State == WRITING_IDLE)
|
||||
GetResourceManager()->MarkDirtyResource(TextureRes(GetCtx(), texture));
|
||||
else
|
||||
m_MissingTracks.insert(GetResourceManager()->GetID(TextureRes(GetCtx(), texture)));
|
||||
}
|
||||
|
||||
bool WrappedOpenGL::Serialise_glCopyImageSubData(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ,
|
||||
@@ -811,6 +816,7 @@ void WrappedOpenGL::glCopyImageSubData(GLuint srcName, GLenum srcTarget, GLint s
|
||||
srcWidth, srcHeight, srcDepth);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(dstrecord->GetResourceID());
|
||||
}
|
||||
else if(m_State == WRITING_IDLE)
|
||||
{
|
||||
@@ -855,6 +861,7 @@ void WrappedOpenGL::Common_glCopyTextureSubImage1DEXT(GLResourceRecord *record,
|
||||
Serialise_glCopyTextureSubImage1DEXT(record->Resource.name, target, level, xoffset, x, y, width);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -929,6 +936,7 @@ void WrappedOpenGL::Common_glCopyTextureSubImage2DEXT(GLResourceRecord *record,
|
||||
Serialise_glCopyTextureSubImage2DEXT(record->Resource.name, target, level, xoffset, yoffset, x, y, width, height);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -997,6 +1005,7 @@ void WrappedOpenGL::Common_glCopyTextureSubImage3DEXT(GLResourceRecord *record,
|
||||
if(m_State == WRITING_IDLE)
|
||||
{
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
else if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
@@ -1004,6 +1013,7 @@ void WrappedOpenGL::Common_glCopyTextureSubImage3DEXT(GLResourceRecord *record,
|
||||
Serialise_glCopyTextureSubImage3DEXT(record->Resource.name, target, level, xoffset, yoffset, zoffset, x, y, width, height);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1682,7 +1692,7 @@ void WrappedOpenGL::Common_glTextureImage1DEXT(ResourceId texId, GLenum target,
|
||||
// so we need to attempt to catch the case where glTexImage is called to re-upload data, not actually re-create it.
|
||||
// Ideally we'd check for non-zero levels, but that would complicate the condition
|
||||
// if we're uploading new data but otherwise everything is identical, ignore this chunk and simply mark the texture dirty
|
||||
if(record->AlreadyDataType(target) && level == 0 &&
|
||||
if(m_State == WRITING_IDLE && record->AlreadyDataType(target) && level == 0 &&
|
||||
m_Textures[record->GetResourceID()].width == width &&
|
||||
m_Textures[record->GetResourceID()].internalFormat == (GLenum)internalformat)
|
||||
{
|
||||
@@ -1698,6 +1708,11 @@ void WrappedOpenGL::Common_glTextureImage1DEXT(ResourceId texId, GLenum target,
|
||||
|
||||
// illegal to re-type textures
|
||||
record->VerifyDataType(target);
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
else if(fromunpackbuf)
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1860,7 +1875,7 @@ void WrappedOpenGL::Common_glTextureImage2DEXT(ResourceId texId, GLenum target,
|
||||
// so we need to attempt to catch the case where glTexImage is called to re-upload data, not actually re-create it.
|
||||
// Ideally we'd check for non-zero levels, but that would complicate the condition
|
||||
// if we're uploading new data but otherwise everything is identical, ignore this chunk and simply mark the texture dirty
|
||||
if(record->AlreadyDataType(target) && level == 0 &&
|
||||
if(m_State == WRITING_IDLE && record->AlreadyDataType(target) && level == 0 &&
|
||||
m_Textures[record->GetResourceID()].width == width &&
|
||||
m_Textures[record->GetResourceID()].height == height &&
|
||||
m_Textures[record->GetResourceID()].internalFormat == (GLenum)internalformat)
|
||||
@@ -1877,8 +1892,10 @@ void WrappedOpenGL::Common_glTextureImage2DEXT(ResourceId texId, GLenum target,
|
||||
|
||||
// illegal to re-type textures
|
||||
record->VerifyDataType(target);
|
||||
|
||||
if(fromunpackbuf)
|
||||
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
else if(fromunpackbuf)
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -2021,7 +2038,7 @@ void WrappedOpenGL::Common_glTextureImage3DEXT(ResourceId texId, GLenum target,
|
||||
// so we need to attempt to catch the case where glTexImage is called to re-upload data, not actually re-create it.
|
||||
// Ideally we'd check for non-zero levels, but that would complicate the condition
|
||||
// if we're uploading new data but otherwise everything is identical, ignore this chunk and simply mark the texture dirty
|
||||
if(record->AlreadyDataType(target) && level == 0 &&
|
||||
if(m_State == WRITING_IDLE && record->AlreadyDataType(target) && level == 0 &&
|
||||
m_Textures[record->GetResourceID()].width == width &&
|
||||
m_Textures[record->GetResourceID()].height == height &&
|
||||
m_Textures[record->GetResourceID()].depth == depth &&
|
||||
@@ -2040,7 +2057,9 @@ void WrappedOpenGL::Common_glTextureImage3DEXT(ResourceId texId, GLenum target,
|
||||
// illegal to re-type textures
|
||||
record->VerifyDataType(target);
|
||||
|
||||
if(fromunpackbuf)
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
else if(fromunpackbuf)
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -2187,7 +2206,7 @@ void WrappedOpenGL::Common_glCompressedTextureImage1DEXT(ResourceId texId, GLenu
|
||||
// so we need to attempt to catch the case where glTexImage is called to re-upload data, not actually re-create it.
|
||||
// Ideally we'd check for non-zero levels, but that would complicate the condition
|
||||
// if we're uploading new data but otherwise everything is identical, ignore this chunk and simply mark the texture dirty
|
||||
if(record->AlreadyDataType(target) && level == 0 &&
|
||||
if(m_State == WRITING_IDLE && record->AlreadyDataType(target) && level == 0 &&
|
||||
m_Textures[record->GetResourceID()].width == width &&
|
||||
m_Textures[record->GetResourceID()].internalFormat == (GLenum)internalformat)
|
||||
{
|
||||
@@ -2204,7 +2223,9 @@ void WrappedOpenGL::Common_glCompressedTextureImage1DEXT(ResourceId texId, GLenu
|
||||
// illegal to re-type textures
|
||||
record->VerifyDataType(target);
|
||||
|
||||
if(fromunpackbuf)
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
else if(fromunpackbuf)
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -2374,7 +2395,7 @@ void WrappedOpenGL::Common_glCompressedTextureImage2DEXT(ResourceId texId, GLenu
|
||||
// so we need to attempt to catch the case where glTexImage is called to re-upload data, not actually re-create it.
|
||||
// Ideally we'd check for non-zero levels, but that would complicate the condition
|
||||
// if we're uploading new data but otherwise everything is identical, ignore this chunk and simply mark the texture dirty
|
||||
if(record->AlreadyDataType(target) && level == 0 &&
|
||||
if(m_State == WRITING_IDLE && record->AlreadyDataType(target) && level == 0 &&
|
||||
m_Textures[record->GetResourceID()].width == width &&
|
||||
m_Textures[record->GetResourceID()].height == height &&
|
||||
m_Textures[record->GetResourceID()].internalFormat == (GLenum)internalformat)
|
||||
@@ -2392,7 +2413,9 @@ void WrappedOpenGL::Common_glCompressedTextureImage2DEXT(ResourceId texId, GLenu
|
||||
// illegal to re-type textures
|
||||
record->VerifyDataType(target);
|
||||
|
||||
if(fromunpackbuf)
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
else if(fromunpackbuf)
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -2541,7 +2564,7 @@ void WrappedOpenGL::Common_glCompressedTextureImage3DEXT(ResourceId texId, GLenu
|
||||
// so we need to attempt to catch the case where glTexImage is called to re-upload data, not actually re-create it.
|
||||
// Ideally we'd check for non-zero levels, but that would complicate the condition
|
||||
// if we're uploading new data but otherwise everything is identical, ignore this chunk and simply mark the texture dirty
|
||||
if(record->AlreadyDataType(target) && level == 0 &&
|
||||
if(m_State == WRITING_IDLE && record->AlreadyDataType(target) && level == 0 &&
|
||||
m_Textures[record->GetResourceID()].width == width &&
|
||||
m_Textures[record->GetResourceID()].height == height &&
|
||||
m_Textures[record->GetResourceID()].depth == depth &&
|
||||
@@ -2560,7 +2583,9 @@ void WrappedOpenGL::Common_glCompressedTextureImage3DEXT(ResourceId texId, GLenu
|
||||
// illegal to re-type textures
|
||||
record->VerifyDataType(target);
|
||||
|
||||
if(fromunpackbuf)
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
else if(fromunpackbuf)
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -2672,6 +2697,7 @@ void WrappedOpenGL::Common_glCopyTextureImage1DEXT(GLResourceRecord *record, GLe
|
||||
Serialise_glCopyTextureImage1DEXT(record->Resource.name, target, level, internalformat, x, y, width, border);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
|
||||
if(level == 0)
|
||||
@@ -2780,6 +2806,7 @@ void WrappedOpenGL::Common_glCopyTextureImage2DEXT(GLResourceRecord *record, GLe
|
||||
Serialise_glCopyTextureImage2DEXT(record->Resource.name, target, level, internalformat, x, y, width, height, border);
|
||||
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
|
||||
if(level == 0)
|
||||
@@ -3432,6 +3459,7 @@ void WrappedOpenGL::Common_glTextureSubImage1DEXT(GLResourceRecord *record, GLen
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3586,6 +3614,7 @@ void WrappedOpenGL::Common_glTextureSubImage2DEXT(GLResourceRecord *record, GLen
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3742,6 +3771,7 @@ void WrappedOpenGL::Common_glTextureSubImage3DEXT(GLResourceRecord *record, GLen
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3876,6 +3906,7 @@ void WrappedOpenGL::Common_glCompressedTextureSubImage1DEXT(GLResourceRecord *re
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4012,6 +4043,7 @@ void WrappedOpenGL::Common_glCompressedTextureSubImage2DEXT(GLResourceRecord *re
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4150,6 +4182,7 @@ void WrappedOpenGL::Common_glCompressedTextureSubImage3DEXT(GLResourceRecord *re
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4261,6 +4294,8 @@ void WrappedOpenGL::Common_glTextureBufferRangeEXT(ResourceId texId, GLenum targ
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(scope.Get());
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
m_MissingTracks.insert(GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4366,6 +4401,8 @@ void WrappedOpenGL::Common_glTextureBufferEXT(ResourceId texId, GLenum target, G
|
||||
if(m_State == WRITING_CAPFRAME)
|
||||
{
|
||||
m_ContextRecord->AddChunk(chunk);
|
||||
m_MissingTracks.insert(record->GetResourceID());
|
||||
m_MissingTracks.insert(GetResourceManager()->GetID(BufferRes(GetCtx(), buffer)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user