mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-27 20:34:24 +01:00
Apply CC test to the final value to be stored in the register
This commit is contained in:
parent
bbf8d6bf01
commit
33056dd833
@ -410,16 +410,17 @@ public:
|
|||||||
* @param dest_num_components Number of components in the destination.
|
* @param dest_num_components Number of components in the destination.
|
||||||
* @param value_num_components Number of components in the value.
|
* @param value_num_components Number of components in the value.
|
||||||
* @param is_saturated Optional, when True, saturates the provided value.
|
* @param is_saturated Optional, when True, saturates the provided value.
|
||||||
|
* @param sets_cc Optional, when True, sets the corresponding values to the implemented
|
||||||
|
* condition flags.
|
||||||
* @param dest_elem Optional, the destination element to use for the operation.
|
* @param dest_elem Optional, the destination element to use for the operation.
|
||||||
*/
|
*/
|
||||||
void SetRegisterToFloat(const Register& reg, u64 elem, const std::string& value,
|
void SetRegisterToFloat(const Register& reg, u64 elem, const std::string& value,
|
||||||
u64 dest_num_components, u64 value_num_components,
|
u64 dest_num_components, u64 value_num_components,
|
||||||
bool is_saturated = false, bool sets_cc = false, u64 dest_elem = 0,
|
bool is_saturated = false, bool sets_cc = false, u64 dest_elem = 0,
|
||||||
bool precise = false) {
|
bool precise = false) {
|
||||||
const const std::string clamped_value =
|
const std::string clamped_value = is_saturated ? "clamp(" + value + ", 0.0, 1.0)" : value;
|
||||||
is_saturated ? "clamp(" + value + ", 0.0, 1.0)" : value;
|
SetRegister(reg, elem, clamped_value, dest_num_components, value_num_components, dest_elem,
|
||||||
SetRegister(reg, elem, clamped_value,
|
precise);
|
||||||
dest_num_components, value_num_components, dest_elem, precise);
|
|
||||||
if (sets_cc) {
|
if (sets_cc) {
|
||||||
if (reg == Register::ZeroIndex) {
|
if (reg == Register::ZeroIndex) {
|
||||||
SetConditionalCodesFromExpression(clamped_value);
|
SetConditionalCodesFromExpression(clamped_value);
|
||||||
@ -437,6 +438,8 @@ public:
|
|||||||
* @param dest_num_components Number of components in the destination.
|
* @param dest_num_components Number of components in the destination.
|
||||||
* @param value_num_components Number of components in the value.
|
* @param value_num_components Number of components in the value.
|
||||||
* @param is_saturated Optional, when True, saturates the provided value.
|
* @param is_saturated Optional, when True, saturates the provided value.
|
||||||
|
* @param sets_cc Optional, when True, sets the corresponding values to the implemented
|
||||||
|
* condition flags.
|
||||||
* @param dest_elem Optional, the destination element to use for the operation.
|
* @param dest_elem Optional, the destination element to use for the operation.
|
||||||
* @param size Register size to use for conversion instructions.
|
* @param size Register size to use for conversion instructions.
|
||||||
*/
|
*/
|
||||||
@ -446,15 +449,15 @@ public:
|
|||||||
bool sets_cc = false, u64 dest_elem = 0,
|
bool sets_cc = false, u64 dest_elem = 0,
|
||||||
Register::Size size = Register::Size::Word) {
|
Register::Size size = Register::Size::Word) {
|
||||||
UNIMPLEMENTED_IF(is_saturated);
|
UNIMPLEMENTED_IF(is_saturated);
|
||||||
|
const std::string final_value = ConvertIntegerSize(value, size);
|
||||||
const std::string func{is_signed ? "intBitsToFloat" : "uintBitsToFloat"};
|
const std::string func{is_signed ? "intBitsToFloat" : "uintBitsToFloat"};
|
||||||
|
|
||||||
SetRegister(reg, elem, func + '(' + ConvertIntegerSize(value, size) + ')',
|
SetRegister(reg, elem, func + '(' + final_value + ')', dest_num_components,
|
||||||
dest_num_components, value_num_components, dest_elem, false);
|
value_num_components, dest_elem, false);
|
||||||
|
|
||||||
if (sets_cc) {
|
if (sets_cc) {
|
||||||
if (reg == Register::ZeroIndex) {
|
if (reg == Register::ZeroIndex) {
|
||||||
SetConditionalCodesFromExpression(value);
|
SetConditionalCodesFromExpression(final_value);
|
||||||
} else {
|
} else {
|
||||||
SetConditionalCodesFromRegister(reg, dest_elem);
|
SetConditionalCodesFromRegister(reg, dest_elem);
|
||||||
}
|
}
|
||||||
@ -1629,7 +1632,7 @@ private:
|
|||||||
if (process_mode != Tegra::Shader::TextureProcessMode::None && gl_lod_supported) {
|
if (process_mode != Tegra::Shader::TextureProcessMode::None && gl_lod_supported) {
|
||||||
if (process_mode == Tegra::Shader::TextureProcessMode::LZ) {
|
if (process_mode == Tegra::Shader::TextureProcessMode::LZ) {
|
||||||
texture += ", 0.0";
|
texture += ", 0.0";
|
||||||
} else {
|
} else {
|
||||||
// If present, lod or bias are always stored in the register indexed by the
|
// If present, lod or bias are always stored in the register indexed by the
|
||||||
// gpr20
|
// gpr20
|
||||||
// field with an offset depending on the usage of the other registers
|
// field with an offset depending on the usage of the other registers
|
||||||
|
Loading…
Reference in New Issue
Block a user