Merge remote branch 'origin/master' into radeon-rewrite
[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_t;
49
50 struct rbug_proto_context_list
51 {
52 struct rbug_header header;
53 };
54
55 struct rbug_proto_context_info
56 {
57 struct rbug_header header;
58 rbug_context_t context;
59 };
60
61 struct rbug_proto_context_draw_block
62 {
63 struct rbug_header header;
64 rbug_context_t context;
65 rbug_block_t block;
66 };
67
68 struct rbug_proto_context_draw_step
69 {
70 struct rbug_header header;
71 rbug_context_t context;
72 rbug_block_t step;
73 };
74
75 struct rbug_proto_context_draw_unblock
76 {
77 struct rbug_header header;
78 rbug_context_t context;
79 rbug_block_t unblock;
80 };
81
82 struct rbug_proto_context_flush
83 {
84 struct rbug_header header;
85 rbug_context_t context;
86 int32_t flags;
87 };
88
89 struct rbug_proto_context_list_reply
90 {
91 struct rbug_header header;
92 uint32_t serial;
93 rbug_context_t *contexts;
94 uint32_t contexts_len;
95 };
96
97 struct rbug_proto_context_info_reply
98 {
99 struct rbug_header header;
100 uint32_t serial;
101 rbug_shader_t vertex;
102 rbug_shader_t fragment;
103 rbug_texture_t *cbufs;
104 uint32_t cbufs_len;
105 rbug_texture_t zsbuf;
106 rbug_block_t blocker;
107 rbug_block_t blocked;
108 };
109
110 struct rbug_proto_context_draw_blocked
111 {
112 struct rbug_header header;
113 rbug_context_t context;
114 rbug_block_t block;
115 };
116
117 int rbug_send_context_list(struct rbug_connection *__con,
118 uint32_t *__serial);
119
120 int rbug_send_context_info(struct rbug_connection *__con,
121 rbug_context_t context,
122 uint32_t *__serial);
123
124 int rbug_send_context_draw_block(struct rbug_connection *__con,
125 rbug_context_t context,
126 rbug_block_t block,
127 uint32_t *__serial);
128
129 int rbug_send_context_draw_step(struct rbug_connection *__con,
130 rbug_context_t context,
131 rbug_block_t step,
132 uint32_t *__serial);
133
134 int rbug_send_context_draw_unblock(struct rbug_connection *__con,
135 rbug_context_t context,
136 rbug_block_t unblock,
137 uint32_t *__serial);
138
139 int rbug_send_context_flush(struct rbug_connection *__con,
140 rbug_context_t context,
141 int32_t flags,
142 uint32_t *__serial);
143
144 int rbug_send_context_list_reply(struct rbug_connection *__con,
145 uint32_t serial,
146 rbug_context_t *contexts,
147 uint32_t contexts_len,
148 uint32_t *__serial);
149
150 int rbug_send_context_info_reply(struct rbug_connection *__con,
151 uint32_t serial,
152 rbug_shader_t vertex,
153 rbug_shader_t fragment,
154 rbug_texture_t *cbufs,
155 uint32_t cbufs_len,
156 rbug_texture_t zsbuf,
157 rbug_block_t blocker,
158 rbug_block_t blocked,
159 uint32_t *__serial);
160
161 int rbug_send_context_draw_blocked(struct rbug_connection *__con,
162 rbug_context_t context,
163 rbug_block_t block,
164 uint32_t *__serial);
165
166 struct rbug_proto_context_list * rbug_demarshal_context_list(struct rbug_proto_header *header);
167
168 struct rbug_proto_context_info * rbug_demarshal_context_info(struct rbug_proto_header *header);
169
170 struct rbug_proto_context_draw_block * rbug_demarshal_context_draw_block(struct rbug_proto_header *header);
171
172 struct rbug_proto_context_draw_step * rbug_demarshal_context_draw_step(struct rbug_proto_header *header);
173
174 struct rbug_proto_context_draw_unblock * rbug_demarshal_context_draw_unblock(struct rbug_proto_header *header);
175
176 struct rbug_proto_context_flush * rbug_demarshal_context_flush(struct rbug_proto_header *header);
177
178 struct rbug_proto_context_list_reply * rbug_demarshal_context_list_reply(struct rbug_proto_header *header);
179
180 struct rbug_proto_context_info_reply * rbug_demarshal_context_info_reply(struct rbug_proto_header *header);
181
182 struct rbug_proto_context_draw_blocked * rbug_demarshal_context_draw_blocked(struct rbug_proto_header *header);
183
184 #endif