[Mesa-dev] [PATCH 02/23] mesa: remove Driver.NewShader

Marek Olšák maraeo at gmail.com
Sun Sep 27 15:20:31 PDT 2015


From: Marek Olšák <marek.olsak at amd.com>

Nothing overrides it.
---
 src/glsl/linker.cpp                  | 2 +-
 src/glsl/main.cpp                    | 2 --
 src/glsl/test_optpass.cpp            | 1 -
 src/mesa/main/dd.h                   | 2 --
 src/mesa/main/ff_fragment_shader.cpp | 3 ++-
 src/mesa/main/shaderapi.c            | 2 +-
 src/mesa/main/shaderobj.c            | 2 --
 7 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 75396fb..29ed1ce 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2060,7 +2060,7 @@ link_intrastage_shaders(void *mem_ctx,
       return NULL;
    }
 
-   gl_shader *linked = ctx->Driver.NewShader(NULL, 0, main->Type);
+   gl_shader *linked = _mesa_new_shader(NULL, 0, main->Type);
    linked->ir = new(linked) exec_list;
    clone_ir_list(mem_ctx, linked->ir, main->ir);
 
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index df93a01..1cf71d1 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -205,8 +205,6 @@ initialize_context(struct gl_context *ctx, gl_api api)
 
    ctx->Const.GenerateTemporaryNames = true;
    ctx->Const.MaxPatchVertices = 32;
-
-   ctx->Driver.NewShader = _mesa_new_shader;
 }
 
 /* Returned string will have 'ctx' as its ralloc owner. */
diff --git a/src/glsl/test_optpass.cpp b/src/glsl/test_optpass.cpp
index fed1fab..90c6e18 100644
--- a/src/glsl/test_optpass.cpp
+++ b/src/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_shader;
    ir_variable::temporaries_allocate_names = true;
 
    struct gl_shader *shader = rzalloc(NULL, struct gl_shader);
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 88f3727..9d5104b 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -783,8 +783,6 @@ struct dd_function_table {
     * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
     */
    /*@{*/
-   struct gl_shader *(*NewShader)(struct gl_context *ctx,
-                                  GLuint name, GLenum type);
    void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
    struct gl_shader_program *(*NewShaderProgram)(GLuint name);
    void (*DeleteShaderProgram)(struct gl_context *ctx,
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index c682892..d666829 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -33,6 +33,7 @@
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/samplerobj.h"
+#include "main/shaderobj.h"
 #include "main/texenvprogram.h"
 #include "main/texobj.h"
 #include "main/uniforms.h"
@@ -1202,7 +1203,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key)
    _mesa_glsl_parse_state *state;
 
    p.mem_ctx = ralloc_context(NULL);
-   p.shader = ctx->Driver.NewShader(ctx, 0, GL_FRAGMENT_SHADER);
+   p.shader = _mesa_new_shader(ctx, 0, GL_FRAGMENT_SHADER);
    p.shader->ir = new(p.shader) exec_list;
    state = new(p.shader) _mesa_glsl_parse_state(ctx, MESA_SHADER_FRAGMENT,
 						p.shader);
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index edc23bc..8c77858 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -305,7 +305,7 @@ create_shader(struct gl_context *ctx, GLenum type)
    }
 
    name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1);
-   sh = ctx->Driver.NewShader(ctx, name, type);
+   sh = _mesa_new_shader(ctx, name, type);
    _mesa_HashInsert(ctx->Shared->ShaderObjects, name, sh);
 
    return name;
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 71d4ed6..afacddc 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -96,7 +96,6 @@ _mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader)
 
 /**
  * Allocate a new gl_shader object, initialize it.
- * Called via ctx->Driver.NewShader()
  */
 struct gl_shader *
 _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
@@ -438,7 +437,6 @@ _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_shader;
    driver->DeleteShader = _mesa_delete_shader;
    driver->NewShaderProgram = _mesa_new_shader_program;
    driver->DeleteShaderProgram = _mesa_delete_shader_program;
-- 
2.1.4



More information about the mesa-dev mailing list