2 * Mesa 3-D graphics library
4 * Copyright (C) 2013 LunarG, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
25 * Chia-I Wu <olv@lunarg.com>
31 #include "ilo_common.h"
32 #include "ilo_state.h"
34 enum ilo_blitter_uses
{
35 ILO_BLITTER_USE_DSA
= 1 << 0,
36 ILO_BLITTER_USE_CC
= 1 << 1,
37 ILO_BLITTER_USE_VIEWPORT
= 1 << 2,
38 ILO_BLITTER_USE_FB_DEPTH
= 1 << 3,
39 ILO_BLITTER_USE_FB_STENCIL
= 1 << 4,
42 struct blitter_context
;
48 struct ilo_context
*ilo
;
49 struct blitter_context
*pipe_blitter
;
52 * A minimal context with the goal to send RECTLISTs down the pipeline.
54 enum ilo_state_raster_earlyz_op earlyz_op
;
55 bool earlyz_stencil_clear
;
61 struct gen6_3dprimitive_info draw_info
;
64 struct ilo_state_vf vf
;
66 struct ilo_state_vs vs
;
67 struct ilo_state_hs hs
;
68 struct ilo_state_ds ds
;
69 struct ilo_state_gs gs
;
71 struct ilo_state_sol sol
;
73 struct ilo_state_viewport vp
;
76 struct ilo_state_sbe sbe
;
77 struct ilo_state_ps ps
;
78 struct ilo_state_cc cc
;
80 uint32_t depth_clear_value
;
82 struct ilo_state_urb urb
;
85 struct ilo_surface_cso dst
;
86 unsigned width
, height
;
89 struct ilo_state_raster rs
;
94 ilo_blitter_create(struct ilo_context
*ilo
);
97 ilo_blitter_destroy(struct ilo_blitter
*blitter
);
100 ilo_blitter_pipe_blit(struct ilo_blitter
*blitter
,
101 const struct pipe_blit_info
*info
);
104 ilo_blitter_pipe_copy_resource(struct ilo_blitter
*blitter
,
105 struct pipe_resource
*dst
, unsigned dst_level
,
106 unsigned dst_x
, unsigned dst_y
, unsigned dst_z
,
107 struct pipe_resource
*src
, unsigned src_level
,
108 const struct pipe_box
*src_box
);
111 ilo_blitter_pipe_clear_rt(struct ilo_blitter
*blitter
,
112 struct pipe_surface
*rt
,
113 const union pipe_color_union
*color
,
114 unsigned x
, unsigned y
,
115 unsigned width
, unsigned height
);
118 ilo_blitter_pipe_clear_zs(struct ilo_blitter
*blitter
,
119 struct pipe_surface
*zs
,
120 unsigned clear_flags
,
121 double depth
, unsigned stencil
,
122 unsigned x
, unsigned y
,
123 unsigned width
, unsigned height
);
126 ilo_blitter_pipe_clear_fb(struct ilo_blitter
*blitter
,
128 const union pipe_color_union
*color
,
129 double depth
, unsigned stencil
);
132 ilo_blitter_blt_copy_resource(struct ilo_blitter
*blitter
,
133 struct pipe_resource
*dst
, unsigned dst_level
,
134 unsigned dst_x
, unsigned dst_y
, unsigned dst_z
,
135 struct pipe_resource
*src
, unsigned src_level
,
136 const struct pipe_box
*src_box
);
139 ilo_blitter_blt_clear_rt(struct ilo_blitter
*blitter
,
140 struct pipe_surface
*rt
,
141 const union pipe_color_union
*color
,
142 unsigned x
, unsigned y
,
143 unsigned width
, unsigned height
);
146 ilo_blitter_blt_clear_zs(struct ilo_blitter
*blitter
,
147 struct pipe_surface
*zs
,
148 unsigned clear_flags
,
149 double depth
, unsigned stencil
,
150 unsigned x
, unsigned y
,
151 unsigned width
, unsigned height
);
154 ilo_blitter_rectlist_clear_zs(struct ilo_blitter
*blitter
,
155 struct pipe_surface
*zs
,
156 unsigned clear_flags
,
157 double depth
, unsigned stencil
);
160 ilo_blitter_rectlist_resolve_z(struct ilo_blitter
*blitter
,
161 struct pipe_resource
*res
,
162 unsigned level
, unsigned slice
);
165 ilo_blitter_rectlist_resolve_hiz(struct ilo_blitter
*blitter
,
166 struct pipe_resource
*res
,
167 unsigned level
, unsigned slice
);
169 #endif /* ILO_BLITTER_H */