Merge branch 'qt-style' of https://github.com/tomboylover93/shadPS4 into qt-style

This commit is contained in:
tomboylover93 2024-12-18 21:19:22 -03:00
commit 29a363dd0d
6 changed files with 14 additions and 6 deletions

View File

@ -327,7 +327,7 @@ void PS4_SYSV_ABI sched_yield() {
std::this_thread::yield(); std::this_thread::yield();
} }
int PS4_SYSV_ABI posix_pthread_once(PthreadOnce* once_control, void (*init_routine)()) { int PS4_SYSV_ABI posix_pthread_once(PthreadOnce* once_control, void PS4_SYSV_ABI (*init_routine)()) {
for (;;) { for (;;) {
auto state = once_control->state.load(); auto state = once_control->state.load();
if (state == PthreadOnceState::Done) { if (state == PthreadOnceState::Done) {

View File

@ -696,6 +696,10 @@ spv::ImageFormat GetFormat(const AmdGpu::Image& image) {
image.GetNumberFmt() == AmdGpu::NumberFormat::Uint) { image.GetNumberFmt() == AmdGpu::NumberFormat::Uint) {
return spv::ImageFormat::R32ui; return spv::ImageFormat::R32ui;
} }
if (image.GetDataFmt() == AmdGpu::DataFormat::Format32 &&
image.GetNumberFmt() == AmdGpu::NumberFormat::Sint) {
return spv::ImageFormat::R32i;
}
if (image.GetDataFmt() == AmdGpu::DataFormat::Format32 && if (image.GetDataFmt() == AmdGpu::DataFormat::Format32 &&
image.GetNumberFmt() == AmdGpu::NumberFormat::Float) { image.GetNumberFmt() == AmdGpu::NumberFormat::Float) {
return spv::ImageFormat::R32f; return spv::ImageFormat::R32f;

View File

@ -98,8 +98,8 @@ void Translator::EmitScalarAlu(const GcnInst& inst) {
break; break;
case Opcode::S_BREV_B32: case Opcode::S_BREV_B32:
return S_BREV_B32(inst); return S_BREV_B32(inst);
case Opcode::S_BCNT1_I32_B64: case Opcode::S_BCNT1_I32_B32:
return S_BCNT1_I32_B64(inst); return S_BCNT1_I32_B32(inst);
case Opcode::S_FF1_I32_B32: case Opcode::S_FF1_I32_B32:
return S_FF1_I32_B32(inst); return S_FF1_I32_B32(inst);
case Opcode::S_AND_SAVEEXEC_B64: case Opcode::S_AND_SAVEEXEC_B64:
@ -579,7 +579,7 @@ void Translator::S_BREV_B32(const GcnInst& inst) {
SetDst(inst.dst[0], ir.BitReverse(GetSrc(inst.src[0]))); SetDst(inst.dst[0], ir.BitReverse(GetSrc(inst.src[0])));
} }
void Translator::S_BCNT1_I32_B64(const GcnInst& inst) { void Translator::S_BCNT1_I32_B32(const GcnInst& inst) {
const IR::U32 result = ir.BitCount(GetSrc(inst.src[0])); const IR::U32 result = ir.BitCount(GetSrc(inst.src[0]));
SetDst(inst.dst[0], result); SetDst(inst.dst[0], result);
ir.SetScc(ir.INotEqual(result, ir.Imm32(0))); ir.SetScc(ir.INotEqual(result, ir.Imm32(0)));
@ -602,6 +602,8 @@ void Translator::S_SAVEEXEC_B64(NegateMode negate, bool is_or, const GcnInst& in
return ir.GetVcc(); return ir.GetVcc();
case OperandField::ScalarGPR: case OperandField::ScalarGPR:
return ir.GetThreadBitScalarReg(IR::ScalarReg(inst.src[0].code)); return ir.GetThreadBitScalarReg(IR::ScalarReg(inst.src[0].code));
case OperandField::ExecLo:
return ir.GetExec();
default: default:
UNREACHABLE(); UNREACHABLE();
} }

View File

@ -439,7 +439,8 @@ void Translator::SetDst64(const InstOperand& operand, const IR::U64F64& value_ra
ir.SetVectorReg(IR::VectorReg(operand.code + 1), hi); ir.SetVectorReg(IR::VectorReg(operand.code + 1), hi);
return ir.SetVectorReg(IR::VectorReg(operand.code), lo); return ir.SetVectorReg(IR::VectorReg(operand.code), lo);
case OperandField::VccLo: case OperandField::VccLo:
UNREACHABLE(); ir.SetVccLo(lo);
return ir.SetVccHi(hi);
case OperandField::VccHi: case OperandField::VccHi:
UNREACHABLE(); UNREACHABLE();
case OperandField::M0: case OperandField::M0:

View File

@ -110,7 +110,7 @@ public:
void S_MOV_B64(const GcnInst& inst); void S_MOV_B64(const GcnInst& inst);
void S_NOT_B64(const GcnInst& inst); void S_NOT_B64(const GcnInst& inst);
void S_BREV_B32(const GcnInst& inst); void S_BREV_B32(const GcnInst& inst);
void S_BCNT1_I32_B64(const GcnInst& inst); void S_BCNT1_I32_B32(const GcnInst& inst);
void S_FF1_I32_B32(const GcnInst& inst); void S_FF1_I32_B32(const GcnInst& inst);
void S_GETPC_B64(u32 pc, const GcnInst& inst); void S_GETPC_B64(u32 pc, const GcnInst& inst);
void S_SAVEEXEC_B64(NegateMode negate, bool is_or, const GcnInst& inst); void S_SAVEEXEC_B64(NegateMode negate, bool is_or, const GcnInst& inst);

View File

@ -172,6 +172,7 @@ void ConvertTileToLinear(u8* dst, const u8* src, u32 width, u32 height, bool is_
vk::Format DemoteImageFormatForDetiling(vk::Format format) { vk::Format DemoteImageFormatForDetiling(vk::Format format) {
switch (format) { switch (format) {
case vk::Format::eR8Uint:
case vk::Format::eR8Unorm: case vk::Format::eR8Unorm:
return vk::Format::eR8Uint; return vk::Format::eR8Uint;
case vk::Format::eR4G4B4A4UnormPack16: case vk::Format::eR4G4B4A4UnormPack16: