mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 05:45:38 +00:00
GPU: Always calculate draw rect
Stops postfx shaders that depend on the draw rect going into NaN territory.
This commit is contained in:
parent
ff7bfaaadb
commit
d63ae8718f
|
@ -1933,9 +1933,7 @@ bool GPU::PresentDisplay()
|
||||||
{
|
{
|
||||||
FlushRender();
|
FlushRender();
|
||||||
|
|
||||||
const GSVector4i draw_rect = m_display_texture ?
|
const GSVector4i draw_rect = CalculateDrawRect(g_gpu_device->GetWindowWidth(), g_gpu_device->GetWindowHeight());
|
||||||
CalculateDrawRect(g_gpu_device->GetWindowWidth(), g_gpu_device->GetWindowHeight()) :
|
|
||||||
GSVector4i::zero();
|
|
||||||
return RenderDisplay(nullptr, draw_rect, !g_settings.debugging.show_vram);
|
return RenderDisplay(nullptr, draw_rect, !g_settings.debugging.show_vram);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2070,10 +2068,12 @@ bool GPU::RenderDisplay(GPUTexture* target, const GSVector4i draw_rect, bool pos
|
||||||
DebugAssert(!g_settings.debugging.show_vram);
|
DebugAssert(!g_settings.debugging.show_vram);
|
||||||
|
|
||||||
// "original size" in postfx includes padding.
|
// "original size" in postfx includes padding.
|
||||||
const float upscale_x =
|
const float upscale_x = m_display_texture ? static_cast<float>(m_display_texture_view_width) /
|
||||||
static_cast<float>(m_display_texture_view_width) / static_cast<float>(m_crtc_state.display_vram_width);
|
static_cast<float>(m_crtc_state.display_vram_width) :
|
||||||
const float upscale_y =
|
1.0f;
|
||||||
static_cast<float>(m_display_texture_view_height) / static_cast<float>(m_crtc_state.display_vram_height);
|
const float upscale_y = m_display_texture ? static_cast<float>(m_display_texture_view_height) /
|
||||||
|
static_cast<float>(m_crtc_state.display_vram_height) :
|
||||||
|
1.0f;
|
||||||
const s32 orig_width = static_cast<s32>(std::ceil(static_cast<float>(m_crtc_state.display_width) * upscale_x));
|
const s32 orig_width = static_cast<s32>(std::ceil(static_cast<float>(m_crtc_state.display_width) * upscale_x));
|
||||||
const s32 orig_height = static_cast<s32>(std::ceil(static_cast<float>(m_crtc_state.display_height) * upscale_y));
|
const s32 orig_height = static_cast<s32>(std::ceil(static_cast<float>(m_crtc_state.display_height) * upscale_y));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue