summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pipelineobj.c
diff options
context:
space:
mode:
authorGregory Hainaut <[email protected]>2013-06-28 14:33:54 -0700
committerIan Romanick <[email protected]>2014-03-25 10:25:25 -0700
commitb2bddaf7a000bf9830a7947b18d8e31fb25353ae (patch)
tree1c7d2871fa96db31f7d35963024ea6dc39c82999 /src/mesa/main/pipelineobj.c
parentb995a010e688bc4d4557e973e5e28091c378e881 (diff)
mesa/sso: replace Shader binding point with _Shader
To avoid NULL pointer check a default pipeline object is installed in _Shader when no program is current The spec say that UseProgram/UseShaderProgramEXT/ActiveProgramEXT got an higher priority over the pipeline object. When default program is uninstall, the pipeline is used if any was bound. Note: A careful rename need to be done now... V2: formating improvement V3 (idr): * Build fix. The original patch added calls to _mesa_use_shader_program with 4 parameters, but the fourth parameter isn't added to that function until a much later patch. Just drop that parameter for now. * Trivial reformatting. * Updated comment of gl_context::_Shader v4 (idr): Reformat spec quotations to look like spec quotations. Update comments describing what gl_context::_Shader can point to. Bot suggested by Eric. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/pipelineobj.c')
-rw-r--r--src/mesa/main/pipelineobj.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index 27012df7273..849c7818d1f 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -94,6 +94,10 @@ _mesa_init_pipeline(struct gl_context *ctx)
ctx->Pipeline.Objects = _mesa_NewHashTable();
ctx->Pipeline.Current = NULL;
+
+ /* Install a default Pipeline */
+ ctx->Pipeline.Default = _mesa_new_pipeline_object(ctx, 0);
+ _mesa_reference_pipeline_object(ctx, &ctx->_Shader, ctx->Pipeline.Default);
}
@@ -117,6 +121,10 @@ _mesa_free_pipeline_data(struct gl_context *ctx)
{
_mesa_HashDeleteAll(ctx->Pipeline.Objects, delete_pipelineobj_cb, ctx);
_mesa_DeleteHashTable(ctx->Pipeline.Objects);
+
+ _mesa_reference_pipeline_object(ctx, &ctx->_Shader, NULL);
+ _mesa_delete_pipeline_object(ctx, ctx->Pipeline.Default);
+
}
/**