Determine creationflags throughout initial read pass

This commit is contained in:
Baldur Karlsson
2014-07-28 11:27:51 +01:00
parent 6d7283f580
commit a3cdece239
4 changed files with 24 additions and 6 deletions
+2 -1
View File
@@ -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;
+2 -4
View File
@@ -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;
}
}
}