#include <cstdlib>
+#include <msp/core/environ.h>
#include <msp/graphics/vulkancontext_private.h>
#include <msp/strings/lexicalcast.h>
#include "device.h"
opts.enable_geometry_shader = true;
opts.enable_tessellation_shader = true;
#ifdef DEBUG
- const char *disable_ptr = getenv("MSPGL_DISABLE_VALIDATION");
- if(disable_ptr && *disable_ptr)
- opts.enable_validation = !lexical_cast<bool>(string(disable_ptr));
+ string disable_str = getenv("MSPGL_DISABLE_VALIDATION");
+ if(!disable_str.empty())
+ opts.enable_validation = !lexical_cast<bool>(disable_str);
else
opts.enable_validation = true;
opts.enable_debug_report = true;
stage_infos[i].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
stage_infos[i].stage = static_cast<VkShaderStageFlagBits>(stage_bit);
stage_infos[i].module = handle_cast<::VkShaderModule>(mod.handle);
- strcpy(name_ptr, e.name.c_str());
+ copy(e.name.begin(), e.name.end(), name_ptr);
+ name_ptr[e.name.size()] = 0;
stage_infos[i].pName = name_ptr;
name_ptr += e.name.size()+1;
stage_infos[i].pSpecializationInfo = spec_info;