[Mesa-dev] [PATCH 03/12] mesa/sso: replace Shader binding point with _Shader
Eric Anholt
eric at anholt.net
Wed Mar 5 12:46:08 PST 2014
Ian Romanick <idr at freedesktop.org> writes:
> From: Gregory Hainaut <gregory.hainaut at gmail.com>
>
> To avoid NULL pointer check a default pipeline object is installed in
> _Shader when no program is current
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index d05649c..8a03afd 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -2824,6 +2824,9 @@ struct gl_pipeline_shader_state
> /** Currently bound pipeline object. See _mesa_BindProgramPipeline() */
> struct gl_pipeline_object *Current;
>
> + /* Default Object to ensure that _Shader is never NULL */
> + struct gl_pipeline_object *Default;
> +
> /** Pipeline objects */
> struct _mesa_HashTable *Objects;
> };
> @@ -4131,6 +4134,18 @@ struct gl_context
>
> struct gl_pipeline_shader_state Pipeline; /**< GLSL pipeline shader object state */
> struct gl_pipeline_object Shader; /**< GLSL shader object state */
> +
> + /**
> + * Current active shader pipeline state
> + *
> + * Almost all internal users want ::_Shader instead of ::Shader. The
> + * exceptions are bits of legacy GLSL API that do not know about separate
> + * shader objects.
> + *
> + * Points to ::Shader, ::Pipeline.Current, or ::Pipeline.Default.
> + */
> + struct gl_pipeline_object *_Shader;
> +
Let's see if I followed:
It points to Shader when there is a GLSL shader program bound to any
stage, it points to Pipeline.Default when all stages are not bound to a
GLSL shader but no SSO pipeline is bound, and it points to
Pipeline.Current when there are no GLSL shader programs individually
bound, but there is a SSO pipeline bound.
Is that right? If so, baking some of that into the comments here would
be really useful.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140305/3e48e13f/attachment.pgp>
More information about the mesa-dev
mailing list