ilo: rename 3d_pipeline to render
[mesa.git] / src / gallium / drivers / ilo / ilo_render_gen.h
1 /*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 2012-2013 LunarG, Inc.
5 *
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:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
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.
23 *
24 * Authors:
25 * Chia-I Wu <olv@lunarg.com>
26 */
27
28 #ifndef ILO_RENDER_GEN_H
29 #define ILO_RENDER_GEN_H
30
31 #include "ilo_common.h"
32
33 struct ilo_query;
34 struct ilo_render;
35 struct ilo_state_vector;
36
37 struct gen6_draw_session {
38 uint32_t pipe_dirty;
39
40 int reduced_prim;
41
42 bool hw_ctx_changed;
43 bool batch_bo_changed;
44 bool state_bo_changed;
45 bool kernel_bo_changed;
46 bool prim_changed;
47 bool primitive_restart_changed;
48
49 void (*emit_draw_states)(struct ilo_render *render,
50 const struct ilo_state_vector *ilo,
51 struct gen6_draw_session *session);
52
53 void (*emit_draw_commands)(struct ilo_render *render,
54 const struct ilo_state_vector *ilo,
55 struct gen6_draw_session *session);
56
57 /* indirect states */
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;
72
73 int num_surfaces[PIPE_SHADER_TYPES];
74 };
75
76 struct gen6_rectlist_session {
77 uint32_t DEPTH_STENCIL_STATE;
78 uint32_t COLOR_CALC_STATE;
79 uint32_t CC_VIEWPORT;
80 };
81
82 void
83 gen6_draw_prepare(const struct ilo_render *r,
84 const struct ilo_state_vector *ilo,
85 struct gen6_draw_session *session);
86
87 void
88 gen6_draw_emit(struct ilo_render *r,
89 const struct ilo_state_vector *ilo,
90 struct gen6_draw_session *session);
91
92 void
93 gen6_draw_end(struct ilo_render *r,
94 const struct ilo_state_vector *ilo,
95 struct gen6_draw_session *session);
96
97 void
98 gen6_draw_common_select(struct ilo_render *r,
99 const struct ilo_state_vector *ilo,
100 struct gen6_draw_session *session);
101
102 void
103 gen6_draw_common_sip(struct ilo_render *r,
104 const struct ilo_state_vector *ilo,
105 struct gen6_draw_session *session);
106
107 void
108 gen6_draw_common_base_address(struct ilo_render *r,
109 const struct ilo_state_vector *ilo,
110 struct gen6_draw_session *session);
111
112 void
113 gen6_draw_vf(struct ilo_render *r,
114 const struct ilo_state_vector *ilo,
115 struct gen6_draw_session *session);
116
117 void
118 gen6_draw_vf_statistics(struct ilo_render *r,
119 const struct ilo_state_vector *ilo,
120 struct gen6_draw_session *session);
121
122 void
123 gen6_draw_vs(struct ilo_render *r,
124 const struct ilo_state_vector *ilo,
125 struct gen6_draw_session *session);
126
127 void
128 gen6_draw_clip(struct ilo_render *r,
129 const struct ilo_state_vector *ilo,
130 struct gen6_draw_session *session);
131
132 void
133 gen6_draw_sf_rect(struct ilo_render *r,
134 const struct ilo_state_vector *ilo,
135 struct gen6_draw_session *session);
136
137 void
138 gen6_draw_wm_raster(struct ilo_render *r,
139 const struct ilo_state_vector *ilo,
140 struct gen6_draw_session *session);
141
142 void
143 gen6_draw_states(struct ilo_render *r,
144 const struct ilo_state_vector *ilo,
145 struct gen6_draw_session *session);
146
147 int
148 gen6_render_estimate_state_size(const struct ilo_render *render,
149 const struct ilo_state_vector *ilo);
150
151 int
152 gen6_render_estimate_query_size(const struct ilo_render *render,
153 const struct ilo_query *q);
154
155 void
156 ilo_render_emit_flush_gen6(struct ilo_render *r);
157
158 void
159 ilo_render_emit_query_gen6(struct ilo_render *r,
160 struct ilo_query *q, uint32_t offset);
161
162 void
163 ilo_render_init_gen6(struct ilo_render *render);
164
165 #endif /* ILO_RENDER_GEN_H */