mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-16 10:57:59 -05:00
shader: Fix F2I
This commit is contained in:
@ -731,6 +731,24 @@ F16F32F64 IREmitter::FPSaturate(const F16F32F64& value) {
|
||||
}
|
||||
}
|
||||
|
||||
F16F32F64 IREmitter::FPClamp(const F16F32F64& value, const F16F32F64& min_value,
|
||||
const F16F32F64& max_value) {
|
||||
if (value.Type() != min_value.Type() || value.Type() != max_value.Type()) {
|
||||
throw InvalidArgument("Mismatching types {}, {}, and {}", value.Type(), min_value.Type(),
|
||||
max_value.Type());
|
||||
}
|
||||
switch (value.Type()) {
|
||||
case Type::F16:
|
||||
return Inst<F16>(Opcode::FPClamp16, value, min_value, max_value);
|
||||
case Type::F32:
|
||||
return Inst<F32>(Opcode::FPClamp32, value, min_value, max_value);
|
||||
case Type::F64:
|
||||
return Inst<F64>(Opcode::FPClamp64, value, min_value, max_value);
|
||||
default:
|
||||
ThrowInvalidType(value.Type());
|
||||
}
|
||||
}
|
||||
|
||||
F16F32F64 IREmitter::FPRoundEven(const F16F32F64& value, FpControl control) {
|
||||
switch (value.Type()) {
|
||||
case Type::F16:
|
||||
|
@ -147,6 +147,7 @@ public:
|
||||
[[nodiscard]] F32F64 FPRecipSqrt(const F32F64& value);
|
||||
[[nodiscard]] F32 FPSqrt(const F32& value);
|
||||
[[nodiscard]] F16F32F64 FPSaturate(const F16F32F64& value);
|
||||
[[nodiscard]] F16F32F64 FPClamp(const F16F32F64& value, const F16F32F64& min_value, const F16F32F64& max_value);
|
||||
[[nodiscard]] F16F32F64 FPRoundEven(const F16F32F64& value, FpControl control = {});
|
||||
[[nodiscard]] F16F32F64 FPFloor(const F16F32F64& value, FpControl control = {});
|
||||
[[nodiscard]] F16F32F64 FPCeil(const F16F32F64& value, FpControl control = {});
|
||||
|
@ -192,6 +192,9 @@ OPCODE(FPLog2, F32, F32,
|
||||
OPCODE(FPSaturate16, F16, F16, )
|
||||
OPCODE(FPSaturate32, F32, F32, )
|
||||
OPCODE(FPSaturate64, F64, F64, )
|
||||
OPCODE(FPClamp16, F16, F16, F16, F16, )
|
||||
OPCODE(FPClamp32, F32, F32, F32, F32, )
|
||||
OPCODE(FPClamp64, F64, F64, F64, F64, )
|
||||
OPCODE(FPRoundEven16, F16, F16, )
|
||||
OPCODE(FPRoundEven32, F32, F32, )
|
||||
OPCODE(FPRoundEven64, F64, F64, )
|
||||
|
Reference in New Issue
Block a user