Skip to content

Commit

Permalink
Merge pull request #6954 from degasus/coherent
Browse files Browse the repository at this point in the history
OGL/Streambuffer: Use coherent mapping by default.
  • Loading branch information
Helios747 committed Jun 5, 2018
2 parents 89b7da7 + fdfd8b1 commit 36ff2a2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
5 changes: 2 additions & 3 deletions Source/Core/VideoBackends/OGL/StreamBuffer.cpp
Expand Up @@ -216,7 +216,7 @@ class MapAndSync : public StreamBuffer
class BufferStorage : public StreamBuffer class BufferStorage : public StreamBuffer
{ {
public: public:
BufferStorage(u32 type, u32 size, bool _coherent = false) BufferStorage(u32 type, u32 size, bool _coherent = true)
: StreamBuffer(type, size), coherent(_coherent) : StreamBuffer(type, size), coherent(_coherent)
{ {
CreateFences(); CreateFences();
Expand Down Expand Up @@ -368,13 +368,12 @@ std::unique_ptr<StreamBuffer> StreamBuffer::Create(u32 type, u32 size)
return std::make_unique<PinnedMemory>(type, size); return std::make_unique<PinnedMemory>(type, size);


// buffer storage works well in most situations // buffer storage works well in most situations
bool coherent = DriverDetails::HasBug(DriverDetails::BUG_BROKEN_EXPLICIT_FLUSH);
if (g_ogl_config.bSupportsGLBufferStorage && if (g_ogl_config.bSupportsGLBufferStorage &&
!(DriverDetails::HasBug(DriverDetails::BUG_BROKEN_BUFFER_STORAGE) && !(DriverDetails::HasBug(DriverDetails::BUG_BROKEN_BUFFER_STORAGE) &&
type == GL_ARRAY_BUFFER) && type == GL_ARRAY_BUFFER) &&
!(DriverDetails::HasBug(DriverDetails::BUG_INTEL_BROKEN_BUFFER_STORAGE) && !(DriverDetails::HasBug(DriverDetails::BUG_INTEL_BROKEN_BUFFER_STORAGE) &&
type == GL_ELEMENT_ARRAY_BUFFER)) type == GL_ELEMENT_ARRAY_BUFFER))
return std::make_unique<BufferStorage>(type, size, coherent); return std::make_unique<BufferStorage>(type, size);


// don't fall back to MapAnd* for Nvidia drivers // don't fall back to MapAnd* for Nvidia drivers
if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_UNSYNC_MAPPING)) if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_UNSYNC_MAPPING))
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/VideoCommon/DriverDetails.cpp
Expand Up @@ -52,8 +52,6 @@ static BugInfo m_known_bugs[] = {
BUG_BROKEN_BUFFER_STREAM, -1.0, -1.0, true}, BUG_BROKEN_BUFFER_STREAM, -1.0, -1.0, true},
{API_OPENGL, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, {API_OPENGL, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN,
BUG_BROKEN_NEGATED_BOOLEAN, -1.0, -1.0, true}, 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, {API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_BUFFER_STREAM, -1.0,
-1.0, true}, -1.0, true},
{API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_VSYNC, -1.0, -1.0, {API_OPENGL, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_VSYNC, -1.0, -1.0,
Expand Down
9 changes: 0 additions & 9 deletions Source/Core/VideoCommon/DriverDetails.h
Expand Up @@ -200,15 +200,6 @@ enum Bug
// Causes misrenderings on a large amount of things that draw lines. // Causes misrenderings on a large amount of things that draw lines.
BUG_BROKEN_GEOMETRY_SHADERS, BUG_BROKEN_GEOMETRY_SHADERS,


// Bug: Explicit flush is very slow on Qualcomm
// Started Version: -1
// Ended Version: -1
// Our ARB_buffer_storage code uses explicit flush to avoid coherent mapping.
// 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_BROKEN_EXPLICIT_FLUSH,

// Bug: glGetBufferSubData for bounding box reads is slow on AMD drivers // Bug: glGetBufferSubData for bounding box reads is slow on AMD drivers
// Started Version: -1 // Started Version: -1
// Ended Version: -1 // Ended Version: -1
Expand Down

0 comments on commit 36ff2a2

Please sign in to comment.