[Mesa-dev] [PATCH] st_glsl_to_tgsi: add support for prim id fragment shader input

Brian Paul brianp at vmware.com
Wed Dec 18 07:21:06 PST 2013


On 12/18/2013 01:01 AM, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> For GLSL 1.50 we can get frag shaders with primitive id as an
> input, add support to the translator for this.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>   src/mesa/state_tracker/st_program.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
> index f010e18..0db8af2 100644
> --- a/src/mesa/state_tracker/st_program.c
> +++ b/src/mesa/state_tracker/st_program.c
> @@ -563,6 +563,11 @@ st_translate_fragment_program(struct st_context *st,
>               input_semantic_index[slot] = 0;
>               interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
>               break;
> +         case VARYING_SLOT_PRIMITIVE_ID:
> +            input_semantic_name[slot] = TGSI_SEMANTIC_PRIMID;
> +            input_semantic_index[slot] = 0;
> +            interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
> +            break;
>            case VARYING_SLOT_CLIP_DIST0:
>               input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
>               input_semantic_index[slot] = 0;
>

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the mesa-dev mailing list