mirror of https://github.com/bjornbytes/lovr.git
Compute shader glsl prefix;
This commit is contained in:
parent
98e518683a
commit
e371359193
|
@ -1521,7 +1521,7 @@ Shader* lovrShaderCreateCompute(const char* source) {
|
|||
if (!shader) return NULL;
|
||||
|
||||
lovrAssert(GLAD_GL_ARB_compute_shader, "Compute shaders are not supported on this system");
|
||||
const char* sources[] = { source, lovrShaderComputeSuffix };
|
||||
const char* sources[] = { lovrShaderComputePrefix, source, lovrShaderComputeSuffix };
|
||||
GLuint computeShader = compileShader(GL_COMPUTE_SHADER, sources, sizeof(sources) / sizeof(sources[0]));
|
||||
GLuint program = glCreateProgram();
|
||||
glAttachShader(program, computeShader);
|
||||
|
|
|
@ -115,6 +115,9 @@ const char* lovrShaderFragmentSuffix = ""
|
|||
"#endif \n"
|
||||
"}";
|
||||
|
||||
const char* lovrShaderComputePrefix = ""
|
||||
"#version 420 \n";
|
||||
|
||||
const char* lovrShaderComputeSuffix = ""
|
||||
"void main() { \n"
|
||||
" compute(); \n"
|
||||
|
|
|
@ -7,6 +7,7 @@ extern const char* lovrShaderVertexPrefix;
|
|||
extern const char* lovrShaderVertexSuffix;
|
||||
extern const char* lovrShaderFragmentPrefix;
|
||||
extern const char* lovrShaderFragmentSuffix;
|
||||
extern const char* lovrShaderComputePrefix;
|
||||
extern const char* lovrShaderComputeSuffix;
|
||||
extern const char* lovrDefaultVertexShader;
|
||||
extern const char* lovrDefaultFragmentShader;
|
||||
|
|
Loading…
Reference in New Issue