[Mesa-dev] [PATCH] llvmpipe: add get sample position

Roland Scheidegger sroland at vmware.com
Mon Nov 25 09:36:50 PST 2013


Am 25.11.2013 11:57, schrieb Dave Airlie:
> This just always returns 0.5,0.5 as the position.
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/gallium/drivers/llvmpipe/lp_context.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
> index 9a6d13b..678f852 100644
> --- a/src/gallium/drivers/llvmpipe/lp_context.c
> +++ b/src/gallium/drivers/llvmpipe/lp_context.c
> @@ -122,6 +122,15 @@ llvmpipe_render_condition ( struct pipe_context *pipe,
>     llvmpipe->render_cond_cond = condition;
>  }
>  
> +static void
> +llvmpipe_get_sample_position( struct pipe_context *pipe,
> +                              unsigned sample_count,
> +                              unsigned sample_index,
> +                              float *out_value )
> +{
> +   out_value[0] = out_value[1] = 0.5;
Shouldn't the result actually be different in theory according to
half_pixel_center? I guess noone really would care though.

> +}
> +
>  struct pipe_context *
>  llvmpipe_create_context( struct pipe_screen *screen, void *priv )
>  {
> @@ -150,6 +159,7 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
>     llvmpipe->pipe.flush = do_flush;
>  
>     llvmpipe->pipe.render_condition = llvmpipe_render_condition;
> +   llvmpipe->pipe.get_sample_position = llvmpipe_get_sample_position;
>  
>     llvmpipe_init_blend_funcs(llvmpipe);
>     llvmpipe_init_clip_funcs(llvmpipe);
> 

Otherwise this looks good.

Roland


More information about the mesa-dev mailing list