Don't try to fetch resource format for uninitialised render buffers

This commit is contained in:
baldurk
2019-07-02 16:57:12 +01:00
parent 2a0ddea474
commit 31fff66d4c
+10 -3
View File
@@ -445,10 +445,17 @@ void GLReplay::CacheTexture(ResourceId id)
tex.msQual = 0;
tex.msSamp = RDCMAX(1, res.samples);
tex.format = MakeResourceFormat(eGL_TEXTURE_2D, res.internalFormat);
if(res.internalFormat == eGL_NONE)
{
tex.format = ResourceFormat();
}
else
{
tex.format = MakeResourceFormat(eGL_TEXTURE_2D, res.internalFormat);
if(IsDepthStencilFormat(res.internalFormat))
tex.creationFlags |= TextureCategory::DepthTarget;
if(IsDepthStencilFormat(res.internalFormat))
tex.creationFlags |= TextureCategory::DepthTarget;
}
tex.byteSize = (tex.width * tex.height) * (tex.format.compByteWidth * tex.format.compCount);