From 8d52765f40f64b32774c9878d082fe509f8aa8af Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 12 May 2016 22:22:24 -0400 Subject: [PATCH] Realised why new shaders weren't taking. Very negligibly decreased Atari drawing cost. --- Machines/Atari2600/Atari2600.cpp | 8 ++++---- Outputs/CRT/Internals/CRTOpenGL.cpp | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Machines/Atari2600/Atari2600.cpp b/Machines/Atari2600/Atari2600.cpp index d41f3c8cc..5615bcebb 100644 --- a/Machines/Atari2600/Atari2600.cpp +++ b/Machines/Atari2600/Atari2600.cpp @@ -36,11 +36,11 @@ void Machine::setup_output(float aspect_ratio) "float composite_sample(usampler2D texID, vec2 coordinate, vec2 iCoordinate, float phase, float amplitude)" "{" "uint c = texture(texID, coordinate).r;" - "uint y = (c >> 1) & 7u;" + "uint y = c & 14u;" "uint iPhase = (c >> 4);" "float phaseOffset = 6.283185308 * float(iPhase + 13u) / 14.0;" - "return (float(y) / 7.0) * (1.0 - amplitude) + step(1, iPhase) * amplitude * cos(phase + phaseOffset);" + "return (float(y) / 14.0) * (1.0 - amplitude) + step(1, iPhase) * amplitude * cos(phase + phaseOffset);" "}"); _crt->set_output_device(Outputs::CRT::Television); } @@ -52,11 +52,11 @@ void Machine::switch_region() "float composite_sample(usampler2D texID, vec2 coordinate, vec2 iCoordinate, float phase, float amplitude)" "{" "uint c = texture(texID, coordinate).r;" - "uint y = (c >> 1) & 7u;" + "uint y = c & 14u;" "uint iPhase = (c >> 4);" "float phaseOffset = (0.5 + 2.0 * (float(iPhase&1u) - 0.5) * (float((iPhase >> 1) + (iPhase&1u)) / 14.0));" - "return (float(y) / 7.0) * (1.0 - amplitude) + step(4, (iPhase + 2u) & 15u) * amplitude * cos(phase + 6.283185308 * phaseOffset);" + "return (float(y) / 14.0) * (1.0 - amplitude) + step(4, (iPhase + 2u) & 15u) * amplitude * cos(phase + 6.283185308 * phaseOffset);" "}"); _crt->set_new_timing(228, 312, Outputs::CRT::ColourSpace::YUV, 228, 1); } diff --git a/Outputs/CRT/Internals/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp index 7132eb6fd..94df2e3b6 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.cpp +++ b/Outputs/CRT/Internals/CRTOpenGL.cpp @@ -343,6 +343,7 @@ void OpenGLOutputBuilder::reset_all_OpenGL_state() rgb_filter_shader_program = nullptr; output_shader_program = nullptr; framebuffer = nullptr; + _last_output_width = _last_output_height = 0; } void OpenGLOutputBuilder::set_openGL_context_will_change(bool should_delete_resources)