Skip to content

Commit a8d932e

Browse files
authored
Merge branch 'shadps4-emu:main' into main
2 parents d59d23d + 76644a0 commit a8d932e

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

src/sdl_window.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ void WindowSDL::onKeyPress(const SDL_Event* event) {
304304
if (axis != Input::Axis::AxisMax) {
305305
controller->Axis(0, axis, ax);
306306
}
307+
if (SDL_GetCursor() != NULL) {
308+
SDL_HideCursor();
309+
}
307310
}
308311

309312
void WindowSDL::onGamepadEvent(const SDL_Event* event) {
@@ -329,6 +332,9 @@ void WindowSDL::onGamepadEvent(const SDL_Event* event) {
329332
if (button != 0) {
330333
controller->CheckButton(0, button, event->type == SDL_EVENT_GAMEPAD_BUTTON_DOWN);
331334
}
335+
if (SDL_GetCursor() != NULL) {
336+
SDL_HideCursor();
337+
}
332338
break;
333339
case SDL_EVENT_GAMEPAD_AXIS_MOTION:
334340
axis = event->gaxis.axis == SDL_GAMEPAD_AXIS_LEFTX ? Input::Axis::LeftX

src/shader_recompiler/frontend/translate/translate.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,19 @@ class Translator {
161161
// VOP1
162162
void V_MOV(const GcnInst& inst);
163163
void V_READFIRSTLANE_B32(const GcnInst& inst);
164+
void V_CVT_I32_F64(const GcnInst& inst);
164165
void V_CVT_F64_I32(const GcnInst& inst);
165166
void V_CVT_F32_I32(const GcnInst& inst);
166167
void V_CVT_F32_U32(const GcnInst& inst);
167168
void V_CVT_U32_F32(const GcnInst& inst);
168169
void V_CVT_I32_F32(const GcnInst& inst);
169170
void V_CVT_F16_F32(const GcnInst& inst);
170171
void V_CVT_F32_F16(const GcnInst& inst);
172+
void V_CVT_RPI_I32_F32(const GcnInst& inst);
171173
void V_CVT_FLR_I32_F32(const GcnInst& inst);
172174
void V_CVT_OFF_F32_I4(const GcnInst& inst);
175+
void V_CVT_F32_F64(const GcnInst& inst);
176+
void V_CVT_F64_F32(const GcnInst& inst);
173177
void V_CVT_F32_UBYTE(u32 index, const GcnInst& inst);
174178
void V_FRACT_F32(const GcnInst& inst);
175179
void V_TRUNC_F32(const GcnInst& inst);

src/shader_recompiler/frontend/translate/vector_alu.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ void Translator::EmitVectorAlu(const GcnInst& inst) {
9999
return V_MOV(inst);
100100
case Opcode::V_READFIRSTLANE_B32:
101101
return V_READFIRSTLANE_B32(inst);
102+
case Opcode::V_CVT_I32_F64:
103+
return V_CVT_I32_F64(inst);
102104
case Opcode::V_CVT_F64_I32:
103105
return V_CVT_F64_I32(inst);
104106
case Opcode::V_CVT_F32_I32:
@@ -115,6 +117,12 @@ void Translator::EmitVectorAlu(const GcnInst& inst) {
115117
return V_CVT_F32_F16(inst);
116118
case Opcode::V_CVT_FLR_I32_F32:
117119
return V_CVT_FLR_I32_F32(inst);
120+
case Opcode::V_CVT_F32_F64:
121+
return V_CVT_F32_F64(inst);
122+
case Opcode::V_CVT_F64_F32:
123+
return V_CVT_F64_F32(inst);
124+
case Opcode::V_CVT_RPI_I32_F32:
125+
return V_CVT_RPI_I32_F32(inst);
118126
case Opcode::V_CVT_OFF_F32_I4:
119127
return V_CVT_OFF_F32_I4(inst);
120128
case Opcode::V_CVT_F32_UBYTE0:
@@ -612,6 +620,11 @@ void Translator::V_MOV(const GcnInst& inst) {
612620
SetDst(inst.dst[0], GetSrc<IR::F32>(inst.src[0]));
613621
}
614622

623+
void Translator::V_CVT_I32_F64(const GcnInst& inst) {
624+
const IR::F64 src0{GetSrc64<IR::F64>(inst.src[0])};
625+
SetDst(inst.dst[0], ir.ConvertFToS(32, src0));
626+
}
627+
615628
void Translator::V_CVT_F64_I32(const GcnInst& inst) {
616629
const IR::U32 src0{GetSrc(inst.src[0])};
617630
SetDst64(inst.dst[0], ir.ConvertSToF(64, 32, src0));
@@ -649,6 +662,11 @@ void Translator::V_CVT_F32_F16(const GcnInst& inst) {
649662
SetDst(inst.dst[0], ir.FPConvert(32, ir.BitCast<IR::F16>(src0l)));
650663
}
651664

665+
void Translator::V_CVT_RPI_I32_F32(const GcnInst& inst) {
666+
const IR::F32 src0{GetSrc<IR::F32>(inst.src[0])};
667+
SetDst(inst.dst[0], ir.ConvertFToI(32, true, ir.FPFloor(ir.FPAdd(src0, ir.Imm32(0.5f)))));
668+
}
669+
652670
void Translator::V_CVT_FLR_I32_F32(const GcnInst& inst) {
653671
const IR::F32 src0{GetSrc<IR::F32>(inst.src[0])};
654672
SetDst(inst.dst[0], ir.ConvertFToI(32, true, ir.FPFloor(src0)));
@@ -663,6 +681,16 @@ void Translator::V_CVT_OFF_F32_I4(const GcnInst& inst) {
663681
SetDst(inst.dst[0], ir.Imm32(IntToFloat[src0.U32() & 0xF]));
664682
}
665683

684+
void Translator::V_CVT_F32_F64(const GcnInst& inst) {
685+
const IR::F64 src0{GetSrc64<IR::F64>(inst.src[0])};
686+
SetDst(inst.dst[0], ir.FPConvert(32, src0));
687+
}
688+
689+
void Translator::V_CVT_F64_F32(const GcnInst& inst) {
690+
const IR::F32 src0{GetSrc<IR::F32>(inst.src[0])};
691+
SetDst64(inst.dst[0], ir.FPConvert(64, src0));
692+
}
693+
666694
void Translator::V_CVT_F32_UBYTE(u32 index, const GcnInst& inst) {
667695
const IR::U32 src0{GetSrc(inst.src[0])};
668696
const IR::U32 byte = ir.BitFieldExtract(src0, ir.Imm32(8 * index), ir.Imm32(8));

src/shader_recompiler/ir/ir_emitter.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,15 @@ F16F32F64 IREmitter::FPConvert(size_t result_bitsize, const F16F32F64& value) {
14021402
switch (value.Type()) {
14031403
case Type::F16:
14041404
return Inst<F32>(Opcode::ConvertF32F16, value);
1405+
case Type::F64:
1406+
return Inst<F32>(Opcode::ConvertF32F64, value);
1407+
default:
1408+
break;
1409+
}
1410+
case 64:
1411+
switch (value.Type()) {
1412+
case Type::F32:
1413+
return Inst<F64>(Opcode::ConvertF64F32, value);
14051414
default:
14061415
break;
14071416
}

0 commit comments

Comments
 (0)