From 6bdcde9dd6ab3a6fe192653749849f5d00ecb806 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 6 Oct 2013 03:12:13 -0500 Subject: [Android] Tegra 4 'support.' This brings up the OpenGL backend to support Tegra 4 to the point where it will run games but it doesn't have any video output for some reason. This is a large change that doesn't actually change much functionally. Walking through the changes. It changes the string in the Android backend select to just OpenGL ES. Adds a check in the Android code to check for Tegra 4 and to enable the option to select the OpenGL ES backend. Adds a DriverDetails bug under BUG_ISTEGRA as a blanket case of Tegra 4 support. The changes that effects most lines in this change. Removing all float suffixes in the pixel/vertex/util shaders since OpenGL ES 2 doesn't support float suffixes. Disables the shaders for reinterpreting the EFB format since Tegra 4 doesn't support integers. Changes GLFunctions.cpp to grab the correct Tegra extension functions. Readds the GLSL 1.2 'hacks' as GLSLES2 'hacks' since they are required for GLSL ES 2 Adds a GLSLES2 to the GLSL_VERSION enum. Disable the SamplerCache on Tegra since Tegra doesn't support samplers... Enable glBufferSubData on Tegra since it is the only mobile GPU to correctly work with it. Disable glDrawRangeElements on Tegra since it doesn't support it, This uses glDrawElements instead. --- .../Plugin_VideoOGL/Src/ProgramShaderCache.cpp | 49 ++++++++++++++++------ 1 file changed, 37 insertions(+), 12 deletions(-) (limited to 'Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp') diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp index f27f56d701..a8360fa9c3 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp @@ -518,16 +518,18 @@ void ProgramShaderCache::CreateHeader ( void ) { GLSL_VERSION v = g_ogl_config.eSupportedGLSLVersion; snprintf(s_glsl_header, sizeof(s_glsl_header), - "#version %s\n" - "%s\n" // default precision + "%s\n" "%s\n" // ubo "%s\n" // early-z + // Precision defines for GLSLES2/3 + "%s\n" + "\n"// A few required defines and ones that will make our lives a lot easier - "#define ATTRIN in\n" - "#define ATTROUT out\n" - "#define VARYIN %s in\n" - "#define VARYOUT %s out\n" + "#define ATTRIN %s\n" + "#define ATTROUT %s\n" + "#define VARYIN %s\n" + "#define VARYOUT %s\n" // Silly differences "#define float2 vec2\n" @@ -542,18 +544,41 @@ void ProgramShaderCache::CreateHeader ( void ) "%s\n" "%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==GLSLES3 ? "300 es" : v==GLSL_130 ? "130" : v==GLSL_140 ? "140" : "150" - , v==GLSLES3 ? "precision highp float;" : "" + , v==GLSLES2 ? "" : v==GLSLES3 ? "#version 300 es" : v==GLSL_130 ? "#version 130" : v==GLSL_140 ? "#version 140" : "#version 150" , g_ActiveConfig.backend_info.bSupportsGLSLUBO && v