PostProcessing: Add native width/height inputs

Available in GLSL as GetNativeSize(), GetUpscaleMultiplier(), and in
reshade as native_width/native_height/upscale_multiplier.

GetPaddedOriginalSize() is now deprecated, as it does not make since
since the postfx shader runs with a window-sized off-screen target as an
input, not the internal render texture.
This commit is contained in:
Stenzek
2024-06-11 14:04:43 +10:00
parent bac2ac0151
commit 354b250642
8 changed files with 107 additions and 67 deletions

View File

@ -24,7 +24,8 @@ public:
bool ResizeOutput(GPUTexture::Format format, u32 width, u32 height) override;
bool CompilePipeline(GPUTexture::Format format, u32 width, u32 height, ProgressCallback* progress) override;
bool Apply(GPUTexture* input, GPUTexture* final_target, s32 final_left, s32 final_top, s32 final_width,
s32 final_height, s32 orig_width, s32 orig_height, u32 target_width, u32 target_height) override;
s32 final_height, s32 orig_width, s32 orig_height, s32 native_width, s32 native_height, u32 target_width,
u32 target_height) override;
private:
struct CommonUniforms
@ -36,9 +37,9 @@ private:
float window_resolution[2];
float rcp_window_resolution[2];
float original_size[2];
float padded_original_size[2];
float native_size[2];
float upscale_multiplier;
float time;
float padding;
};
void LoadOptions();
@ -46,7 +47,8 @@ private:
u32 GetUniformsSize() const;
void FillUniformBuffer(void* buffer, u32 texture_width, s32 texture_height, s32 texture_view_x, s32 texture_view_y,
s32 texture_view_width, s32 texture_view_height, u32 window_width, u32 window_height,
s32 original_width, s32 original_height, float time) const;
s32 original_width, s32 original_height, s32 native_width, s32 native_height,
float time) const;
std::string m_code;