p_state.h revision bdbe77f9c6f06cfaa155f27c2ade3c523d7fbea7
18e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell/************************************************************************** 28e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * 38e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. 48e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * All Rights Reserved. 58e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * 68e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * Permission is hereby granted, free of charge, to any person obtaining a 78e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * copy of this software and associated documentation files (the 88e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * "Software"), to deal in the Software without restriction, including 98e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * without limitation the rights to use, copy, modify, merge, publish, 108e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * distribute, sub license, and/or sell copies of the Software, and to 118e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * permit persons to whom the Software is furnished to do so, subject to 128e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * the following conditions: 138e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * 148e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * The above copyright notice and this permission notice (including the 158e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * next paragraph) shall be included in all copies or substantial portions 168e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * of the Software. 178e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * 188e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 198e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 208e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 218e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 228e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 238e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 248e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 258e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * 268e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell **************************************************************************/ 278e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 28f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian 29f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian/** 30984a7c4e9c42cf8ddfcff5b880b522a6dd58bce2José Fonseca * @file 31984a7c4e9c42cf8ddfcff5b880b522a6dd58bce2José Fonseca * 32f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian * Abstract graphics pipe state objects. 33f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian * 34f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian * Basic notes: 35f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian * 1. Want compact representations, so we use bitfields. 36f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian * 2. Put bitfields before other (GLfloat) fields. 37f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian */ 38f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian 39f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian 40943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#ifndef PIPE_STATE_H 41943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwell#define PIPE_STATE_H 428e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 4340a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell#include "p_compiler.h" 441c5f27a18b775b3784fcd265d60e0affa0b31581Michel Dänzer#include "p_defines.h" 4554fc80ab31f89520d3119196bfa9c6332b35fe2fBrian#include "p_format.h" 4613682d959ddacde1ce65843aa8c5b43dc9017b32Brian 47e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca 48e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca#ifdef __cplusplus 49e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonsecaextern "C" { 50e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca#endif 51e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca 52e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca 5313682d959ddacde1ce65843aa8c5b43dc9017b32Brian/** 5413682d959ddacde1ce65843aa8c5b43dc9017b32Brian * Implementation limits 5513682d959ddacde1ce65843aa8c5b43dc9017b32Brian */ 56da8934034b33adef5dc41395cfde4bdd26ba207cBrian#define PIPE_MAX_ATTRIBS 32 57da8934034b33adef5dc41395cfde4bdd26ba207cBrian#define PIPE_MAX_CLIP_PLANES 6 58da8934034b33adef5dc41395cfde4bdd26ba207cBrian#define PIPE_MAX_COLOR_BUFS 8 597c5f255201f42303188137f56ea8acc030444f0eMichal Krol#define PIPE_MAX_CONSTANT_BUFFERS 32 60da8934034b33adef5dc41395cfde4bdd26ba207cBrian#define PIPE_MAX_SAMPLERS 16 6115d1b406afd733b5f46b16dc933e29c218cdca39Michal Krol#define PIPE_MAX_VERTEX_SAMPLERS 16 6253bd9796a1395e4acde884ff55cb7ee18586595aZack Rusin#define PIPE_MAX_GEOMETRY_SAMPLERS 16 63b273928140479f089d45cd2dbc30708306b97ee0Brian Paul#define PIPE_MAX_SHADER_INPUTS 32 64b273928140479f089d45cd2dbc30708306b97ee0Brian Paul#define PIPE_MAX_SHADER_OUTPUTS 32 65bdbe77f9c6f06cfaa155f27c2ade3c523d7fbea7Zack Rusin#define PIPE_MAX_SHADER_RESOURCES 32 66da8934034b33adef5dc41395cfde4bdd26ba207cBrian#define PIPE_MAX_TEXTURE_LEVELS 16 67a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusin#define PIPE_MAX_SO_BUFFERS 4 6813682d959ddacde1ce65843aa8c5b43dc9017b32Brian 6913682d959ddacde1ce65843aa8c5b43dc9017b32Brian 7038f6f23fcf37247fd709d1c612d08bfa9b124e69José Fonsecastruct pipe_reference 7138f6f23fcf37247fd709d1c612d08bfa9b124e69José Fonseca{ 7238f6f23fcf37247fd709d1c612d08bfa9b124e69José Fonseca int32_t count; /* atomic */ 7338f6f23fcf37247fd709d1c612d08bfa9b124e69José Fonseca}; 7438f6f23fcf37247fd709d1c612d08bfa9b124e69José Fonseca 7538f6f23fcf37247fd709d1c612d08bfa9b124e69José Fonseca 76bec2230514ad2e8e52625ecb339fcadfabffd4dfBrian 77f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian/** 78294401814d1d89cc731de1c22c25333aa5d59374Zack Rusin * Primitive (point/line/tri) rasterization info 79f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian */ 80294401814d1d89cc731de1c22c25333aa5d59374Zack Rusinstruct pipe_rasterizer_state 81f79c225d9e5adee6287a9bba35f014c3fe00d3f9Brian{ 8240a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned flatshade:1; 8340a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned light_twoside:1; 840bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell unsigned front_ccw:1; 850bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell unsigned cull_face:2; /**< PIPE_FACE_x */ 860bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell unsigned fill_front:2; /**< PIPE_POLYGON_MODE_x */ 870bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell unsigned fill_back:2; /**< PIPE_POLYGON_MODE_x */ 880bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell unsigned offset_point:1; 890bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell unsigned offset_line:1; 900bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell unsigned offset_tri:1; 9140a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned scissor:1; 9240a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned poly_smooth:1; 9340a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned poly_stipple_enable:1; 9440a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned point_smooth:1; 954a4daa75a85db22cd37ebd533ebbccb427e07077Roland Scheidegger unsigned sprite_coord_enable:PIPE_MAX_SHADER_OUTPUTS; 964a4daa75a85db22cd37ebd533ebbccb427e07077Roland Scheidegger unsigned sprite_coord_mode:1; /**< PIPE_SPRITE_COORD_ */ 9768f93ea3eb83cfad014b8ec93cec3564c1aa9833Roland Scheidegger unsigned point_quad_rasterization:1; /** points rasterized as quads or points */ 98beefc6011bce9e99cb46430186de1c13f027cb05Brian unsigned point_size_per_vertex:1; /**< size computed in vertex shader */ 9940a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned multisample:1; /* XXX maybe more ms state in future */ 10040a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned line_smooth:1; 10140a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned line_stipple_enable:1; 10240a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned line_stipple_factor:8; /**< [1..256] actually */ 10340a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned line_stipple_pattern:16; 10499691f38c278f1d4aeb0617b149109644e3571fbKeith Whitwell unsigned line_last_pixel:1; 105683e7091a953204c9aee1410ac44be3b69bae9fcKeith Whitwell 106683e7091a953204c9aee1410ac44be3b69bae9fcKeith Whitwell /** 107a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * Use the first vertex of a primitive as the provoking vertex for 108a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * flat shading. 109a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell */ 110a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell unsigned flatshade_first:1; 111a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell 112a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell /** 113a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * When true, triangle rasterization uses (0.5, 0.5) pixel centers 114a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * for determining pixel ownership. 115a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * 116a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * When false, triangle rasterization uses (0,0) pixel centers for 117a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * determining pixel ownership. 118a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * 119a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * Triangle rasterization always uses a 'top,left' rule for pixel 120a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * ownership, this just alters which point we consider the pixel 121a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell * center for that test. 122a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell */ 123a1fa770c01d913658900de1c267fb4c41bc6300dKeith Whitwell unsigned gl_rasterization_rules:1; 12440a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell 12540a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell float line_width; 12640a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell float point_size; /**< used when no per-vertex size */ 12740a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell float offset_units; 12840a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell float offset_scale; 1298e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell}; 1308e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 13163a51aee86f76ae54fb1ce572d584fb0f01aaec5Brian 132d4d2e36a429fd015316c484fc40be7e6d2c69946Brianstruct pipe_poly_stipple 133d4d2e36a429fd015316c484fc40be7e6d2c69946Brian{ 13440a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned stipple[32]; 1358e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell}; 1368e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 1378e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 138d4d2e36a429fd015316c484fc40be7e6d2c69946Brianstruct pipe_viewport_state 139d4d2e36a429fd015316c484fc40be7e6d2c69946Brian{ 14040a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell float scale[4]; 14140a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell float translate[4]; 1428e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell}; 1438e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 14450eb29ed9492a34db4ba53f1f28a2868b808955aBrian 145d4d2e36a429fd015316c484fc40be7e6d2c69946Brianstruct pipe_scissor_state 146d4d2e36a429fd015316c484fc40be7e6d2c69946Brian{ 14740a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned minx:16; 14840a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned miny:16; 14940a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned maxx:16; 15040a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned maxy:16; 1518e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell}; 1528e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 15350eb29ed9492a34db4ba53f1f28a2868b808955aBrian 154d4d2e36a429fd015316c484fc40be7e6d2c69946Brianstruct pipe_clip_state 155d4d2e36a429fd015316c484fc40be7e6d2c69946Brian{ 15640a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell float ucp[PIPE_MAX_CLIP_PLANES][4]; 15740a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned nr; 158f47c9b088056e25a0a007b16045631df70001c8fMarek Olšák unsigned depth_clamp:1; 1598e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell}; 1608e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 1614824c342c864e870251a7d343c95e51274e50d23Keith Whitwell 162d4d2e36a429fd015316c484fc40be7e6d2c69946Brianstruct pipe_shader_state 163d4d2e36a429fd015316c484fc40be7e6d2c69946Brian{ 16443d7c1fe9d2544b851afa2f1c1e245a63860e670Brian const struct tgsi_token *tokens; 16543d7c1fe9d2544b851afa2f1c1e245a63860e670Brian}; 16643d7c1fe9d2544b851afa2f1c1e245a63860e670Brian 16750eb29ed9492a34db4ba53f1f28a2868b808955aBrian 168b9a3952f8f04a25818aba69e235e3d250c064cb8Brian Paulstruct pipe_depth_state 169b9a3952f8f04a25818aba69e235e3d250c064cb8Brian Paul{ 170ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca unsigned enabled:1; /**< depth test enabled? */ 171ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca unsigned writemask:1; /**< allow depth buffer writes? */ 172ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca unsigned func:3; /**< depth test func (PIPE_FUNC_x) */ 173ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca}; 174ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca 175ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca 176b9a3952f8f04a25818aba69e235e3d250c064cb8Brian Paulstruct pipe_stencil_state 177b9a3952f8f04a25818aba69e235e3d250c064cb8Brian Paul{ 178ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca unsigned enabled:1; /**< stencil[0]: stencil enabled, stencil[1]: two-side enabled */ 179ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca unsigned func:3; /**< PIPE_FUNC_x */ 180ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca unsigned fail_op:3; /**< PIPE_STENCIL_OP_x */ 181ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca unsigned zpass_op:3; /**< PIPE_STENCIL_OP_x */ 182ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca unsigned zfail_op:3; /**< PIPE_STENCIL_OP_x */ 183c59446a4930ec93e55f7cd3d1fffe46585cbe506Roland Scheidegger unsigned valuemask:8; 184c59446a4930ec93e55f7cd3d1fffe46585cbe506Roland Scheidegger unsigned writemask:8; 185ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca}; 186ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca 187ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca 188b9a3952f8f04a25818aba69e235e3d250c064cb8Brian Paulstruct pipe_alpha_state 189b9a3952f8f04a25818aba69e235e3d250c064cb8Brian Paul{ 190ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca unsigned enabled:1; 191ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca unsigned func:3; /**< PIPE_FUNC_x */ 192d6888e811d24eaa7e8d9093be606394f00435c05Zack Rusin float ref_value; /**< reference value */ 193ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca}; 194ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca 195ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca 196bfe79babf99e6b9435195178d1ea64687c60d161Keith Whitwellstruct pipe_depth_stencil_alpha_state 1978f2888758129b0a40d71fa4ce10d606b4bcf7631Brian{ 198ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca struct pipe_depth_state depth; 199ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca struct pipe_stencil_state stencil[2]; /**< [0] = front, [1] = back */ 200ca826d79a64d46e7f3bffff22640f148c044cdadJosé Fonseca struct pipe_alpha_state alpha; 201493f7b5f3ae2eb64eaa65e24e79a7a071c359b81Brian}; 2028f2888758129b0a40d71fa4ce10d606b4bcf7631Brian 203bfe79babf99e6b9435195178d1ea64687c60d161Keith Whitwell 204bef610f693266c338b99511b4d1eea5d5b97644eRoland Scheideggerstruct pipe_rt_blend_state 205d4d2e36a429fd015316c484fc40be7e6d2c69946Brian{ 20640a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned blend_enable:1; 2078e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 20840a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned rgb_func:3; /**< PIPE_BLEND_x */ 20940a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned rgb_src_factor:5; /**< PIPE_BLENDFACTOR_x */ 21040a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned rgb_dst_factor:5; /**< PIPE_BLENDFACTOR_x */ 2118e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 21240a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned alpha_func:3; /**< PIPE_BLEND_x */ 21340a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned alpha_src_factor:5; /**< PIPE_BLENDFACTOR_x */ 21440a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned alpha_dst_factor:5; /**< PIPE_BLENDFACTOR_x */ 2158e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 216bef610f693266c338b99511b4d1eea5d5b97644eRoland Scheidegger unsigned colormask:4; /**< bitmask of PIPE_MASK_R/G/B/A */ 217bef610f693266c338b99511b4d1eea5d5b97644eRoland Scheidegger}; 218bef610f693266c338b99511b4d1eea5d5b97644eRoland Scheidegger 219bef610f693266c338b99511b4d1eea5d5b97644eRoland Scheideggerstruct pipe_blend_state 220bef610f693266c338b99511b4d1eea5d5b97644eRoland Scheidegger{ 221bef610f693266c338b99511b4d1eea5d5b97644eRoland Scheidegger unsigned independent_blend_enable:1; 22240a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned logicop_enable:1; 22340a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned logicop_func:4; /**< PIPE_LOGICOP_x */ 22440a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned dither:1; 225aac2cccccfd701ae8d7ce0813c28c64498d4a076Roland Scheidegger unsigned alpha_to_coverage:1; 226aac2cccccfd701ae8d7ce0813c28c64498d4a076Roland Scheidegger unsigned alpha_to_one:1; 227bef610f693266c338b99511b4d1eea5d5b97644eRoland Scheidegger struct pipe_rt_blend_state rt[PIPE_MAX_COLOR_BUFS]; 2288e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell}; 2298e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 23050eb29ed9492a34db4ba53f1f28a2868b808955aBrian 231d4d2e36a429fd015316c484fc40be7e6d2c69946Brianstruct pipe_blend_color 232d4d2e36a429fd015316c484fc40be7e6d2c69946Brian{ 23340a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell float color[4]; 2348e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell}; 2358e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 2361a859ecf4a4728cb321b1f68d51491cd285a3c03Roland Scheideggerstruct pipe_stencil_ref 2371a859ecf4a4728cb321b1f68d51491cd285a3c03Roland Scheidegger{ 2381a859ecf4a4728cb321b1f68d51491cd285a3c03Roland Scheidegger ubyte ref_value[2]; 2391a859ecf4a4728cb321b1f68d51491cd285a3c03Roland Scheidegger}; 24050eb29ed9492a34db4ba53f1f28a2868b808955aBrian 2418f6b6eed35832733674372dea7bd5ce69a965c4eBrianstruct pipe_framebuffer_state 2428f6b6eed35832733674372dea7bd5ce69a965c4eBrian{ 24380567f9c9f84d9df1cdb2d91a3c0814888cc5d08Brian unsigned width, height; 24480567f9c9f84d9df1cdb2d91a3c0814888cc5d08Brian 2454243ca1144eef5783ed080cce9db1a8dda2c6360Brian Paul /** multiple color buffers for multiple render targets */ 2462299f21f8da816fc4588492965e7dac422da1a96Zack Rusin unsigned nr_cbufs; 247f0f9a22609ccf2b8edc5760480f1a7a78cb504d7Brian struct pipe_surface *cbufs[PIPE_MAX_COLOR_BUFS]; 248f0f9a22609ccf2b8edc5760480f1a7a78cb504d7Brian 2498de2331e432e2ea6f978acb6c80666da99c6c4a1Brian struct pipe_surface *zsbuf; /**< Z/stencil buffer */ 2508f6b6eed35832733674372dea7bd5ce69a965c4eBrian}; 2518f6b6eed35832733674372dea7bd5ce69a965c4eBrian 2528f6b6eed35832733674372dea7bd5ce69a965c4eBrian 25302a47549ad182d28d330063d4f452108e3a4b452Brian/** 25402a47549ad182d28d330063d4f452108e3a4b452Brian * Texture sampler state. 25502a47549ad182d28d330063d4f452108e3a4b452Brian */ 256943964a1e5bad86bdceb0a06d60fb3b302ebce6aKeith Whitwellstruct pipe_sampler_state 25702a47549ad182d28d330063d4f452108e3a4b452Brian{ 258d4d2e36a429fd015316c484fc40be7e6d2c69946Brian unsigned wrap_s:3; /**< PIPE_TEX_WRAP_x */ 259d4d2e36a429fd015316c484fc40be7e6d2c69946Brian unsigned wrap_t:3; /**< PIPE_TEX_WRAP_x */ 260d4d2e36a429fd015316c484fc40be7e6d2c69946Brian unsigned wrap_r:3; /**< PIPE_TEX_WRAP_x */ 26140a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned min_img_filter:2; /**< PIPE_TEX_FILTER_x */ 26240a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned min_mip_filter:2; /**< PIPE_TEX_MIPFILTER_x */ 26340a86b20478024ca7c55400019c536cb5ff631d1Keith Whitwell unsigned mag_img_filter:2; /**< PIPE_TEX_FILTER_x */ 264d4d2e36a429fd015316c484fc40be7e6d2c69946Brian unsigned compare_mode:1; /**< PIPE_TEX_COMPARE_x */ 265d4d2e36a429fd015316c484fc40be7e6d2c69946Brian unsigned compare_func:3; /**< PIPE_FUNC_x */ 266d4d2e36a429fd015316c484fc40be7e6d2c69946Brian unsigned normalized_coords:1; /**< Are coords normalized to [0,1]? */ 267ebe12d50064370e4ddec21a1e087b24295940319Roland Scheidegger unsigned max_anisotropy:6; 268d4d2e36a429fd015316c484fc40be7e6d2c69946Brian float lod_bias; /**< LOD/lambda bias */ 269d4d2e36a429fd015316c484fc40be7e6d2c69946Brian float min_lod, max_lod; /**< LOD clamp range, after bias */ 270d45dd5672ae60f1f49648725974693bf4ebf4bf8Brian float border_color[4]; 27102a47549ad182d28d330063d4f452108e3a4b452Brian}; 27202a47549ad182d28d330063d4f452108e3a4b452Brian 2735d69aeb0028f44d06093faede5c545908b0df89aBrian 27420adf45c23dd9ec86a1439ad87c1473395bbb1a7Brian/** 2754c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger * A view into a texture that can be bound to a color render target / 2764c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger * depth stencil attachment point. 27720adf45c23dd9ec86a1439ad87c1473395bbb1a7Brian */ 27820adf45c23dd9ec86a1439ad87c1473395bbb1a7Brianstruct pipe_surface 27920adf45c23dd9ec86a1439ad87c1473395bbb1a7Brian{ 2805e27cd46c04a9e7b5904cc014bffd0f4daae31feMichel Dänzer struct pipe_reference reference; 281287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell struct pipe_resource *texture; /**< resource into which this is a view */ 2824c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger struct pipe_context *context; /**< context this view belongs to */ 2834243ca1144eef5783ed080cce9db1a8dda2c6360Brian Paul enum pipe_format format; 284287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 2854c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger /* XXX width/height should be removed */ 2865531c986bd34457e113163a68ff4ab98394738f0Brian Paul unsigned width; /**< logical width in pixels */ 2875531c986bd34457e113163a68ff4ab98394738f0Brian Paul unsigned height; /**< logical height in pixels */ 288287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 289287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell unsigned usage; /**< bitmask of PIPE_BIND_x */ 290c9ed86a96483063f3d6789ed16645a3dca77d726Keith Whitwell 2914c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger union { 2924c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger struct { 2934c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned level; 2944c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned first_layer:16; 2954c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned last_layer:16; 2964c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger } tex; 2974c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger struct { 2984c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned first_element; 2994c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned last_element; 3004c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger } buf; 3014c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger } u; 30220adf45c23dd9ec86a1439ad87c1473395bbb1a7Brian}; 30320adf45c23dd9ec86a1439ad87c1473395bbb1a7Brian 30420adf45c23dd9ec86a1439ad87c1473395bbb1a7Brian 3055d69aeb0028f44d06093faede5c545908b0df89aBrian/** 306f6106566081978f663cf08e54bb8908cb58a5316Michal Krol * A view into a texture that can be bound to a shader stage. 307f6106566081978f663cf08e54bb8908cb58a5316Michal Krol */ 308f6106566081978f663cf08e54bb8908cb58a5316Michal Krolstruct pipe_sampler_view 309f6106566081978f663cf08e54bb8908cb58a5316Michal Krol{ 310f6106566081978f663cf08e54bb8908cb58a5316Michal Krol struct pipe_reference reference; 311f6106566081978f663cf08e54bb8908cb58a5316Michal Krol enum pipe_format format; /**< typed PIPE_FORMAT_x */ 312287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell struct pipe_resource *texture; /**< texture into which this is a view */ 313f6106566081978f663cf08e54bb8908cb58a5316Michal Krol struct pipe_context *context; /**< context this view belongs to */ 3144c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger union { 3154c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger struct { 3164c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned first_layer:16; /**< first layer to use for array textures */ 3174c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned last_layer:16; /**< last layer to use for array textures */ 3184c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned first_level:8; /**< first mipmap level to use */ 3194c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned last_level:8; /**< last mipmap level to use */ 3204c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger } tex; 3214c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger struct { 3224c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned first_element; 3234c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned last_element; 3244c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger } buf; 3254c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger } u; 326f6106566081978f663cf08e54bb8908cb58a5316Michal Krol unsigned swizzle_r:3; /**< PIPE_SWIZZLE_x for red component */ 327f6106566081978f663cf08e54bb8908cb58a5316Michal Krol unsigned swizzle_g:3; /**< PIPE_SWIZZLE_x for green component */ 328f6106566081978f663cf08e54bb8908cb58a5316Michal Krol unsigned swizzle_b:3; /**< PIPE_SWIZZLE_x for blue component */ 329f6106566081978f663cf08e54bb8908cb58a5316Michal Krol unsigned swizzle_a:3; /**< PIPE_SWIZZLE_x for alpha component */ 330f6106566081978f663cf08e54bb8908cb58a5316Michal Krol}; 331f6106566081978f663cf08e54bb8908cb58a5316Michal Krol 332f6106566081978f663cf08e54bb8908cb58a5316Michal Krol 33397831efdb02ad68c70602a5b3a68c024e49e5715Brian Paul/** 33497831efdb02ad68c70602a5b3a68c024e49e5715Brian Paul * Subregion of 1D/2D/3D image resource. 33597831efdb02ad68c70602a5b3a68c024e49e5715Brian Paul */ 336287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwellstruct pipe_box 3374617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer{ 338287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell unsigned x; 339287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell unsigned y; 340287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell unsigned z; 341287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell unsigned width; 342287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell unsigned height; 343287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell unsigned depth; 3444617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer}; 3454617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer 3464617981ec72f7985941bee4b03c534d97ff96bc6Michel Dänzer 34797831efdb02ad68c70602a5b3a68c024e49e5715Brian Paul/** 34897831efdb02ad68c70602a5b3a68c024e49e5715Brian Paul * A memory object/resource such as a vertex buffer or texture. 34997831efdb02ad68c70602a5b3a68c024e49e5715Brian Paul */ 350287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwellstruct pipe_resource 351287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell{ 352287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell struct pipe_reference reference; 353287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell struct pipe_screen *screen; /**< screen that this texture belongs to */ 3541c5f27a18b775b3784fcd265d60e0affa0b31581Michel Dänzer enum pipe_texture_target target; /**< PIPE_TEXTURE_x */ 3551c5f27a18b775b3784fcd265d60e0affa0b31581Michel Dänzer enum pipe_format format; /**< PIPE_FORMAT_x */ 35688723b2fc84628c1bc1e0008b88602b85e8668beMichel Dänzer 357683e35f726a182ed9fc6b6d5cb07146eebe14deaKeith Whitwell unsigned width0; 358683e35f726a182ed9fc6b6d5cb07146eebe14deaKeith Whitwell unsigned height0; 359683e35f726a182ed9fc6b6d5cb07146eebe14deaKeith Whitwell unsigned depth0; 3604c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned array_size; 361d9605cdf7cbbd3c81c506d01eb8e88a11ccfc09bBrian 36218e94e15c0ca881309ac5784075a04160cc1eeb6Keith Whitwell unsigned last_level:8; /**< Index of last mipmap level present/defined */ 363b9a3952f8f04a25818aba69e235e3d250c064cb8Brian Paul unsigned nr_samples:8; /**< for multisampled surfaces, nr of samples */ 364a2a01853f3f40b4ef8b3f01503391877960bdaeeBrian Paul unsigned usage:8; /**< PIPE_USAGE_x (not a bitmask) */ 365429a08384c2ea66d446e46beb28e33ee3b764d52Roland Scheidegger 3664c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned bind; /**< bitmask of PIPE_BIND_x */ 3674c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned flags; /**< bitmask of PIPE_RESOURCE_FLAG_x */ 368287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell}; 369d9605cdf7cbbd3c81c506d01eb8e88a11ccfc09bBrian 370a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusinstruct pipe_stream_output_state 371a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusin{ 372c9db97c8229689060fab0edee7df717f804b99ceZack Rusin /**< number of the output buffer to insert each element into */ 373c9db97c8229689060fab0edee7df717f804b99ceZack Rusin int output_buffer[PIPE_MAX_SHADER_OUTPUTS]; 374c9db97c8229689060fab0edee7df717f804b99ceZack Rusin /**< which register to grab each output from */ 375c9db97c8229689060fab0edee7df717f804b99ceZack Rusin int register_index[PIPE_MAX_SHADER_OUTPUTS]; 376c9db97c8229689060fab0edee7df717f804b99ceZack Rusin /**< TGSI_WRITEMASK signifying which components to output */ 377c9db97c8229689060fab0edee7df717f804b99ceZack Rusin ubyte register_mask[PIPE_MAX_SHADER_OUTPUTS]; 378c9db97c8229689060fab0edee7df717f804b99ceZack Rusin /**< number of outputs */ 379a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusin int num_outputs; 380c9db97c8229689060fab0edee7df717f804b99ceZack Rusin 381c9db97c8229689060fab0edee7df717f804b99ceZack Rusin /**< stride for an entire vertex, only used if all output_buffers 382c9db97c8229689060fab0edee7df717f804b99ceZack Rusin * are 0 */ 383c9db97c8229689060fab0edee7df717f804b99ceZack Rusin unsigned stride; 384a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusin}; 385287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 386287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 387287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell/** 38897831efdb02ad68c70602a5b3a68c024e49e5715Brian Paul * Transfer object. For data transfer to/from a resource. 389287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell */ 390287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwellstruct pipe_transfer 391287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell{ 392287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell struct pipe_resource *resource; /**< resource to transfer to/from */ 3934c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned level; 394287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell enum pipe_transfer_usage usage; 395287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell struct pipe_box box; 396287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell unsigned stride; 3974c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned layer_stride; 398287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell void *data; 399d9605cdf7cbbd3c81c506d01eb8e88a11ccfc09bBrian}; 400d9605cdf7cbbd3c81c506d01eb8e88a11ccfc09bBrian 401d9605cdf7cbbd3c81c506d01eb8e88a11ccfc09bBrian 402287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 4036e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian/** 4046e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian * A vertex buffer. Typically, all the vertex data/attributes for 4056e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian * drawing something will be in one buffer. But it's also possible, for 4066e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian * example, to put colors in one buffer and texcoords in another. 4076e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian */ 4088269bc48d8fafaa432b58f4adf5e0dddd81d979dKeith Whitwellstruct pipe_vertex_buffer 4098269bc48d8fafaa432b58f4adf5e0dddd81d979dKeith Whitwell{ 410872b515e8f0bb1be5bad85fd9d01529c71f07ba2Zack Rusin unsigned stride; /**< stride to same attrib in next vertex, in bytes */ 4116e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian unsigned max_index; /**< number of vertices in this buffer */ 4126e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian unsigned buffer_offset; /**< offset to start of data in buffer, in bytes */ 413287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell struct pipe_resource *buffer; /**< the actual buffer */ 4148269bc48d8fafaa432b58f4adf5e0dddd81d979dKeith Whitwell}; 4158269bc48d8fafaa432b58f4adf5e0dddd81d979dKeith Whitwell 4168269bc48d8fafaa432b58f4adf5e0dddd81d979dKeith Whitwell 4176e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian/** 4186e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian * Information to describe a vertex attribute (position, color, etc) 4196e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian */ 4208269bc48d8fafaa432b58f4adf5e0dddd81d979dKeith Whitwellstruct pipe_vertex_element 4218269bc48d8fafaa432b58f4adf5e0dddd81d979dKeith Whitwell{ 4226e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian /** Offset of this attribute, in bytes, from the start of the vertex */ 42318e94e15c0ca881309ac5784075a04160cc1eeb6Keith Whitwell unsigned src_offset; 4246e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian 425f7d1689cfa8e3eb2aea4b86031510323b4d13110Michal Krol /** Instance data rate divisor. 0 means this is per-vertex data, 426f7d1689cfa8e3eb2aea4b86031510323b4d13110Michal Krol * n means per-instance data used for n consecutive instances (n > 0). 427f7d1689cfa8e3eb2aea4b86031510323b4d13110Michal Krol */ 428f7d1689cfa8e3eb2aea4b86031510323b4d13110Michal Krol unsigned instance_divisor; 429f7d1689cfa8e3eb2aea4b86031510323b4d13110Michal Krol 4306e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian /** Which vertex_buffer (as given to pipe->set_vertex_buffer()) does 4316e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian * this attribute live in? 4326e02b4c7c3c6efc05ead2ffd46b0928f7c9316bfBrian */ 433d350695a6b86caaee6b2bd1d64b48a26159a8e95Keith Whitwell unsigned vertex_buffer_index; 434c31416971e4eac148f8e82d6c4392bd6f9cbc05dKeith Whitwell 4354243ca1144eef5783ed080cce9db1a8dda2c6360Brian Paul enum pipe_format src_format; 4368269bc48d8fafaa432b58f4adf5e0dddd81d979dKeith Whitwell}; 4378269bc48d8fafaa432b58f4adf5e0dddd81d979dKeith Whitwell 4388269bc48d8fafaa432b58f4adf5e0dddd81d979dKeith Whitwell 439c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu/** 440c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu * An index buffer. When an index buffer is bound, all indices to vertices 441c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu * will be looked up in the buffer. 442c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu */ 443c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wustruct pipe_index_buffer 444c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu{ 445c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu unsigned index_size; /**< size of an index, in bytes */ 446c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu unsigned offset; /**< offset to start of data in buffer, in bytes */ 447c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu struct pipe_resource *buffer; /**< the actual buffer */ 448c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu}; 449c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu 450c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu 451c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu/** 452c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu * Information to describe a draw_vbo call. 453c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu */ 454c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wustruct pipe_draw_info 455c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu{ 456c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu boolean indexed; /**< use index buffer */ 457c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu 458c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu unsigned mode; /**< the mode of the primitive */ 459c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu unsigned start; /**< the index of the first vertex */ 460c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu unsigned count; /**< number of vertices */ 461c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu 462c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu unsigned start_instance; /**< first instance id */ 463c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu unsigned instance_count; /**< number of instances */ 464c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu 465c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu /** 466c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu * For indexed drawing, these fields apply after index lookup. 467c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu */ 468c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu int index_bias; /**< a bias to be added to each index */ 469c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu unsigned min_index; /**< the min index */ 470c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu unsigned max_index; /**< the max index */ 471adf35e80d3b3d37b97f0608a5a2f221dbd8c0d64Brian Paul 472adf35e80d3b3d37b97f0608a5a2f221dbd8c0d64Brian Paul /** 473adf35e80d3b3d37b97f0608a5a2f221dbd8c0d64Brian Paul * Primitive restart enable/index (only applies to indexed drawing) 474adf35e80d3b3d37b97f0608a5a2f221dbd8c0d64Brian Paul */ 475adf35e80d3b3d37b97f0608a5a2f221dbd8c0d64Brian Paul boolean primitive_restart; 476adf35e80d3b3d37b97f0608a5a2f221dbd8c0d64Brian Paul unsigned restart_index; 477c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu}; 478c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu 479c5e9d3114a80d6d35a2f4e65783cdc75fcc2deacChia-I Wu 480e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca#ifdef __cplusplus 481e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca} 482e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca#endif 483e4e30089231831339815cccebf3a3a0ea6dcd2a9José Fonseca 4848e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell#endif 485