]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/stenciltest_backend.cpp
Initial implementation of Vulkan backend
[libs/gl.git] / source / backends / vulkan / stenciltest_backend.cpp
diff --git a/source/backends/vulkan/stenciltest_backend.cpp b/source/backends/vulkan/stenciltest_backend.cpp
new file mode 100644 (file)
index 0000000..70dcbee
--- /dev/null
@@ -0,0 +1,27 @@
+#include "stenciltest.h"
+#include "stenciltest_backend.h"
+#include "vulkan.h"
+
+using namespace std;
+
+namespace Msp {
+namespace GL {
+
+unsigned get_vulkan_stencil_op(StencilOp op)
+{
+       switch(op)
+       {
+       case KEEP: return VK_STENCIL_OP_KEEP;
+       case SET_ZERO: return VK_STENCIL_OP_ZERO;
+       case REPLACE: return VK_STENCIL_OP_REPLACE;
+       case INCR_CLAMP: return VK_STENCIL_OP_INCREMENT_AND_CLAMP;
+       case DECR_CLAMP: return VK_STENCIL_OP_DECREMENT_AND_CLAMP;
+       case INVERT: return VK_STENCIL_OP_INVERT;
+       case INCR_WRAP: return VK_STENCIL_OP_INCREMENT_AND_WRAP;
+       case DECR_WRAP: return VK_STENCIL_OP_DECREMENT_AND_WRAP;
+       default: throw invalid_argument("get_vulkan_stencil_op");
+       }
+}
+
+} // namespace GL
+} // namespace Msp