rbug_shader.h revision fc3bac8a407dc2a2804236e1e2b813a3991fa84f
193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)/*
293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * Copyright 2009 VMware, Inc.
393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * All Rights Reserved.
493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * Permission is hereby granted, free of charge, to any person obtaining a
693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * copy of this software and associated documentation files (the "Software"),
793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * to deal in the Software without restriction, including without limitation
893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * on the rights to use, copy, modify, merge, publish, distribute, sub
993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * license, and/or sell copies of the Software, and to permit persons to whom
1093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * the Software is furnished to do so, subject to the following conditions:
1193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
1293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * The above copyright notice and this permission notice (including the next
1393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * paragraph) shall be included in all copies or substantial portions of the
1493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * Software.
1593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
1693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
1993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
2093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * USE OR OTHER DEALINGS IN THE SOFTWARE.
2393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) */
2493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
2593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)/*
2693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * This file holds structs decelerations and function prototypes for one of
2793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * the rbug extensions. Implementation of the functions is in the same folder
2893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * in the c file matching this file's name.
2993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
3093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * The structs what is returned from the demarshal functions. The functions
3193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * starting rbug_send_* encodes a call to the write format and sends that to
3293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * the supplied connection, while functions starting with rbug_demarshal_*
3393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * demarshal data from the wire protocol.
34521d96ec04ace82590870fb04353ec4f82bb150fTorne (Richard Coles) *
3506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles) * Structs and functions ending with _reply are replies to requests.
3693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) */
3793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#ifndef _RBUG_PROTO_SHADER_H_
3993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#define _RBUG_PROTO_SHADER_H_
4093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
4106f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)#include "rbug_proto.h"
4206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)#include "rbug_core.h"
4393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
4406f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)struct rbug_proto_shader_list
4506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles){
4606f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	struct rbug_header header;
4706f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	rbug_context_t context;
4806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)};
4906f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)
5006f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)struct rbug_proto_shader_info
5106f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles){
5206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	struct rbug_header header;
5306f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	rbug_context_t context;
5406f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	rbug_shader_t shader;
5506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)};
5606f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)
5706f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)struct rbug_proto_shader_disable
5806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles){
5906f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	struct rbug_header header;
6093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)	rbug_context_t context;
61521d96ec04ace82590870fb04353ec4f82bb150fTorne (Richard Coles)	rbug_shader_t shader;
6293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)	uint8_t disable;
6306f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)};
6406f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)
6506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)struct rbug_proto_shader_replace
6606f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles){
6706f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	struct rbug_header header;
6806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	rbug_context_t context;
6906f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	rbug_shader_t shader;
7006f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	uint32_t *tokens;
71197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch	uint32_t tokens_len;
7206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)};
7393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
74e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)struct rbug_proto_shader_list_reply
7593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles){
7693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)	struct rbug_header header;
7793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)	uint32_t serial;
7806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	rbug_shader_t *shaders;
7923e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch	uint32_t shaders_len;
8023e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch};
8123e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch
8206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)struct rbug_proto_shader_info_reply
8306f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles){
8406f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)	struct rbug_header header;
8593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)	uint32_t serial;
8693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)	uint32_t *original;
8793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)	uint32_t original_len;
8893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)	uint32_t *replaced;
8993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)	uint32_t replaced_len;
90f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)	uint8_t disabled;
9193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)};
9293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
9393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)int rbug_send_shader_list(struct rbug_connection *__con,
94e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)                          rbug_context_t context,
95f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)                          uint32_t *__serial);
96f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)
97e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)int rbug_send_shader_info(struct rbug_connection *__con,
98e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)                          rbug_context_t context,
99e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)                          rbug_shader_t shader,
100e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)                          uint32_t *__serial);
101e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)
102e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)int rbug_send_shader_disable(struct rbug_connection *__con,
103e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)                             rbug_context_t context,
104f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)                             rbug_shader_t shader,
105f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)                             uint8_t disable,
106f5e4ad553afbc08dd2e729bb77e937a9a94d5827Torne (Richard Coles)                             uint32_t *__serial);
10793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
10806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)int rbug_send_shader_replace(struct rbug_connection *__con,
10993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)                             rbug_context_t context,
11093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)                             rbug_shader_t shader,
11193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)                             uint32_t *tokens,
11293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)                             uint32_t tokens_len,
11323e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch                             uint32_t *__serial);
11423e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch
11523e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdochint rbug_send_shader_list_reply(struct rbug_connection *__con,
11623e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch                                uint32_t serial,
11723e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch                                rbug_shader_t *shaders,
11823e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch                                uint32_t shaders_len,
11923e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch                                uint32_t *__serial);
12023e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch
12123e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdochint rbug_send_shader_info_reply(struct rbug_connection *__con,
12223e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch                                uint32_t serial,
12323e46e0f045bc1935a09565578b448d36cfc5b8cBen Murdoch                                uint32_t *original,
12493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)                                uint32_t original_len,
12593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)                                uint32_t *replaced,
12606f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)                                uint32_t replaced_len,
12706f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)                                uint8_t disabled,
12806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)                                uint32_t *__serial);
12906f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)
13006f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)struct rbug_proto_shader_list * rbug_demarshal_shader_list(struct rbug_proto_header *header);
13106f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)
13206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)struct rbug_proto_shader_info * rbug_demarshal_shader_info(struct rbug_proto_header *header);
13306f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)
13406f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)struct rbug_proto_shader_disable * rbug_demarshal_shader_disable(struct rbug_proto_header *header);
13506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)
13606f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)struct rbug_proto_shader_replace * rbug_demarshal_shader_replace(struct rbug_proto_header *header);
137197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
13806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)struct rbug_proto_shader_list_reply * rbug_demarshal_shader_list_reply(struct rbug_proto_header *header);
139197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
140197021e6b966cfb06891637935ef33fff06433d1Ben Murdochstruct rbug_proto_shader_info_reply * rbug_demarshal_shader_info_reply(struct rbug_proto_header *header);
141197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
142197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#endif
143197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch