Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ogl: warn on osd if not supported features are enabled
  • Loading branch information
degasus committed Aug 27, 2013
1 parent 4a863c8 commit 40a1cb5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
8 changes: 8 additions & 0 deletions Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp
Expand Up @@ -5,6 +5,7 @@
#include "Globals.h"
#include "FramebufferManager.h"
#include "VertexShaderGen.h"
#include "OnScreenDisplay.h"

#include "TextureConverter.h"
#include "Render.h"
Expand Down Expand Up @@ -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;
}

Expand Down
9 changes: 6 additions & 3 deletions Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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);
Expand Down
11 changes: 10 additions & 1 deletion Source/Plugins/Plugin_VideoOGL/Src/StreamBuffer.cpp
Expand Up @@ -8,6 +8,7 @@
#include "MemoryUtil.h"
#include "Render.h"
#include "DriverDetails.h"
#include "OnScreenDisplay.h"

namespace OGL
{
Expand All @@ -24,11 +25,19 @@ 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 && !DriverDetails::HasBug(DriverDetails::BUG_BROKENHACKEDBUFFER) && (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 && (!DriverDetails::HasBug(DriverDetails::BUG_BROKENPINNEDMEMORY) || type != GL_ELEMENT_ARRAY_BUFFER) && (m_uploadtype & PINNED_MEMORY))
m_uploadtype = PINNED_MEMORY;
Expand Down

0 comments on commit 40a1cb5

Please sign in to comment.