mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-14 10:36:43 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user