mirror of
https://github.com/stenzek/duckstation.git
synced 2026-11-17 03:24:23 +01:00
PostProcessing: Avoid creating zero-sized intermediate targets
This commit is contained in:
2 files changed
+8
-6
No files matched your search
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user