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_SHADER_H_
39#define _RBUG_PROTO_SHADER_H_
40
41#include "rbug_proto.h"
42#include "rbug_core.h"
43
44struct rbug_proto_shader_list
45{
46	struct rbug_header header;
47	rbug_context_t context;
48};
49
50struct rbug_proto_shader_info
51{
52	struct rbug_header header;
53	rbug_context_t context;
54	rbug_shader_t shader;
55};
56
57struct rbug_proto_shader_disable
58{
59	struct rbug_header header;
60	rbug_context_t context;
61	rbug_shader_t shader;
62	uint8_t disable;
63};
64
65struct rbug_proto_shader_replace
66{
67	struct rbug_header header;
68	rbug_context_t context;
69	rbug_shader_t shader;
70	uint32_t *tokens;
71	uint32_t tokens_len;
72};
73
74struct rbug_proto_shader_list_reply
75{
76	struct rbug_header header;
77	uint32_t serial;
78	rbug_shader_t *shaders;
79	uint32_t shaders_len;
80};
81
82struct rbug_proto_shader_info_reply
83{
84	struct rbug_header header;
85	uint32_t serial;
86	uint32_t *original;
87	uint32_t original_len;
88	uint32_t *replaced;
89	uint32_t replaced_len;
90	uint8_t disabled;
91};
92
93int rbug_send_shader_list(struct rbug_connection *__con,
94                          rbug_context_t context,
95                          uint32_t *__serial);
96
97int rbug_send_shader_info(struct rbug_connection *__con,
98                          rbug_context_t context,
99                          rbug_shader_t shader,
100                          uint32_t *__serial);
101
102int rbug_send_shader_disable(struct rbug_connection *__con,
103                             rbug_context_t context,
104                             rbug_shader_t shader,
105                             uint8_t disable,
106                             uint32_t *__serial);
107
108int rbug_send_shader_replace(struct rbug_connection *__con,
109                             rbug_context_t context,
110                             rbug_shader_t shader,
111                             uint32_t *tokens,
112                             uint32_t tokens_len,
113                             uint32_t *__serial);
114
115int rbug_send_shader_list_reply(struct rbug_connection *__con,
116                                uint32_t serial,
117                                rbug_shader_t *shaders,
118                                uint32_t shaders_len,
119                                uint32_t *__serial);
120
121int rbug_send_shader_info_reply(struct rbug_connection *__con,
122                                uint32_t serial,
123                                uint32_t *original,
124                                uint32_t original_len,
125                                uint32_t *replaced,
126                                uint32_t replaced_len,
127                                uint8_t disabled,
128                                uint32_t *__serial);
129
130struct rbug_proto_shader_list * rbug_demarshal_shader_list(struct rbug_proto_header *header);
131
132struct rbug_proto_shader_info * rbug_demarshal_shader_info(struct rbug_proto_header *header);
133
134struct rbug_proto_shader_disable * rbug_demarshal_shader_disable(struct rbug_proto_header *header);
135
136struct rbug_proto_shader_replace * rbug_demarshal_shader_replace(struct rbug_proto_header *header);
137
138struct rbug_proto_shader_list_reply * rbug_demarshal_shader_list_reply(struct rbug_proto_header *header);
139
140struct rbug_proto_shader_info_reply * rbug_demarshal_shader_info_reply(struct rbug_proto_header *header);
141
142#endif
143