summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-06-28 09:41:59 +1000
committerTimothy Arceri <[email protected]>2016-06-30 16:51:25 +1000
commitfd2b3da5c8cdbc5b00436185a3c03dfb7b7bd853 (patch)
tree7c08cfcdb3d15870a979b5b0641a9a1aeca4c0cd /src
parent32c410d2df2b9c9476834bf891cdcf8254bdfb4e (diff)
glsl/main: remove unused params and make function static
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/builtin_functions.cpp2
-rw-r--r--src/compiler/glsl/standalone_scaffolding.cpp4
-rw-r--r--src/compiler/glsl/standalone_scaffolding.h2
-rw-r--r--src/mesa/drivers/common/meta.c2
-rw-r--r--src/mesa/main/ff_fragment_shader.cpp2
-rw-r--r--src/mesa/main/shaderapi.c2
-rw-r--r--src/mesa/main/shaderobj.c8
-rw-r--r--src/mesa/main/shaderobj.h6
8 files changed, 11 insertions, 17 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index ae4e8f2c455..941ea1242bb 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -956,7 +956,7 @@ builtin_builder::create_shader()
* GLSL utility code that could be linked against any stage, so just
* arbitrarily pick GL_VERTEX_SHADER.
*/
- shader = _mesa_new_shader(NULL, 0, MESA_SHADER_VERTEX);
+ shader = _mesa_new_shader(0, MESA_SHADER_VERTEX);
shader->symbols = new(mem_ctx) glsl_symbol_table;
gl_ModelViewProjectionMatrix =
diff --git a/src/compiler/glsl/standalone_scaffolding.cpp b/src/compiler/glsl/standalone_scaffolding.cpp
index b5dc5231ee8..53729af3921 100644
--- a/src/compiler/glsl/standalone_scaffolding.cpp
+++ b/src/compiler/glsl/standalone_scaffolding.cpp
@@ -68,12 +68,10 @@ _mesa_shader_debug(struct gl_context *, GLenum, GLuint *,
}
struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, gl_shader_stage stage)
+_mesa_new_shader(GLuint name, gl_shader_stage stage)
{
struct gl_shader *shader;
- (void) ctx;
-
assert(stage == MESA_SHADER_FRAGMENT || stage == MESA_SHADER_VERTEX);
shader = rzalloc(NULL, struct gl_shader);
if (shader) {
diff --git a/src/compiler/glsl/standalone_scaffolding.h b/src/compiler/glsl/standalone_scaffolding.h
index c6666c9c73d..a19eae28de6 100644
--- a/src/compiler/glsl/standalone_scaffolding.h
+++ b/src/compiler/glsl/standalone_scaffolding.h
@@ -42,7 +42,7 @@ _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
struct gl_shader *sh);
extern "C" struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, gl_shader_stage stage);
+_mesa_new_shader(GLuint name, gl_shader_stage stage);
extern "C" struct gl_linked_shader *
_mesa_new_linked_shader(gl_shader_stage stage);
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index df57c87fa3f..fdc4748602f 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -129,7 +129,7 @@ meta_compile_shader_with_debug(struct gl_context *ctx, gl_shader_stage stage,
const GLuint name = ~0;
struct gl_shader *sh;
- sh = _mesa_new_shader(ctx, name, stage);
+ sh = _mesa_new_shader(name, stage);
sh->Source = strdup(source);
sh->CompileStatus = false;
_mesa_compile_shader(ctx, sh);
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index f90d31ae7e9..83881e9ccf1 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -1203,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 = _mesa_new_shader(ctx, 0, MESA_SHADER_FRAGMENT);
+ p.shader = _mesa_new_shader(0, MESA_SHADER_FRAGMENT);
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 962b42e62ae..fdfe1e7c6c4 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -334,7 +334,7 @@ create_shader(struct gl_context *ctx, GLenum type)
_mesa_HashLockMutex(ctx->Shared->ShaderObjects);
name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1);
- sh = _mesa_new_shader(ctx, name, _mesa_shader_enum_to_shader_stage(type));
+ sh = _mesa_new_shader(name, _mesa_shader_enum_to_shader_stage(type));
sh->Type = type;
_mesa_HashInsertLocked(ctx->Shared->ShaderObjects, name, sh);
_mesa_HashUnlockMutex(ctx->Shared->ShaderObjects);
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 93fdc669f2f..131d6824df0 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -88,8 +88,8 @@ _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
}
}
-void
-_mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader)
+static void
+_mesa_init_shader(struct gl_shader *shader)
{
shader->RefCount = 1;
shader->Geom.VerticesOut = -1;
@@ -101,14 +101,14 @@ _mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader)
* Allocate a new gl_shader object, initialize it.
*/
struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, gl_shader_stage stage)
+_mesa_new_shader(GLuint name, gl_shader_stage stage)
{
struct gl_shader *shader;
shader = rzalloc(NULL, struct gl_shader);
if (shader) {
shader->Stage = stage;
shader->Name = name;
- _mesa_init_shader(ctx, shader);
+ _mesa_init_shader(shader);
}
return shader;
}
diff --git a/src/mesa/main/shaderobj.h b/src/mesa/main/shaderobj.h
index f331db11664..814a7f11552 100644
--- a/src/mesa/main/shaderobj.h
+++ b/src/mesa/main/shaderobj.h
@@ -75,12 +75,8 @@ _mesa_reference_shader_program(struct gl_context *ctx,
_mesa_reference_shader_program_(ctx, ptr, shProg);
}
-
-extern void
-_mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader);
-
extern struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, gl_shader_stage type);
+_mesa_new_shader(GLuint name, gl_shader_stage type);
extern struct gl_linked_shader *
_mesa_new_linked_shader(gl_shader_stage type);