[Mesa-dev] [PATCH 4/6] mesa/st: wire up DiscardSubFramebuffer
Ilia Mirkin
imirkin at alum.mit.edu
Tue Dec 11 23:10:08 UTC 2018
On Tue, Dec 11, 2018 at 5:50 PM Rob Clark <robdclark at gmail.com> wrote:
>
> Signed-off-by: Rob Clark <robdclark at gmail.com>
> ---
> src/gallium/include/pipe/p_context.h | 11 +++++++++++
> src/mesa/state_tracker/st_cb_fbo.c | 26 ++++++++++++++++++++++++++
> 2 files changed, 37 insertions(+)
>
> diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
> index d4e9179b78a..eb52c7e9a4e 100644
> --- a/src/gallium/include/pipe/p_context.h
> +++ b/src/gallium/include/pipe/p_context.h
> @@ -811,6 +811,17 @@ struct pipe_context {
> void (*invalidate_surface)(struct pipe_context *ctx,
> struct pipe_surface *surf);
>
> + /**
> + * Invalidate a portion of a surface. This is used to
> + *
> + * (1) implement glInvalidateSubFramebuffer() and friends
> + * (2) as a hint before a scissored clear (which is turned into draw_vbo()
> + * that the cleared rect can be discarded
> + */
> + void (*invalidate_sub_surface)(struct pipe_context *ctx,
> + struct pipe_surface *surf,
> + const struct pipe_scissor_state *rect);
I think pipe_box is a bit more natural here than scissor state? box is
used for transfers, etc. This could also enable you to to specify a
sub-3d area. And perhaps by passing a level, you could go back to this
being a resource (and just extend invalidate_resource)?
-ilia
More information about the mesa-dev
mailing list