26 #include <glslang/Include/ResourceLimits.h>
27 #include <glslang/Public/ShaderLang.h>
28 #include <glslang/SPIRV/GlslangToSpv.h>
32 using namespace glslang;
38 #define GLSL_VERSION EShTargetVulkan_1_1
41 #define SPIRV_VERSION EShTargetSpv_1_3
158 static const EShLanguage lang[] = {
165 TShader *shader =
new TShader(lang[stage]);
173 shader->setStrings(&glsl, 1);
181 TProgram *prog =
new TProgram();
188 prog->addShader(shader);
189 if (!prog->link(EShMsgDefault)) {
197 std::vector<unsigned int> spirv;
200 options.generateDebugInfo =
false;
203 options.disableOptimizer =
false;
206 GlslangToSpv(*prog->getIntermediate(lang[stage]), spirv,
NULL, &
options);
208 res->
size = spirv.size()*
sizeof(
unsigned int);
229 ret = !InitializeProcess();
simple assert() macros that are a bit more flexible than ISO C assert().
const OptionDef options[]
#define pthread_mutex_lock(a)
#define pthread_mutex_unlock(a)
void glslang_uninit(void)
static const TBuiltInResource DefaultTBuiltInResource
static int glslang_refcount
GLSlangResult * glslang_compile(const char *glsl, enum GLSlangStage stage)
static pthread_mutex_t glslang_mutex
#define AVERROR_EXTERNAL
Generic error in an external library.
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
char * av_strdup(const char *s)
Duplicate a string.
Memory handling functions.
#define PTHREAD_MUTEX_INITIALIZER