shader_recompiler: Normal gathers

This commit is contained in:
IndecisiveTurtle 2024-07-17 16:49:45 +03:00
parent 53fb73e95f
commit cd009cfec6
7 changed files with 38 additions and 15 deletions

View file

@ -543,7 +543,9 @@ void PatchImageInstruction(IR::Block& block, IR::Inst& inst, Info& info, Descrip
if (inst_info.has_offset) {
// The offsets are six-bit signed integers: X=[5:0], Y=[13:8], and Z=[21:16].
const u32 arg_pos = inst_info.is_depth ? 4 : 3;
const bool is_gather = inst.GetOpcode() == IR::Opcode::ImageGather ||
inst.GetOpcode() == IR::Opcode::ImageGatherDref;
const u32 arg_pos = is_gather ? 2 : (inst_info.is_depth ? 4 : 3);
const IR::Value arg = inst.Arg(arg_pos);
ASSERT_MSG(arg.Type() == IR::Type::U32, "Unexpected offset type");
const auto sign_ext = [&](u32 value) { return ir.Imm32(s32(value << 24) >> 24); };

View file

@ -39,6 +39,7 @@ union TextureInstInfo {
BitField<3, 1, u32> force_level0;
BitField<4, 1, u32> explicit_lod;
BitField<5, 1, u32> has_offset;
BitField<6, 2, u32> gather_comp;
};
union BufferInstInfo {