Path: blob/21.2-virgl/src/gallium/auxiliary/rbug/rbug_texture.h
4561 views
/*1* Copyright 2009 VMware, Inc.2* All Rights Reserved.3*4* Permission is hereby granted, free of charge, to any person obtaining a5* copy of this software and associated documentation files (the "Software"),6* to deal in the Software without restriction, including without limitation7* on the rights to use, copy, modify, merge, publish, distribute, sub8* license, and/or sell copies of the Software, and to permit persons to whom9* the Software is furnished to do so, subject to the following conditions:10*11* The above copyright notice and this permission notice (including the next12* paragraph) shall be included in all copies or substantial portions of the13* Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL18* VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,19* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR20* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE21* USE OR OTHER DEALINGS IN THE SOFTWARE.22*/2324/*25* This file holds structs decelerations and function prototypes for one of26* the rbug extensions. Implementation of the functions is in the same folder27* in the c file matching this file's name.28*29* The structs what is returned from the demarshal functions. The functions30* starting rbug_send_* encodes a call to the write format and sends that to31* the supplied connection, while functions starting with rbug_demarshal_*32* demarshal data from the wire protocol.33*34* Structs and functions ending with _reply are replies to requests.35*/3637#ifndef _RBUG_PROTO_TEXTURE_H_38#define _RBUG_PROTO_TEXTURE_H_3940#include "rbug_proto.h"41#include "rbug_core.h"4243struct rbug_proto_texture_list44{45struct rbug_header header;46};4748struct rbug_proto_texture_info49{50struct rbug_header header;51rbug_texture_t texture;52};5354struct rbug_proto_texture_write55{56struct rbug_header header;57rbug_texture_t texture;58uint32_t face;59uint32_t level;60uint32_t zslice;61uint32_t x;62uint32_t y;63uint32_t w;64uint32_t h;65uint8_t *data;66uint32_t data_len;67uint32_t stride;68};6970struct rbug_proto_texture_read71{72struct rbug_header header;73rbug_texture_t texture;74uint32_t face;75uint32_t level;76uint32_t zslice;77uint32_t x;78uint32_t y;79uint32_t w;80uint32_t h;81};8283struct rbug_proto_texture_list_reply84{85struct rbug_header header;86uint32_t serial;87rbug_texture_t *textures;88uint32_t textures_len;89};9091struct rbug_proto_texture_info_reply92{93struct rbug_header header;94uint32_t serial;95uint32_t target;96uint32_t format;97uint32_t *width;98uint32_t width_len;99uint32_t *height;100uint32_t height_len;101uint32_t *depth;102uint32_t depth_len;103uint32_t blockw;104uint32_t blockh;105uint32_t blocksize;106uint32_t last_level;107uint32_t nr_samples;108uint32_t tex_usage;109};110111struct rbug_proto_texture_read_reply112{113struct rbug_header header;114uint32_t serial;115uint32_t format;116uint32_t blockw;117uint32_t blockh;118uint32_t blocksize;119uint8_t *data;120uint32_t data_len;121uint32_t stride;122};123124int rbug_send_texture_list(struct rbug_connection *__con,125uint32_t *__serial);126127int rbug_send_texture_info(struct rbug_connection *__con,128rbug_texture_t texture,129uint32_t *__serial);130131int rbug_send_texture_write(struct rbug_connection *__con,132rbug_texture_t texture,133uint32_t face,134uint32_t level,135uint32_t zslice,136uint32_t x,137uint32_t y,138uint32_t w,139uint32_t h,140uint8_t *data,141uint32_t data_len,142uint32_t stride,143uint32_t *__serial);144145int rbug_send_texture_read(struct rbug_connection *__con,146rbug_texture_t texture,147uint32_t face,148uint32_t level,149uint32_t zslice,150uint32_t x,151uint32_t y,152uint32_t w,153uint32_t h,154uint32_t *__serial);155156int rbug_send_texture_list_reply(struct rbug_connection *__con,157uint32_t serial,158rbug_texture_t *textures,159uint32_t textures_len,160uint32_t *__serial);161162int rbug_send_texture_info_reply(struct rbug_connection *__con,163uint32_t serial,164uint32_t target,165uint32_t format,166uint32_t *width,167uint32_t width_len,168uint16_t *height,169uint32_t height_len,170uint16_t *depth,171uint32_t depth_len,172uint32_t blockw,173uint32_t blockh,174uint32_t blocksize,175uint32_t last_level,176uint32_t nr_samples,177uint32_t tex_usage,178uint32_t *__serial);179180int rbug_send_texture_read_reply(struct rbug_connection *__con,181uint32_t serial,182uint32_t format,183uint32_t blockw,184uint32_t blockh,185uint32_t blocksize,186uint8_t *data,187uint32_t data_len,188uint32_t stride,189uint32_t *__serial);190191struct rbug_proto_texture_list * rbug_demarshal_texture_list(struct rbug_proto_header *header);192193struct rbug_proto_texture_info * rbug_demarshal_texture_info(struct rbug_proto_header *header);194195struct rbug_proto_texture_write * rbug_demarshal_texture_write(struct rbug_proto_header *header);196197struct rbug_proto_texture_read * rbug_demarshal_texture_read(struct rbug_proto_header *header);198199struct rbug_proto_texture_list_reply * rbug_demarshal_texture_list_reply(struct rbug_proto_header *header);200201struct rbug_proto_texture_info_reply * rbug_demarshal_texture_info_reply(struct rbug_proto_header *header);202203struct rbug_proto_texture_read_reply * rbug_demarshal_texture_read_reply(struct rbug_proto_header *header);204205#endif206207208