texture_pass: Fix wrong descriptor used with rectangle texture patching

This commit is contained in:
GPUCode 2023-12-08 00:21:11 +02:00
parent 8a79dd2d6c
commit a7caa07fdd

View File

@ -538,14 +538,6 @@ void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo
flags.type.Assign(ReadTextureType(env, cbuf)); flags.type.Assign(ReadTextureType(env, cbuf));
inst->SetFlags(flags); inst->SetFlags(flags);
break; break;
case IR::Opcode::ImageSampleImplicitLod:
if (flags.type != TextureType::Color2D) {
break;
}
if (ReadTextureType(env, cbuf) == TextureType::Color2DRect) {
PatchImageSampleImplicitLod(*texture_inst.block, *texture_inst.inst);
}
break;
case IR::Opcode::ImageFetch: case IR::Opcode::ImageFetch:
if (flags.type == TextureType::Color2D || flags.type == TextureType::Color2DRect || if (flags.type == TextureType::Color2D || flags.type == TextureType::Color2DRect ||
flags.type == TextureType::ColorArray2D) { flags.type == TextureType::ColorArray2D) {
@ -662,6 +654,19 @@ void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo
PatchTexelFetch(*texture_inst.block, *texture_inst.inst, pixel_format); PatchTexelFetch(*texture_inst.block, *texture_inst.inst, pixel_format);
} }
} }
switch (inst->GetOpcode()) {
case IR::Opcode::ImageSampleImplicitLod:
if (flags.type != TextureType::Color2D) {
break;
}
if (ReadTextureType(env, cbuf) == TextureType::Color2DRect) {
PatchImageSampleImplicitLod(*texture_inst.block, *texture_inst.inst);
}
break;
default:
break;
}
} }
} }