GPU: Use full display rect for postfx calculations

This commit is contained in:
Stenzek
2024-08-06 17:38:08 +10:00
parent 4f16cb61b4
commit b2ca23e9da
3 changed files with 45 additions and 32 deletions

View File

@ -4,8 +4,8 @@
#pragma once
#include "gpu_types.h"
#include "timers.h"
#include "types.h"
#include "timing_event.h"
#include "types.h"
#include "util/gpu_texture.h"
@ -207,14 +207,16 @@ public:
virtual void FlushRender() = 0;
/// Helper function for computing the draw rectangle in a larger window.
GSVector4i CalculateDrawRect(s32 window_width, s32 window_height, bool apply_rotation, bool apply_aspect_ratio) const;
void CalculateDrawRect(s32 window_width, s32 window_height, bool apply_rotation, bool apply_aspect_ratio,
GSVector4i* display_rect, GSVector4i* draw_rect) const;
/// Helper function to save current display texture to PNG.
bool WriteDisplayTextureToFile(std::string filename, bool compress_on_thread = false);
/// Renders the display, optionally with postprocessing to the specified image.
bool RenderScreenshotToBuffer(u32 width, u32 height, const GSVector4i draw_rect, bool postfx,
std::vector<u32>* out_pixels, u32* out_stride, GPUTexture::Format* out_format);
bool RenderScreenshotToBuffer(u32 width, u32 height, const GSVector4i display_rect, const GSVector4i draw_rect,
bool postfx, std::vector<u32>* out_pixels, u32* out_stride,
GPUTexture::Format* out_format);
/// Helper function to save screenshot to PNG.
bool RenderScreenshotToFile(std::string filename, DisplayScreenshotMode mode, u8 quality, bool compress_on_thread,
@ -343,8 +345,7 @@ protected:
AddCommandTicks(pixels);
}
ALWAYS_INLINE_RELEASE void AddDrawRectangleTicks(const GSVector4i clamped_rect, bool textured,
bool semitransparent)
ALWAYS_INLINE_RELEASE void AddDrawRectangleTicks(const GSVector4i clamped_rect, bool textured, bool semitransparent)
{
u32 drawn_width = clamped_rect.width();
u32 drawn_height = clamped_rect.height();
@ -591,7 +592,7 @@ protected:
void SetDisplayTexture(GPUTexture* texture, GPUTexture* depth_texture, s32 view_x, s32 view_y, s32 view_width,
s32 view_height);
bool RenderDisplay(GPUTexture* target, const GSVector4i draw_rect, bool postfx);
bool RenderDisplay(GPUTexture* target, const GSVector4i display_rect, const GSVector4i draw_rect, bool postfx);
bool Deinterlace(u32 field, u32 line_skip);
bool DeinterlaceExtractField(u32 dst_bufidx, GPUTexture* src, u32 x, u32 y, u32 width, u32 height, u32 line_skip);