From 437b3d15565e75b19733b0f055c12ed2df3fa11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 29 Jan 2021 22:31:49 +0100 Subject: [PATCH] GL: don't check for Windows-only workarounds everywhere. Apparently nobody tried to run AMDGPU PRO drivers on Linux until now. Sorry. --- doc/changelog.dox | 2 ++ src/Magnum/GL/Implementation/TextureState.cpp | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 988aab84b..7440bd68c 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -262,6 +262,8 @@ See also: - @ref GL::Context move constructor was not marked @cpp noexcept @ce by accident - @ref GL::Renderer::MemoryBarrier::ShaderStorage had an incorrect value +- Fixed assertions related to OpenGL driver workarounds when the proprietary + AMDGPU PRO drivers are used on Linux - @ref Platform::EmscriptenApplication randomly created antialiased contexts due to an uninitialized variable in its @ref Platform::EmscriptenApplication::GLConfiguration "GLConfiguration" diff --git a/src/Magnum/GL/Implementation/TextureState.cpp b/src/Magnum/GL/Implementation/TextureState.cpp index bf470137a..22534e671 100644 --- a/src/Magnum/GL/Implementation/TextureState.cpp +++ b/src/Magnum/GL/Implementation/TextureState.cpp @@ -312,6 +312,9 @@ TextureState::TextureState(Context& context, std::vector& extension else getFullCompressedCubeImageImplementation = &CubeMapTexture::getCompressedImageImplementationDSA; + #ifdef CORRADE_TARGET_WINDOWS + /** @todo those *might* be happening with the proprietary AMD driver on + linux as well, test */ if((context.detectedDriver() & Context::DetectedDriver::Amd) && context.isExtensionSupported() && !context.isDriverWorkaroundDisabled("amd-windows-cubemap-image3d-slice-by-slice")) @@ -321,7 +324,10 @@ TextureState::TextureState(Context& context, std::vector& extension !context.isDriverWorkaroundDisabled("intel-windows-broken-dsa-for-cubemaps")) getFullCubeImageImplementation = &CubeMapTexture::getImageImplementationSliceBySlice; else + #endif + { getFullCubeImageImplementation = &CubeMapTexture::getImageImplementationDSA; + } #endif /* Texture storage implementation for desktop and ES */ @@ -472,12 +478,18 @@ TextureState::TextureState(Context& context, std::vector& extension } else if((context.detectedDriver() & Context::DetectedDriver::IntelWindows) && !context.isDriverWorkaroundDisabled("intel-windows-broken-dsa-for-cubemaps")) { cubeSubImage3DImplementation = &CubeMapTexture::subImageImplementationSliceBySlice; - } else if((context.detectedDriver() & Context::DetectedDriver::Amd) && + } + #ifdef CORRADE_TARGET_WINDOWS + /** @todo those *might* be happening with the proprietary AMD driver on + linux as well, test */ + else if((context.detectedDriver() & Context::DetectedDriver::Amd) && !context.isDriverWorkaroundDisabled("amd-windows-cubemap-image3d-slice-by-slice")) { /* DSA version is broken (non-zero Z offset not allowed), need to emulate using classic APIs */ cubeSubImage3DImplementation = &CubeMapTexture::subImageImplementationSliceBySlice; - } else if(context.isExtensionSupported()) { + } + #endif + else if(context.isExtensionSupported()) { cubeSubImage3DImplementation = &CubeMapTexture::subImageImplementationDSA; } else {