diff options
Diffstat (limited to 'src/shader_recompiler/frontend/ir/modifiers.h')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/modifiers.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/modifiers.h b/src/shader_recompiler/frontend/ir/modifiers.h new file mode 100644 index 000000000..28bb9e798 --- /dev/null +++ b/src/shader_recompiler/frontend/ir/modifiers.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | namespace Shader::IR { | ||
| 8 | |||
| 9 | enum class FmzMode { | ||
| 10 | None, // Denorms are not flushed, NAN is propagated (nouveau) | ||
| 11 | FTZ, // Flush denorms to zero, NAN is propagated (D3D11, NVN, GL, VK) | ||
| 12 | FMZ, // Flush denorms to zero, x * 0 == 0 (D3D9) | ||
| 13 | }; | ||
| 14 | |||
| 15 | enum class FpRounding { | ||
| 16 | RN, // Round to nearest even, | ||
| 17 | RM, // Round towards negative infinity | ||
| 18 | RP, // Round towards positive infinity | ||
| 19 | RZ, // Round towards zero | ||
| 20 | }; | ||
| 21 | |||
| 22 | struct FpControl { | ||
| 23 | bool no_contraction{false}; | ||
| 24 | FpRounding rounding : 8 = FpRounding::RN; | ||
| 25 | FmzMode fmz_mode : 8 = FmzMode::FTZ; | ||
| 26 | }; | ||
| 27 | static_assert(sizeof(FpControl) <= sizeof(u64)); | ||
| 28 | } // namespace Shader::IR | ||