Fix handling of colorspace changes when using CUDA+SDL

This commit is contained in:
Cameron Gutman 2022-05-28 22:55:55 -05:00
parent e9edad6f8c
commit 1b96b18bc0

View file

@ -372,6 +372,13 @@ ReadbackRetry:
// texture creation for most SDL render backends, we need to recreate
// the texture when the colorspace changes.
if (frame->colorspace != m_ColorSpace) {
#ifdef HAVE_CUDA
if (m_CudaGLHelper != nullptr) {
delete m_CudaGLHelper;
m_CudaGLHelper = nullptr;
}
#endif
if (m_Texture != nullptr) {
SDL_DestroyTexture(m_Texture);
m_Texture = nullptr;