2 * Copyright 2009 VMware, Inc.
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:
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
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.
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.
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.
35 * Structs and functions ending with _reply are replies to requests.
38 #ifndef _RBUG_PROTO_CONTEXT_H_
39 #define _RBUG_PROTO_CONTEXT_H_
41 #include "rbug/rbug_proto.h"
42 #include "rbug/rbug_core.h"
44 typedef uint64_t rbug_block_rule_t
;
48 RBUG_BLOCK_BEFORE
= 1,
52 struct rbug_proto_context_list
54 struct rbug_header header
;
57 struct rbug_proto_context_info
59 struct rbug_header header
;
60 rbug_context_t context
;
63 struct rbug_proto_context_draw_block
65 struct rbug_header header
;
66 rbug_context_t context
;
70 struct rbug_proto_context_draw_step
72 struct rbug_header header
;
73 rbug_context_t context
;
77 struct rbug_proto_context_draw_unblock
79 struct rbug_header header
;
80 rbug_context_t context
;
84 struct rbug_proto_context_flush
86 struct rbug_header header
;
87 rbug_context_t context
;
91 struct rbug_proto_context_rule_add
93 struct rbug_header header
;
94 rbug_context_t context
;
96 rbug_shader_t fragment
;
97 rbug_texture_t texture
;
98 rbug_texture_t surface
;
102 struct rbug_proto_context_rule_delete
104 struct rbug_header header
;
105 rbug_context_t context
;
106 rbug_block_rule_t rule
;
109 struct rbug_proto_context_list_reply
111 struct rbug_header header
;
113 rbug_context_t
*contexts
;
114 uint32_t contexts_len
;
117 struct rbug_proto_context_info_reply
119 struct rbug_header header
;
121 rbug_shader_t vertex
;
122 rbug_shader_t fragment
;
123 rbug_texture_t
*texs
;
125 rbug_texture_t
*cbufs
;
127 rbug_texture_t zsbuf
;
128 rbug_block_t blocker
;
129 rbug_block_t blocked
;
132 struct rbug_proto_context_rule_add_reply
134 struct rbug_header header
;
136 rbug_block_rule_t rule
;
139 struct rbug_proto_context_draw_blocked
141 struct rbug_header header
;
142 rbug_context_t context
;
146 int rbug_send_context_list(struct rbug_connection
*__con
,
149 int rbug_send_context_info(struct rbug_connection
*__con
,
150 rbug_context_t context
,
153 int rbug_send_context_draw_block(struct rbug_connection
*__con
,
154 rbug_context_t context
,
158 int rbug_send_context_draw_step(struct rbug_connection
*__con
,
159 rbug_context_t context
,
163 int rbug_send_context_draw_unblock(struct rbug_connection
*__con
,
164 rbug_context_t context
,
165 rbug_block_t unblock
,
168 int rbug_send_context_flush(struct rbug_connection
*__con
,
169 rbug_context_t context
,
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
,
182 int rbug_send_context_rule_delete(struct rbug_connection
*__con
,
183 rbug_context_t context
,
184 rbug_block_rule_t rule
,
187 int rbug_send_context_list_reply(struct rbug_connection
*__con
,
189 rbug_context_t
*contexts
,
190 uint32_t contexts_len
,
193 int rbug_send_context_info_reply(struct rbug_connection
*__con
,
195 rbug_shader_t vertex
,
196 rbug_shader_t fragment
,
197 rbug_texture_t
*texs
,
199 rbug_texture_t
*cbufs
,
201 rbug_texture_t zsbuf
,
202 rbug_block_t blocker
,
203 rbug_block_t blocked
,
206 int rbug_send_context_rule_add_reply(struct rbug_connection
*__con
,
208 rbug_block_rule_t rule
,
211 int rbug_send_context_draw_blocked(struct rbug_connection
*__con
,
212 rbug_context_t context
,
216 struct rbug_proto_context_list
* rbug_demarshal_context_list(struct rbug_proto_header
*header
);
218 struct rbug_proto_context_info
* rbug_demarshal_context_info(struct rbug_proto_header
*header
);
220 struct rbug_proto_context_draw_block
* rbug_demarshal_context_draw_block(struct rbug_proto_header
*header
);
222 struct rbug_proto_context_draw_step
* rbug_demarshal_context_draw_step(struct rbug_proto_header
*header
);
224 struct rbug_proto_context_draw_unblock
* rbug_demarshal_context_draw_unblock(struct rbug_proto_header
*header
);
226 struct rbug_proto_context_flush
* rbug_demarshal_context_flush(struct rbug_proto_header
*header
);
228 struct rbug_proto_context_rule_add
* rbug_demarshal_context_rule_add(struct rbug_proto_header
*header
);
230 struct rbug_proto_context_rule_delete
* rbug_demarshal_context_rule_delete(struct rbug_proto_header
*header
);
232 struct rbug_proto_context_list_reply
* rbug_demarshal_context_list_reply(struct rbug_proto_header
*header
);
234 struct rbug_proto_context_info_reply
* rbug_demarshal_context_info_reply(struct rbug_proto_header
*header
);
236 struct rbug_proto_context_rule_add_reply
* rbug_demarshal_context_rule_add_reply(struct rbug_proto_header
*header
);
238 struct rbug_proto_context_draw_blocked
* rbug_demarshal_context_draw_blocked(struct rbug_proto_header
*header
);