modifiers.h 967 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2021 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. namespace Shader::IR {
  7. enum class FmzMode : u8 {
  8. DontCare, // Not specified for this instruction
  9. FTZ, // Flush denorms to zero, NAN is propagated (D3D11, NVN, GL, VK)
  10. FMZ, // Flush denorms to zero, x * 0 == 0 (D3D9)
  11. None, // Denorms are not flushed, NAN is propagated (nouveau)
  12. };
  13. enum class FpRounding : u8 {
  14. DontCare, // Not specified for this instruction
  15. RN, // Round to nearest even,
  16. RM, // Round towards negative infinity
  17. RP, // Round towards positive infinity
  18. RZ, // Round towards zero
  19. };
  20. struct FpControl {
  21. bool no_contraction{false};
  22. FpRounding rounding{FpRounding::DontCare};
  23. FmzMode fmz_mode{FmzMode::DontCare};
  24. };
  25. static_assert(sizeof(FpControl) <= sizeof(u32));
  26. } // namespace Shader::IR