summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt/rescaling_pass.cpp
diff options
context:
space:
mode:
authorFernando S <fsahmkow27@gmail.com>2022-08-31 10:40:45 +0200
committerGitHub <noreply@github.com>2022-08-31 10:40:45 +0200
commita83a5d2e4c8932df864dd4cea2b04d87a12c8760 (patch)
tree53bd0ce10e965110c7811bd227443fd51e054eff /src/shader_recompiler/ir_opt/rescaling_pass.cpp
parentMerge pull request #8809 from german77/finally_is_fixed (diff)
parentvideo_code: support rectangle texture (diff)
downloadyuzu-a83a5d2e4c8932df864dd4cea2b04d87a12c8760.tar
yuzu-a83a5d2e4c8932df864dd4cea2b04d87a12c8760.tar.gz
yuzu-a83a5d2e4c8932df864dd4cea2b04d87a12c8760.tar.bz2
yuzu-a83a5d2e4c8932df864dd4cea2b04d87a12c8760.tar.lz
yuzu-a83a5d2e4c8932df864dd4cea2b04d87a12c8760.tar.xz
yuzu-a83a5d2e4c8932df864dd4cea2b04d87a12c8760.tar.zst
yuzu-a83a5d2e4c8932df864dd4cea2b04d87a12c8760.zip
Diffstat (limited to 'src/shader_recompiler/ir_opt/rescaling_pass.cpp')
-rw-r--r--src/shader_recompiler/ir_opt/rescaling_pass.cpp7
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 0d5f2e4d8..9198fa5f2 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: {