diff options
Diffstat (limited to 'source/blender/gpu/opengl/gl_shader.cc')
-rw-r--r-- | source/blender/gpu/opengl/gl_shader.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index 193e4ee8a70..cc5f83228d6 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -53,7 +53,7 @@ GLShader::GLShader(const char *name) : Shader(name) debug::object_label(GL_PROGRAM, shader_program_, name); } -GLShader::~GLShader(void) +GLShader::~GLShader() { #if 0 /* Would be nice to have, but for now the Deferred compilation \ * does not have a GPUContext. */ @@ -72,7 +72,7 @@ GLShader::~GLShader(void) /** \name Shader stage creation * \{ */ -char *GLShader::glsl_patch_get(void) +char *GLShader::glsl_patch_get() { /** Used for shader patching. Init once. */ static char patch[512] = "\0"; @@ -123,14 +123,14 @@ GLuint GLShader::create_shader_stage(GLenum gl_stage, MutableSpan<const char *> /* Patch the shader code using the first source slot. */ sources[0] = glsl_patch_get(); - glShaderSource(shader, sources.size(), sources.data(), NULL); + glShaderSource(shader, sources.size(), sources.data(), nullptr); glCompileShader(shader); GLint status; glGetShaderiv(shader, GL_COMPILE_STATUS, &status); if (!status || (G.debug & G_DEBUG_GPU)) { char log[5000] = ""; - glGetShaderInfoLog(shader, sizeof(log), NULL, log); + glGetShaderInfoLog(shader, sizeof(log), nullptr, log); if (log[0] != '\0') { switch (gl_stage) { case GL_VERTEX_SHADER: @@ -172,7 +172,7 @@ void GLShader::fragment_shader_from_glsl(MutableSpan<const char *> sources) frag_shader_ = this->create_shader_stage(GL_FRAGMENT_SHADER, sources); } -bool GLShader::finalize(void) +bool GLShader::finalize() { if (compilation_failed_) { return false; @@ -184,7 +184,7 @@ bool GLShader::finalize(void) glGetProgramiv(shader_program_, GL_LINK_STATUS, &status); if (!status) { char log[5000]; - glGetProgramInfoLog(shader_program_, sizeof(log), NULL, log); + glGetProgramInfoLog(shader_program_, sizeof(log), nullptr, log); Span<const char *> sources; this->print_log(sources, log, "Linking", true); return false; @@ -201,13 +201,13 @@ bool GLShader::finalize(void) /** \name Binding * \{ */ -void GLShader::bind(void) +void GLShader::bind() { BLI_assert(shader_program_ != 0); glUseProgram(shader_program_); } -void GLShader::unbind(void) +void GLShader::unbind() { #ifndef NDEBUG glUseProgram(0); @@ -259,7 +259,7 @@ bool GLShader::transform_feedback_enable(GPUVertBuf *buf_) return true; } -void GLShader::transform_feedback_disable(void) +void GLShader::transform_feedback_disable() { glEndTransformFeedback(); } @@ -409,7 +409,7 @@ void GLShader::vertformat_from_shader(GPUVertFormat *format) const char name[256]; GLenum gl_type; GLint size; - glGetActiveAttrib(shader_program_, i, sizeof(name), NULL, &size, &gl_type, name); + glGetActiveAttrib(shader_program_, i, sizeof(name), nullptr, &size, &gl_type, name); /* Ignore OpenGL names like `gl_BaseInstanceARB`, `gl_InstanceID` and `gl_VertexID`. */ if (glGetAttribLocation(shader_program_, name) == -1) { |