Merge branch 'mesa_7_5_branch'
[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 enum
45 {
46 RBUG_BLOCK_BEFORE = 1,
47 RBUG_BLOCK_AFTER = 2,
48 RBUG_BLOCK_RULE = 4,
49 RBUG_BLOCK_MASK = 7,
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_draw_rule
85 {
86 struct rbug_header header;
87 rbug_context_t context;
88 rbug_shader_t vertex;
89 rbug_shader_t fragment;
90 rbug_texture_t texture;
91 rbug_texture_t surface;
92 rbug_block_t block;
93 };
94
95 struct rbug_proto_context_flush
96 {
97 struct rbug_header header;
98 rbug_context_t context;
99 int32_t flags;
100 };
101
102 struct rbug_proto_context_list_reply
103 {
104 struct rbug_header header;
105 uint32_t serial;
106 rbug_context_t *contexts;
107 uint32_t contexts_len;
108 };
109
110 struct rbug_proto_context_info_reply
111 {
112 struct rbug_header header;
113 uint32_t serial;
114 rbug_shader_t vertex;
115 rbug_shader_t fragment;
116 rbug_texture_t *texs;
117 uint32_t texs_len;
118 rbug_texture_t *cbufs;
119 uint32_t cbufs_len;
120 rbug_texture_t zsbuf;
121 rbug_block_t blocker;
122 rbug_block_t blocked;
123 };
124
125 struct rbug_proto_context_draw_blocked
126 {
127 struct rbug_header header;
128 rbug_context_t context;
129 rbug_block_t block;
130 };
131
132 int rbug_send_context_list(struct rbug_connection *__con,
133 uint32_t *__serial);
134
135 int rbug_send_context_info(struct rbug_connection *__con,
136 rbug_context_t context,
137 uint32_t *__serial);
138
139 int rbug_send_context_draw_block(struct rbug_connection *__con,
140 rbug_context_t context,
141 rbug_block_t block,
142 uint32_t *__serial);
143
144 int rbug_send_context_draw_step(struct rbug_connection *__con,
145 rbug_context_t context,
146 rbug_block_t step,
147 uint32_t *__serial);
148
149 int rbug_send_context_draw_unblock(struct rbug_connection *__con,
150 rbug_context_t context,
151 rbug_block_t unblock,
152 uint32_t *__serial);
153
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,
160 rbug_block_t block,
161 uint32_t *__serial);
162
163 int rbug_send_context_flush(struct rbug_connection *__con,
164 rbug_context_t context,
165 int32_t flags,
166 uint32_t *__serial);
167
168 int rbug_send_context_list_reply(struct rbug_connection *__con,
169 uint32_t serial,
170 rbug_context_t *contexts,
171 uint32_t contexts_len,
172 uint32_t *__serial);
173
174 int rbug_send_context_info_reply(struct rbug_connection *__con,
175 uint32_t serial,
176 rbug_shader_t vertex,
177 rbug_shader_t fragment,
178 rbug_texture_t *texs,
179 uint32_t texs_len,
180 rbug_texture_t *cbufs,
181 uint32_t cbufs_len,
182 rbug_texture_t zsbuf,
183 rbug_block_t blocker,
184 rbug_block_t blocked,
185 uint32_t *__serial);
186
187 int rbug_send_context_draw_blocked(struct rbug_connection *__con,
188 rbug_context_t context,
189 rbug_block_t block,
190 uint32_t *__serial);
191
192 struct rbug_proto_context_list * rbug_demarshal_context_list(struct rbug_proto_header *header);
193
194 struct rbug_proto_context_info * rbug_demarshal_context_info(struct rbug_proto_header *header);
195
196 struct rbug_proto_context_draw_block * rbug_demarshal_context_draw_block(struct rbug_proto_header *header);
197
198 struct rbug_proto_context_draw_step * rbug_demarshal_context_draw_step(struct rbug_proto_header *header);
199
200 struct rbug_proto_context_draw_unblock * rbug_demarshal_context_draw_unblock(struct rbug_proto_header *header);
201
202 struct rbug_proto_context_draw_rule * rbug_demarshal_context_draw_rule(struct rbug_proto_header *header);
203
204 struct rbug_proto_context_flush * rbug_demarshal_context_flush(struct rbug_proto_header *header);
205
206 struct rbug_proto_context_list_reply * rbug_demarshal_context_list_reply(struct rbug_proto_header *header);
207
208 struct rbug_proto_context_info_reply * rbug_demarshal_context_info_reply(struct rbug_proto_header *header);
209
210 struct rbug_proto_context_draw_blocked * rbug_demarshal_context_draw_blocked(struct rbug_proto_header *header);
211
212 #endif