2 * Mesa 3-D graphics library
4 * Copyright (C) 2012-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>
28 #ifndef ILO_RENDER_GEN_H
29 #define ILO_RENDER_GEN_H
31 #include "ilo_common.h"
35 struct ilo_state_vector
;
37 struct gen6_draw_session
{
43 bool batch_bo_changed
;
44 bool state_bo_changed
;
45 bool kernel_bo_changed
;
47 bool primitive_restart_changed
;
49 void (*emit_draw_states
)(struct ilo_render
*render
,
50 const struct ilo_state_vector
*ilo
,
51 struct gen6_draw_session
*session
);
53 void (*emit_draw_commands
)(struct ilo_render
*render
,
54 const struct ilo_state_vector
*ilo
,
55 struct gen6_draw_session
*session
);
58 bool viewport_state_changed
;
59 bool cc_state_blend_changed
;
60 bool cc_state_dsa_changed
;
61 bool cc_state_cc_changed
;
62 bool scissor_state_changed
;
63 bool binding_table_vs_changed
;
64 bool binding_table_gs_changed
;
65 bool binding_table_fs_changed
;
66 bool sampler_state_vs_changed
;
67 bool sampler_state_gs_changed
;
68 bool sampler_state_fs_changed
;
69 bool pcb_state_vs_changed
;
70 bool pcb_state_gs_changed
;
71 bool pcb_state_fs_changed
;
73 int num_surfaces
[PIPE_SHADER_TYPES
];
76 struct gen6_rectlist_session
{
77 uint32_t DEPTH_STENCIL_STATE
;
78 uint32_t COLOR_CALC_STATE
;
83 gen6_draw_prepare(const struct ilo_render
*r
,
84 const struct ilo_state_vector
*ilo
,
85 struct gen6_draw_session
*session
);
88 gen6_draw_emit(struct ilo_render
*r
,
89 const struct ilo_state_vector
*ilo
,
90 struct gen6_draw_session
*session
);
93 gen6_draw_end(struct ilo_render
*r
,
94 const struct ilo_state_vector
*ilo
,
95 struct gen6_draw_session
*session
);
98 gen6_draw_common_select(struct ilo_render
*r
,
99 const struct ilo_state_vector
*ilo
,
100 struct gen6_draw_session
*session
);
103 gen6_draw_common_sip(struct ilo_render
*r
,
104 const struct ilo_state_vector
*ilo
,
105 struct gen6_draw_session
*session
);
108 gen6_draw_common_base_address(struct ilo_render
*r
,
109 const struct ilo_state_vector
*ilo
,
110 struct gen6_draw_session
*session
);
113 gen6_draw_vf(struct ilo_render
*r
,
114 const struct ilo_state_vector
*ilo
,
115 struct gen6_draw_session
*session
);
118 gen6_draw_vf_statistics(struct ilo_render
*r
,
119 const struct ilo_state_vector
*ilo
,
120 struct gen6_draw_session
*session
);
123 gen6_draw_vs(struct ilo_render
*r
,
124 const struct ilo_state_vector
*ilo
,
125 struct gen6_draw_session
*session
);
128 gen6_draw_clip(struct ilo_render
*r
,
129 const struct ilo_state_vector
*ilo
,
130 struct gen6_draw_session
*session
);
133 gen6_draw_sf_rect(struct ilo_render
*r
,
134 const struct ilo_state_vector
*ilo
,
135 struct gen6_draw_session
*session
);
138 gen6_draw_wm_raster(struct ilo_render
*r
,
139 const struct ilo_state_vector
*ilo
,
140 struct gen6_draw_session
*session
);
143 gen6_draw_states(struct ilo_render
*r
,
144 const struct ilo_state_vector
*ilo
,
145 struct gen6_draw_session
*session
);
148 gen6_render_estimate_state_size(const struct ilo_render
*render
,
149 const struct ilo_state_vector
*ilo
);
152 gen6_render_estimate_query_size(const struct ilo_render
*render
,
153 const struct ilo_query
*q
);
156 ilo_render_emit_flush_gen6(struct ilo_render
*r
);
159 ilo_render_emit_query_gen6(struct ilo_render
*r
,
160 struct ilo_query
*q
, uint32_t offset
);
163 ilo_render_init_gen6(struct ilo_render
*render
);
165 #endif /* ILO_RENDER_GEN_H */