summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/transformfeedback.c
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-09 11:16:27 -0800
committerPaul Berry <[email protected]>2014-01-21 20:25:02 -0800
commit3b22146dc714b6090f7423abbc4df53d7d1fdaa9 (patch)
treeb59bef08624870671092f9906585869f6f9aeac9 /src/mesa/main/transformfeedback.c
parentcd18ba1c7aba66f2dd7cdbe2cf3b4a803c241d10 (diff)
mesa: Replace ctx->Shader.Current{Vertex,Fragment,Geometry}Program with an array.
These are replaced with ctx->Shader.CurrentProgram[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' ')' \ -print0 | xargs -0 sed -i \ -e 's/\.CurrentVertexProgram/.CurrentProgram[MESA_SHADER_VERTEX]/g' \ -e 's/\.CurrentGeometryProgram/.CurrentProgram[MESA_SHADER_GEOMETRY]/g' \ -e 's/\.CurrentFragmentProgram/.CurrentProgram[MESA_SHADER_FRAGMENT]/g' Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/transformfeedback.c')
-rw-r--r--src/mesa/main/transformfeedback.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
index 76d213b16aa..9eaa698ab95 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -387,13 +387,13 @@ _mesa_BeginTransformFeedback(GLenum mode)
obj = ctx->TransformFeedback.CurrentObject;
- if (ctx->Shader.CurrentVertexProgram == NULL) {
+ if (ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] == NULL) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBeginTransformFeedback(no program active)");
return;
}
- info = &ctx->Shader.CurrentVertexProgram->LinkedTransformFeedback;
+ info = &ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]->LinkedTransformFeedback;
if (info->NumOutputs == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION,
@@ -451,7 +451,7 @@ _mesa_BeginTransformFeedback(GLenum mode)
obj->GlesRemainingPrims = max_vertices / vertices_per_prim;
}
- obj->shader_program = ctx->Shader.CurrentVertexProgram;
+ obj->shader_program = ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX];
assert(ctx->Driver.BeginTransformFeedback);
ctx->Driver.BeginTransformFeedback(ctx, mode, obj);
@@ -993,7 +993,7 @@ _mesa_ResumeTransformFeedback(void)
* the program object being used by the current transform feedback object
* is not active."
*/
- if (obj->shader_program != ctx->Shader.CurrentVertexProgram) {
+ if (obj->shader_program != ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX]) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glResumeTransformFeedback(wrong vertex program bound)");
return;