diff options
| author | degasus <wickmarkus@web.de> | 2013-09-03 20:56:24 +0200 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2013-09-22 23:45:14 +0200 |
| commit | 573dbfd494e56f5333d18db8f708b894be55b884 (patch) | |
| tree | ae41699ae18a194f612239bfa84fc25047cfdf71 /Source | |
| parent | 12e7c22006552e6f93392504f19808a7030f7f7e (diff) | |
ogl: drop glsl120 support
Diffstat (limited to 'Source')
9 files changed, 23 insertions, 64 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 459ae0733c..03d1677b2c 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -309,9 +309,9 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T if (ApiType == API_OPENGL) { - out.Write("COLOROUT(ocol0)\n"); + out.Write("out vec4 ocol0;\n"); if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND) - out.Write("COLOROUT(ocol1)\n"); + out.Write("out vec4 ocol1;\n"); if (per_pixel_depth) out.Write("#define depth gl_FragDepth\n"); diff --git a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp index de5198c9fe..bf2f2737ea 100644 --- a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp +++ b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp @@ -96,7 +96,7 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType) if (ApiType == API_OPENGL) { - WRITE(p, " COLOROUT(ocol0)\n"); + WRITE(p, " out vec4 ocol0;\n"); WRITE(p, " VARYIN float2 uv0;\n"); WRITE(p, "void main()\n"); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp index a9ea7fbb4e..ed36b5dd6d 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp @@ -200,7 +200,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms char ps_rgba6_to_rgb8[] = "uniform sampler2DRect samp9;\n" - "COLOROUT(ocol0)\n" + "out vec4 ocol0;\n" "void main()\n" "{\n" " ivec4 src6 = ivec4(round(texture2DRect(samp9, gl_FragCoord.xy) * 63.f));\n" @@ -214,7 +214,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms char ps_rgb8_to_rgba6[] = "uniform sampler2DRect samp9;\n" - "COLOROUT(ocol0)\n" + "out vec4 ocol0;\n" "void main()\n" "{\n" " ivec4 src8 = ivec4(round(texture2DRect(samp9, gl_FragCoord.xy) * 255.f));\n" @@ -226,13 +226,8 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms " ocol0 = float4(dst6) / 63.f;\n" "}"; - if(g_ogl_config.eSupportedGLSLVersion != GLSL_120) - { - // HACK: This shaders aren't glsl120 compatible as glsl120 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); } @@ -364,18 +359,6 @@ GLuint FramebufferManager::ResolveAndGetDepthTarget(const EFBRectangle &source_r 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; - } - g_renderer->ResetAPIState(); GLuint src_texture = 0; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp index 5cc9ec36cd..f27f56d701 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp @@ -524,10 +524,10 @@ void ProgramShaderCache::CreateHeader ( void ) "%s\n" // early-z "\n"// A few required defines and ones that will make our lives a lot easier - "#define ATTRIN %s\n" - "#define ATTROUT %s\n" - "#define VARYIN %s\n" - "#define VARYOUT %s\n" + "#define ATTRIN in\n" + "#define ATTROUT out\n" + "#define VARYIN %s in\n" + "#define VARYOUT %s out\n" // Silly differences "#define float2 vec2\n" @@ -538,35 +538,18 @@ void ProgramShaderCache::CreateHeader ( void ) "#define frac fract\n" "#define lerp mix\n" - // glsl 120 hack - "%s\n" - "%s\n" - "%s\n" - "%s\n" - "%s\n" - "#define COLOROUT(name) %s\n" - // texture2d hack "%s\n" "%s\n" "%s\n" - , v==GLSLES3 ? "300 es" : v==GLSL_120 ? "120" : v==GLSL_130 ? "130" : v==GLSL_140 ? "140" : "150" + , v==GLSLES3 ? "300 es" : v==GLSL_130 ? "130" : v==GLSL_140 ? "140" : "150" , v==GLSLES3 ? "precision highp float;" : "" , 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==GLSL_120 ? "attribute" : "in" - , v==GLSL_120 ? "attribute" : "out" - , v==GLSL_120 ? "varying" : DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "in" : "centroid in" - , v==GLSL_120 ? "varying" : DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "out" : "centroid out" - - , v==GLSL_120 ? "#define texture texture2D" : "" - , v==GLSL_120 ? "#define round(x) floor((x)+0.5f)" : "" - , v==GLSL_120 ? "#define out " : "" - , v==GLSL_120 ? "#define ocol0 gl_FragColor" : "" - , v==GLSL_120 ? "#define ocol1 gl_FragColor" : "" //TODO: implement dual source blend - , v==GLSL_120 ? "" : "out vec4 name;" + , DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "" : "centroid" + , DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "" : "centroid" , 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)" : "" diff --git a/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp b/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp index 9e46a5eb86..658b72da1c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/RasterFont.cpp @@ -127,7 +127,7 @@ static const char *s_fragmentShaderSrc = "uniform sampler2D samp8;\n" "uniform vec4 color;\n" "VARYIN vec2 uv0;\n" - "COLOROUT(ocol0)\n" + "out vec4 ocol0;\n" "void main(void) {\n" " ocol0 = texture(samp8,uv0) * color;\n" "}\n"; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 352058c26f..3e5862dbe9 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -495,19 +495,13 @@ Renderer::Renderer() g_ogl_config.bSupportSampleShading = GLEW_ARB_sample_shading; g_ogl_config.bSupportOGL31 = GLEW_VERSION_3_1; - if(strstr(g_ogl_config.glsl_version, "1.00") || strstr(g_ogl_config.glsl_version, "1.10")) + if(strstr(g_ogl_config.glsl_version, "1.00") || strstr(g_ogl_config.glsl_version, "1.10") || strstr(g_ogl_config.glsl_version, "1.20")) { - PanicAlert("GPU: OGL ERROR: Need at least GLSL 1.20\n" - "GPU: Does your video card support OpenGL 2.1?\n" + PanicAlert("GPU: OGL ERROR: Need at least GLSL 1.30\n" + "GPU: Does your video card support OpenGL 3.0?\n" "GPU: Your driver supports GLSL %s", g_ogl_config.glsl_version); bSuccess = false; } - else if(strstr(g_ogl_config.glsl_version, "1.20")) - { - g_ogl_config.eSupportedGLSLVersion = GLSL_120; - g_Config.backend_info.bSupportsDualSourceBlend = false; //TODO: implement dual source blend - g_Config.backend_info.bSupportsEarlyZ = false; // layout keyword is only supported on glsl150+ - } else if(strstr(g_ogl_config.glsl_version, "1.30")) { g_ogl_config.eSupportedGLSLVersion = GLSL_130; @@ -669,7 +663,7 @@ void Renderer::Init() " c = vec4(color0, 1.0f);\n" "}\n", "VARYIN vec4 c;\n" - "COLOROUT(ocol0)\n" + "out vec4 ocol0;\n" "void main(void) {\n" " ocol0 = c;\n" "}\n"); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.h b/Source/Plugins/Plugin_VideoOGL/Src/Render.h index a570faab85..7f7ae6233c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.h @@ -10,7 +10,6 @@ namespace OGL void ClearEFBCache(); enum GLSL_VERSION { - GLSL_120, GLSL_130, GLSL_140, GLSL_150, // and above diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp index da3a4b33e9..06480df99a 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp @@ -411,7 +411,7 @@ TextureCache::TextureCache() "uniform sampler2DRect samp9;\n" "uniform vec4 colmat[7];\n" "VARYIN vec2 uv0;\n" - "COLOROUT(ocol0)\n" + "out vec4 ocol0;\n" "\n" "void main(){\n" " vec4 texcol = texture2DRect(samp9, uv0);\n" @@ -423,7 +423,7 @@ TextureCache::TextureCache() "uniform sampler2DRect samp9;\n" "uniform vec4 colmat[5];\n" "VARYIN vec2 uv0;\n" - "COLOROUT(ocol0)\n" + "out vec4 ocol0;\n" "\n" "void main(){\n" " vec4 texcol = texture2DRect(samp9, uv0);\n" diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp index 3ebc542a70..d912df12a7 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp @@ -68,7 +68,7 @@ void CreatePrograms() const char *FProgramRgbToYuyv = "uniform sampler2DRect samp9;\n" "VARYIN vec2 uv0;\n" - "COLOROUT(ocol0)\n" + "out vec4 ocol0;\n" "void main()\n" "{\n" " vec3 c0 = texture2DRect(samp9, uv0).rgb;\n" @@ -84,7 +84,7 @@ void CreatePrograms() const char *FProgramYuyvToRgb = "uniform sampler2DRect samp9;\n" "VARYIN vec2 uv0;\n" - "COLOROUT(ocol0)\n" + "out vec4 ocol0;\n" "void main()\n" "{\n" " vec4 c0 = texture2DRect(samp9, uv0).rgba;\n" |
