Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DriverDetails: Update Qualcomm new driver version. #3832

Merged
merged 3 commits into from
May 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/OGL/Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ Renderer::Renderer()
g_ogl_config.bSupportsGLSLCache = true;
g_ogl_config.bSupportsGLSync = true;

if (strstr(g_ogl_config.glsl_version, "3.0") || DriverDetails::HasBug(DriverDetails::BUG_BROKENGLES31))
if (strstr(g_ogl_config.glsl_version, "3.0"))
{
g_ogl_config.eSupportedGLSLVersion = GLSLES_300;
g_ogl_config.bSupportsAEP = false;
Expand Down
13 changes: 8 additions & 5 deletions Source/Core/VideoBackends/OGL/StreamBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class MapAndSync : public StreamBuffer
class BufferStorage : public StreamBuffer
{
public:
BufferStorage(u32 type, u32 size) : StreamBuffer(type, size)
BufferStorage(u32 type, u32 size, bool _coherent = false) : StreamBuffer(type, size), coherent(_coherent)
{
CreateFences();
glBindBuffer(m_buffertype, m_buffer);
Expand All @@ -219,9 +219,9 @@ class BufferStorage : public StreamBuffer
// COHERENT_BIT is set so we don't have to use a MemoryBarrier on write
// CLIENT_STORAGE_BIT is set since we access the buffer more frequently on the client side then server side
glBufferStorage(m_buffertype, m_size, nullptr,
GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT);
GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | (coherent ? GL_MAP_COHERENT_BIT : 0));
m_pointer = (u8*)glMapBufferRange(m_buffertype, 0, m_size,
GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_FLUSH_EXPLICIT_BIT);
GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | (coherent ? GL_MAP_COHERENT_BIT : GL_MAP_FLUSH_EXPLICIT_BIT));
}

~BufferStorage()
Expand All @@ -239,11 +239,13 @@ class BufferStorage : public StreamBuffer

void Unmap(u32 used_size) override
{
glFlushMappedBufferRange(m_buffertype, m_iterator, used_size);
if (!coherent)
glFlushMappedBufferRange(m_buffertype, m_iterator, used_size);
m_iterator += used_size;
}

u8* m_pointer;
const bool coherent;
};

/* --- AMD only ---
Expand Down Expand Up @@ -377,10 +379,11 @@ std::unique_ptr<StreamBuffer> StreamBuffer::Create(u32 type, u32 size)
return std::make_unique<PinnedMemory>(type, size);

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

// don't fall back to MapAnd* for Nvidia drivers
if (DriverDetails::HasBug(DriverDetails::BUG_BROKENUNSYNCMAPPING))
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/VideoCommon/DriverDetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ namespace DriverDetails
static BugInfo m_known_bugs[] = {
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true},
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENNEGATEDBOOLEAN,-1.0, -1.0, true},
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENGLES31, -1.0, -1.0, true},
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENALPHATEST, -1.0, -1.0, true},
{OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKENEXPLICITFLUSH, -1.0, -1.0, true},
{OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true},
{OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKENVSYNC, -1.0, -1.0, true},
{OS_ALL, VENDOR_IMGTEC, DRIVER_IMGTEC, Family::UNKNOWN, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true},
Expand Down
27 changes: 8 additions & 19 deletions Source/Core/VideoCommon/DriverDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,6 @@ namespace DriverDetails
// Mesa meta misses to disable the scissor test.
BUG_BROKENCOPYIMAGE,

// Bug: Qualcomm has broken OpenGL ES 3.1 support
// Affected devices: Adreno
// Started Version: -1
// Ended Version: -1
// This isn't fully researched, but at the very least Qualcomm doesn't implement Geometry shader features fully.
// Until each bug is fully investigated, just disable GLES 3.1 entirely on these devices.
BUG_BROKENGLES31,

// Bug: ARM Mali managed to break disabling vsync
// Affected Devices: Mali
// Started Version: r5p0-rev2
Expand All @@ -177,24 +169,21 @@ namespace DriverDetails
// the GL_VERSION string, we will have to force vsync to be enabled at all times.
BUG_BROKENVSYNC,

// Bug: Adreno has a broken alpha test
// Affected Devices: Adreno
// Started Version: v103 confirmed (v95 potentially as well?)
// Ended Version: -1
// The Qualcomm video drivers have somehow managed to hit a situation where in a certain situation the alpha test
// always evaluates to false for some reason.
// This has yet to be tracked as to why they fail at such a simple check
// Example alpha test path
// if(( (prev.a > alphaRef.r) && (prev.a > alphaRef.g)) == false) {
BUG_BROKENALPHATEST,

// Bug: Broken lines in geometry shaders
// Affected Devices: Mesa r600/radeonsi, Mesa Sandy Bridge
// Started Version: -1
// Ended Version: 11.1.2 for radeon, -1 for Sandy
// 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: 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 exlicit flushing, but the coherent mapping path is fine.
// So let's use coherent mapping there.
BUG_BROKENEXPLICITFLUSH,
};

// Initializes our internal vendor, device family, and driver version
Expand Down