V_NOP | PfpSyncMe | S_CMPK_EQ_U32 (#426)

* V_NOP

V_NOP = Do nothing

* PfpSyncMe

PfpSyncMe ensures that all previous commands are completed before continuing.
'break' should be enough for now

* S_CMPK_EQ_U32

S_CMPK_EQ_U32
SCC = (D.u == SIMM16)

* S_CMPK_EQ_U32

* OperandField::Undefined:

* Update translate.cpp

remove  OperandField::Undefined:

* Update image_view.cpp

[Render.Vulkan] <Error> image_view.cpp:ImageViewInfo:109: Storage image (num_comps = 4) requires swizzling [BGRA]
format 43 dst_sel 3886

* Update liverpool_to_vk.cpp

* S_CMPK_EQ_U32

* S_CMPK_EQ_U32
This commit is contained in:
DanielSvoboda 2024-08-25 17:07:46 -03:00 committed by GitHub
parent b687ae5e34
commit 2a737d0800
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 19 additions and 0 deletions

View File

@ -96,6 +96,8 @@ void Translator::EmitScalarAlu(const GcnInst& inst) {
return S_MAX_U32(inst);
case Opcode::S_WQM_B64:
break;
case Opcode::S_CMPK_EQ_U32:
return S_CMPK_EQ_U32(inst);
default:
LogMissingOpcode(inst);
}
@ -468,4 +470,11 @@ void Translator::S_MIN_U32(const GcnInst& inst) {
ir.SetScc(ir.IEqual(result, src0));
}
void Translator::S_CMPK_EQ_U32(const GcnInst& inst) {
const s32 simm16 = inst.control.sopk.simm;
const IR::U32 src0{GetSrc(inst.src[0])};
const IR::U32 src1{ir.Imm32(simm16)};
ir.SetScc(ir.IEqual(src0, src1));
}
} // namespace Shader::Gcn

View File

@ -98,6 +98,7 @@ public:
void S_ADDK_I32(const GcnInst& inst);
void S_MAX_U32(const GcnInst& inst);
void S_MIN_U32(const GcnInst& inst);
void S_CMPK_EQ_U32(const GcnInst& inst);
// Scalar Memory
void S_LOAD_DWORD(int num_dwords, const GcnInst& inst);

View File

@ -307,6 +307,8 @@ void Translator::EmitVectorAlu(const GcnInst& inst) {
return V_MBCNT_U32_B32(true, inst);
case Opcode::V_MBCNT_HI_U32_B32:
return V_MBCNT_U32_B32(false, inst);
case Opcode::V_NOP:
return;
default:
LogMissingOpcode(inst);
}

View File

@ -455,6 +455,9 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
}
break;
}
case PM4ItOpcode::PfpSyncMe: {
break;
}
default:
UNREACHABLE_MSG("Unknown PM4 type 3 opcode {:#x} with count {}",
static_cast<u32>(opcode), count);

View File

@ -320,6 +320,7 @@ std::span<const vk::Format> GetAllFormats() {
vk::Format::eR8G8Uint,
vk::Format::eR8G8Unorm,
vk::Format::eR8Sint,
vk::Format::eR8Snorm,
vk::Format::eR8Uint,
vk::Format::eR8Unorm,
vk::Format::eR8Srgb,

View File

@ -59,6 +59,9 @@ vk::Format TrySwizzleFormat(vk::Format format, u32 dst_sel) {
if (format == vk::Format::eR8G8B8A8Unorm && dst_sel == 0b111100101110) {
return vk::Format::eB8G8R8A8Unorm;
}
if (format == vk::Format::eR8G8B8A8Srgb && dst_sel == 0b111100101110) {
return vk::Format::eB8G8R8A8Srgb;
}
return format;
}