summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2013-11-24 15:49:23 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2013-11-24 15:49:23 -0600
commitf292819ff5d9017094c8d2debca2e4a93add448c (patch)
tree41525cfe9025935c7d40b17d63b0c28c2bbe185c /Source/Core/VideoBackends
parentd410fe7c96f63fe994fb18160c0b66e2ca4b3324 (diff)
[Android] Due to recent changes in code breaking Tegra 4 support, and also the upcoming code which will be breaking GLES2 support entirely. Taking the initiative to drop the remaining support code from the codebase in preparation for the upcoming changes. For a look at how Dolphin on Tegra 4 looked like prior and would not have been able to be fixed at all due to Tegra 4 not supporting the precision we need in our shaders; Look at this Youtube video http://youtu.be/Ga7Jc_Ote7U
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/OGL/Src/FramebufferManager.cpp35
-rw-r--r--Source/Core/VideoBackends/OGL/Src/GLFunctions.cpp79
-rw-r--r--Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.cpp40
-rw-r--r--Source/Core/VideoBackends/OGL/Src/Render.cpp5
-rw-r--r--Source/Core/VideoBackends/OGL/Src/Render.h1
-rw-r--r--Source/Core/VideoBackends/OGL/Src/SamplerCache.cpp5
-rw-r--r--Source/Core/VideoBackends/OGL/Src/VertexManager.cpp18
7 files changed, 42 insertions, 141 deletions
diff --git a/Source/Core/VideoBackends/OGL/Src/FramebufferManager.cpp b/Source/Core/VideoBackends/OGL/Src/FramebufferManager.cpp
index e2e4d873dd..1530016336 100644
--- a/Source/Core/VideoBackends/OGL/Src/FramebufferManager.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/FramebufferManager.cpp
@@ -66,15 +66,6 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
// alpha channel should be ignored if the EFB does not have one.
// Create EFB target.
- u32 depthType;
- if (DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA))
- {
- depthType = GL_DEPTH_COMPONENT;
- }
- else
- {
- depthType = GL_DEPTH_COMPONENT24;
- }
glGenFramebuffers(1, &m_efbFramebuffer);
glActiveTexture(GL_TEXTURE0 + 9);
@@ -94,7 +85,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
glBindTexture(getFbType(), m_efbDepth);
glTexParameteri(getFbType(), GL_TEXTURE_MAX_LEVEL, 0);
- glTexImage2D(getFbType(), 0, depthType, m_targetWidth, m_targetHeight, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
+ glTexImage2D(getFbType(), 0, GL_DEPTH_COMPONENT24, m_targetWidth, m_targetHeight, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
glBindTexture(getFbType(), m_resolvedColorTexture);
glTexParameteri(getFbType(), GL_TEXTURE_MAX_LEVEL, 0);
@@ -159,7 +150,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
glBindTexture(getFbType(), m_resolvedDepthTexture);
glTexParameteri(getFbType(), GL_TEXTURE_MAX_LEVEL, 0);
- glTexImage2D(getFbType(), 0, depthType, m_targetWidth, m_targetHeight, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
+ glTexImage2D(getFbType(), 0, GL_DEPTH_COMPONENT24, m_targetWidth, m_targetHeight, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
// Bind resolved textures to resolved framebuffer.
@@ -235,13 +226,8 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
" ocol0 = float4(dst6) / 63.f;\n"
"}";
- if(g_ogl_config.eSupportedGLSLVersion != GLSLES2)
- {
- // HACK: This shaders aren't glsles2 compatible as glsles2 don't support bit operations
- // it could be workaround by floor + frac + tons off additions, but I think it isn't worth
- ProgramShaderCache::CompileShader(m_pixel_format_shaders[0], vs, ps_rgb8_to_rgba6);
- ProgramShaderCache::CompileShader(m_pixel_format_shaders[1], vs, ps_rgba6_to_rgb8);
- }
+ ProgramShaderCache::CompileShader(m_pixel_format_shaders[0], vs, ps_rgb8_to_rgba6);
+ ProgramShaderCache::CompileShader(m_pixel_format_shaders[1], vs, ps_rgba6_to_rgb8);
}
FramebufferManager::~FramebufferManager()
@@ -372,19 +358,6 @@ GLuint FramebufferManager::ResolveAndGetDepthTarget(const EFBRectangle &source_r
void FramebufferManager::ReinterpretPixelData(unsigned int convtype)
{
- if(g_ogl_config.eSupportedGLSLVersion == GLSLES2) {
- // This feature isn't supported by glsles2
-
- // 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;
- }
g_renderer->ResetAPIState();
GLuint src_texture = 0;
diff --git a/Source/Core/VideoBackends/OGL/Src/GLFunctions.cpp b/Source/Core/VideoBackends/OGL/Src/GLFunctions.cpp
index 6ff264aebe..c91908ea11 100644
--- a/Source/Core/VideoBackends/OGL/Src/GLFunctions.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/GLFunctions.cpp
@@ -72,67 +72,42 @@ namespace GLFunc
self = dlopen(NULL, RTLD_LAZY);
LoadFunction("glUnmapBuffer", (void**)&glUnmapBuffer);
+ LoadFunction("glBeginQuery", (void**)&glBeginQuery);
+ LoadFunction("glEndQuery", (void**)&glEndQuery);
+ LoadFunction("glGetQueryObjectuiv", (void**)&glGetQueryObjectuiv);
+ LoadFunction("glDeleteQueries", (void**)&glDeleteQueries);
+ LoadFunction("glGenQueries", (void**)&glGenQueries);
- if (DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA))
- {
- LoadFunction("glBeginQueryEXT", (void**)&glBeginQuery);
- LoadFunction("glEndQueryEXT", (void**)&glEndQuery);
- LoadFunction("glGetQueryObjectuivEXT", (void**)&glGetQueryObjectuiv);
- LoadFunction("glDeleteQueriesEXT", (void**)&glDeleteQueries);
- LoadFunction("glGenQueriesEXT", (void**)&glGenQueries);
-
- LoadFunction("glMapBufferRangeNV", (void**)&glMapBufferRange);
- LoadFunction("glBindBufferRangeNV", (void**)&glBindBufferRange);
- LoadFunction("glBlitFramebufferNV", (void**)&glBlitFramebuffer);
-
- LoadFunction("glGenVertexArraysOES", (void**)&glGenVertexArrays);
- LoadFunction("glDeleteVertexArraysOES", (void**)&glDeleteVertexArrays);
- LoadFunction("glBindVertexArrayOES", (void**)&glBindVertexArray);
+ LoadFunction("glMapBufferRange", (void**)&glMapBufferRange);
+ LoadFunction("glBindBufferRange", (void**)&glBindBufferRange);
+ LoadFunction("glBlitFramebuffer", (void**)&glBlitFramebuffer);
- LoadFunction("glRenderbufferStorageMultisampleNV", (void**)&glRenderbufferStorageMultisample);
+ LoadFunction("glGenVertexArrays", (void**)&glGenVertexArrays);
+ LoadFunction("glDeleteVertexArrays", (void**)&glDeleteVertexArrays);
+ LoadFunction("glBindVertexArray", (void**)&glBindVertexArray);
- LoadFunction("glGetUniformBlockIndexNV", (void**)&glGetUniformBlockIndex);
- LoadFunction("glUniformBlockBindingNV", (void**)&glUniformBlockBinding);
- }
- else
- {
- LoadFunction("glBeginQuery", (void**)&glBeginQuery);
- LoadFunction("glEndQuery", (void**)&glEndQuery);
- LoadFunction("glGetQueryObjectuiv", (void**)&glGetQueryObjectuiv);
- LoadFunction("glDeleteQueries", (void**)&glDeleteQueries);
- LoadFunction("glGenQueries", (void**)&glGenQueries);
+ LoadFunction("glClientWaitSync", (void**)&glClientWaitSync);
+ LoadFunction("glDeleteSync", (void**)&glDeleteSync);
+ LoadFunction("glFenceSync", (void**)&glFenceSync);
- LoadFunction("glMapBufferRange", (void**)&glMapBufferRange);
- LoadFunction("glBindBufferRange", (void**)&glBindBufferRange);
- LoadFunction("glBlitFramebuffer", (void**)&glBlitFramebuffer);
+ LoadFunction("glSamplerParameterf", (void**)&glSamplerParameterf);
+ LoadFunction("glSamplerParameteri", (void**)&glSamplerParameteri);
+ LoadFunction("glSamplerParameterfv", (void**)&glSamplerParameterfv);
+ LoadFunction("glBindSampler", (void**)&glBindSampler);
+ LoadFunction("glDeleteSamplers", (void**)&glDeleteSamplers);
+ LoadFunction("glGenSamplers", (void**)&glGenSamplers);
- LoadFunction("glGenVertexArrays", (void**)&glGenVertexArrays);
- LoadFunction("glDeleteVertexArrays", (void**)&glDeleteVertexArrays);
- LoadFunction("glBindVertexArray", (void**)&glBindVertexArray);
+ LoadFunction("glGetProgramBinary", (void**)&glGetProgramBinary);
+ LoadFunction("glProgramBinary", (void**)&glProgramBinary);
+ LoadFunction("glProgramParameteri", (void**)&glProgramParameteri);
- LoadFunction("glClientWaitSync", (void**)&glClientWaitSync);
- LoadFunction("glDeleteSync", (void**)&glDeleteSync);
- LoadFunction("glFenceSync", (void**)&glFenceSync);
+ LoadFunction("glDrawRangeElements", (void**)&glDrawRangeElements);
- LoadFunction("glSamplerParameterf", (void**)&glSamplerParameterf);
- LoadFunction("glSamplerParameteri", (void**)&glSamplerParameteri);
- LoadFunction("glSamplerParameterfv", (void**)&glSamplerParameterfv);
- LoadFunction("glBindSampler", (void**)&glBindSampler);
- LoadFunction("glDeleteSamplers", (void**)&glDeleteSamplers);
- LoadFunction("glGenSamplers", (void**)&glGenSamplers);
+ LoadFunction("glRenderbufferStorageMultisample", (void**)&glRenderbufferStorageMultisample);
- LoadFunction("glGetProgramBinary", (void**)&glGetProgramBinary);
- LoadFunction("glProgramBinary", (void**)&glProgramBinary);
- LoadFunction("glProgramParameteri", (void**)&glProgramParameteri);
+ LoadFunction("glGetUniformBlockIndex", (void**)&glGetUniformBlockIndex);
+ LoadFunction("glUniformBlockBinding", (void**)&glUniformBlockBinding);
- LoadFunction("glDrawRangeElements", (void**)&glDrawRangeElements);
-
- LoadFunction("glRenderbufferStorageMultisample", (void**)&glRenderbufferStorageMultisample);
-
- LoadFunction("glGetUniformBlockIndex", (void**)&glGetUniformBlockIndex);
- LoadFunction("glUniformBlockBinding", (void**)&glUniformBlockBinding);
-
- }
dlclose(self);
}
}
diff --git a/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.cpp
index cc807b7952..f998c6ced2 100644
--- a/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/ProgramShaderCache.cpp
@@ -571,12 +571,12 @@ void ProgramShaderCache::CreateHeader ( void )
"%s\n" // ubo
"%s\n" // early-z
- // Precision defines for GLSLES2/3
+ // Precision defines for GLSLES3
"%s\n"
"\n"// A few required defines and ones that will make our lives a lot easier
- "#define ATTRIN %s\n"
- "#define ATTROUT %s\n"
+ "#define ATTRIN in\n"
+ "#define ATTROUT out\n"
"#define VARYIN %s\n"
"#define VARYOUT %s\n"
@@ -594,40 +594,18 @@ void ProgramShaderCache::CreateHeader ( void )
"%s\n"
"%s\n"
- // GLSLES2 hacks
- "%s\n"
- "%s\n"
- "%s\n"
- "%s\n"
- "%s\n"
- "%s\n"
- "%s\n"
- "#define COLOROUT(name) %s\n"
-
-
- , v==GLSLES2 ? "" : v==GLSLES3 ? "#version 300 es" : v==GLSL_130 ? "#version 130" : v==GLSL_140 ? "#version 140" : "#version 150"
+ , v==GLSLES3 ? "#version 300 es" : v==GLSL_130 ? "#version 130" : v==GLSL_140 ? "#version 140" : "#version 150"
, g_ActiveConfig.backend_info.bSupportsGLSLUBO && v<GLSL_140 ? "#extension GL_ARB_uniform_buffer_object : enable" : ""
, g_ActiveConfig.backend_info.bSupportsEarlyZ ? "#extension GL_ARB_shader_image_load_store : enable" : ""
- , (v==GLSLES3 || v==GLSLES2) ? "precision highp float;" : ""
+ , v==GLSLES3 ? "precision highp float;" : ""
- , v==GLSLES2 ? "attribute" : "in"
- , v==GLSLES2 ? "attribute" : "out"
- , v==GLSLES2 ? "varying" : DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "in" : "centroid in"
- , v==GLSLES2 ? "varying" : DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "out" : "centroid out"
+ , DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "in" : "centroid in"
+ , DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "out" : "centroid out"
- , v==GLSLES2 ? "#define texture2DRect texture2D" : v==GLSLES3 ? "" : v<=GLSL_130 ? "#extension GL_ARB_texture_rectangle : enable" : "#define texture2DRect texture"
+ , v==GLSLES3 ? "" : v<=GLSL_130 ? "#extension GL_ARB_texture_rectangle : enable" : "#define texture2DRect texture"
, v==GLSLES3 ? "#define texture2DRect(samp, uv) texelFetch(samp, ivec2(floor(uv)), 0)" : ""
- , (v==GLSLES3 || v==GLSLES2) ? "#define sampler2DRect sampler2D" : ""
-
- , v==GLSLES2 ? "#define texture texture2D" : ""
- , v==GLSLES2 ? "#define round(x) floor((x)+0.5)" : ""
- , v==GLSLES2 ? "#define out " : ""
- , v==GLSLES2 ? "#define ocol0 gl_FragColor" : ""
- , v==GLSLES2 ? "#define ocol1 gl_FragColor" : ""
- , DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA) ? "#extension GL_NV_uniform_buffer_object : enable" : ""
- , DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA) ? "#extension GL_NV_fragdepth : enable" : ""
- , v==GLSLES2 ? "" : "out vec4 name;"
+ , v==GLSLES3 ? "#define sampler2DRect sampler2D" : ""
);
}
diff --git a/Source/Core/VideoBackends/OGL/Src/Render.cpp b/Source/Core/VideoBackends/OGL/Src/Render.cpp
index d75ac31159..8f95f5575e 100644
--- a/Source/Core/VideoBackends/OGL/Src/Render.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/Render.cpp
@@ -371,10 +371,7 @@ Renderer::Renderer()
g_ogl_config.bSupportSampleShading = false;
g_ogl_config.bSupportOGL31 = false;
g_ogl_config.bSupportViewportFloat = false;
- if (DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA) || DriverDetails::HasBug(DriverDetails::BUG_ISPOWERVR))
- g_ogl_config.eSupportedGLSLVersion = GLSLES2;
- else
- g_ogl_config.eSupportedGLSLVersion = GLSLES3;
+ g_ogl_config.eSupportedGLSLVersion = GLSLES3;
#else
#ifdef __APPLE__
glewExperimental = 1;
diff --git a/Source/Core/VideoBackends/OGL/Src/Render.h b/Source/Core/VideoBackends/OGL/Src/Render.h
index 0cda2f4c0e..9489d5c7ac 100644
--- a/Source/Core/VideoBackends/OGL/Src/Render.h
+++ b/Source/Core/VideoBackends/OGL/Src/Render.h
@@ -13,7 +13,6 @@ enum GLSL_VERSION {
GLSL_130,
GLSL_140,
GLSL_150, // and above
- GLSLES2,
GLSLES3
};
diff --git a/Source/Core/VideoBackends/OGL/Src/SamplerCache.cpp b/Source/Core/VideoBackends/OGL/Src/SamplerCache.cpp
index 8419777fae..2b50652ade 100644
--- a/Source/Core/VideoBackends/OGL/Src/SamplerCache.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/SamplerCache.cpp
@@ -16,14 +16,11 @@ SamplerCache::SamplerCache()
SamplerCache::~SamplerCache()
{
- if (!DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA))
- Clear();
+ Clear();
}
void SamplerCache::SetSamplerState(int stage, const TexMode0& tm0, const TexMode1& tm1)
{
- if (DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA))
- return;
// TODO: can this go somewhere else?
if (m_last_max_anisotropy != g_ActiveConfig.iMaxAnisotropy)
{
diff --git a/Source/Core/VideoBackends/OGL/Src/VertexManager.cpp b/Source/Core/VideoBackends/OGL/Src/VertexManager.cpp
index 1ff9b53e28..64e8f92313 100644
--- a/Source/Core/VideoBackends/OGL/Src/VertexManager.cpp
+++ b/Source/Core/VideoBackends/OGL/Src/VertexManager.cpp
@@ -134,24 +134,6 @@ void VertexManager::Draw(u32 stride)
glDrawRangeElementsBaseVertex(GL_POINTS, 0, max_index, point_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[2], (GLint)s_baseVertex);
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
}
- }
- else if (DriverDetails::HasBug(DriverDetails::BUG_ISTEGRA))
- {
- if (triangle_index_size > 0)
- {
- glDrawElements(triangle_mode, triangle_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[0]);
- INCSTAT(stats.thisFrame.numIndexedDrawCalls);
- }
- if (line_index_size > 0)
- {
- glDrawElements(GL_LINES, line_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[1]);
- INCSTAT(stats.thisFrame.numIndexedDrawCalls);
- }
- if (point_index_size > 0)
- {
- glDrawElements(GL_POINTS, point_index_size, GL_UNSIGNED_SHORT, (u8*)NULL+s_offset[2]);
- INCSTAT(stats.thisFrame.numIndexedDrawCalls);
- }
} else {
if (triangle_index_size > 0)
{