Lines Matching refs:Shader
1299 * shader with a saturate.
1327 * shader with a saturate.
1354 * shader with a saturate.
1790 * FINISHME: W component of fragment shader output zero, work correctly.
2442 * Generate the program parameters list for the user uniforms in a shader
2444 * \param shader_program Linked shader program. This is only used to
2446 * \param sh Shader whose uniforms are to be processed.
2743 * Convert a shader's GLSL IR into a Mesa gl_program.
2748 struct gl_shader *shader)
2758 &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader->Type)];
2760 switch (shader->Type) {
2778 validate_ir_tree(shader->ir);
2789 _mesa_generate_parameters_list_for_uniforms(shader_program, shader,
2793 visit_exec_list(shader->ir, &v);
2889 if (ctx->Shader.Flags & GLSL_DUMP) {
2893 _mesa_print_ir(shader->ir, NULL);
2910 do_set_program_inouts(shader->ir, prog, shader->Type == GL_FRAGMENT_SHADER);
2912 prog->SamplersUsed = shader->active_samplers;
2913 prog->ShadowSamplers = shader->shadow_samplers;
2922 _mesa_reference_program(ctx, &shader->Program, prog);
2924 if ((ctx->Shader.Flags & GLSL_NO_OPT) == 0) {
2941 _mesa_reference_program(ctx, &shader->Program, NULL);
2948 * Link a shader.
3046 * Compile a GLSL shader. Called via glCompileShader().
3049 _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader)
3052 new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
3054 const char *source = shader->Source;
3059 shader->CompileStatus = GL_FALSE;
3066 if (ctx->Shader.Flags & GLSL_DUMP) {
3067 printf("GLSL source for %s shader %d:\n",
3068 _mesa_glsl_shader_target_name(state->target), shader->Name);
3069 printf("%s\n", shader->Source);
3078 ralloc_free(shader->ir);
3079 shader->ir = new(shader) exec_list;
3081 _mesa_ast_to_hir(shader->ir, state);
3083 if (!state->error && !shader->ir->is_empty()) {
3084 validate_ir_tree(shader->ir);
3086 /* Do some optimization at compile time to reduce shader IR size
3087 * and reduce later work if the same shader is linked multiple times
3089 while (do_common_optimization(shader->ir, false, false, 32))
3092 validate_ir_tree(shader->ir);
3095 shader->symbols = state->symbols;
3097 shader->CompileStatus = !state->error;
3098 shader->InfoLog = state->info_log;
3099 shader->Version = state->language_version;
3100 memcpy(shader->builtins_to_link, state->builtins_to_link,
3101 sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link);
3102 shader->num_builtins_to_link = state->num_builtins_to_link;
3104 if (ctx->Shader.Flags & GLSL_LOG) {
3105 _mesa_write_shader_to_file(shader);
3108 if (ctx->Shader.Flags & GLSL_DUMP) {
3109 if (shader->CompileStatus) {
3110 printf("GLSL IR for shader %d:\n", shader->Name);
3111 _mesa_print_ir(shader->ir, NULL);
3114 printf("GLSL shader %d failed to compile.\n", shader->Name);
3116 if (shader->InfoLog && shader->InfoLog[0] != 0) {
3117 printf("GLSL shader %d info log:\n", shader->Name);
3118 printf("%s\n", shader->InfoLog);
3122 if (shader->UniformBlocks)
3123 ralloc_free(shader->UniformBlocks);
3124 shader->NumUniformBlocks = state->num_uniform_blocks;
3125 shader->UniformBlocks = state->uniform_blocks;
3126 ralloc_steal(shader, shader->UniformBlocks);
3129 reparent_ir(shader->ir, shader->ir);
3136 * Link a GLSL shader program. Called via glLinkProgram().
3149 linker_error(prog, "linking with uncompiled shader");
3164 if (ctx->Shader.Flags & GLSL_DUMP) {
3166 printf("GLSL shader program %d failed to link\n", prog->Name);
3170 printf("GLSL shader program %d info log:\n", prog->Name);