From 086f839435ce53676803e6c68f5d2c4a51e42568 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Sun, 30 Oct 2016 00:56:18 +0200 Subject: [PATCH] DriverDetails: Make the bug identifiers humanly readable. --- Source/Core/VideoBackends/OGL/BoundingBox.cpp | 2 +- Source/Core/VideoBackends/OGL/Render.cpp | 12 ++--- .../Core/VideoBackends/OGL/StreamBuffer.cpp | 12 ++--- Source/Core/VideoCommon/DriverDetails.cpp | 48 +++++++++---------- Source/Core/VideoCommon/DriverDetails.h | 28 +++++------ Source/Core/VideoCommon/GeometryShaderGen.cpp | 2 +- Source/Core/VideoCommon/PixelShaderGen.cpp | 4 +- 7 files changed, 54 insertions(+), 54 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/BoundingBox.cpp b/Source/Core/VideoBackends/OGL/BoundingBox.cpp index fdc449442c..0ee4bd2afe 100644 --- a/Source/Core/VideoBackends/OGL/BoundingBox.cpp +++ b/Source/Core/VideoBackends/OGL/BoundingBox.cpp @@ -45,7 +45,7 @@ int BoundingBox::Get(int index) int data = 0; glBindBuffer(GL_SHADER_STORAGE_BUFFER, s_bbox_buffer_id); - if (!DriverDetails::HasBug(DriverDetails::BUG_SLOWGETBUFFERSUBDATA)) + if (!DriverDetails::HasBug(DriverDetails::BUG_SLOW_GETBUFFERSUBDATA)) { // Using glMapBufferRange to read back the contents of the SSBO is extremely slow // on nVidia drivers. This is more noticeable at higher internal resolutions. diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index ab6576915e..de7dc8fff6 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -413,7 +413,7 @@ Renderer::Renderer() "GPU: Does your video card support OpenGL 3.1?"); bSuccess = false; } - else if (DriverDetails::HasBug(DriverDetails::BUG_BROKENUBO)) + else if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_UBO)) { PanicAlert( "Buggy GPU driver detected.\n" @@ -447,7 +447,7 @@ Renderer::Renderer() (GLExtensions::Supports("GL_ARB_blend_func_extended") || GLExtensions::Supports("GL_EXT_blend_func_extended")); g_Config.backend_info.bSupportsPrimitiveRestart = - !DriverDetails::HasBug(DriverDetails::BUG_PRIMITIVERESTART) && + !DriverDetails::HasBug(DriverDetails::BUG_PRIMITIVE_RESTART) && ((GLExtensions::Version() >= 310) || GLExtensions::Supports("GL_NV_primitive_restart")); g_Config.backend_info.bSupportsBBox = GLExtensions::Supports("GL_ARB_shader_storage_buffer_object"); @@ -456,7 +456,7 @@ Renderer::Renderer() GLExtensions::Supports("GL_ARB_sample_shading"); g_Config.backend_info.bSupportsGeometryShaders = GLExtensions::Version() >= 320 && - !DriverDetails::HasBug(DriverDetails::BUG_BROKENGEOMETRYSHADERS); + !DriverDetails::HasBug(DriverDetails::BUG_BROKEN_GEOMETRY_SHADERS); g_Config.backend_info.bSupportsPaletteConversion = GLExtensions::Supports("GL_ARB_texture_buffer_object") || GLExtensions::Supports("GL_OES_texture_buffer") || @@ -466,7 +466,7 @@ Renderer::Renderer() (GLExtensions::Supports("GL_ARB_copy_image") || GLExtensions::Supports("GL_NV_copy_image") || GLExtensions::Supports("GL_EXT_copy_image") || GLExtensions::Supports("GL_OES_copy_image")) && - !DriverDetails::HasBug(DriverDetails::BUG_BROKENCOPYIMAGE); + !DriverDetails::HasBug(DriverDetails::BUG_BROKEN_COPYIMAGE); // Desktop OpenGL supports the binding layout if it supports 420pack // OpenGL ES 3.1 supports it implicitly without an extension @@ -694,7 +694,7 @@ Renderer::Renderer() // Handle VSync on/off s_vsync = g_ActiveConfig.IsVSync(); - if (!DriverDetails::HasBug(DriverDetails::BUG_BROKENVSYNC)) + if (!DriverDetails::HasBug(DriverDetails::BUG_BROKEN_VSYNC)) GLInterface->SwapInterval(s_vsync); // TODO: Move these somewhere else? @@ -1561,7 +1561,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, if (s_vsync != g_ActiveConfig.IsVSync()) { s_vsync = g_ActiveConfig.IsVSync(); - if (!DriverDetails::HasBug(DriverDetails::BUG_BROKENVSYNC)) + if (!DriverDetails::HasBug(DriverDetails::BUG_BROKEN_VSYNC)) GLInterface->SwapInterval(s_vsync); } diff --git a/Source/Core/VideoBackends/OGL/StreamBuffer.cpp b/Source/Core/VideoBackends/OGL/StreamBuffer.cpp index f0ede2d7d0..a81d96b0ff 100644 --- a/Source/Core/VideoBackends/OGL/StreamBuffer.cpp +++ b/Source/Core/VideoBackends/OGL/StreamBuffer.cpp @@ -341,7 +341,7 @@ std::unique_ptr StreamBuffer::Create(u32 type, u32 size) // without basevertex support, only streaming methods whith uploads everything to zero works fine: if (!g_ogl_config.bSupportsGLBaseVertex) { - if (!DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTREAM)) + if (!DriverDetails::HasBug(DriverDetails::BUG_BROKEN_BUFFER_STREAM)) return std::make_unique(type, size); // BufferData is by far the worst way, only use it if needed @@ -353,21 +353,21 @@ std::unique_ptr StreamBuffer::Create(u32 type, u32 size) { // pinned memory is much faster than buffer storage on AMD cards if (g_ogl_config.bSupportsGLPinnedMemory && - !(DriverDetails::HasBug(DriverDetails::BUG_BROKENPINNEDMEMORY) && + !(DriverDetails::HasBug(DriverDetails::BUG_BROKEN_PINNED_MEMORY) && type == GL_ELEMENT_ARRAY_BUFFER)) return std::make_unique(type, size); // buffer storage works well in most situations - bool coherent = DriverDetails::HasBug(DriverDetails::BUG_BROKENEXPLICITFLUSH); + bool coherent = DriverDetails::HasBug(DriverDetails::BUG_BROKEN_EXPLICIT_FLUSH); if (g_ogl_config.bSupportsGLBufferStorage && - !(DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTORAGE) && + !(DriverDetails::HasBug(DriverDetails::BUG_BROKEN_BUFFER_STORAGE) && type == GL_ARRAY_BUFFER) && - !(DriverDetails::HasBug(DriverDetails::BUG_INTELBROKENBUFFERSTORAGE) && + !(DriverDetails::HasBug(DriverDetails::BUG_INTEL_BROKEN_BUFFER_STORAGE) && type == GL_ELEMENT_ARRAY_BUFFER)) return std::make_unique(type, size, coherent); // don't fall back to MapAnd* for Nvidia drivers - if (DriverDetails::HasBug(DriverDetails::BUG_BROKENUNSYNCMAPPING)) + if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_UNSYNC_MAPPING)) return std::make_unique(type, size); // mapping fallback diff --git a/Source/Core/VideoCommon/DriverDetails.cpp b/Source/Core/VideoCommon/DriverDetails.cpp index 4282e50398..8d3c4715fb 100644 --- a/Source/Core/VideoCommon/DriverDetails.cpp +++ b/Source/Core/VideoCommon/DriverDetails.cpp @@ -46,43 +46,43 @@ static double m_version = 0.0; // This is a list of all known bugs for each vendor // We use this to check if the device and driver has a issue static BugInfo m_known_bugs[] = { - {API_OPENGL, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENBUFFERSTREAM, - -1.0, -1.0, true}, {API_OPENGL, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, - BUG_BROKENNEGATEDBOOLEAN, -1.0, -1.0, true}, - {API_OPENGL, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENEXPLICITFLUSH, - -1.0, -1.0, true}, - {API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKENBUFFERSTREAM, -1.0, + BUG_BROKEN_BUFFER_STREAM, -1.0, -1.0, true}, + {API_OPENGL, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, + BUG_BROKEN_NEGATED_BOOLEAN, -1.0, -1.0, true}, + {API_OPENGL, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, + BUG_BROKEN_EXPLICIT_FLUSH, -1.0, -1.0, true}, + {API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_BUFFER_STREAM, -1.0, -1.0, true}, - {API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKENVSYNC, -1.0, -1.0, + {API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_VSYNC, -1.0, -1.0, true}, - {API_OPENGL, OS_ALL, VENDOR_IMGTEC, DRIVER_IMGTEC, Family::UNKNOWN, BUG_BROKENBUFFERSTREAM, + {API_OPENGL, OS_ALL, VENDOR_IMGTEC, DRIVER_IMGTEC, Family::UNKNOWN, BUG_BROKEN_BUFFER_STREAM, -1.0, -1.0, true}, - {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_NOUVEAU, Family::UNKNOWN, BUG_BROKENUBO, 900, 916, + {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_NOUVEAU, Family::UNKNOWN, BUG_BROKEN_UBO, 900, 916, true}, - {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_R600, Family::UNKNOWN, BUG_BROKENUBO, 900, 913, true}, - {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_R600, Family::UNKNOWN, BUG_BROKENGEOMETRYSHADERS, -1.0, - 1112.0, true}, - {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_I965, Family::INTEL_SANDY, BUG_BROKENGEOMETRYSHADERS, + {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_R600, Family::UNKNOWN, BUG_BROKEN_UBO, 900, 913, true}, + {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_R600, Family::UNKNOWN, BUG_BROKEN_GEOMETRY_SHADERS, + -1.0, 1112.0, true}, + {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_I965, Family::INTEL_SANDY, BUG_BROKEN_GEOMETRY_SHADERS, -1.0, 1120.0, true}, - {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN, BUG_BROKENUBO, 900, 920, true}, - {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_ALL, Family::UNKNOWN, BUG_BROKENCOPYIMAGE, -1.0, + {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN, BUG_BROKEN_UBO, 900, 920, true}, + {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_ALL, Family::UNKNOWN, BUG_BROKEN_COPYIMAGE, -1.0, 1064.0, true}, - {API_OPENGL, OS_LINUX, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_BROKENPINNEDMEMORY, -1.0, + {API_OPENGL, OS_LINUX, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_BROKEN_PINNED_MEMORY, -1.0, -1.0, true}, - {API_OPENGL, OS_LINUX, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKENBUFFERSTORAGE, + {API_OPENGL, OS_LINUX, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKEN_BUFFER_STORAGE, -1.0, 33138.0, true}, - {API_OPENGL, OS_OSX, VENDOR_INTEL, DRIVER_INTEL, Family::INTEL_SANDY, BUG_PRIMITIVERESTART, + {API_OPENGL, OS_OSX, VENDOR_INTEL, DRIVER_INTEL, Family::INTEL_SANDY, BUG_PRIMITIVE_RESTART, -1.0, -1.0, true}, - {API_OPENGL, OS_WINDOWS, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKENUNSYNCMAPPING, - -1.0, -1.0, true}, - {API_OPENGL, OS_LINUX, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKENUNSYNCMAPPING, + {API_OPENGL, OS_WINDOWS, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, + BUG_BROKEN_UNSYNC_MAPPING, -1.0, -1.0, true}, + {API_OPENGL, OS_LINUX, VENDOR_NVIDIA, DRIVER_NVIDIA, Family::UNKNOWN, BUG_BROKEN_UNSYNC_MAPPING, -1.0, -1.0, true}, {API_OPENGL, OS_WINDOWS, VENDOR_INTEL, DRIVER_INTEL, Family::UNKNOWN, - BUG_INTELBROKENBUFFERSTORAGE, 101810.3907, 101810.3960, true}, - {API_OPENGL, OS_ALL, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_SLOWGETBUFFERSUBDATA, -1.0, + BUG_INTEL_BROKEN_BUFFER_STORAGE, 101810.3907, 101810.3960, true}, + {API_OPENGL, OS_ALL, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_SLOW_GETBUFFERSUBDATA, -1.0, -1.0, true}, - {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN, BUG_BROKENCLIPDISTANCE, -1.0, + {API_OPENGL, OS_ALL, VENDOR_MESA, DRIVER_I965, Family::UNKNOWN, BUG_BROKEN_CLIP_DISTANCE, -1.0, -1.0, true}, {API_VULKAN, OS_ALL, VENDOR_ATI, DRIVER_ATI, Family::UNKNOWN, BUG_BROKEN_FRAGMENT_SHADER_INDEX_DECORATION, -1.0, -1.0, true}, diff --git a/Source/Core/VideoCommon/DriverDetails.h b/Source/Core/VideoCommon/DriverDetails.h index 3af4dd715e..dc3340c024 100644 --- a/Source/Core/VideoCommon/DriverDetails.h +++ b/Source/Core/VideoCommon/DriverDetails.h @@ -84,7 +84,7 @@ enum Bug // The offset of glBindBufferRange was ignored on all Mesa Gallium3D drivers until 9.1.3 // Nouveau stored the offset as u16 which isn't enough for all cases with range until 9.1.6 // I965 has broken data fetches from uniform buffers which results in a dithering until 9.2.0 - BUG_BROKENUBO, + BUG_BROKEN_UBO, // Bug: The pinned memory extension isn't working for index buffers // Affected devices: AMD as they are the only vendor providing this extension // Started Version: ? @@ -97,7 +97,7 @@ enum Bug // This bug only happens when paired with base_vertex. // Please see issue #6105. Let's hope buffer storage solves this issue. // TODO: Detect broken drivers. - BUG_BROKENPINNEDMEMORY, + BUG_BROKEN_PINNED_MEMORY, // Bug: glBufferSubData/glMapBufferRange stalls + OOM // Affected devices: Adreno a3xx/Mali-t6xx // Started Version: -1 @@ -106,7 +106,7 @@ enum Bug // The driver stalls in each instance no matter what you do // Apparently Mali and Adreno share code in this regard since they were written by the same // person. - BUG_BROKENBUFFERSTREAM, + BUG_BROKEN_BUFFER_STREAM, // Bug: ARB_buffer_storage doesn't work with ARRAY_BUFFER type streams // Affected devices: GeForce 4xx+ // Started Version: -1 @@ -114,7 +114,7 @@ enum Bug // The buffer_storage streaming method is required for greater speed gains in our buffer streaming // It reduces what is needed for streaming to basically a memcpy call // It seems to work for all buffer types except GL_ARRAY_BUFFER - BUG_BROKENBUFFERSTORAGE, + BUG_BROKEN_BUFFER_STORAGE, // Bug: Intel HD 3000 on OS X has broken primitive restart // Affected devices: Intel HD 3000 // Affected OS: OS X @@ -122,7 +122,7 @@ enum Bug // Ended Version: -1 // The drivers on OS X has broken primitive restart. // Intel HD 4000 series isn't affected by the bug - BUG_PRIMITIVERESTART, + BUG_PRIMITIVE_RESTART, // Bug: unsync mapping doesn't work fine // Affected devices: Nvidia driver // Started Version: -1 @@ -133,7 +133,7 @@ enum Bug // Workaround: Use BufferSubData // TODO: some Windows AMD driver/GPU combination seems also affected // but as they all support pinned memory, it doesn't matter - BUG_BROKENUNSYNCMAPPING, + BUG_BROKEN_UNSYNC_MAPPING, // Bug: Intel's Window driver broke buffer_storage with GL_ELEMENT_ARRAY_BUFFER // Affected devices: Intel (Windows) // Started Version: 15.36.3.64.3907 (10.18.10.3907) @@ -141,7 +141,7 @@ enum Bug // Intel implemented buffer_storage in their GL 4.3 driver. // It works for all the buffer types we use except GL_ELEMENT_ARRAY_BUFFER. // Causes complete blackscreen issues. - BUG_INTELBROKENBUFFERSTORAGE, + BUG_INTEL_BROKEN_BUFFER_STORAGE, // Bug: Qualcomm has broken boolean negation // Affected devices: Adreno // Started Version: -1 @@ -165,13 +165,13 @@ enum Bug // Works on Qualcomm // Broken on Windows Intel // if (cond == false) - BUG_BROKENNEGATEDBOOLEAN, + BUG_BROKEN_NEGATED_BOOLEAN, // Bug: glCopyImageSubData doesn't work on i965 // Started Version: -1 // Ended Version: 10.6.4 // Mesa meta misses to disable the scissor test. - BUG_BROKENCOPYIMAGE, + BUG_BROKEN_COPYIMAGE, // Bug: ARM Mali managed to break disabling vsync // Affected Devices: Mali @@ -184,7 +184,7 @@ enum Bug // We can't actually detect what the driver version is on Android, so until the driver version // lands that displays the version in // the GL_VERSION string, we will have to force vsync to be enabled at all times. - BUG_BROKENVSYNC, + BUG_BROKEN_VSYNC, // Bug: Broken lines in geometry shaders // Affected Devices: Mesa r600/radeonsi, Mesa Sandy Bridge @@ -193,7 +193,7 @@ enum Bug // Mesa introduced geometry shader support for radeon and sandy bridge devices and failed to test // it with us. // Causes misrenderings on a large amount of things that draw lines. - BUG_BROKENGEOMETRYSHADERS, + BUG_BROKEN_GEOMETRY_SHADERS, // Bug: Explicit flush is very slow on Qualcomm // Started Version: -1 @@ -202,7 +202,7 @@ enum Bug // Qualcomm seems to have lots of overhead on explicit flushing, but the coherent mapping path is // fine. // So let's use coherent mapping there. - BUG_BROKENEXPLICITFLUSH, + BUG_BROKEN_EXPLICIT_FLUSH, // Bug: glGetBufferSubData for bounding box reads is slow on AMD drivers // Started Version: -1 @@ -213,7 +213,7 @@ enum Bug // first call moving the buffer from // GPU memory to system memory. Use glMapBufferRange for BBox reads on AMD, and glGetBufferSubData // everywhere else. - BUG_SLOWGETBUFFERSUBDATA, + BUG_SLOW_GETBUFFERSUBDATA, // Bug: Broken lines in geometry shaders when writing to gl_ClipDistance in the vertex shader // Affected Devices: Mesa i965 @@ -222,7 +222,7 @@ enum Bug // Writing to gl_ClipDistance in both the vertex shader and the geometry shader will break // the geometry shader. Current workaround is to make sure the geometry shader always consumes // the gl_ClipDistance inputs from the vertex shader. - BUG_BROKENCLIPDISTANCE, + BUG_BROKEN_CLIP_DISTANCE, // Bug: Dual-source outputs from fragment shaders are broken on AMD Vulkan drivers // Started Version: -1 diff --git a/Source/Core/VideoCommon/GeometryShaderGen.cpp b/Source/Core/VideoCommon/GeometryShaderGen.cpp index 2c196e10e7..ab2154ef17 100644 --- a/Source/Core/VideoCommon/GeometryShaderGen.cpp +++ b/Source/Core/VideoCommon/GeometryShaderGen.cpp @@ -214,7 +214,7 @@ ShaderCode GenerateGeometryShaderCode(APIType ApiType, const geometry_shader_uid AssignVSOutputMembers(out, "f", "vs[i]", uid_data->numTexGens, uid_data->pixel_lighting); if (g_ActiveConfig.backend_info.bSupportsDepthClamp && - DriverDetails::HasBug(DriverDetails::BUG_BROKENCLIPDISTANCE)) + DriverDetails::HasBug(DriverDetails::BUG_BROKEN_CLIP_DISTANCE)) { // On certain GPUs we have to consume the clip distance from the vertex shader // or else the other vertex shader outputs will get corrupted. diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 37e01ade0d..2d42de591d 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -1194,7 +1194,7 @@ static void WriteAlphaTest(ShaderCode& out, const pixel_shader_uid_data* uid_dat out.SetConstantsUsed(C_ALPHA, C_ALPHA); - if (DriverDetails::HasBug(DriverDetails::BUG_BROKENNEGATEDBOOLEAN)) + if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_NEGATED_BOOLEAN)) out.Write("\tif(( "); else out.Write("\tif(!( "); @@ -1209,7 +1209,7 @@ static void WriteAlphaTest(ShaderCode& out, const pixel_shader_uid_data* uid_dat compindex = uid_data->alpha_test_comp1; out.Write(tevAlphaFuncsTable[compindex], alphaRef[1]); - if (DriverDetails::HasBug(DriverDetails::BUG_BROKENNEGATEDBOOLEAN)) + if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_NEGATED_BOOLEAN)) out.Write(") == false) {\n"); else out.Write(")) {\n");