diff options
author | Fernando S <fsahmkow27@gmail.com> | 2022-08-31 10:40:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-31 10:40:45 +0200 |
commit | a83a5d2e4c8932df864dd4cea2b04d87a12c8760 (patch) | |
tree | 53bd0ce10e965110c7811bd227443fd51e054eff /src/shader_recompiler/ir_opt/rescaling_pass.cpp | |
parent | c881a67dbaa3efa962e60e3e60dd59371d15b6bb (diff) | |
parent | b2a6dde4380a5526e9d936f92a9e3d6ad9393bfa (diff) |
Merge pull request #8752 from vonchenplus/rectangle_texture
video_code: support rectangle texture
Diffstat (limited to 'src/shader_recompiler/ir_opt/rescaling_pass.cpp')
-rw-r--r-- | src/shader_recompiler/ir_opt/rescaling_pass.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/shader_recompiler/ir_opt/rescaling_pass.cpp b/src/shader_recompiler/ir_opt/rescaling_pass.cpp index 0d5f2e4d89..9198fa5f2e 100644 --- a/src/shader_recompiler/ir_opt/rescaling_pass.cpp +++ b/src/shader_recompiler/ir_opt/rescaling_pass.cpp @@ -16,6 +16,7 @@ namespace { switch (type) { case TextureType::Color2D: case TextureType::ColorArray2D: + case TextureType::Color2DRect: return true; case TextureType::Color1D: case TextureType::ColorArray1D: @@ -132,7 +133,8 @@ void PatchImageQueryDimensions(IR::Block& block, IR::Inst& inst) { const IR::U1 is_scaled{ir.IsTextureScaled(ir.Imm32(info.descriptor_index))}; switch (info.type) { case TextureType::Color2D: - case TextureType::ColorArray2D: { + case TextureType::ColorArray2D: + case TextureType::Color2DRect: { const IR::Value new_inst{&*block.PrependNewInst(it, inst)}; const IR::U32 width{DownScale(ir, is_scaled, IR::U32{ir.CompositeExtract(new_inst, 0)})}; const IR::U32 height{DownScale(ir, is_scaled, IR::U32{ir.CompositeExtract(new_inst, 1)})}; @@ -163,6 +165,7 @@ void ScaleIntegerComposite(IR::IREmitter& ir, IR::Inst& inst, const IR::U1& is_s const IR::U32 y{Scale(ir, is_scaled, IR::U32{ir.CompositeExtract(composite, 1)})}; switch (info.type) { case TextureType::Color2D: + case TextureType::Color2DRect: inst.SetArg(index, ir.CompositeConstruct(x, y)); break; case TextureType::ColorArray2D: { @@ -193,6 +196,7 @@ void ScaleIntegerOffsetComposite(IR::IREmitter& ir, IR::Inst& inst, const IR::U1 switch (info.type) { case TextureType::ColorArray2D: case TextureType::Color2D: + case TextureType::Color2DRect: inst.SetArg(index, ir.CompositeConstruct(x, y)); break; case TextureType::Color1D: @@ -216,6 +220,7 @@ void SubScaleCoord(IR::IREmitter& ir, IR::Inst& inst, const IR::U1& is_scaled) { const IR::U32 scaled_y{SubScale(ir, is_scaled, coord_y, IR::Attribute::PositionY)}; switch (info.type) { case TextureType::Color2D: + case TextureType::Color2DRect: inst.SetArg(1, ir.CompositeConstruct(scaled_x, scaled_y)); break; case TextureType::ColorArray2D: { |