Minor-hack around applications that resize MS textures with non-storage

* 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).
This commit is contained in:
baldurk
2024-10-28 13:59:18 +00:00
parent 32d8c6d79d
commit 21db7b5f8a
@@ -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);
}