if (clear->ShaderProg != 0)
return;
- vs = _mesa_CreateShader(GL_VERTEX_SHADER);
- _mesa_ShaderSource(vs, 1, &vs_source, NULL);
- _mesa_CompileShader(vs);
-
- fs = _mesa_CreateShader(GL_FRAGMENT_SHADER);
- _mesa_ShaderSource(fs, 1, &fs_source, NULL);
- _mesa_CompileShader(fs);
-
- clear->ShaderProg = _mesa_CreateProgram();
- _mesa_AttachShader(clear->ShaderProg, fs);
- _mesa_DeleteShader(fs);
- _mesa_AttachShader(clear->ShaderProg, vs);
- _mesa_DeleteShader(vs);
- _mesa_ObjectLabel(GL_PROGRAM, clear->ShaderProg, -1, "meta clear");
- _mesa_LinkProgram(clear->ShaderProg);
+ _mesa_meta_compile_and_link_program(ctx, vs_source, fs_source, "meta clear",
+ &clear->ShaderProg);
has_integer_textures = _mesa_is_gles3(ctx) ||
(_mesa_is_desktop_gl(ctx) && ctx->Const.GLSLVersion >= 130);
" out_color = color;\n"
"}\n");
- vs = _mesa_meta_compile_shader_with_debug(ctx, GL_VERTEX_SHADER,
- vs_int_source);
- fs = _mesa_meta_compile_shader_with_debug(ctx, GL_FRAGMENT_SHADER,
- fs_int_source);
+ _mesa_meta_compile_and_link_program(ctx, vs_int_source, fs_int_source,
+ "integer clear",
+ &clear->IntegerShaderProg);
ralloc_free(shader_source_mem_ctx);
- clear->IntegerShaderProg = _mesa_CreateProgram();
- _mesa_AttachShader(clear->IntegerShaderProg, fs);
- _mesa_DeleteShader(fs);
- _mesa_AttachShader(clear->IntegerShaderProg, vs);
- _mesa_DeleteShader(vs);
-
/* Note that user-defined out attributes get automatically assigned
* locations starting from 0, so we don't need to explicitly
* BindFragDataLocation to 0.
*/
-
- _mesa_ObjectLabel(GL_PROGRAM, clear->IntegerShaderProg, -1,
- "integer clear");
- _mesa_meta_link_program_with_debug(ctx, clear->IntegerShaderProg);
}
}
" gl_FragColor = color;\n"
"}\n";
- GLuint vs, fs;
struct brw_fast_clear_state *clear = brw->fast_clear_state;
struct gl_context *ctx = &brw->ctx;
return;
}
- vs = _mesa_meta_compile_shader_with_debug(ctx, GL_VERTEX_SHADER, vs_source);
- fs = _mesa_meta_compile_shader_with_debug(ctx, GL_FRAGMENT_SHADER, fs_source);
-
- clear->shader_prog = _mesa_CreateProgram();
- _mesa_AttachShader(clear->shader_prog, fs);
- _mesa_DeleteShader(fs);
- _mesa_AttachShader(clear->shader_prog, vs);
- _mesa_DeleteShader(vs);
- _mesa_ObjectLabel(GL_PROGRAM, clear->shader_prog, -1, "meta repclear");
- _mesa_LinkProgram(clear->shader_prog);
+ _mesa_meta_compile_and_link_program(ctx, vs_source, fs_source,
+ "meta repclear",
+ &clear->shader_prog);
clear->color_location =
_mesa_GetUniformLocation(clear->shader_prog, "color");