summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/exception.h
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-01-09 03:30:07 -0300
committerGravatar ameerj2021-07-22 21:51:21 -0400
commit2d48a7b4d0666ad16d03a22d85712617a0849046 (patch)
treedd1069afca86f66e77e3438da77421a43adf5091 /src/shader_recompiler/exception.h
parentthread_worker: Fix compile time error (diff)
downloadyuzu-2d48a7b4d0666ad16d03a22d85712617a0849046.tar.gz
yuzu-2d48a7b4d0666ad16d03a22d85712617a0849046.tar.xz
yuzu-2d48a7b4d0666ad16d03a22d85712617a0849046.zip
shader: Initial recompiler work
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/exception.h42
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
12namespace Shader {
13
14class LogicError : public std::logic_error {
15public:
16 template <typename... Args>
17 LogicError(const char* message, Args&&... args)
18 : std::logic_error{fmt::format(message, std::forward<Args>(args)...)} {}
19};
20
21class RuntimeError : public std::runtime_error {
22public:
23 template <typename... Args>
24 RuntimeError(const char* message, Args&&... args)
25 : std::runtime_error{fmt::format(message, std::forward<Args>(args)...)} {}
26};
27
28class NotImplementedException : public std::logic_error {
29public:
30 template <typename... Args>
31 NotImplementedException(const char* message, Args&&... args)
32 : std::logic_error{fmt::format(message, std::forward<Args>(args)...)} {}
33};
34
35class InvalidArgument : public std::invalid_argument {
36public:
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