mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 23:16:31 +00:00
Reset pixel unpack state when uploading proxy texture data in GL
This commit is contained in:
@@ -3130,6 +3130,11 @@ void GLReplay::SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint32_t
|
||||
|
||||
if(IsCompressedFormat(fmt))
|
||||
{
|
||||
PixelUnpackState unpack;
|
||||
unpack.Fetch(true);
|
||||
|
||||
ResetPixelUnpackState(true, 1);
|
||||
|
||||
if(target == eGL_TEXTURE_1D)
|
||||
{
|
||||
drv.glCompressedTextureSubImage1DEXT(tex, target, (GLint)mip, 0, width, fmt,
|
||||
@@ -3173,6 +3178,8 @@ void GLReplay::SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint32_t
|
||||
{
|
||||
RDCERR("Unexpected compressed MSAA texture!");
|
||||
}
|
||||
|
||||
unpack.Apply(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3185,6 +3192,11 @@ void GLReplay::SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint32_t
|
||||
return;
|
||||
}
|
||||
|
||||
PixelUnpackState unpack;
|
||||
unpack.Fetch(false);
|
||||
|
||||
ResetPixelUnpackState(false, 1);
|
||||
|
||||
if(target == eGL_TEXTURE_1D)
|
||||
{
|
||||
drv.glTextureSubImage1DEXT(tex, target, (GLint)mip, 0, width, baseformat, datatype, data);
|
||||
@@ -3271,6 +3283,8 @@ void GLReplay::SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint32_t
|
||||
// delete the temporary texture
|
||||
drv.glDeleteTextures(1, &uploadTex);
|
||||
}
|
||||
|
||||
unpack.Apply(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user