rbug: Extend context info and block ops
[mesa.git] / src / gallium / auxiliary / rbug / rbug_context.h
1 /*
2 * Copyright 2009 VMware, Inc.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * on the rights to use, copy, modify, merge, publish, distribute, sub
9 * license, and/or sell copies of the Software, and to permit persons to whom
10 * the Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * 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 NON-INFRINGEMENT. IN NO EVENT SHALL
19 * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22 * USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 /*
26 * This file holds structs decelerations and function prototypes for one of
27 * the rbug extensions. Implementation of the functions is in the same folder
28 * in the c file matching this file's name.
29 *
30 * The structs what is returned from the demarshal functions. The functions
31 * starting rbug_send_* encodes a call to the write format and sends that to
32 * the supplied connection, while functions starting with rbug_demarshal_*
33 * demarshal data from the wire protocol.
34 *
35 * Structs and functions ending with _reply are replies to requests.
36 */
37
38 #ifndef _RBUG_PROTO_CONTEXT_H_
39 #define _RBUG_PROTO_CONTEXT_H_
40
41 #include "rbug/rbug_proto.h"
42 #include "rbug/rbug_core.h"
43
44 typedef uint64_t rbug_block_rule_t;
45
46 typedef enum
47 {
48 RBUG_BLOCK_BEFORE = 1,
49 RBUG_BLOCK_AFTER = 2,
50 } rbug_block_t;
51
52 struct rbug_proto_context_list
53 {
54 struct rbug_header header;
55 };
56
57 struct rbug_proto_context_info
58 {
59 struct rbug_header header;
60 rbug_context_t context;
61 };
62
63 struct rbug_proto_context_draw_block
64 {
65 struct rbug_header header;
66 rbug_context_t context;
67 rbug_block_t block;
68 };
69
70 struct rbug_proto_context_draw_step
71 {
72 struct rbug_header header;
73 rbug_context_t context;
74 rbug_block_t step;
75 };
76
77 struct rbug_proto_context_draw_unblock
78 {
79 struct rbug_header header;
80 rbug_context_t context;
81 rbug_block_t unblock;
82 };
83
84 struct rbug_proto_context_flush
85 {
86 struct rbug_header header;
87 rbug_context_t context;
88 int32_t flags;
89 };
90
91 struct rbug_proto_context_rule_add
92 {
93 struct rbug_header header;
94 rbug_context_t context;
95 rbug_shader_t vertex;
96 rbug_shader_t fragment;
97 rbug_texture_t texture;
98 rbug_texture_t surface;
99 rbug_block_t block;
100 };
101
102 struct rbug_proto_context_rule_delete
103 {
104 struct rbug_header header;
105 rbug_context_t context;
106 rbug_block_rule_t rule;
107 };
108
109 struct rbug_proto_context_list_reply
110 {
111 struct rbug_header header;
112 uint32_t serial;
113 rbug_context_t *contexts;
114 uint32_t contexts_len;
115 };
116
117 struct rbug_proto_context_info_reply
118 {
119 struct rbug_header header;
120 uint32_t serial;
121 rbug_shader_t vertex;
122 rbug_shader_t fragment;
123 rbug_texture_t *texs;
124 uint32_t texs_len;
125 rbug_texture_t *cbufs;
126 uint32_t cbufs_len;
127 rbug_texture_t zsbuf;
128 rbug_block_t blocker;
129 rbug_block_t blocked;
130 };
131
132 struct rbug_proto_context_rule_add_reply
133 {
134 struct rbug_header header;
135 uint32_t serial;
136 rbug_block_rule_t rule;
137 };
138
139 struct rbug_proto_context_draw_blocked
140 {
141 struct rbug_header header;
142 rbug_context_t context;
143 rbug_block_t block;
144 };
145
146 int rbug_send_context_list(struct rbug_connection *__con,
147 uint32_t *__serial);
148
149 int rbug_send_context_info(struct rbug_connection *__con,
150 rbug_context_t context,
151 uint32_t *__serial);
152
153 int rbug_send_context_draw_block(struct rbug_connection *__con,
154 rbug_context_t context,
155 rbug_block_t block,
156 uint32_t *__serial);
157
158 int rbug_send_context_draw_step(struct rbug_connection *__con,
159 rbug_context_t context,
160 rbug_block_t step,
161 uint32_t *__serial);
162
163 int rbug_send_context_draw_unblock(struct rbug_connection *__con,
164 rbug_context_t context,
165 rbug_block_t unblock,
166 uint32_t *__serial);
167
168 int rbug_send_context_flush(struct rbug_connection *__con,
169 rbug_context_t context,
170 int32_t flags,
171 uint32_t *__serial);
172
173 int rbug_send_context_rule_add(struct rbug_connection *__con,
174 rbug_context_t context,
175 rbug_shader_t vertex,
176 rbug_shader_t fragment,
177 rbug_texture_t texture,
178 rbug_texture_t surface,
179 rbug_block_t block,
180 uint32_t *__serial);
181
182 int rbug_send_context_rule_delete(struct rbug_connection *__con,
183 rbug_context_t context,
184 rbug_block_rule_t rule,
185 uint32_t *__serial);
186
187 int rbug_send_context_list_reply(struct rbug_connection *__con,
188 uint32_t serial,
189 rbug_context_t *contexts,
190 uint32_t contexts_len,
191 uint32_t *__serial);
192
193 int rbug_send_context_info_reply(struct rbug_connection *__con,
194 uint32_t serial,
195 rbug_shader_t vertex,
196 rbug_shader_t fragment,
197 rbug_texture_t *texs,
198 uint32_t texs_len,
199 rbug_texture_t *cbufs,
200 uint32_t cbufs_len,
201 rbug_texture_t zsbuf,
202 rbug_block_t blocker,
203 rbug_block_t blocked,
204 uint32_t *__serial);
205
206 int rbug_send_context_rule_add_reply(struct rbug_connection *__con,
207 uint32_t serial,
208 rbug_block_rule_t rule,
209 uint32_t *__serial);
210
211 int rbug_send_context_draw_blocked(struct rbug_connection *__con,
212 rbug_context_t context,
213 rbug_block_t block,
214 uint32_t *__serial);
215
216 struct rbug_proto_context_list * rbug_demarshal_context_list(struct rbug_proto_header *header);
217
218 struct rbug_proto_context_info * rbug_demarshal_context_info(struct rbug_proto_header *header);
219
220 struct rbug_proto_context_draw_block * rbug_demarshal_context_draw_block(struct rbug_proto_header *header);
221
222 struct rbug_proto_context_draw_step * rbug_demarshal_context_draw_step(struct rbug_proto_header *header);
223
224 struct rbug_proto_context_draw_unblock * rbug_demarshal_context_draw_unblock(struct rbug_proto_header *header);
225
226 struct rbug_proto_context_flush * rbug_demarshal_context_flush(struct rbug_proto_header *header);
227
228 struct rbug_proto_context_rule_add * rbug_demarshal_context_rule_add(struct rbug_proto_header *header);
229
230 struct rbug_proto_context_rule_delete * rbug_demarshal_context_rule_delete(struct rbug_proto_header *header);
231
232 struct rbug_proto_context_list_reply * rbug_demarshal_context_list_reply(struct rbug_proto_header *header);
233
234 struct rbug_proto_context_info_reply * rbug_demarshal_context_info_reply(struct rbug_proto_header *header);
235
236 struct rbug_proto_context_rule_add_reply * rbug_demarshal_context_rule_add_reply(struct rbug_proto_header *header);
237
238 struct rbug_proto_context_draw_blocked * rbug_demarshal_context_draw_blocked(struct rbug_proto_header *header);
239
240 #endif