]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/device_backend.cpp
Add tessellation shader support to the engine
[libs/gl.git] / source / backends / vulkan / device_backend.cpp
index cc94e967f03c5372b18211d96ac4a2557fe44aa5..6d8995807c842832e22dce16315ca80a0c8bd5fd 100644 (file)
@@ -1,8 +1,12 @@
+#include <cstdlib>
 #include <msp/graphics/vulkancontext_platform.h>
+#include <msp/strings/lexicalcast.h>
 #include "device.h"
 #include "device_backend.h"
 #include "vulkan.h"
 
+using namespace std;
+
 namespace Msp {
 namespace GL {
 
@@ -15,7 +19,8 @@ VulkanDevice::VulkanDevice(Graphics::Window &wnd, const Graphics::VulkanOptions
        destroy_queue(*static_cast<Device *>(this)),
        synchronizer(*static_cast<Device *>(this)),
        transfer_queue(*static_cast<Device *>(this)),
-       pipeline_cache(*static_cast<Device *>(this))
+       pipeline_cache(*static_cast<Device *>(this)),
+       descriptor_pool(*static_cast<Device *>(this))
 { }
 
 // Cause the destructor of RefPtr<VulkanFunctions> to be emitted here
@@ -25,8 +30,14 @@ VulkanDevice::~VulkanDevice()
 Graphics::VulkanOptions VulkanDevice::create_default_options()
 {
        Graphics::VulkanOptions opts;
+       opts.enable_geometry_shader = true;
+       opts.enable_tessellation_shader = true;
 #ifdef DEBUG
-       opts.enable_validation = true;
+       const char *disable_ptr = getenv("MSPGL_DISABLE_VALIDATION");
+       if(disable_ptr && *disable_ptr)
+               opts.enable_validation = !lexical_cast<bool>(string(disable_ptr));
+       else
+               opts.enable_validation = true;
        opts.enable_debug_report = true;
 #endif
        return opts;