Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-09-16 13:28:06 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-09-16 13:28:35 +0300
commitf3058c1b664135fcad08f9e45ea64b3f55543b94 (patch)
tree772ceb684cc2c598bcc65e36fc808cef2ecbd93f /intern
parenta27b54f6e29fbf37aa21f7fe7dca41804d3f4442 (diff)
OpenSubdiv: Remove redundant section define from shader compilation
Diffstat (limited to 'intern')
-rw-r--r--intern/opensubdiv/opensubdiv_gpu_capi.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/intern/opensubdiv/opensubdiv_gpu_capi.cc b/intern/opensubdiv/opensubdiv_gpu_capi.cc
index da4a937540d..c36eaae1c6e 100644
--- a/intern/opensubdiv/opensubdiv_gpu_capi.cc
+++ b/intern/opensubdiv/opensubdiv_gpu_capi.cc
@@ -208,26 +208,23 @@ struct OpenSubdiv_GLMeshFVarData
namespace {
GLuint compileShader(GLenum shaderType,
- const char *section,
const char *version,
const char *define,
const char *source)
{
- char sdefine[64];
- sprintf(sdefine, "#define %s\n", section);
-
const char *sources[] = {
version,
define,
- sdefine,
#ifdef SUPPORT_COLOR_MATERIAL
"#define SUPPORT_COLOR_MATERIAL\n",
+#else
+ "",
#endif
source,
};
GLuint shader = glCreateShader(shaderType);
- glShaderSource(shader, 5, sources, NULL);
+ glShaderSource(shader, 4, sources, NULL);
glCompileShader(shader);
GLint status;
@@ -235,7 +232,7 @@ GLuint compileShader(GLenum shaderType,
if (status == GL_FALSE) {
GLchar emsg[1024];
glGetShaderInfoLog(shader, sizeof(emsg), 0, emsg);
- fprintf(stderr, "Error compiling GLSL %s: %s\n", section, emsg);
+ fprintf(stderr, "Error compiling GLSL: %s\n", emsg);
fprintf(stderr, "Version: %s\n", version);
fprintf(stderr, "Defines: %s\n", define);
fprintf(stderr, "Source: %s\n", source);
@@ -248,7 +245,6 @@ GLuint compileShader(GLenum shaderType,
GLuint linkProgram(const char *version, const char *define)
{
GLuint vertexShader = compileShader(GL_VERTEX_SHADER,
- "VERTEX_SHADER",
version,
define,
datatoc_gpu_shader_opensubdiv_vertex_glsl);
@@ -256,7 +252,6 @@ GLuint linkProgram(const char *version, const char *define)
return 0;
}
GLuint geometryShader = compileShader(GL_GEOMETRY_SHADER,
- "GEOMETRY_SHADER",
version,
define,
datatoc_gpu_shader_opensubdiv_geometry_glsl);
@@ -264,7 +259,6 @@ GLuint linkProgram(const char *version, const char *define)
return 0;
}
GLuint fragmentShader = compileShader(GL_FRAGMENT_SHADER,
- "FRAGMENT_SHADER",
version,
define,
datatoc_gpu_shader_opensubdiv_fragment_glsl );