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,
50 struct rbug_proto_context_list
52 struct rbug_header header
;
55 struct rbug_proto_context_info
57 struct rbug_header header
;
58 rbug_context_t context
;
61 struct rbug_proto_context_draw_block
63 struct rbug_header header
;
64 rbug_context_t context
;
68 struct rbug_proto_context_draw_step
70 struct rbug_header header
;
71 rbug_context_t context
;
75 struct rbug_proto_context_draw_unblock
77 struct rbug_header header
;
78 rbug_context_t context
;
82 struct rbug_proto_context_flush
84 struct rbug_header header
;
85 rbug_context_t context
;
89 struct rbug_proto_context_list_reply
91 struct rbug_header header
;
93 rbug_context_t
*contexts
;
94 uint32_t contexts_len
;
97 struct rbug_proto_context_info_reply
99 struct rbug_header header
;
101 rbug_shader_t vertex
;
102 rbug_shader_t fragment
;
103 rbug_texture_t
*cbufs
;
105 rbug_texture_t zsbuf
;
106 rbug_block_t blocker
;
107 rbug_block_t blocked
;
110 struct rbug_proto_context_draw_blocked
112 struct rbug_header header
;
113 rbug_context_t context
;
117 int rbug_send_context_list(struct rbug_connection
*__con
,
120 int rbug_send_context_info(struct rbug_connection
*__con
,
121 rbug_context_t context
,
124 int rbug_send_context_draw_block(struct rbug_connection
*__con
,
125 rbug_context_t context
,
129 int rbug_send_context_draw_step(struct rbug_connection
*__con
,
130 rbug_context_t context
,
134 int rbug_send_context_draw_unblock(struct rbug_connection
*__con
,
135 rbug_context_t context
,
136 rbug_block_t unblock
,
139 int rbug_send_context_flush(struct rbug_connection
*__con
,
140 rbug_context_t context
,
144 int rbug_send_context_list_reply(struct rbug_connection
*__con
,
146 rbug_context_t
*contexts
,
147 uint32_t contexts_len
,
150 int rbug_send_context_info_reply(struct rbug_connection
*__con
,
152 rbug_shader_t vertex
,
153 rbug_shader_t fragment
,
154 rbug_texture_t
*cbufs
,
156 rbug_texture_t zsbuf
,
157 rbug_block_t blocker
,
158 rbug_block_t blocked
,
161 int rbug_send_context_draw_blocked(struct rbug_connection
*__con
,
162 rbug_context_t context
,
166 struct rbug_proto_context_list
* rbug_demarshal_context_list(struct rbug_proto_header
*header
);
168 struct rbug_proto_context_info
* rbug_demarshal_context_info(struct rbug_proto_header
*header
);
170 struct rbug_proto_context_draw_block
* rbug_demarshal_context_draw_block(struct rbug_proto_header
*header
);
172 struct rbug_proto_context_draw_step
* rbug_demarshal_context_draw_step(struct rbug_proto_header
*header
);
174 struct rbug_proto_context_draw_unblock
* rbug_demarshal_context_draw_unblock(struct rbug_proto_header
*header
);
176 struct rbug_proto_context_flush
* rbug_demarshal_context_flush(struct rbug_proto_header
*header
);
178 struct rbug_proto_context_list_reply
* rbug_demarshal_context_list_reply(struct rbug_proto_header
*header
);
180 struct rbug_proto_context_info_reply
* rbug_demarshal_context_info_reply(struct rbug_proto_header
*header
);
182 struct rbug_proto_context_draw_blocked
* rbug_demarshal_context_draw_blocked(struct rbug_proto_header
*header
);