mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-07 06:24:57 +00:00
Use resource IDs not handles to mark high traffic resources
* In OpenGL and D3D11, resource handles (pointers or namespace/uint pairs respectively) could be reused, so we can't use these to denote resources that are getting updated regularly and should have updates ignored. * I don't know how I got away with this for so long, or why I used pointers in the first place. It could have predated resource IDs maybe.
This commit is contained in:
1 parent
563c9e88a5
commit
37700b3945
5 files changed
+87
-85
No files matched your search
@@ -158,7 +158,7 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
set<IUnknown*> m_HighTrafficResources;
|
||||
set<ResourceId> m_HighTrafficResources;
|
||||
map<MappedResource, MapIntercept> m_OpenMaps;
|
||||
|
||||
struct StreamOutData
|
||||
|
||||
@@ -6537,9 +6537,11 @@ HRESULT WrappedID3D11DeviceContext::Map(ID3D11Resource *pResource, UINT Subresou
|
||||
DrainAnnotationQueue();
|
||||
|
||||
m_EmptyCommandList = false;
|
||||
|
||||
ResourceId id = GetIDForResource(pResource);
|
||||
|
||||
bool straightUp = false;
|
||||
if(m_HighTrafficResources.find(pResource) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(id) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
straightUp = true;
|
||||
|
||||
if(m_pDevice->GetResourceManager()->IsResourceDirty(GetIDForResource(pResource)) && m_State != WRITING_CAPFRAME)
|
||||
@@ -6549,9 +6551,9 @@ HRESULT WrappedID3D11DeviceContext::Map(ID3D11Resource *pResource, UINT Subresou
|
||||
m_pRealContext->GetType() == D3D11_DEVICE_CONTEXT_DEFERRED)
|
||||
{
|
||||
straightUp = true;
|
||||
m_HighTrafficResources.insert(pResource);
|
||||
m_HighTrafficResources.insert(id);
|
||||
if(m_State != WRITING_CAPFRAME)
|
||||
m_pDevice->GetResourceManager()->MarkDirtyResource(GetIDForResource(pResource));
|
||||
m_pDevice->GetResourceManager()->MarkDirtyResource(id);
|
||||
}
|
||||
|
||||
if(straightUp && m_State == WRITING_IDLE)
|
||||
@@ -6606,7 +6608,7 @@ HRESULT WrappedID3D11DeviceContext::Map(ID3D11Resource *pResource, UINT Subresou
|
||||
|
||||
if(record->UpdateCount > 60 && RenderDoc::Inst().GetCaptureOptions().VerifyMapWrites == 0)
|
||||
{
|
||||
m_HighTrafficResources.insert(pResource);
|
||||
m_HighTrafficResources.insert(Id);
|
||||
m_pDevice->GetResourceManager()->MarkDirtyResource(Id);
|
||||
|
||||
return ret;
|
||||
@@ -6849,9 +6851,11 @@ void WrappedID3D11DeviceContext::Unmap(ID3D11Resource *pResource, UINT Subresour
|
||||
|
||||
m_EmptyCommandList = false;
|
||||
|
||||
auto it = m_OpenMaps.find(MappedResource(GetIDForResource(pResource), Subresource));
|
||||
ResourceId id = GetIDForResource(pResource);
|
||||
|
||||
if(m_State == WRITING_IDLE && m_HighTrafficResources.find(pResource) != m_HighTrafficResources.end())
|
||||
auto it = m_OpenMaps.find(MappedResource(id, Subresource));
|
||||
|
||||
if(m_State == WRITING_IDLE && m_HighTrafficResources.find(id) != m_HighTrafficResources.end())
|
||||
{
|
||||
// we intercepted this, even though we now don't need to serialise it. Time to finish what we started!
|
||||
if(it != m_OpenMaps.end() && it->second.MapType != D3D11_MAP_READ)
|
||||
|
||||
@@ -144,7 +144,7 @@ class WrappedOpenGL
|
||||
vector<double> m_FrameTimes;
|
||||
double m_TotalTime, m_AvgFrametime, m_MinFrametime, m_MaxFrametime;
|
||||
|
||||
set<GLResource> m_HighTrafficResources;
|
||||
set<ResourceId> m_HighTrafficResources;
|
||||
|
||||
vector<FetchFrameRecord> m_FrameRecord;
|
||||
|
||||
|
||||
@@ -552,11 +552,11 @@ void WrappedOpenGL::glNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, GLsi
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
if(m_HighTrafficResources.find(BufferRes(GetCtx(), buffer)) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(BUFFERSUBDATA);
|
||||
Serialise_glNamedBufferSubDataEXT(buffer, offset, size, data);
|
||||
@@ -574,7 +574,7 @@ void WrappedOpenGL::glNamedBufferSubDataEXT(GLuint buffer, GLintptr offset, GLsi
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(BufferRes(GetCtx(), buffer));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -592,7 +592,7 @@ void WrappedOpenGL::glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr s
|
||||
|
||||
GLResource res = record->Resource;
|
||||
|
||||
if(m_HighTrafficResources.find(res) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(BUFFERSUBDATA);
|
||||
@@ -609,7 +609,7 @@ void WrappedOpenGL::glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr s
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(res);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -671,14 +671,12 @@ void WrappedOpenGL::glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, G
|
||||
GLResourceRecord *writerecord = GetCtxData().m_BufferRecord[BufferIdx(writeTarget)];
|
||||
RDCASSERT(readrecord && writerecord);
|
||||
|
||||
GLResource writeBuffer = writerecord->Resource;
|
||||
|
||||
if(m_HighTrafficResources.find(writeBuffer) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(writerecord->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(COPYBUFFERSUBDATA);
|
||||
Serialise_glNamedCopyBufferSubDataEXT(readrecord->Resource.name,
|
||||
writeBuffer.name,
|
||||
writerecord->Resource.name,
|
||||
readOffset, writeOffset, size);
|
||||
|
||||
Chunk *chunk = scope.Get();
|
||||
@@ -695,7 +693,7 @@ void WrappedOpenGL::glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, G
|
||||
|
||||
if(writerecord->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(writeBuffer);
|
||||
m_HighTrafficResources.insert(writerecord->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(writerecord->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -1056,7 +1054,7 @@ void *WrappedOpenGL::glMapNamedBufferEXT(GLuint buffer, GLenum access)
|
||||
m_Real.glGetNamedBufferParameterivEXT(buffer, eGL_BUFFER_SIZE, &length);
|
||||
|
||||
bool straightUp = false;
|
||||
if(m_HighTrafficResources.find(BufferRes(GetCtx(), buffer)) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
straightUp = true;
|
||||
|
||||
if(GetResourceManager()->IsResourceDirty(record->GetResourceID()) && m_State != WRITING_CAPFRAME)
|
||||
@@ -1065,7 +1063,7 @@ void *WrappedOpenGL::glMapNamedBufferEXT(GLuint buffer, GLenum access)
|
||||
if(!straightUp && (access == eGL_WRITE_ONLY || access == eGL_READ_WRITE) && m_State != WRITING_CAPFRAME)
|
||||
{
|
||||
straightUp = true;
|
||||
m_HighTrafficResources.insert(BufferRes(GetCtx(), buffer));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
if(m_State != WRITING_CAPFRAME)
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
@@ -1147,7 +1145,7 @@ void *WrappedOpenGL::glMapNamedBufferEXT(GLuint buffer, GLenum access)
|
||||
record->UpdateCount++;
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
m_HighTrafficResources.insert(BufferRes(GetCtx(), buffer));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1182,7 +1180,7 @@ void *WrappedOpenGL::glMapNamedBufferRangeEXT(GLuint buffer, GLintptr offset, GL
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
|
||||
|
||||
bool straightUp = false;
|
||||
if(m_HighTrafficResources.find(BufferRes(GetCtx(), buffer)) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
straightUp = true;
|
||||
|
||||
if(GetResourceManager()->IsResourceDirty(record->GetResourceID()) && m_State != WRITING_CAPFRAME)
|
||||
@@ -1193,7 +1191,7 @@ void *WrappedOpenGL::glMapNamedBufferRangeEXT(GLuint buffer, GLintptr offset, GL
|
||||
if(!straightUp && !invalidateMap && (access & GL_MAP_WRITE_BIT) && m_State != WRITING_CAPFRAME)
|
||||
{
|
||||
straightUp = true;
|
||||
m_HighTrafficResources.insert(BufferRes(GetCtx(), buffer));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
if(m_State != WRITING_CAPFRAME)
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
@@ -1313,7 +1311,7 @@ void *WrappedOpenGL::glMapNamedBufferRangeEXT(GLuint buffer, GLintptr offset, GL
|
||||
record->UpdateCount++;
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
m_HighTrafficResources.insert(BufferRes(GetCtx(), buffer));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -823,11 +823,11 @@ void WrappedOpenGL::glTextureParameteriEXT(GLuint texture, GLenum target, GLenum
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
if(m_HighTrafficResources.find(TextureRes(GetCtx(), texture)) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERI);
|
||||
Serialise_glTextureParameteriEXT(texture, target, pname, param);
|
||||
@@ -843,7 +843,7 @@ void WrappedOpenGL::glTextureParameteriEXT(GLuint texture, GLenum target, GLenum
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(TextureRes(GetCtx(), texture));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -861,7 +861,7 @@ void WrappedOpenGL::glTexParameteri(GLenum target, GLenum pname, GLint param)
|
||||
|
||||
GLResource res = record->Resource;
|
||||
|
||||
if(m_HighTrafficResources.find(res) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERI);
|
||||
@@ -878,7 +878,7 @@ void WrappedOpenGL::glTexParameteri(GLenum target, GLenum pname, GLint param)
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(res);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -909,11 +909,11 @@ void WrappedOpenGL::glTextureParameterivEXT(GLuint texture, GLenum target, GLenu
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
if(m_HighTrafficResources.find(TextureRes(GetCtx(), texture)) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERIV);
|
||||
Serialise_glTextureParameterivEXT(texture, target, pname, params);
|
||||
@@ -929,7 +929,7 @@ void WrappedOpenGL::glTextureParameterivEXT(GLuint texture, GLenum target, GLenu
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(TextureRes(GetCtx(), texture));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -947,7 +947,7 @@ void WrappedOpenGL::glTexParameteriv(GLenum target, GLenum pname, const GLint *p
|
||||
|
||||
GLResource res = record->Resource;
|
||||
|
||||
if(m_HighTrafficResources.find(res) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERIV);
|
||||
@@ -964,7 +964,7 @@ void WrappedOpenGL::glTexParameteriv(GLenum target, GLenum pname, const GLint *p
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(res);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -995,11 +995,11 @@ void WrappedOpenGL::glTextureParameterIivEXT(GLuint texture, GLenum target, GLen
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
if(m_HighTrafficResources.find(TextureRes(GetCtx(), texture)) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERIIV);
|
||||
Serialise_glTextureParameterIivEXT(texture, target, pname, params);
|
||||
@@ -1015,7 +1015,7 @@ void WrappedOpenGL::glTextureParameterIivEXT(GLuint texture, GLenum target, GLen
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(TextureRes(GetCtx(), texture));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -1033,7 +1033,7 @@ void WrappedOpenGL::glTexParameterIiv(GLenum target, GLenum pname, const GLint *
|
||||
|
||||
GLResource res = record->Resource;
|
||||
|
||||
if(m_HighTrafficResources.find(res) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERIIV);
|
||||
@@ -1050,7 +1050,7 @@ void WrappedOpenGL::glTexParameterIiv(GLenum target, GLenum pname, const GLint *
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(res);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -1081,11 +1081,11 @@ void WrappedOpenGL::glTextureParameterIuivEXT(GLuint texture, GLenum target, GLe
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
if(m_HighTrafficResources.find(TextureRes(GetCtx(), texture)) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERIUIV);
|
||||
Serialise_glTextureParameterIuivEXT(texture, target, pname, params);
|
||||
@@ -1101,7 +1101,7 @@ void WrappedOpenGL::glTextureParameterIuivEXT(GLuint texture, GLenum target, GLe
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(TextureRes(GetCtx(), texture));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -1119,7 +1119,7 @@ void WrappedOpenGL::glTexParameterIuiv(GLenum target, GLenum pname, const GLuint
|
||||
|
||||
GLResource res = record->Resource;
|
||||
|
||||
if(m_HighTrafficResources.find(res) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERIUIV);
|
||||
@@ -1136,7 +1136,7 @@ void WrappedOpenGL::glTexParameterIuiv(GLenum target, GLenum pname, const GLuint
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(res);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -1164,11 +1164,11 @@ void WrappedOpenGL::glTextureParameterfEXT(GLuint texture, GLenum target, GLenum
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
if(m_HighTrafficResources.find(TextureRes(GetCtx(), texture)) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERF);
|
||||
Serialise_glTextureParameterfEXT(texture, target, pname, param);
|
||||
@@ -1184,7 +1184,7 @@ void WrappedOpenGL::glTextureParameterfEXT(GLuint texture, GLenum target, GLenum
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(TextureRes(GetCtx(), texture));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -1202,7 +1202,7 @@ void WrappedOpenGL::glTexParameterf(GLenum target, GLenum pname, GLfloat param)
|
||||
|
||||
GLResource res = record->Resource;
|
||||
|
||||
if(m_HighTrafficResources.find(res) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERF);
|
||||
@@ -1219,7 +1219,7 @@ void WrappedOpenGL::glTexParameterf(GLenum target, GLenum pname, GLfloat param)
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(res);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -1250,11 +1250,11 @@ void WrappedOpenGL::glTextureParameterfvEXT(GLuint texture, GLenum target, GLenu
|
||||
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
if(m_HighTrafficResources.find(TextureRes(GetCtx(), texture)) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERFV);
|
||||
Serialise_glTextureParameterfvEXT(texture, target, pname, params);
|
||||
@@ -1270,7 +1270,7 @@ void WrappedOpenGL::glTextureParameterfvEXT(GLuint texture, GLenum target, GLenu
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(TextureRes(GetCtx(), texture));
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -1288,7 +1288,7 @@ void WrappedOpenGL::glTexParameterfv(GLenum target, GLenum pname, const GLfloat
|
||||
|
||||
GLResource res = record->Resource;
|
||||
|
||||
if(m_HighTrafficResources.find(res) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State != WRITING_CAPFRAME)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERFV);
|
||||
@@ -1305,7 +1305,7 @@ void WrappedOpenGL::glTexParameterfv(GLenum target, GLenum pname, const GLfloat
|
||||
|
||||
if(record->UpdateCount > 12)
|
||||
{
|
||||
m_HighTrafficResources.insert(res);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -2934,7 +2934,7 @@ void WrappedOpenGL::glTextureSubImage1DEXT(GLuint texture, GLenum target, GLint
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE1D);
|
||||
@@ -2951,7 +2951,7 @@ void WrappedOpenGL::glTextureSubImage1DEXT(GLuint texture, GLenum target, GLint
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -2980,7 +2980,7 @@ void WrappedOpenGL::glTexSubImage1D(GLenum target, GLint level, GLint xoffset, G
|
||||
GLResourceRecord *record = GetCtxData().GetActiveTexRecord();
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE1D);
|
||||
@@ -2998,7 +2998,7 @@ void WrappedOpenGL::glTexSubImage1D(GLenum target, GLint level, GLint xoffset, G
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -3074,7 +3074,7 @@ void WrappedOpenGL::glTextureSubImage2DEXT(GLuint texture, GLenum target, GLint
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE2D);
|
||||
@@ -3091,7 +3091,7 @@ void WrappedOpenGL::glTextureSubImage2DEXT(GLuint texture, GLenum target, GLint
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -3120,7 +3120,7 @@ void WrappedOpenGL::glTexSubImage2D(GLenum target, GLint level, GLint xoffset, G
|
||||
GLResourceRecord *record = GetCtxData().GetActiveTexRecord();
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE2D);
|
||||
@@ -3138,7 +3138,7 @@ void WrappedOpenGL::glTexSubImage2D(GLenum target, GLint level, GLint xoffset, G
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -3216,7 +3216,7 @@ void WrappedOpenGL::glTextureSubImage3DEXT(GLuint texture, GLenum target, GLint
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE3D);
|
||||
@@ -3233,7 +3233,7 @@ void WrappedOpenGL::glTextureSubImage3DEXT(GLuint texture, GLenum target, GLint
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -3262,7 +3262,7 @@ void WrappedOpenGL::glTexSubImage3D(GLenum target, GLint level, GLint xoffset, G
|
||||
GLResourceRecord *record = GetCtxData().GetActiveTexRecord();
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE3D);
|
||||
@@ -3280,7 +3280,7 @@ void WrappedOpenGL::glTexSubImage3D(GLenum target, GLint level, GLint xoffset, G
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -3343,7 +3343,7 @@ void WrappedOpenGL::glCompressedTextureSubImage1DEXT(GLuint texture, GLenum targ
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE1D_COMPRESSED);
|
||||
@@ -3360,7 +3360,7 @@ void WrappedOpenGL::glCompressedTextureSubImage1DEXT(GLuint texture, GLenum targ
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -3389,7 +3389,7 @@ void WrappedOpenGL::glCompressedTexSubImage1D(GLenum target, GLint level, GLint
|
||||
GLResourceRecord *record = GetCtxData().GetActiveTexRecord();
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE1D_COMPRESSED);
|
||||
@@ -3407,7 +3407,7 @@ void WrappedOpenGL::glCompressedTexSubImage1D(GLenum target, GLint level, GLint
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -3472,7 +3472,7 @@ void WrappedOpenGL::glCompressedTextureSubImage2DEXT(GLuint texture, GLenum targ
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE2D_COMPRESSED);
|
||||
@@ -3489,7 +3489,7 @@ void WrappedOpenGL::glCompressedTextureSubImage2DEXT(GLuint texture, GLenum targ
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -3518,7 +3518,7 @@ void WrappedOpenGL::glCompressedTexSubImage2D(GLenum target, GLint level, GLint
|
||||
GLResourceRecord *record = GetCtxData().GetActiveTexRecord();
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE2D_COMPRESSED);
|
||||
@@ -3536,7 +3536,7 @@ void WrappedOpenGL::glCompressedTexSubImage2D(GLenum target, GLint level, GLint
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -3603,7 +3603,7 @@ void WrappedOpenGL::glCompressedTextureSubImage3DEXT(GLuint texture, GLenum targ
|
||||
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE3D_COMPRESSED);
|
||||
@@ -3620,7 +3620,7 @@ void WrappedOpenGL::glCompressedTextureSubImage3DEXT(GLuint texture, GLenum targ
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
@@ -3649,7 +3649,7 @@ void WrappedOpenGL::glCompressedTexSubImage3D(GLenum target, GLint level, GLint
|
||||
GLResourceRecord *record = GetCtxData().GetActiveTexRecord();
|
||||
RDCASSERT(record);
|
||||
|
||||
if(m_HighTrafficResources.find(record->Resource) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
if(m_HighTrafficResources.find(record->GetResourceID()) != m_HighTrafficResources.end() && m_State == WRITING_IDLE)
|
||||
return;
|
||||
|
||||
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE3D_COMPRESSED);
|
||||
@@ -3667,7 +3667,7 @@ void WrappedOpenGL::glCompressedTexSubImage3D(GLenum target, GLint level, GLint
|
||||
|
||||
if(record->UpdateCount > 60)
|
||||
{
|
||||
m_HighTrafficResources.insert(record->Resource);
|
||||
m_HighTrafficResources.insert(record->GetResourceID());
|
||||
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user