From 127fbc086ba9365e9304843af09fe730edb1d389 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sat, 28 Dec 2013 15:57:49 +0800 Subject: ilo: add HiZ op support to the pipelines Add blitter functions to perform Depth Buffer Clear, Depth Buffer Resolve, and Hierarchical Depth Buffer Resolve. Those functions set ilo_blitter up and pass it to the pipelines to emit the commands. --- src/gallium/drivers/ilo/ilo_blitter.h | 70 ++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/ilo/ilo_blitter.h') diff --git a/src/gallium/drivers/ilo/ilo_blitter.h b/src/gallium/drivers/ilo/ilo_blitter.h index 6a2a0d7022e..c2c86c04e90 100644 --- a/src/gallium/drivers/ilo/ilo_blitter.h +++ b/src/gallium/drivers/ilo/ilo_blitter.h @@ -29,14 +29,64 @@ #define ILO_BLITTER_H #include "ilo_common.h" +#include "ilo_context.h" +#include "ilo_gpe.h" + +enum ilo_blitter_uses { + ILO_BLITTER_USE_DSA = 1 << 0, + ILO_BLITTER_USE_CC = 1 << 1, + ILO_BLITTER_USE_VIEWPORT = 1 << 2, + ILO_BLITTER_USE_FB_DEPTH = 1 << 3, + ILO_BLITTER_USE_FB_STENCIL = 1 << 4, +}; + +enum ilo_blitter_rectlist_op { + ILO_BLITTER_RECTLIST_CLEAR_ZS, + ILO_BLITTER_RECTLIST_RESOLVE_Z, + ILO_BLITTER_RECTLIST_RESOLVE_HIZ, +}; -struct ilo_context; struct blitter_context; +struct pipe_resource; +struct pipe_surface; struct ilo_blitter { struct ilo_context *ilo; - struct blitter_context *pipe_blitter; + + /* + * A minimal context with the goal to send RECTLISTs down the pipeline. + */ + enum ilo_blitter_rectlist_op op; + uint32_t uses; + + bool initialized; + + struct { + struct pipe_resource *res; + unsigned offset, size; + } buffer; + + struct ilo_ve_state ve; + struct ilo_vb_state vb; + struct pipe_draw_info draw; + + struct ilo_viewport_cso viewport; + struct ilo_dsa_state dsa; + + struct { + struct pipe_stencil_ref stencil_ref; + ubyte alpha_ref; + struct pipe_blend_color blend_color; + } cc; + + uint32_t depth_clear_value; + + struct { + struct ilo_surface_cso dst; + unsigned width, height; + unsigned num_samples; + } fb; }; struct ilo_blitter * @@ -99,4 +149,20 @@ ilo_blitter_blt_clear_zs(struct ilo_blitter *blitter, unsigned x, unsigned y, unsigned width, unsigned height); +bool +ilo_blitter_rectlist_clear_zs(struct ilo_blitter *blitter, + struct pipe_surface *zs, + unsigned clear_flags, + double depth, unsigned stencil); + +void +ilo_blitter_rectlist_resolve_z(struct ilo_blitter *blitter, + struct pipe_resource *res, + unsigned level, unsigned slice); + +void +ilo_blitter_rectlist_resolve_hiz(struct ilo_blitter *blitter, + struct pipe_resource *res, + unsigned level, unsigned slice); + #endif /* ILO_BLITTER_H */ -- cgit v1.2.3