Lines Matching refs:shader

56 /** Define this to enable shader substitution (see below) */
95 * Initialize context's shader state.
121 * Free the per-context shader-related state.
161 * Confirm that the a shader type is valid and supported by the implementation
200 struct gl_shader *shader = _mesa_lookup_shader(ctx, name);
201 return shader ? GL_TRUE : GL_FALSE;
206 * Attach shader to a shader program.
209 attach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
219 sh = _mesa_lookup_shader_err(ctx, shader, "glAttachShader");
227 /* The shader is already attched to this program. The
323 delete_shader(struct gl_context *ctx, GLuint shader)
327 sh = _mesa_lookup_shader_err(ctx, shader, "glDeleteShader");
341 detach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
354 if (shProg->Shaders[i]->Name == shader) {
396 if (is_shader(ctx, shader))
398 else if (is_program(ctx, shader))
402 _mesa_error(ctx, err, "glDetachProgram(shader)");
409 * Return list of shaders attached to shader program.
429 * glGetHandleARB() - return ID/name of currently bound shader program.
448 * glGetProgramiv() - get shader program state.
449 * Note that this is for GLSL shader programs, not ARB vertex/fragment
609 * glGetShaderiv() - get GLSL shader state
614 struct gl_shader *shader =
617 if (!shader) {
623 *params = shader->Type;
626 *params = shader->DeletePending;
629 *params = shader->CompileStatus;
632 *params = shader->InfoLog ? strlen(shader->InfoLog) + 1 : 0;
635 *params = shader->Source ? strlen((char *) shader->Source) + 1 : 0;
659 get_shader_info_log(struct gl_context *ctx, GLuint shader, GLsizei bufSize,
662 struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
664 _mesa_error(ctx, GL_INVALID_VALUE, "glGetShaderInfoLog(shader)");
672 * Return shader source code.
675 get_shader_source(struct gl_context *ctx, GLuint shader, GLsizei maxLength,
679 sh = _mesa_lookup_shader_err(ctx, shader, "glGetShaderSource");
688 * Set/replace shader source code. A helper function used by
692 shader_source(struct gl_context *ctx, GLuint shader, const GLchar *source)
696 sh = _mesa_lookup_shader_err(ctx, shader, "glShaderSource");
700 /* free old shader source string and install new one */
713 * Compile a shader.
727 /* set default pragma state for shader */
737 _mesa_debug(ctx, "Error compiling shader %u:\n%s\n",
785 printf(" shader %u, type 0x%x\n",
794 * Print basic shader info (for debug).
817 printf(" %s shader %u, checksum %u\n", s,
834 * Use the named shader program for subsequent glUniform calls
894 /* If the shader is also bound as the current rendering shader, unbind
928 * Use the named shader program for subsequent rendering.
944 * Do validation of the given shader program.
1010 _mesa_AttachObjectARB(GLhandleARB program, GLhandleARB shader)
1013 attach_shader(ctx, program, shader);
1018 _mesa_AttachShader(GLuint program, GLuint shader)
1021 attach_shader(ctx, program, shader);
1118 _mesa_DetachObjectARB(GLhandleARB program, GLhandleARB shader)
1121 detach_shader(ctx, program, shader);
1126 _mesa_DetachShader(GLuint program, GLuint shader)
1129 detach_shader(ctx, program, shader);
1214 _mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params)
1217 get_shaderiv(ctx, shader, pname, params);
1231 _mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
1235 get_shader_info_log(ctx, shader, bufSize, length, infoLog);
1240 _mesa_GetShaderSourceARB(GLhandleARB shader, GLsizei maxLength,
1244 get_shader_source(ctx, shader, maxLength, length, sourceOut);
1282 * Read shader source code from a file.
1283 * Useful for debugging to override an app's shader.
1290 GLcharARB *buffer, *shader;
1303 shader = _mesa_strdup(buffer);
1306 return shader;
1377 /* Compute the shader's source code checksum then try to open a file
1379 * original shader source code. For debugging.
1390 fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n",
1672 const GLuint shader = create_shader(ctx, type);
1675 if (shader) {
1676 shader_source(ctx, shader, _mesa_strdup(string));
1677 compile_shader(ctx, shader);
1686 sh = _mesa_lookup_shader(ctx, shader);
1688 get_shaderiv(ctx, shader, GL_COMPILE_STATUS, &compiled);
1690 attach_shader(ctx, program, shader);
1692 detach_shader(ctx, program, shader);
1706 delete_shader(ctx, shader);
1713 * Plug in shader-related functions into API dispatch table.