1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Realised why new shaders weren't taking. Very negligibly decreased Atari drawing cost.

This commit is contained in:
Thomas Harte 2016-05-12 22:22:24 -04:00
parent 6d65bc9b3a
commit 8d52765f40
2 changed files with 5 additions and 4 deletions

View File

@ -36,11 +36,11 @@ void Machine::setup_output(float aspect_ratio)
"float composite_sample(usampler2D texID, vec2 coordinate, vec2 iCoordinate, float phase, float amplitude)" "float composite_sample(usampler2D texID, vec2 coordinate, vec2 iCoordinate, float phase, float amplitude)"
"{" "{"
"uint c = texture(texID, coordinate).r;" "uint c = texture(texID, coordinate).r;"
"uint y = (c >> 1) & 7u;" "uint y = c & 14u;"
"uint iPhase = (c >> 4);" "uint iPhase = (c >> 4);"
"float phaseOffset = 6.283185308 * float(iPhase + 13u) / 14.0;" "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); _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)" "float composite_sample(usampler2D texID, vec2 coordinate, vec2 iCoordinate, float phase, float amplitude)"
"{" "{"
"uint c = texture(texID, coordinate).r;" "uint c = texture(texID, coordinate).r;"
"uint y = (c >> 1) & 7u;" "uint y = c & 14u;"
"uint iPhase = (c >> 4);" "uint iPhase = (c >> 4);"
"float phaseOffset = (0.5 + 2.0 * (float(iPhase&1u) - 0.5) * (float((iPhase >> 1) + (iPhase&1u)) / 14.0));" "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); _crt->set_new_timing(228, 312, Outputs::CRT::ColourSpace::YUV, 228, 1);
} }

View File

@ -343,6 +343,7 @@ void OpenGLOutputBuilder::reset_all_OpenGL_state()
rgb_filter_shader_program = nullptr; rgb_filter_shader_program = nullptr;
output_shader_program = nullptr; output_shader_program = nullptr;
framebuffer = nullptr; framebuffer = nullptr;
_last_output_width = _last_output_height = 0;
} }
void OpenGLOutputBuilder::set_openGL_context_will_change(bool should_delete_resources) void OpenGLOutputBuilder::set_openGL_context_will_change(bool should_delete_resources)