]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/predicate_backend.cpp
Initial implementation of Vulkan backend
[libs/gl.git] / source / backends / vulkan / predicate_backend.cpp
1 #include "predicate.h"
2 #include "predicate_backend.h"
3 #include "vulkan.h"
4
5 using namespace std;
6
7 namespace Msp {
8 namespace GL {
9
10 unsigned get_vulkan_predicate(Predicate pred)
11 {
12         switch(pred)
13         {
14         case NEVER: return VK_COMPARE_OP_NEVER;
15         case ALWAYS: return VK_COMPARE_OP_ALWAYS;
16         case LESS: return VK_COMPARE_OP_LESS;
17         case LEQUAL: return VK_COMPARE_OP_LESS_OR_EQUAL;
18         case EQUAL: return VK_COMPARE_OP_EQUAL;
19         case GREATER: return VK_COMPARE_OP_GREATER;
20         case GEQUAL: return VK_COMPARE_OP_GREATER_OR_EQUAL;
21         case NOTEQUAL: return VK_COMPARE_OP_NOT_EQUAL;
22         default: throw invalid_argument("get_vulkan_predicate");
23         }
24 }
25
26 } // namespace GL
27 } // namespace Msp