summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2013-08-26 19:45:19 +0200
committerdegasus <wickmarkus@web.de>2013-08-26 19:45:19 +0200
commit15df7b3445f54cfcbe303aded3a7d1ec33fa4776 (patch)
tree71f53523fee5139727d89e301e00552afac0c36b /Source
parentd83dffe44284163f87e48fe335296e7afde9a6cb (diff)
ogl driverdetails: add flag to disable hacked and pinned memory
pinned memory is broken for index buffers hacked buffer crashes the amd driver
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/VideoCommon/Src/DriverDetails.cpp15
-rw-r--r--Source/Core/VideoCommon/Src/DriverDetails.h16
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp5
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp5
4 files changed, 29 insertions, 12 deletions
diff --git a/Source/Core/VideoCommon/Src/DriverDetails.cpp b/Source/Core/VideoCommon/Src/DriverDetails.cpp
index 0a115e1354..cdecc71cd1 100644
--- a/Source/Core/VideoCommon/Src/DriverDetails.cpp
+++ b/Source/Core/VideoCommon/Src/DriverDetails.cpp
@@ -27,12 +27,15 @@ namespace DriverDetails
// This is a list of all known bugs for each vendor
// We use this to check if the device and driver has a issue
BugInfo m_known_bugs[] = {
- {VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_NODYNUBOACCESS, 14.0, -1.0, true},
- {VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENCENTROID, 14.0, -1.0, true},
- {VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENINFOLOG, -1.0, -1.0, true},
- {VENDOR_MESA, DRIVER_NOUVEAU, BUG_BROKENUBO, 900, 916, true},
- {VENDOR_MESA, DRIVER_R600, BUG_BROKENUBO, 900, 913, true},
- {VENDOR_MESA, DRIVER_I965, BUG_BROKENUBO, 900, 920, true},
+ {VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_NODYNUBOACCESS, 14.0, -1.0, true},
+ {VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENCENTROID, 14.0, -1.0, true},
+ {VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENINFOLOG, -1.0, -1.0, true},
+ {VENDOR_MESA, DRIVER_NOUVEAU, BUG_BROKENUBO, 900, 916, true},
+ {VENDOR_MESA, DRIVER_R600, BUG_BROKENUBO, 900, 913, true},
+ {VENDOR_MESA, DRIVER_I965, BUG_BROKENUBO, 900, 920, true},
+ {VENDOR_ATI, DRIVER_ATI, BUG_BROKENHACKEDBUFFER, -1.0, -1.0, true},
+ {VENDOR_MESA, DRIVER_NOUVEAU, BUG_BROKENHACKEDBUFFER, -1.0, -1.0, true},
+ {VENDOR_ATI, DRIVER_ATI, BUG_BROKENPINNEDMEMORY, -1.0, -1.0, true}
};
std::map<Bug, BugInfo> m_bugs;
diff --git a/Source/Core/VideoCommon/Src/DriverDetails.h b/Source/Core/VideoCommon/Src/DriverDetails.h
index efb0c7c6c0..dc0d2900eb 100644
--- a/Source/Core/VideoCommon/Src/DriverDetails.h
+++ b/Source/Core/VideoCommon/Src/DriverDetails.h
@@ -83,6 +83,22 @@ namespace DriverDetails
// 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: The hacked buffer upload method isn't working
+ // This isn't a bug as the hacked buffer itself isn't used to work.
+ // I'm still surprised that it works on so many drivers.
+ // Affected devices: - amd close sourced driver
+ // - nouveau
+ // - maybe also some others
+ // This hack is evil. It's like free(pointer); *pointer = data;
+ BUG_BROKENHACKEDBUFFER,
+ // 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: ?
+ // Ended Version: -1
+ // Pinned memory is disabled for index buffer as the amd driver (the only one with pinned memory support) seems
+ // to be broken. We just get flickering/black rendering when using pinned memory here -- degasus - 2013/08/20
+ // Please see issue #6105 on google code. Let's hope buffer storage solves this issues.
+ BUG_BROKENPINNEDMEMORY,
};
// Initializes our internal vendor, device family, and driver version
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp
index af013467eb..e03bcfbef4 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp
@@ -7,6 +7,7 @@
#include "StreamBuffer.h"
#include "MemoryUtil.h"
#include "Render.h"
+#include "DriverDetails.h"
namespace OGL
{
@@ -27,9 +28,9 @@ StreamBuffer::StreamBuffer(u32 type, size_t size, StreamType uploadType)
m_uploadtype = BUFFERDATA;
else if(!g_ogl_config.bSupportsGLBaseVertex && (m_uploadtype & BUFFERSUBDATA))
m_uploadtype = BUFFERSUBDATA;
- else if(g_ogl_config.bSupportsGLSync && g_Config.bHackedBufferUpload && (m_uploadtype & MAP_AND_RISK))
+ else if(g_ogl_config.bSupportsGLSync && g_Config.bHackedBufferUpload && !DriverDetails::HasBug(DriverDetails::BUG_BROKENHACKEDBUFFER) && (m_uploadtype & MAP_AND_RISK))
m_uploadtype = MAP_AND_RISK;
- else if(g_ogl_config.bSupportsGLSync && g_ogl_config.bSupportsGLPinnedMemory && (m_uploadtype & PINNED_MEMORY))
+ else if(g_ogl_config.bSupportsGLSync && g_ogl_config.bSupportsGLPinnedMemory && (!DriverDetails::HasBug(DriverDetails::BUG_BROKENPINNEDMEMORY) || type != GL_ELEMENT_ARRAY_BUFFER) && (m_uploadtype & PINNED_MEMORY))
m_uploadtype = PINNED_MEMORY;
else if(nvidia && (m_uploadtype & BUFFERSUBDATA))
m_uploadtype = BUFFERSUBDATA;
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp
index 8dc884ea63..3f4547a005 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp
@@ -62,10 +62,7 @@ void VertexManager::CreateDeviceObjects()
s_vertexBuffer = new StreamBuffer(GL_ARRAY_BUFFER, MAX_VBUFFER_SIZE);
m_vertex_buffers = s_vertexBuffer->getBuffer();
- // Pinned memory is disabled for index buffer as the amd driver (the only one with pinned memory support) seems
- // to be broken. We just get flickering/black rendering when using pinned memory here -- degasus - 2013/08/20
- // Please see issue #6105 on google code. Let's hope buffer storage solves this issues.
- s_indexBuffer = new StreamBuffer(GL_ELEMENT_ARRAY_BUFFER, MAX_IBUFFER_SIZE, (StreamType)(DETECT_MASK & ~PINNED_MEMORY));
+ s_indexBuffer = new StreamBuffer(GL_ELEMENT_ARRAY_BUFFER, MAX_IBUFFER_SIZE);
m_index_buffers = s_indexBuffer->getBuffer();
m_CurrentVertexFmt = NULL;