glsl: Fix locations of variables in patch qualified interface blocks.
[mesa.git] / src / compiler / glsl / standalone_scaffolding.cpp
index 09d7d6e8c26ce9ba4e5dcc16752018375800c233..b0fb4b726aeb0784f972c8a1b44a9fc51c2bc6f1 100644 (file)
@@ -68,23 +68,33 @@ _mesa_shader_debug(struct gl_context *, GLenum, GLuint *,
 }
 
 struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
+_mesa_new_shader(GLuint name, gl_shader_stage stage)
 {
    struct gl_shader *shader;
 
-   (void) ctx;
-
-   assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER);
+   assert(stage == MESA_SHADER_FRAGMENT || stage == MESA_SHADER_VERTEX);
    shader = rzalloc(NULL, struct gl_shader);
    if (shader) {
-      shader->Type = type;
-      shader->Stage = _mesa_shader_enum_to_shader_stage(type);
+      shader->Stage = stage;
       shader->Name = name;
       shader->RefCount = 1;
    }
    return shader;
 }
 
+struct gl_linked_shader *
+_mesa_new_linked_shader(gl_shader_stage stage)
+{
+   struct gl_linked_shader *shader;
+
+   assert(stage == MESA_SHADER_FRAGMENT || stage == MESA_SHADER_VERTEX);
+   shader = rzalloc(NULL, struct gl_linked_shader);
+   if (shader) {
+      shader->Stage = stage;
+   }
+   return shader;
+}
+
 void
 _mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh)
 {
@@ -93,6 +103,13 @@ _mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh)
    ralloc_free(sh);
 }
 
+void
+_mesa_delete_linked_shader(struct gl_context *ctx,
+                           struct gl_linked_shader *sh)
+{
+   ralloc_free(sh);
+}
+
 void
 _mesa_clear_shader_program_data(struct gl_shader_program *shProg)
 {
@@ -152,6 +169,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
    ctx->Extensions.ARB_texture_query_lod = true;
    ctx->Extensions.ARB_uniform_buffer_object = true;
    ctx->Extensions.ARB_viewport_array = true;
+   ctx->Extensions.ARB_cull_distance = true;
 
    ctx->Extensions.OES_EGL_image_external = true;
    ctx->Extensions.OES_standard_derivatives = true;
@@ -159,6 +177,8 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
    ctx->Extensions.EXT_shader_integer_mix = true;
    ctx->Extensions.EXT_texture_array = true;
 
+   ctx->Extensions.MESA_shader_integer_functions = true;
+
    ctx->Extensions.NV_texture_rectangle = true;
 
    ctx->Const.GLSLVersion = 120;