mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 13:48:40 +00:00
Implement shader resource tables (#1165)
* Implement shader resource tables * fix after rebase + squash * address some review comments * fix pipeline_common * cleanup debug stuff * switch to using single codegenerator
This commit is contained in:
@@ -10,6 +10,10 @@ static constexpr u32 SQ_SRC_LITERAL = 0xFF;
|
||||
void Translator::EmitScalarMemory(const GcnInst& inst) {
|
||||
switch (inst.opcode) {
|
||||
// SMRD
|
||||
case Opcode::S_LOAD_DWORD:
|
||||
return S_LOAD_DWORD(1, inst);
|
||||
case Opcode::S_LOAD_DWORDX2:
|
||||
return S_LOAD_DWORD(2, inst);
|
||||
case Opcode::S_LOAD_DWORDX4:
|
||||
return S_LOAD_DWORD(4, inst);
|
||||
case Opcode::S_LOAD_DWORDX8:
|
||||
|
||||
@@ -388,7 +388,7 @@ void Translator::EmitFetch(const GcnInst& inst) {
|
||||
IR::VectorReg dst_reg{attrib.dest_vgpr};
|
||||
|
||||
// Read the V# of the attribute to figure out component number and type.
|
||||
const auto buffer = info.ReadUd<AmdGpu::Buffer>(attrib.sgpr_base, attrib.dword_offset);
|
||||
const auto buffer = info.ReadUdReg<AmdGpu::Buffer>(attrib.sgpr_base, attrib.dword_offset);
|
||||
for (u32 i = 0; i < 4; i++) {
|
||||
const IR::F32 comp = [&] {
|
||||
switch (buffer.GetSwizzle(i)) {
|
||||
@@ -418,8 +418,7 @@ void Translator::EmitFetch(const GcnInst& inst) {
|
||||
if (step_rate == Info::VsInput::OverStepRate0 ||
|
||||
step_rate == Info::VsInput::OverStepRate1) {
|
||||
info.buffers.push_back({
|
||||
.sgpr_base = attrib.sgpr_base,
|
||||
.dword_offset = attrib.dword_offset,
|
||||
.sharp_idx = info.srt_info.ReserveSharp(attrib.sgpr_base, attrib.dword_offset, 4),
|
||||
.used_types = IR::Type::F32,
|
||||
.is_instance_data = true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user