diff options
| author | 2021-07-25 11:39:04 -0700 | |
|---|---|---|
| committer | 2021-07-25 11:39:04 -0700 | |
| commit | 98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f (patch) | |
| tree | 816faa96c2c4d291825063433331a8ea4b3d08f1 /src/shader_recompiler/frontend/ir/modifiers.h | |
| parent | Merge pull request #6699 from lat9nq/common-threads (diff) | |
| parent | shader: Support out of bound local memory reads and immediate writes (diff) | |
| download | yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.tar.gz yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.tar.xz yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.zip | |
Merge pull request #6585 from ameerj/hades
Shader Decompiler Rewrite
Diffstat (limited to 'src/shader_recompiler/frontend/ir/modifiers.h')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/modifiers.h | 49 |
1 files changed, 49 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..77cda1f8a --- /dev/null +++ b/src/shader_recompiler/frontend/ir/modifiers.h | |||
| @@ -0,0 +1,49 @@ | |||
| 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 | #include "common/bit_field.h" | ||
| 8 | #include "common/common_types.h" | ||
| 9 | #include "shader_recompiler/shader_info.h" | ||
| 10 | |||
| 11 | namespace Shader::IR { | ||
| 12 | |||
| 13 | enum class FmzMode : u8 { | ||
| 14 | DontCare, // Not specified for this instruction | ||
| 15 | FTZ, // Flush denorms to zero, NAN is propagated (D3D11, NVN, GL, VK) | ||
| 16 | FMZ, // Flush denorms to zero, x * 0 == 0 (D3D9) | ||
| 17 | None, // Denorms are not flushed, NAN is propagated (nouveau) | ||
| 18 | }; | ||
| 19 | |||
| 20 | enum class FpRounding : u8 { | ||
| 21 | DontCare, // Not specified for this instruction | ||
| 22 | RN, // Round to nearest even, | ||
| 23 | RM, // Round towards negative infinity | ||
| 24 | RP, // Round towards positive infinity | ||
| 25 | RZ, // Round towards zero | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct FpControl { | ||
| 29 | bool no_contraction{false}; | ||
| 30 | FpRounding rounding{FpRounding::DontCare}; | ||
| 31 | FmzMode fmz_mode{FmzMode::DontCare}; | ||
| 32 | }; | ||
| 33 | static_assert(sizeof(FpControl) <= sizeof(u32)); | ||
| 34 | |||
| 35 | union TextureInstInfo { | ||
| 36 | u32 raw; | ||
| 37 | BitField<0, 16, u32> descriptor_index; | ||
| 38 | BitField<16, 3, TextureType> type; | ||
| 39 | BitField<19, 1, u32> is_depth; | ||
| 40 | BitField<20, 1, u32> has_bias; | ||
| 41 | BitField<21, 1, u32> has_lod_clamp; | ||
| 42 | BitField<22, 1, u32> relaxed_precision; | ||
| 43 | BitField<23, 2, u32> gather_component; | ||
| 44 | BitField<25, 2, u32> num_derivates; | ||
| 45 | BitField<27, 3, ImageFormat> image_format; | ||
| 46 | }; | ||
| 47 | static_assert(sizeof(TextureInstInfo) <= sizeof(u32)); | ||
| 48 | |||
| 49 | } // namespace Shader::IR | ||