Cache textures in GL GetTexture if they weren't seen before. Refs #386

* When saving the result of a custom shader visualisation, we need to
  get the texture details of a live-created (ie. not from the capture)
  texture.
This commit is contained in:
baldurk
2016-10-06 12:12:53 +02:00
parent 2be29d9229
commit d322f17695
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -421,6 +421,18 @@ bool GLReplay::IsRenderOutput(ResourceId id)
return false;
}
FetchTexture GLReplay::GetTexture(ResourceId id)
{
auto it = m_CachedTextures.find(id);
if(it == m_CachedTextures.end())
{
CacheTexture(id);
return m_CachedTextures[id];
}
return it->second;
}
void GLReplay::CacheTexture(ResourceId id)
{
FetchTexture tex;
+1 -1
View File
@@ -94,7 +94,7 @@ public:
FetchBuffer GetBuffer(ResourceId id);
vector<ResourceId> GetTextures();
FetchTexture GetTexture(ResourceId id) { return m_CachedTextures[id]; }
FetchTexture GetTexture(ResourceId id);
ShaderReflection *GetShader(ResourceId shader, string entryPoint);
vector<DebugMessage> GetDebugMessages();