vk/glsl_helpers: Fix GLSL_VK_SHADER with respect to commas

Previously, the GLSL_VK_SHADER macro didn't work if the shader contained
commas outside of parentheses due to the way the C preprocessor works.
This commit fixes this by making it variadic again and doing it correctly
this time.
This commit is contained in:
Jason Ekstrand
2015-05-15 22:17:05 -07:00
parent 3b9f32e893
commit eb1952592e
+2 -2
View File
@@ -23,9 +23,9 @@
#pragma once
#define GLSL_VK_SHADER(device, stage, source) ({ \
#define GLSL_VK_SHADER(device, stage, ...) ({ \
VkShader __shader; \
const char __src[] = "#version 330\n" #source; \
const char __src[] = "#version 330\n" #__VA_ARGS__; \
VkShaderCreateInfo __shader_create_info = { \
.sType = VK_STRUCTURE_TYPE_SHADER_CREATE_INFO, \
.codeSize = sizeof(__src), \