]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/device_backend.cpp
Rewrite descriptor set management
[libs/gl.git] / source / backends / vulkan / device_backend.cpp
index efdd596cdc873a1e3bcb02acb0263fe35e11de0e..f1f2e3279160b209c1545df2279b91aa5ea2228c 100644 (file)
@@ -1,8 +1,11 @@
+#include <cstdlib>
 #include <msp/graphics/vulkancontext_platform.h>
 #include "device.h"
 #include "device_backend.h"
 #include "vulkan.h"
 
+using namespace std;
+
 namespace Msp {
 namespace GL {
 
@@ -15,7 +18,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
@@ -27,7 +31,11 @@ Graphics::VulkanOptions VulkanDevice::create_default_options()
        Graphics::VulkanOptions opts;
        opts.enable_geometry_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;