Home | History | Annotate | Download | only in main

Lines Matching full:shader

117  * Initialize context's shader state.
136 ctx->Shader.Flags = _mesa_get_shader_flags();
138 if (ctx->Shader.Flags != 0)
142 ctx->Shader.RefCount = 1;
143 mtx_init(&ctx->Shader.Mutex, mtx_plain);
154 * Free the per-context shader-related state.
161 _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram[i],
164 _mesa_reference_program(ctx, &ctx->Shader._CurrentFragmentProgram, NULL);
165 _mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram, NULL);
170 assert(ctx->Shader.RefCount == 1);
171 mtx_destroy(&ctx->Shader.Mutex);
199 * Confirm that the a shader type is valid and supported by the implementation
202 * \param type Shader target
210 * a shader target we recognize, not that it's supported in the current
244 struct gl_shader *shader = _mesa_lookup_shader(ctx, name);
245 return shader ? GL_TRUE : GL_FALSE;
250 * Attach shader to a shader program.
253 attach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
265 sh = _mesa_lookup_shader_err(ctx, shader, "glAttachShader");
273 /* The shader is already attched to this program. The
283 /* Shader with the same type is already attached to this program,
286 * "Multiple shader objects of the same type may not be attached
288 * is generated if [...] another shader object of the same type
289 * as shader is already attached to program."
357 * Delete a shader program. Actually, just decrement the program's
366 * texture objects (and buffer objects, etc). Shader/program
388 delete_shader(struct gl_context *ctx, GLuint shader)
392 sh = _mesa_lookup_shader_err(ctx, shader, "glDeleteShader");
406 detach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
419 if (shProg->Shaders[i]->Name == shader) {
464 if (is_shader(ctx, shader) || is_program(ctx, shader))
468 _mesa_error(ctx, err, "glDetachShader(shader)");
475 * Return list of shaders attached to shader program.
503 * glGetHandleARB() - return ID/name of currently bound shader program.
522 * Check if a geometry shader query is valid at this time. If not, report an
525 * From GL 3.2 section 6.1.16 (Shader and Program Queries):
529 * which does not contain objects to form a geometry shader, then an
541 "glGetProgramv(linked geometry shader required)");
547 * Check if a tessellation control shader query is valid at this time.
550 * From GL 4.0 section 6.1.12 (Shader and Program Queries):
554 * form a tessellation control shader, then an INVALID_OPERATION error is
566 "glGetProgramv(linked tessellation control shader required)");
572 * Check if a tessellation evaluation shader query is valid at this time.
575 * From GL 4.0 section 6.1.12 (Shader and Program Queries):
579 * objects to form a tessellation evaluation shader, then an
592 "evaluation shader required)");
598 * glGetProgramiv() - get shader program state.
599 * Note that this is for GLSL shader programs, not ARB vertex/fragment
885 * glGetShaderiv() - get GLSL shader state
890 struct gl_shader *shader =
893 if (!shader) {
899 *params = shader->Type;
902 *params = shader->DeletePending;
905 *params = shader->CompileStatus;
908 *params = (shader->InfoLog && shader->InfoLog[0] != '\0') ?
909 strlen(shader->InfoLog) + 1 : 0;
912 *params = shader->Source ? strlen((char *) shader->Source) + 1 : 0;
949 get_shader_info_log(struct gl_context *ctx, GLuint shader, GLsizei bufSize,
965 sh = _mesa_lookup_shader_err(ctx, shader, "glGetShaderInfoLog(shader)");
975 * Return shader source code.
978 get_shader_source(struct gl_context *ctx, GLuint shader, GLsizei maxLength,
988 sh = _mesa_lookup_shader_err(ctx, shader, "glGetShaderSource");
997 * Set/replace shader source code. A helper function used by
1005 /* free old shader source string and install new one */
1015 * Compile a shader.
1030 _mesa_log("GLSL source for %s shader %d:\n",
1035 /* this call will set the shader->CompileStatus field to indicate if
1047 _mesa_log("GLSL IR for shader %d:\n", sh->Name);
1050 _mesa_log("No GLSL IR for shader %d (shader may be from "
1055 _mesa_log("GLSL shader %d failed to compile.\n", sh->Name);
1058 _mesa_log("GLSL shader %d info log:\n", sh->Name);
1066 _mesa_log("GLSL source for %s shader %d:\n",
1073 _mesa_debug(ctx, "Error compiling shader %u:\n%s\n",
1120 fprintf(file, "[%s shader]\n%s\n",
1147 printf(" shader %u, stage %u\n",
1156 * Print basic shader info (for debug).
1166 printf(" %s shader %u, checksum %u\n",
1171 printf(" %s shader %u\n",
1195 * Use the named shader program for subsequent glUniform calls
1207 if (ctx->Shader.ActiveProgram != shProg) {
1208 _mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram, shProg);
1233 /* If the shader is also bound as the current rendering shader, unbind
1264 * Use the named shader program for subsequent rendering.
1271 use_shader_program(ctx, i, shProg, &ctx->Shader);
1277 * Do validation of the given shader program.
1342 _mesa_AttachObjectARB(GLhandleARB program, GLhandleARB shader)
1345 attach_shader(ctx, program, shader);
1350 _mesa_AttachShader(GLuint program, GLuint shader)
1353 attach_shader(ctx, program, shader);
1451 _mesa_DetachObjectARB(GLhandleARB program, GLhandleARB shader)
1454 detach_shader(ctx, program, shader);
1459 _mesa_DetachShader(GLuint program, GLuint shader)
1462 detach_shader(ctx, program, shader);
1547 _mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params)
1550 get_shaderiv(ctx, shader, pname, params);
1564 _mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
1568 get_shader_info_log(ctx, shader, bufSize, length, infoLog);
1573 _mesa_GetShaderSource(GLuint shader, GLsizei maxLength,
1577 get_shader_source(ctx, shader, maxLength, length, sourceOut);
1628 * Construct a full path for shader replacement functionality using
1647 * Write given shader source to a file in MESA_SHADER_DUMP_PATH.
1673 _mesa_warning(ctx, "could not open %s for dumping shader (%s)", name,
1680 * Read shader source code from a file.
1681 * Useful for debugging to override an app's shader.
1707 /* allocate enough room for the entire shader */
1802 /* Dump original shader source to MESA_SHADER_DUMP_PATH and replace
1857 * "The executable code for an individual shader stage is taken from
1865 /* Attach shader state to the binding point */
1866 _mesa_reference_pipeline_object(ctx, &ctx->_Shader, &ctx->Shader);
1967 /* Page 68, section 7.2 'Shader Binaries" of the of the OpenGL ES 3.1, and
2105 * the next time the shader is linked.
2237 const GLuint shader = create_shader(ctx, type);
2249 if (shader) {
2250 struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
2252 _mesa_ShaderSource(shader, count, strings, NULL);
2264 get_shaderiv(ctx, shader, GL_COMPILE_STATUS, &compiled);
2266 attach_shader(ctx, program, shader);
2268 detach_shader(ctx, program, shader);
2282 delete_shader(ctx, shader);