diff options
author | lat9nq <lat9nq@gmail.com> | 2021-07-25 15:31:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-25 15:31:33 -0400 |
commit | 09d6cc99435322c5f480eaa2b0967e33f4966ba6 (patch) | |
tree | 72cdf06f6b7d77fdf5826104fea691f3ea450f54 /src/shader_recompiler/frontend/ir/modifiers.h | |
parent | d8b00fd863c8aa9fca02a479ce958899f1aadf24 (diff) | |
parent | 7e272d3cd81656b65b21f5a569fc9a2d76cac758 (diff) |
Merge branch 'master' into fullscreen-enum
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 @@ +// Copyright 2021 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "common/bit_field.h" +#include "common/common_types.h" +#include "shader_recompiler/shader_info.h" + +namespace Shader::IR { + +enum class FmzMode : u8 { + DontCare, // Not specified for this instruction + FTZ, // Flush denorms to zero, NAN is propagated (D3D11, NVN, GL, VK) + FMZ, // Flush denorms to zero, x * 0 == 0 (D3D9) + None, // Denorms are not flushed, NAN is propagated (nouveau) +}; + +enum class FpRounding : u8 { + DontCare, // Not specified for this instruction + RN, // Round to nearest even, + RM, // Round towards negative infinity + RP, // Round towards positive infinity + RZ, // Round towards zero +}; + +struct FpControl { + bool no_contraction{false}; + FpRounding rounding{FpRounding::DontCare}; + FmzMode fmz_mode{FmzMode::DontCare}; +}; +static_assert(sizeof(FpControl) <= sizeof(u32)); + +union TextureInstInfo { + u32 raw; + BitField<0, 16, u32> descriptor_index; + BitField<16, 3, TextureType> type; + BitField<19, 1, u32> is_depth; + BitField<20, 1, u32> has_bias; + BitField<21, 1, u32> has_lod_clamp; + BitField<22, 1, u32> relaxed_precision; + BitField<23, 2, u32> gather_component; + BitField<25, 2, u32> num_derivates; + BitField<27, 3, ImageFormat> image_format; +}; +static_assert(sizeof(TextureInstInfo) <= sizeof(u32)); + +} // namespace Shader::IR |