summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/arbprogram.c
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-08 10:00:28 -0800
committerPaul Berry <[email protected]>2014-01-09 09:31:01 -0800
commit84732a982c3eeaca2e2809532c8422dc5f7045c1 (patch)
tree851c411dc92ad2192d2c63db0898dec46a200611 /src/mesa/main/arbprogram.c
parent9b96be595b93544266436ec3b22b2cbd349d180c (diff)
mesa: replace ctx->Const.{Vertex,Fragment,Geomtery}Program with an array.
These are replaced with ctx->Const.Program[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}]. In patches to follow, this will allow us to replace a lot of ad-hoc logic with a variable index into the array. With the exception of the changes to mtypes.h, this patch was generated entirely by the command: find src -type f '(' -iname '*.c' -o -iname '*.cpp' -o -iname '*.py' \ -o -iname '*.y' ')' -print0 | xargs -0 sed -i \ -e 's/Const\.VertexProgram/Const.Program[MESA_SHADER_VERTEX]/g' \ -e 's/Const\.GeometryProgram/Const.Program[MESA_SHADER_GEOMETRY]/g' \ -e 's/Const\.FragmentProgram/Const.Program[MESA_SHADER_FRAGMENT]/g' Suggested-by: Brian Paul <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/arbprogram.c')
-rw-r--r--src/mesa/main/arbprogram.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c
index bf2a5f83298..247b4925368 100644
--- a/src/mesa/main/arbprogram.c
+++ b/src/mesa/main/arbprogram.c
@@ -247,12 +247,12 @@ get_local_param_pointer(struct gl_context *ctx, const char *func,
if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
prog = &(ctx->VertexProgram.Current->Base);
- maxParams = ctx->Const.VertexProgram.MaxLocalParams;
+ maxParams = ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams;
}
else if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
prog = &(ctx->FragmentProgram.Current->Base);
- maxParams = ctx->Const.FragmentProgram.MaxLocalParams;
+ maxParams = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams;
}
else {
_mesa_error(ctx, GL_INVALID_ENUM,
@@ -282,7 +282,7 @@ get_env_param_pointer(struct gl_context *ctx, const char *func,
{
if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
- if (index >= ctx->Const.FragmentProgram.MaxEnvParams) {
+ if (index >= ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxEnvParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func);
return GL_FALSE;
}
@@ -291,7 +291,7 @@ get_env_param_pointer(struct gl_context *ctx, const char *func,
}
else if (target == GL_VERTEX_PROGRAM_ARB &&
ctx->Extensions.ARB_vertex_program) {
- if (index >= ctx->Const.VertexProgram.MaxEnvParams) {
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxEnvParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func);
return GL_FALSE;
}
@@ -436,7 +436,7 @@ _mesa_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
- if ((index + count) > ctx->Const.FragmentProgram.MaxEnvParams) {
+ if ((index + count) > ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxEnvParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)");
return;
}
@@ -444,7 +444,7 @@ _mesa_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
}
else if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
- if ((index + count) > ctx->Const.VertexProgram.MaxEnvParams) {
+ if ((index + count) > ctx->Const.Program[MESA_SHADER_VERTEX].MaxEnvParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)");
return;
}
@@ -530,8 +530,8 @@ _mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
if (get_local_param_pointer(ctx, "glProgramLocalParameters4fvEXT",
target, index, &dest)) {
GLuint maxParams = target == GL_FRAGMENT_PROGRAM_ARB ?
- ctx->Const.FragmentProgram.MaxLocalParams :
- ctx->Const.VertexProgram.MaxLocalParams;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams :
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams;
if ((index + count) > maxParams) {
_mesa_error(ctx, GL_INVALID_VALUE,
@@ -602,12 +602,12 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params)
if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
prog = &(ctx->VertexProgram.Current->Base);
- limits = &ctx->Const.VertexProgram;
+ limits = &ctx->Const.Program[MESA_SHADER_VERTEX];
}
else if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
prog = &(ctx->FragmentProgram.Current->Base);
- limits = &ctx->Const.FragmentProgram;
+ limits = &ctx->Const.Program[MESA_SHADER_FRAGMENT];
}
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivARB(target)");