ilo: hook up pipe context 3D functions
[mesa.git] / src / gallium / drivers / ilo / ilo_3d_pipeline_gen6.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_3D_PIPELINE_GEN6_H
29 #define ILO_3D_PIPELINE_GEN6_H
30
31 #include "ilo_common.h"
32
33 struct ilo_3d_pipeline;
34 struct ilo_context;
35
36 struct gen6_pipeline_session {
37 const struct pipe_draw_info *info;
38
39 uint32_t pipe_dirty;
40
41 int reduced_prim;
42 int init_cp_space;
43
44 bool hw_ctx_changed;
45 bool state_bo_changed;
46 bool instruction_bo_changed;
47 bool prim_changed;
48
49 void (*emit_draw_states)(struct ilo_3d_pipeline *p,
50 const struct ilo_context *ilo,
51 struct gen6_pipeline_session *session);
52
53 void (*emit_draw_commands)(struct ilo_3d_pipeline *p,
54 const struct ilo_context *ilo,
55 struct gen6_pipeline_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 void
77 gen6_pipeline_prepare(const struct ilo_3d_pipeline *p,
78 const struct ilo_context *ilo,
79 const struct pipe_draw_info *info,
80 struct gen6_pipeline_session *session);
81
82 void
83 gen6_pipeline_draw(struct ilo_3d_pipeline *p,
84 const struct ilo_context *ilo,
85 struct gen6_pipeline_session *session);
86
87 void
88 gen6_pipeline_end(struct ilo_3d_pipeline *p,
89 const struct ilo_context *ilo,
90 struct gen6_pipeline_session *session);
91
92 void
93 gen6_pipeline_common_select(struct ilo_3d_pipeline *p,
94 const struct ilo_context *ilo,
95 struct gen6_pipeline_session *session);
96
97 void
98 gen6_pipeline_common_sip(struct ilo_3d_pipeline *p,
99 const struct ilo_context *ilo,
100 struct gen6_pipeline_session *session);
101
102 void
103 gen6_pipeline_common_base_address(struct ilo_3d_pipeline *p,
104 const struct ilo_context *ilo,
105 struct gen6_pipeline_session *session);
106
107 void
108 gen6_pipeline_vf(struct ilo_3d_pipeline *p,
109 const struct ilo_context *ilo,
110 struct gen6_pipeline_session *session);
111
112 void
113 gen6_pipeline_vf_statistics(struct ilo_3d_pipeline *p,
114 const struct ilo_context *ilo,
115 struct gen6_pipeline_session *session);
116
117 void
118 gen6_pipeline_vf_draw(struct ilo_3d_pipeline *p,
119 const struct ilo_context *ilo,
120 struct gen6_pipeline_session *session);
121
122 void
123 gen6_pipeline_vs(struct ilo_3d_pipeline *p,
124 const struct ilo_context *ilo,
125 struct gen6_pipeline_session *session);
126
127 void
128 gen6_pipeline_clip(struct ilo_3d_pipeline *p,
129 const struct ilo_context *ilo,
130 struct gen6_pipeline_session *session);
131
132 void
133 gen6_pipeline_sf_rect(struct ilo_3d_pipeline *p,
134 const struct ilo_context *ilo,
135 struct gen6_pipeline_session *session);
136
137 void
138 gen6_pipeline_wm_raster(struct ilo_3d_pipeline *p,
139 const struct ilo_context *ilo,
140 struct gen6_pipeline_session *session);
141
142 void
143 gen6_pipeline_states(struct ilo_3d_pipeline *p,
144 const struct ilo_context *ilo,
145 struct gen6_pipeline_session *session);
146
147 void
148 ilo_3d_pipeline_emit_flush_gen6(struct ilo_3d_pipeline *p);
149
150 void
151 ilo_3d_pipeline_emit_write_timestamp_gen6(struct ilo_3d_pipeline *p,
152 struct intel_bo *bo, int index);
153
154 void
155 ilo_3d_pipeline_emit_write_depth_count_gen6(struct ilo_3d_pipeline *p,
156 struct intel_bo *bo, int index);
157
158 void
159 ilo_3d_pipeline_init_gen6(struct ilo_3d_pipeline *p);
160
161 #endif /* ILO_3D_PIPELINE_GEN6_H */