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"
46 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_draw_rule
86 struct rbug_header header
;
87 rbug_context_t context
;
89 rbug_shader_t fragment
;
90 rbug_texture_t texture
;
91 rbug_texture_t surface
;
95 struct rbug_proto_context_flush
97 struct rbug_header header
;
98 rbug_context_t context
;
102 struct rbug_proto_context_list_reply
104 struct rbug_header header
;
106 rbug_context_t
*contexts
;
107 uint32_t contexts_len
;
110 struct rbug_proto_context_info_reply
112 struct rbug_header header
;
114 rbug_shader_t vertex
;
115 rbug_shader_t fragment
;
116 rbug_texture_t
*texs
;
118 rbug_texture_t
*cbufs
;
120 rbug_texture_t zsbuf
;
121 rbug_block_t blocker
;
122 rbug_block_t blocked
;
125 struct rbug_proto_context_draw_blocked
127 struct rbug_header header
;
128 rbug_context_t context
;
132 int rbug_send_context_list(struct rbug_connection
*__con
,
135 int rbug_send_context_info(struct rbug_connection
*__con
,
136 rbug_context_t context
,
139 int rbug_send_context_draw_block(struct rbug_connection
*__con
,
140 rbug_context_t context
,
144 int rbug_send_context_draw_step(struct rbug_connection
*__con
,
145 rbug_context_t context
,
149 int rbug_send_context_draw_unblock(struct rbug_connection
*__con
,
150 rbug_context_t context
,
151 rbug_block_t unblock
,
154 int rbug_send_context_draw_rule(struct rbug_connection
*__con
,
155 rbug_context_t context
,
156 rbug_shader_t vertex
,
157 rbug_shader_t fragment
,
158 rbug_texture_t texture
,
159 rbug_texture_t surface
,
163 int rbug_send_context_flush(struct rbug_connection
*__con
,
164 rbug_context_t context
,
168 int rbug_send_context_list_reply(struct rbug_connection
*__con
,
170 rbug_context_t
*contexts
,
171 uint32_t contexts_len
,
174 int rbug_send_context_info_reply(struct rbug_connection
*__con
,
176 rbug_shader_t vertex
,
177 rbug_shader_t fragment
,
178 rbug_texture_t
*texs
,
180 rbug_texture_t
*cbufs
,
182 rbug_texture_t zsbuf
,
183 rbug_block_t blocker
,
184 rbug_block_t blocked
,
187 int rbug_send_context_draw_blocked(struct rbug_connection
*__con
,
188 rbug_context_t context
,
192 struct rbug_proto_context_list
* rbug_demarshal_context_list(struct rbug_proto_header
*header
);
194 struct rbug_proto_context_info
* rbug_demarshal_context_info(struct rbug_proto_header
*header
);
196 struct rbug_proto_context_draw_block
* rbug_demarshal_context_draw_block(struct rbug_proto_header
*header
);
198 struct rbug_proto_context_draw_step
* rbug_demarshal_context_draw_step(struct rbug_proto_header
*header
);
200 struct rbug_proto_context_draw_unblock
* rbug_demarshal_context_draw_unblock(struct rbug_proto_header
*header
);
202 struct rbug_proto_context_draw_rule
* rbug_demarshal_context_draw_rule(struct rbug_proto_header
*header
);
204 struct rbug_proto_context_flush
* rbug_demarshal_context_flush(struct rbug_proto_header
*header
);
206 struct rbug_proto_context_list_reply
* rbug_demarshal_context_list_reply(struct rbug_proto_header
*header
);
208 struct rbug_proto_context_info_reply
* rbug_demarshal_context_info_reply(struct rbug_proto_header
*header
);
210 struct rbug_proto_context_draw_blocked
* rbug_demarshal_context_draw_blocked(struct rbug_proto_header
*header
);