[Mesa-dev] [PATCH] i965: Add support for GL_ARB_cull_distance

Kenneth Graunke kenneth at whitecape.org
Fri May 13 01:39:36 UTC 2016


On Thursday, May 12, 2016 5:39:02 PM PDT Kristian Høgsberg wrote:
> From: Kristian Høgsberg Kristensen <kristian.h.kristensen at intel.com>
> 
> This applies on top of Tobias series.
> 
> Signed-off-by: Kristian Høgsberg Kristensen 
<kristian.h.kristensen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_compiler.h     | 2 ++
>  src/mesa/drivers/dri/i965/brw_vs.c           | 4 ++++
>  src/mesa/drivers/dri/i965/gen6_clip_state.c  | 2 ++
>  src/mesa/drivers/dri/i965/gen8_ds_state.c    | 3 ++-
>  src/mesa/drivers/dri/i965/gen8_gs_state.c    | 3 ++-
>  src/mesa/drivers/dri/i965/gen8_vs_state.c    | 3 ++-
>  src/mesa/drivers/dri/i965/intel_extensions.c | 1 +
>  7 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_compiler.h b/src/mesa/drivers/
dri/i965/brw_compiler.h
> index 5807305..3d1dc88 100644
> --- a/src/mesa/drivers/dri/i965/brw_compiler.h
> +++ b/src/mesa/drivers/dri/i965/brw_compiler.h
> @@ -592,6 +592,8 @@ struct brw_vue_prog_data {
>     GLuint urb_read_length;
>     GLuint total_grf;
>  
> +   uint32_t cull_distance_mask;
> +
>     /* Used for calculating urb partitions.  In the VS, this is the size of 
the
>      * URB entry used for both input and output to the thread.  In the GS, 
this
>      * is the size of the URB entry used for output.
> diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/
brw_vs.c
> index 3095d82..1bbc315 100644
> --- a/src/mesa/drivers/dri/i965/brw_vs.c
> +++ b/src/mesa/drivers/dri/i965/brw_vs.c
> @@ -118,6 +118,10 @@ brw_codegen_vs_prog(struct brw_context *brw,
>        prog_data.inputs_read |= VERT_BIT_EDGEFLAG;
>     }
>  
> +   prog_data.base.cull_distance_mask =
> +      ((1 << vp->program.Base.CullDistanceArraySize) - 1) <<
> +      vp->program.Base.ClipDistanceArraySize;
> +

You need to set this in brw_codegen_gs_prog and brw_codegen_tes_prog as
well, using gp-> and tep->.

With that fixed, this would get a
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160512/0c40d448/attachment.sig>


More information about the mesa-dev mailing list