Vulkan: Add the #define VULKAN 100 when compiled for Vulkan.

Note this requires test-based piecing together of the preamble string,
so it changed to being a std::string to make it easier to do.

This closes issue #254.
This commit is contained in:
John Kessenich 2016-05-03 21:17:55 -06:00
parent af459216a1
commit e512cd943e
6 changed files with 30 additions and 14 deletions

View file

@ -2,4 +2,8 @@
layout(constant_id = 17) const int arraySize = 12; // ERROR
layout(input_attachment_index = 1) int foo; // ERROR
layout(push_constant) uniform ubn { int a; } ubi; // ERROR
layout(push_constant) uniform ubn { int a; } ubi; // ERROR
#ifdef VULKAN
#error VULKAN should not be defined
#endif

View file

@ -37,3 +37,11 @@ void foo()
}
layout(set = 1, push_constant) uniform badpc { int a; } badpcI; // ERROR, no descriptor set with push_constant
#ifndef VULKAN
#error VULKAN should be defined
#endif
#if VULKAN != 100
#error VULKAN should be 100
#endif