summaryrefslogtreecommitdiff
path: root/Source/Plugins
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2013-08-28 00:57:37 +1200
committerMatthew Parlane <parlane@gmail.com>2013-08-28 00:57:37 +1200
commit2a68b65cda35d325efcd347b090f76f14a5a033e (patch)
treee91f460f870b518bb249e08ce5f41bb3c33d9f53 /Source/Plugins
parent75c398118fb1d470a82735f93f5c0d1fe0a91664 (diff)
parent40a1cb5dfed6d5b255d1f330af2cdc14446e0b53 (diff)
Merge branch 'master' into wii-network
Diffstat (limited to 'Source/Plugins')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp12
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/Render.cpp17
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp14
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp5
4 files changed, 39 insertions, 9 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp
index ceafb75dca..f3b8578b23 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp
@@ -5,6 +5,7 @@
#include "Globals.h"
#include "FramebufferManager.h"
#include "VertexShaderGen.h"
+#include "OnScreenDisplay.h"
#include "TextureConverter.h"
#include "Render.h"
@@ -366,6 +367,13 @@ void FramebufferManager::ReinterpretPixelData(unsigned int convtype)
{
if(g_ogl_config.eSupportedGLSLVersion == GLSL_120) {
// This feature isn't supported by glsl120
+
+ // TODO: move this to InitBackendInfo
+ // We have to disable both the active and the stored config. Else we would either
+ // show this line per format change in one frame or once per frame.
+ OSD::AddMessage("Format Change Emulation isn't supported by your GPU.", 10000);
+ g_ActiveConfig.bEFBEmulateFormatChanges = false;
+ g_Config.bEFBEmulateFormatChanges = false;
return;
}
@@ -435,6 +443,8 @@ void XFBSource::DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
void XFBSource::CopyEFB(float Gamma)
{
+ g_renderer->ResetAPIState();
+
// Copy EFB data to XFB and restore render target again
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetEFBFramebuffer());
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, FramebufferManager::GetXFBFramebuffer());
@@ -451,6 +461,8 @@ void XFBSource::CopyEFB(float Gamma)
// Return to EFB.
FramebufferManager::SetFramebuffer(0);
+
+ g_renderer->RestoreAPIState();
}
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
index ee159929d1..504e58f85b 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
@@ -173,7 +173,8 @@ int GetNumMSAASamples(int MSAAMode)
if(samples <= g_ogl_config.max_samples) return samples;
- ERROR_LOG(VIDEO, "MSAA Bug: %d samples selected, but only %d supported by GPU.", samples, g_ogl_config.max_samples);
+ // TODO: move this to InitBackendInfo
+ OSD::AddMessage(StringFromFormat("%d Anti Aliasing samples selected, but only %d supported by your GPU.", samples, g_ogl_config.max_samples), 10000);
return g_ogl_config.max_samples;
}
@@ -197,7 +198,8 @@ int GetNumMSAACoverageSamples(int MSAAMode)
}
if(g_ogl_config.bSupportCoverageMSAA || samples == 0) return samples;
- ERROR_LOG(VIDEO, "MSAA Bug: CSAA selected, but not supported by GPU.");
+ // TODO: move this to InitBackendInfo
+ OSD::AddMessage("CSAA Anti Aliasing isn't supported by your GPU.", 10000);
return 0;
}
@@ -209,7 +211,8 @@ void ApplySSAASettings() {
glEnable(GL_SAMPLE_SHADING_ARB);
glMinSampleShadingARB(s_MSAASamples);
} else {
- ERROR_LOG(VIDEO, "MSAA Bug: SSAA selected, but not supported by GPU.");
+ // TODO: move this to InitBackendInfo
+ OSD::AddMessage("SSAA Anti Aliasing isn't supported by your GPU.", 10000);
}
} else if(g_ogl_config.bSupportSampleShading) {
glDisable(GL_SAMPLE_SHADING_ARB);
@@ -958,9 +961,13 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
{
if (s_MSAASamples > 1)
{
+ g_renderer->ResetAPIState();
+
// Resolve our rectangle.
FramebufferManager::GetEFBDepthTexture(efbPixelRc);
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetResolvedFramebuffer());
+
+ g_renderer->RestoreAPIState();
}
u32* depthMap = new u32[targetPixelRcWidth * targetPixelRcHeight];
@@ -1007,9 +1014,13 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
{
if (s_MSAASamples > 1)
{
+ g_renderer->ResetAPIState();
+
// Resolve our rectangle.
FramebufferManager::GetEFBColorTexture(efbPixelRc);
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetResolvedFramebuffer());
+
+ g_renderer->RestoreAPIState();
}
u32* colorMap = new u32[targetPixelRcWidth * targetPixelRcHeight];
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp
index af013467eb..5832a292ed 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp
@@ -7,6 +7,8 @@
#include "StreamBuffer.h"
#include "MemoryUtil.h"
#include "Render.h"
+#include "DriverDetails.h"
+#include "OnScreenDisplay.h"
namespace OGL
{
@@ -23,13 +25,21 @@ StreamBuffer::StreamBuffer(u32 type, size_t size, StreamType uploadType)
if(m_uploadtype & STREAM_DETECT)
{
+ // TODO: move this to InitBackendInfo
+ if(g_ActiveConfig.bHackedBufferUpload && !DriverDetails::HasBug(DriverDetails::BUG_BROKENHACKEDBUFFER))
+ {
+ OSD::AddMessage("Vertex Streaming Hack isn't supported by your GPU.", 10000);
+ g_ActiveConfig.bHackedBufferUpload = false;
+ g_Config.bHackedBufferUpload = false;
+ }
+
if(!g_ogl_config.bSupportsGLBaseVertex && (m_uploadtype & BUFFERDATA))
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_ActiveConfig.bHackedBufferUpload && (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;