shader_recompiler: Rework image read/write emit. (#1819)

This commit is contained in:
squidbus 2024-12-24 15:13:32 -08:00 committed by GitHub
parent 95638d5ca5
commit a89c29c2ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 88 additions and 88 deletions

View file

@ -420,13 +420,13 @@ void Translator::IMAGE_LOAD(bool has_mip, const GcnInst& inst) {
IR::TextureInstInfo info{};
info.has_lod.Assign(has_mip);
const IR::Value texel = ir.ImageFetch(handle, body, {}, {}, {}, info);
const IR::Value texel = ir.ImageRead(handle, body, {}, {}, info);
for (u32 i = 0; i < 4; i++) {
if (((mimg.dmask >> i) & 1) == 0) {
continue;
}
IR::F32 value = IR::F32{ir.CompositeExtract(texel, i)};
IR::U32 value = IR::U32{ir.CompositeExtract(texel, i)};
ir.SetVectorReg(dest_reg++, value);
}
}
@ -454,7 +454,7 @@ void Translator::IMAGE_STORE(bool has_mip, const GcnInst& inst) {
comps.push_back(ir.GetVectorReg<IR::F32>(data_reg++));
}
const IR::Value value = ir.CompositeConstruct(comps[0], comps[1], comps[2], comps[3]);
ir.ImageWrite(handle, body, {}, value, info);
ir.ImageWrite(handle, body, {}, {}, value, info);
}
void Translator::IMAGE_GET_RESINFO(const GcnInst& inst) {