Skip to content

Commit

Permalink
Minor-hack around applications that resize MS textures with non-storage
Browse files Browse the repository at this point in the history
* We can safely use the non-DSA function since this always happens in the
  texture chunk, not during capture (we do not support mid-capture texture
  resizes for obvious reasons).
  • Loading branch information
baldurk committed Oct 28, 2024
1 parent 32d8c6d commit 21db7b5
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5166,12 +5166,23 @@ bool WrappedOpenGL::Serialise_glTextureStorage2DMultisampleEXT(SerialiserType &s
m_Textures[liveId].emulated = emulated;
m_Textures[liveId].mipsValid = 1;

if(target != eGL_NONE)
GL.glTextureStorage2DMultisampleEXT(texture.name, target, samples, internalformat, width,
height, fixedsamplelocations);
// some applications may resize MSAA textures using old-style functions, so we can't promote to
// storage DSA (and a non-storage DSA does not exist so can't be emulated)...
if(gl_CurChunk == GLChunk::glTexImage2DMultisample)
{
GL.glBindTexture(eGL_TEXTURE_2D_MULTISAMPLE, texture.name);
GL.glTexImage2DMultisample(eGL_TEXTURE_2D_MULTISAMPLE, samples, internalformat, width, height,
fixedsamplelocations);
}
else
GL.glTextureStorage2DMultisample(texture.name, samples, internalformat, width, height,
fixedsamplelocations);
{
if(target != eGL_NONE)
GL.glTextureStorage2DMultisampleEXT(texture.name, target, samples, internalformat, width,
height, fixedsamplelocations);
else
GL.glTextureStorage2DMultisample(texture.name, samples, internalformat, width, height,
fixedsamplelocations);
}

AddResourceInitChunk(texture);
}
Expand Down

0 comments on commit 21db7b5

Please sign in to comment.