diff options
| author | 2021-01-09 03:30:07 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:21 -0400 | |
| commit | 2d48a7b4d0666ad16d03a22d85712617a0849046 (patch) | |
| tree | dd1069afca86f66e77e3438da77421a43adf5091 /src/shader_recompiler/exception.h | |
| parent | thread_worker: Fix compile time error (diff) | |
| download | yuzu-2d48a7b4d0666ad16d03a22d85712617a0849046.tar.gz yuzu-2d48a7b4d0666ad16d03a22d85712617a0849046.tar.xz yuzu-2d48a7b4d0666ad16d03a22d85712617a0849046.zip | |
shader: Initial recompiler work
Diffstat (limited to 'src/shader_recompiler/exception.h')
| -rw-r--r-- | src/shader_recompiler/exception.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/shader_recompiler/exception.h b/src/shader_recompiler/exception.h new file mode 100644 index 000000000..6fe620801 --- /dev/null +++ b/src/shader_recompiler/exception.h | |||
| @@ -0,0 +1,42 @@ | |||
| 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 <stdexcept> | ||
| 8 | #include <utility> | ||
| 9 | |||
| 10 | #include <fmt/format.h> | ||
| 11 | |||
| 12 | namespace Shader { | ||
| 13 | |||
| 14 | class LogicError : public std::logic_error { | ||
| 15 | public: | ||
| 16 | template <typename... Args> | ||
| 17 | LogicError(const char* message, Args&&... args) | ||
| 18 | : std::logic_error{fmt::format(message, std::forward<Args>(args)...)} {} | ||
| 19 | }; | ||
| 20 | |||
| 21 | class RuntimeError : public std::runtime_error { | ||
| 22 | public: | ||
| 23 | template <typename... Args> | ||
| 24 | RuntimeError(const char* message, Args&&... args) | ||
| 25 | : std::runtime_error{fmt::format(message, std::forward<Args>(args)...)} {} | ||
| 26 | }; | ||
| 27 | |||
| 28 | class NotImplementedException : public std::logic_error { | ||
| 29 | public: | ||
| 30 | template <typename... Args> | ||
| 31 | NotImplementedException(const char* message, Args&&... args) | ||
| 32 | : std::logic_error{fmt::format(message, std::forward<Args>(args)...)} {} | ||
| 33 | }; | ||
| 34 | |||
| 35 | class InvalidArgument : public std::invalid_argument { | ||
| 36 | public: | ||
| 37 | template <typename... Args> | ||
| 38 | InvalidArgument(const char* message, Args&&... args) | ||
| 39 | : std::invalid_argument{fmt::format(message, std::forward<Args>(args)...)} {} | ||
| 40 | }; | ||
| 41 | |||
| 42 | } // namespace Shader | ||