diff --git a/src/util/postprocessing_shader_glsl.cpp b/src/util/postprocessing_shader_glsl.cpp index c3639252d..070f07bea 100644 --- a/src/util/postprocessing_shader_glsl.cpp +++ b/src/util/postprocessing_shader_glsl.cpp @@ -190,12 +190,17 @@ GPUDevice::PresentResult PostProcessing::GLSLShader::Apply(GPUTexture* input_col g_gpu_device->SetPipeline(m_pipeline.get()); g_gpu_device->SetTextureSampler(0, input_color, m_sampler.get()); - g_gpu_device->SetViewportAndScissor(final_rect); + + // need to flip the rect, since we're not drawing the entire fb + const GSVector4i real_final_rect = + g_gpu_device->UsesLowerLeftOrigin() ? g_gpu_device->FlipToLowerLeft(final_rect, target_height) : final_rect; + g_gpu_device->SetViewportAndScissor(real_final_rect); const u32 uniforms_size = GetUniformsSize(); void* uniforms = g_gpu_device->MapUniformBuffer(uniforms_size); - FillUniformBuffer(uniforms, final_rect.left, final_rect.top, final_rect.width(), final_rect.height(), target_width, - target_height, orig_width, orig_height, native_width, native_height, time); + FillUniformBuffer(uniforms, real_final_rect.left, real_final_rect.top, real_final_rect.width(), + real_final_rect.height(), target_width, target_height, orig_width, orig_height, native_width, + native_height, time); g_gpu_device->UnmapUniformBuffer(uniforms_size); g_gpu_device->Draw(3, 0); return GPUDevice::PresentResult::OK;