PostProcessing: Avoid creating zero-sized intermediate targets

This commit is contained in:
Stenzek committed 2026-01-19 15:05:46 +10:00
1 parent 962454bbf4
commit 4800a4e552
2 files changed
+8 -6

No files matched your search

+2 -2
View File
@@ -1586,8 +1586,8 @@ bool PostProcessing::ReShadeFXShader::ResizeTargets(u32 source_width, u32 source
if (!tex.render_target)
continue;
const u32 t_width = (tex.render_target_width > 0) ? tex.render_target_width : target_width;
const u32 t_height = (tex.render_target_height > 0) ? tex.render_target_height : target_height;
const u32 t_width = (tex.render_target_width > 0) ? tex.render_target_width : std::max<u32>(target_width, 1);
const u32 t_height = (tex.render_target_height > 0) ? tex.render_target_height : std::max<u32>(target_height, 1);
if (!g_gpu_device->ResizeTexture(&tex.texture, t_width, t_height, GPUTexture::Type::RenderTarget, tex.format,
tex.storage_access ? GPUTexture::Flags::AllowBindAsImage : GPUTexture::Flags::None,
false, error))
+6 -4
View File
@@ -1996,10 +1996,12 @@ bool PostProcessing::SlangShader::ResizeTargets(u32 source_width, u32 source_hei
if (pass.output_texture_id < 0)
continue;
const u32 tex_width =
apply_scale(pass.output_scale[0].first, pass.output_scale[0].second, prev_width, viewport_width, source_width);
const u32 tex_height =
apply_scale(pass.output_scale[1].first, pass.output_scale[1].second, prev_height, viewport_height, source_height);
const u32 tex_width = std::max<u32>(
apply_scale(pass.output_scale[0].first, pass.output_scale[0].second, prev_width, viewport_width, source_width),
1);
const u32 tex_height = std::max<u32>(
apply_scale(pass.output_scale[1].first, pass.output_scale[1].second, prev_height, viewport_height, source_height),
1);
// Source for the next pass is the previous pass's output.
prev_width = tex_width;