mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-13 13:30:44 +00:00
Determine creationflags throughout initial read pass
This commit is contained in:
@@ -169,10 +169,11 @@ class WrappedOpenGL
|
||||
|
||||
struct TextureData
|
||||
{
|
||||
TextureData() : width(0), height(0), depth(0) {}
|
||||
TextureData() : width(0), height(0), depth(0), creationFlags(0) {}
|
||||
GLResource resource;
|
||||
GLenum curType;
|
||||
GLint width, height, depth;
|
||||
uint32_t creationFlags;
|
||||
};
|
||||
|
||||
map<ResourceId, TextureData> m_Textures;
|
||||
|
||||
@@ -451,14 +451,12 @@ FetchTexture GLReplay::GetTexture(ResourceId id)
|
||||
|
||||
tex.name = widen(str);
|
||||
|
||||
tex.creationFlags = eTextureCreate_SRV;
|
||||
tex.creationFlags = res.creationFlags;
|
||||
if(tex.format.compType == eCompType_Depth)
|
||||
tex.creationFlags |= eTextureCreate_DSV;
|
||||
if(res.resource.name == gl.m_FakeBB_Color)
|
||||
if(res.resource.name == gl.m_FakeBB_Color || res.resource.name == gl.m_FakeBB_DepthStencil)
|
||||
tex.creationFlags |= eTextureCreate_SwapBuffer;
|
||||
|
||||
GLNOTIMP("creationFlags are not calculated yet");
|
||||
|
||||
tex.byteSize = 0;
|
||||
GLNOTIMP("Not calculating bytesize");
|
||||
|
||||
|
||||
@@ -95,6 +95,11 @@ bool WrappedOpenGL::Serialise_glNamedFramebufferTextureEXT(GLuint framebuffer, G
|
||||
GLResource fbres = GetResourceManager()->GetLiveResource(fbid);
|
||||
glNamedFramebufferTextureEXT(fbres.name, Attach, res.name, Level);
|
||||
}
|
||||
|
||||
if(m_State == READING)
|
||||
{
|
||||
m_Textures[GetResourceManager()->GetLiveID(id)].creationFlags |= eTextureCreate_RTV;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -166,6 +171,11 @@ bool WrappedOpenGL::Serialise_glNamedFramebufferTexture2DEXT(GLuint framebuffer,
|
||||
GLResource fbres = GetResourceManager()->GetLiveResource(fbid);
|
||||
glNamedFramebufferTexture2DEXT(fbres.name, Attach, TexTarget, res.name, Level);
|
||||
}
|
||||
|
||||
if(m_State == READING)
|
||||
{
|
||||
m_Textures[GetResourceManager()->GetLiveID(id)].creationFlags |= eTextureCreate_RTV;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -237,6 +247,11 @@ bool WrappedOpenGL::Serialise_glNamedFramebufferTextureLayerEXT(GLuint framebuff
|
||||
GLResource fbres = GetResourceManager()->GetLiveResource(fbid);
|
||||
glNamedFramebufferTextureLayerEXT(fbres.name, Attach, res.name, Level, Layer);
|
||||
}
|
||||
|
||||
if(m_State == READING)
|
||||
{
|
||||
m_Textures[GetResourceManager()->GetLiveID(id)].creationFlags |= eTextureCreate_RTV;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -109,7 +109,11 @@ bool WrappedOpenGL::Serialise_glBindTexture(GLenum target, GLuint texture)
|
||||
GLResource res = GetResourceManager()->GetLiveResource(Id);
|
||||
m_Real.glBindTexture(Target, res.name);
|
||||
|
||||
m_Textures[GetResourceManager()->GetLiveID(Id)].curType = Target;
|
||||
if(m_State == READING)
|
||||
{
|
||||
m_Textures[GetResourceManager()->GetLiveID(Id)].curType = Target;
|
||||
m_Textures[GetResourceManager()->GetLiveID(Id)].creationFlags |= eTextureCreate_SRV;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user