[Mesa-dev] [PATCH 12/70] mesa/glsl/i965: remove Driver.NewShader()

Timothy Arceri timothy.arceri at collabora.com
Tue Dec 20 10:37:22 UTC 2016


After removing brw_shader in the previous commit this is no longer
needed.

V2: remove use in src/compiler/glsl/test_optpass.cpp
---
 src/compiler/glsl/linker.cpp                 |  3 ++-
 src/compiler/glsl/standalone.cpp             |  1 -
 src/compiler/glsl/standalone_scaffolding.cpp | 13 -------------
 src/compiler/glsl/standalone_scaffolding.h   |  3 ---
 src/compiler/glsl/test_optpass.cpp           |  1 -
 src/mesa/drivers/dri/i965/brw_link.cpp       | 11 -----------
 src/mesa/drivers/dri/i965/brw_program.c      |  1 -
 src/mesa/main/dd.h                           |  7 -------
 src/mesa/main/shaderobj.c                    | 17 -----------------
 src/mesa/main/shaderobj.h                    |  3 ---
 10 files changed, 2 insertions(+), 58 deletions(-)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 1a2f98c..4d0e3da 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -2194,7 +2194,8 @@ link_intrastage_shaders(void *mem_ctx,
       return NULL;
    }
 
-   gl_linked_shader *linked = ctx->Driver.NewShader(shader_list[0]->Stage);
+   gl_linked_shader *linked = rzalloc(NULL, struct gl_linked_shader);
+   linked->Stage = shader_list[0]->Stage;
 
    /* Create program and attach it to the linked shader */
    struct gl_program *gl_prog =
diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp
index 00c9500..69d86c7 100644
--- a/src/compiler/glsl/standalone.cpp
+++ b/src/compiler/glsl/standalone.cpp
@@ -330,7 +330,6 @@ initialize_context(struct gl_context *ctx, gl_api api)
    ctx->Const.MaxUserAssignableUniformLocations =
       4 * MESA_SHADER_STAGES * MAX_UNIFORMS;
 
-   ctx->Driver.NewShader = _mesa_new_linked_shader;
    ctx->Driver.NewProgram = new_program;
 }
 
diff --git a/src/compiler/glsl/standalone_scaffolding.cpp b/src/compiler/glsl/standalone_scaffolding.cpp
index 1113426..9160ba0 100644
--- a/src/compiler/glsl/standalone_scaffolding.cpp
+++ b/src/compiler/glsl/standalone_scaffolding.cpp
@@ -90,19 +90,6 @@ _mesa_new_shader(GLuint name, gl_shader_stage stage)
    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;
-}
-
 GLbitfield
 _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
 {
diff --git a/src/compiler/glsl/standalone_scaffolding.h b/src/compiler/glsl/standalone_scaffolding.h
index 0e77f72..790ff4a 100644
--- a/src/compiler/glsl/standalone_scaffolding.h
+++ b/src/compiler/glsl/standalone_scaffolding.h
@@ -49,9 +49,6 @@ _mesa_reference_program_(struct gl_context *ctx, struct gl_program **ptr,
 extern "C" struct gl_shader *
 _mesa_new_shader(GLuint name, gl_shader_stage stage);
 
-extern "C" struct gl_linked_shader *
-_mesa_new_linked_shader(gl_shader_stage stage);
-
 extern "C" void
 _mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh);
 
diff --git a/src/compiler/glsl/test_optpass.cpp b/src/compiler/glsl/test_optpass.cpp
index 4d0bcc2..c6e9788 100644
--- a/src/compiler/glsl/test_optpass.cpp
+++ b/src/compiler/glsl/test_optpass.cpp
@@ -200,7 +200,6 @@ int test_optpass(int argc, char **argv)
    struct gl_context *ctx = &local_ctx;
    initialize_context_to_defaults(ctx, API_OPENGL_COMPAT);
 
-   ctx->Driver.NewShader = _mesa_new_linked_shader;
    ir_variable::temporaries_allocate_names = true;
 
    struct gl_shader *shader = rzalloc(NULL, struct gl_shader);
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index fc68f0d..83f73b4 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -195,17 +195,6 @@ process_glsl_ir(struct brw_context *brw,
    }
 }
 
-extern "C" struct gl_linked_shader *
-brw_new_shader(gl_shader_stage stage)
-{
-   struct gl_linked_shader *shader = rzalloc(NULL, struct gl_linked_shader);
-   if (shader) {
-      shader->Stage = stage;
-   }
-
-   return shader;
-}
-
 static void
 unify_interfaces(struct shader_info **infos)
 {
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index a502b8e..a70ae81 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -364,7 +364,6 @@ void brwInitFragProgFuncs( struct dd_function_table *functions )
    functions->DeleteProgram = brwDeleteProgram;
    functions->ProgramStringNotify = brwProgramStringNotify;
 
-   functions->NewShader = brw_new_shader;
    functions->LinkShader = brw_link_shader;
 
    functions->MemoryBarrier = brw_memory_barrier;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 1d75b9f..21e8260 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -780,13 +780,6 @@ struct dd_function_table {
    /*@}*/
 
    /**
-    * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
-    */
-   /*@{*/
-   struct gl_linked_shader *(*NewShader)(gl_shader_stage stage);
-   /*@}*/
-
-   /**
     * \name GREMEDY debug/marker functions
     */
    /*@{*/
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 6fcdf44..8ace36c 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -119,22 +119,6 @@ _mesa_new_shader(GLuint name, gl_shader_stage stage)
 
 
 /**
- * Allocate a new gl_linked_shader object.
- * Called via ctx->Driver.NewShader()
- */
-struct gl_linked_shader *
-_mesa_new_linked_shader(gl_shader_stage stage)
-{
-   struct gl_linked_shader *shader;
-   shader = rzalloc(NULL, struct gl_linked_shader);
-   if (shader) {
-      shader->Stage = stage;
-   }
-   return shader;
-}
-
-
-/**
  * Delete a shader object.
  */
 void
@@ -511,6 +495,5 @@ _mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name,
 void
 _mesa_init_shader_object_functions(struct dd_function_table *driver)
 {
-   driver->NewShader = _mesa_new_linked_shader;
    driver->LinkShader = _mesa_ir_link_shader;
 }
diff --git a/src/mesa/main/shaderobj.h b/src/mesa/main/shaderobj.h
index c5153d0..b7dae62 100644
--- a/src/mesa/main/shaderobj.h
+++ b/src/mesa/main/shaderobj.h
@@ -83,9 +83,6 @@ _mesa_reference_shader_program(struct gl_context *ctx,
 extern struct gl_shader *
 _mesa_new_shader(GLuint name, gl_shader_stage type);
 
-extern struct gl_linked_shader *
-_mesa_new_linked_shader(gl_shader_stage type);
-
 extern void
 _mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh);
 
-- 
2.9.3



More information about the mesa-dev mailing list