- struct gl_shader *shader;
- assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER);
- shader = talloc_zero(NULL, struct gl_shader);
- if (shader) {
- shader->Type = type;
- shader->Name = name;
- shader->RefCount = 1;
- }
- return shader;
+ initialize_context_to_defaults(ctx, api);
+
+ /* The standalone compiler needs to claim support for almost
+ * everything in order to compile the built-in functions.
+ */
+ ctx->Const.GLSLVersion = 140;
+ ctx->Extensions.ARB_ES3_compatibility = true;
+
+ ctx->Const.MaxClipPlanes = 8;
+ ctx->Const.MaxDrawBuffers = 2;
+
+ /* More than the 1.10 minimum to appease parser tests taken from
+ * apps that (hopefully) already checked the number of coords.
+ */
+ ctx->Const.MaxTextureCoordUnits = 4;
+
+ ctx->Driver.NewShader = _mesa_new_shader;