]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/stenciltest_backend.cpp
Initial implementation of Vulkan backend
[libs/gl.git] / source / backends / vulkan / stenciltest_backend.cpp
1 #include "stenciltest.h"
2 #include "stenciltest_backend.h"
3 #include "vulkan.h"
4
5 using namespace std;
6
7 namespace Msp {
8 namespace GL {
9
10 unsigned get_vulkan_stencil_op(StencilOp op)
11 {
12         switch(op)
13         {
14         case KEEP: return VK_STENCIL_OP_KEEP;
15         case SET_ZERO: return VK_STENCIL_OP_ZERO;
16         case REPLACE: return VK_STENCIL_OP_REPLACE;
17         case INCR_CLAMP: return VK_STENCIL_OP_INCREMENT_AND_CLAMP;
18         case DECR_CLAMP: return VK_STENCIL_OP_DECREMENT_AND_CLAMP;
19         case INVERT: return VK_STENCIL_OP_INVERT;
20         case INCR_WRAP: return VK_STENCIL_OP_INCREMENT_AND_WRAP;
21         case DECR_WRAP: return VK_STENCIL_OP_DECREMENT_AND_WRAP;
22         default: throw invalid_argument("get_vulkan_stencil_op");
23         }
24 }
25
26 } // namespace GL
27 } // namespace Msp