diff --git a/src/duckstation-qt/d3d11displaywindow.cpp b/src/duckstation-qt/d3d11displaywindow.cpp index 28dafaaed..87c397d87 100644 --- a/src/duckstation-qt/d3d11displaywindow.cpp +++ b/src/duckstation-qt/d3d11displaywindow.cpp @@ -418,8 +418,8 @@ void D3D11DisplayWindow::renderDisplay() 0, 1, m_display_linear_filtering ? m_linear_sampler.GetAddressOf() : m_point_sampler.GetAddressOf()); const float uniforms[4] = { - static_cast(m_display_texture_view_x) / static_cast(m_display_texture_width), - static_cast(m_display_texture_view_y) / static_cast(m_display_texture_height), + (static_cast(m_display_texture_view_x) + 0.25f) / static_cast(m_display_texture_width), + (static_cast(m_display_texture_view_y) + 0.25f) / static_cast(m_display_texture_height), (static_cast(m_display_texture_view_width) - 0.5f) / static_cast(m_display_texture_width), (static_cast(m_display_texture_view_height) - 0.5f) / static_cast(m_display_texture_height)}; const auto map = m_display_uniform_buffer.Map(m_context.Get(), sizeof(uniforms), sizeof(uniforms)); diff --git a/src/duckstation-qt/opengldisplaywindow.cpp b/src/duckstation-qt/opengldisplaywindow.cpp index be62ff1ea..e83bec793 100644 --- a/src/duckstation-qt/opengldisplaywindow.cpp +++ b/src/duckstation-qt/opengldisplaywindow.cpp @@ -475,10 +475,10 @@ void OpenGLDisplayWindow::renderDisplay() glDepthMask(GL_FALSE); m_display_program.Bind(); m_display_program.Uniform4f( - 0, static_cast(m_display_texture_view_x) / static_cast(m_display_texture_width), - static_cast(m_display_texture_view_y) / static_cast(m_display_texture_height), + 0, (static_cast(m_display_texture_view_x) + 0.25f) / static_cast(m_display_texture_width), + (static_cast(m_display_texture_view_y) - 0.25f) / static_cast(m_display_texture_height), (static_cast(m_display_texture_view_width) - 0.5f) / static_cast(m_display_texture_width), - (static_cast(m_display_texture_view_height) - 0.5f) / static_cast(m_display_texture_height)); + (static_cast(m_display_texture_view_height) + 0.5f) / static_cast(m_display_texture_height)); glBindTexture(GL_TEXTURE_2D, static_cast(reinterpret_cast(m_display_texture_handle))); glBindSampler(0, m_display_linear_filtering ? m_display_linear_sampler : m_display_nearest_sampler); glBindVertexArray(m_display_vao); diff --git a/src/duckstation-sdl/d3d11_host_display.cpp b/src/duckstation-sdl/d3d11_host_display.cpp index 1ac4792f7..e12a7a8a0 100644 --- a/src/duckstation-sdl/d3d11_host_display.cpp +++ b/src/duckstation-sdl/d3d11_host_display.cpp @@ -395,8 +395,8 @@ void D3D11HostDisplay::RenderDisplay() 0, 1, m_display_linear_filtering ? m_linear_sampler.GetAddressOf() : m_point_sampler.GetAddressOf()); const float uniforms[4] = { - static_cast(m_display_texture_view_x) / static_cast(m_display_texture_width), - static_cast(m_display_texture_view_y) / static_cast(m_display_texture_height), + (static_cast(m_display_texture_view_x) + 0.25f) / static_cast(m_display_texture_width), + (static_cast(m_display_texture_view_y) + 0.25f) / static_cast(m_display_texture_height), (static_cast(m_display_texture_view_width) - 0.5f) / static_cast(m_display_texture_width), (static_cast(m_display_texture_view_height) - 0.5f) / static_cast(m_display_texture_height)}; const auto map = m_display_uniform_buffer.Map(m_context.Get(), sizeof(uniforms), sizeof(uniforms)); diff --git a/src/duckstation-sdl/opengl_host_display.cpp b/src/duckstation-sdl/opengl_host_display.cpp index 516f21ed8..cb39ca9e6 100644 --- a/src/duckstation-sdl/opengl_host_display.cpp +++ b/src/duckstation-sdl/opengl_host_display.cpp @@ -386,10 +386,10 @@ void OpenGLHostDisplay::RenderDisplay() glDepthMask(GL_FALSE); m_display_program.Bind(); m_display_program.Uniform4f( - 0, static_cast(m_display_texture_view_x) / static_cast(m_display_texture_width), - static_cast(m_display_texture_view_y) / static_cast(m_display_texture_height), + 0, (static_cast(m_display_texture_view_x) + 0.25f) / static_cast(m_display_texture_width), + (static_cast(m_display_texture_view_y) - 0.25f) / static_cast(m_display_texture_height), (static_cast(m_display_texture_view_width) - 0.5f) / static_cast(m_display_texture_width), - (static_cast(m_display_texture_view_height) - 0.5f) / static_cast(m_display_texture_height)); + (static_cast(m_display_texture_view_height) + 0.5f) / static_cast(m_display_texture_height)); glBindTexture(GL_TEXTURE_2D, static_cast(reinterpret_cast(m_display_texture_handle))); glBindSampler(0, m_display_linear_filtering ? m_display_linear_sampler : m_display_nearest_sampler); glBindVertexArray(m_display_vao);