summaryrefslogtreecommitdiff
path: root/graphics/asymptote/shaders.cc
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/shaders.cc')
-rw-r--r--graphics/asymptote/shaders.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/graphics/asymptote/shaders.cc b/graphics/asymptote/shaders.cc
index 36dc72a4ae..9aa29bec06 100644
--- a/graphics/asymptote/shaders.cc
+++ b/graphics/asymptote/shaders.cc
@@ -17,7 +17,7 @@ int GLSLversion;
GLuint compileAndLinkShader(std::vector<ShaderfileModePair> const& shaders,
std::vector<std::string> const& defineflags,
- bool ssbo, bool compute)
+ bool ssbo, bool interlock, bool compute)
{
GLuint shader = glCreateProgram();
std::vector<GLuint> compiledShaders;
@@ -25,8 +25,8 @@ GLuint compileAndLinkShader(std::vector<ShaderfileModePair> const& shaders,
size_t n=shaders.size();
for(size_t i=0; i < n; ++i) {
GLint newshader=createShaderFile(shaders[i].first,shaders[i].second,
- defineflags,ssbo,compute);
- if((ssbo || compute) && newshader == 0) return 0;
+ defineflags,ssbo,interlock,compute);
+ if((ssbo || interlock || compute) && newshader == 0) return 0;
glAttachShader(shader,newshader);
compiledShaders.push_back(newshader);
}
@@ -48,7 +48,8 @@ GLuint compileAndLinkShader(std::vector<ShaderfileModePair> const& shaders,
}
GLuint createShader(const std::string& src, int shaderType,
- const std::string& filename, bool ssbo, bool compute)
+ const std::string& filename, bool ssbo, bool interlock,
+ bool compute)
{
const GLchar *source=src.c_str();
GLuint shader=glCreateShader(shaderType);
@@ -59,7 +60,7 @@ GLuint createShader(const std::string& src, int shaderType,
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
if(status != GL_TRUE) {
- if(ssbo || compute) return 0;
+ if(ssbo || interlock || compute) return 0;
GLint length;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
@@ -85,7 +86,7 @@ GLuint createShader(const std::string& src, int shaderType,
GLuint createShaderFile(std::string file, int shaderType,
std::vector<std::string> const& defineflags,
- bool ssbo, bool compute)
+ bool ssbo, bool interlock, bool compute)
{
std::ifstream shaderFile;
shaderFile.open(file.c_str());
@@ -95,10 +96,14 @@ GLuint createShaderFile(std::string file, int shaderType,
#ifndef __APPLE__
shaderSrc << "#extension GL_ARB_uniform_buffer_object : enable" << "\n";
#ifdef HAVE_SSBO
- if(ssbo)
+ if(ssbo) {
shaderSrc << "#extension GL_ARB_shader_storage_buffer_object : enable" << "\n";
- if(compute)
- shaderSrc << "#extension GL_ARB_compute_shader : enable" << "\n";
+ if(interlock)
+ shaderSrc << "#extension GL_ARB_fragment_shader_interlock : enable"
+ << "\n";
+ if(compute)
+ shaderSrc << "#extension GL_ARB_compute_shader : enable" << "\n";
+ }
#endif
#endif
@@ -114,6 +119,6 @@ GLuint createShaderFile(std::string file, int shaderType,
exit(-1);
}
- return createShader(shaderSrc.str(),shaderType,file,ssbo,compute);
+ return createShader(shaderSrc.str(),shaderType,file,ssbo,interlock,compute);
}
#endif