lp_texture.h revision 8257bb963f0b21c0c35da479707b5cacbc1c2824
1946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca/************************************************************************** 2946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * 3946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. 4946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * All Rights Reserved. 5946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * 6946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * Permission is hereby granted, free of charge, to any person obtaining a 7946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * copy of this software and associated documentation files (the 8946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * "Software"), to deal in the Software without restriction, including 9946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * without limitation the rights to use, copy, modify, merge, publish, 10946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * distribute, sub license, and/or sell copies of the Software, and to 11946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * permit persons to whom the Software is furnished to do so, subject to 12946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * the following conditions: 13946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * 14946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * The above copyright notice and this permission notice (including the 15946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * next paragraph) shall be included in all copies or substantial portions 16946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * of the Software. 17946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * 18946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 22946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * 26946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca **************************************************************************/ 27946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 28c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#ifndef LP_TEXTURE_H 29c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_TEXTURE_H 30946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 31946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 32946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca#include "pipe/p_state.h" 3368df2949971f6a9c0854bdfb2a252cb82fd9b7aaJosé Fonseca#include "util/u_debug.h" 342de31f2bf2b9c68aaa76a63fa0d0d3e0731ccfb5Brian Paul#include "lp_limits.h" 350639765b2850739af1678f10fc0c5706d5827776Brian Paul 360639765b2850739af1678f10fc0c5706d5827776Brian Paul 370639765b2850739af1678f10fc0c5706d5827776Brian Paulenum lp_texture_usage 380639765b2850739af1678f10fc0c5706d5827776Brian Paul{ 390639765b2850739af1678f10fc0c5706d5827776Brian Paul LP_TEX_USAGE_READ = 100, 400639765b2850739af1678f10fc0c5706d5827776Brian Paul LP_TEX_USAGE_READ_WRITE, 410639765b2850739af1678f10fc0c5706d5827776Brian Paul LP_TEX_USAGE_WRITE_ALL 420639765b2850739af1678f10fc0c5706d5827776Brian Paul}; 430639765b2850739af1678f10fc0c5706d5827776Brian Paul 440639765b2850739af1678f10fc0c5706d5827776Brian Paul 450639765b2850739af1678f10fc0c5706d5827776Brian Paul/** Per-tile layout mode */ 460639765b2850739af1678f10fc0c5706d5827776Brian Paulenum lp_texture_layout 470639765b2850739af1678f10fc0c5706d5827776Brian Paul{ 480639765b2850739af1678f10fc0c5706d5827776Brian Paul LP_TEX_LAYOUT_NONE = 0, /**< no layout for the tile data yet */ 490639765b2850739af1678f10fc0c5706d5827776Brian Paul LP_TEX_LAYOUT_TILED, /**< the tile data is in tiled layout */ 500639765b2850739af1678f10fc0c5706d5827776Brian Paul LP_TEX_LAYOUT_LINEAR, /**< the tile data is in linear layout */ 510639765b2850739af1678f10fc0c5706d5827776Brian Paul LP_TEX_LAYOUT_BOTH /**< the tile data is in both modes */ 520639765b2850739af1678f10fc0c5706d5827776Brian Paul}; 530639765b2850739af1678f10fc0c5706d5827776Brian Paul 54d73fadf2116f5459f18bd84f48e7ed86773797b0Brian Paul 55946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonsecastruct pipe_context; 56946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonsecastruct pipe_screen; 57946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonsecastruct llvmpipe_context; 5894ce4eb3c27706d992226d847d123c46b14b1c4fKeith Whitwell 5994ce4eb3c27706d992226d847d123c46b14b1c4fKeith Whitwellstruct sw_displaytarget; 60946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 614414a1a73ca649df12b514daa82381a2dbde2ba4Brian Paul 620639765b2850739af1678f10fc0c5706d5827776Brian Paul/** 630639765b2850739af1678f10fc0c5706d5827776Brian Paul * We keep one or two copies of the texture image data: one in a simple 640639765b2850739af1678f10fc0c5706d5827776Brian Paul * linear layout (for texture sampling) and another in a tiled layout (for 650639765b2850739af1678f10fc0c5706d5827776Brian Paul * render targets). We keep track of whether each image tile is linear 660639765b2850739af1678f10fc0c5706d5827776Brian Paul * or tiled on a per-tile basis. 670639765b2850739af1678f10fc0c5706d5827776Brian Paul */ 680639765b2850739af1678f10fc0c5706d5827776Brian Paul 690639765b2850739af1678f10fc0c5706d5827776Brian Paul 700639765b2850739af1678f10fc0c5706d5827776Brian Paul/** A 1D/2D/3D image, one mipmap level */ 710639765b2850739af1678f10fc0c5706d5827776Brian Paulstruct llvmpipe_texture_image 720639765b2850739af1678f10fc0c5706d5827776Brian Paul{ 730639765b2850739af1678f10fc0c5706d5827776Brian Paul void *data; 740639765b2850739af1678f10fc0c5706d5827776Brian Paul}; 750639765b2850739af1678f10fc0c5706d5827776Brian Paul 760639765b2850739af1678f10fc0c5706d5827776Brian Paul 770639765b2850739af1678f10fc0c5706d5827776Brian Paul/** 780639765b2850739af1678f10fc0c5706d5827776Brian Paul * llvmpipe subclass of pipe_resource. A texture, drawing surface, 790639765b2850739af1678f10fc0c5706d5827776Brian Paul * vertex buffer, const buffer, etc. 800639765b2850739af1678f10fc0c5706d5827776Brian Paul * Textures are stored differently than othere types of objects such as 810639765b2850739af1678f10fc0c5706d5827776Brian Paul * vertex buffers and const buffers. 820639765b2850739af1678f10fc0c5706d5827776Brian Paul * The former are tiled and have per-tile layout flags. 830639765b2850739af1678f10fc0c5706d5827776Brian Paul * The later are simple malloc'd blocks of memory. 840639765b2850739af1678f10fc0c5706d5827776Brian Paul */ 85287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwellstruct llvmpipe_resource 86946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca{ 87287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell struct pipe_resource base; 88946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 890639765b2850739af1678f10fc0c5706d5827776Brian Paul /** Row stride in bytes */ 90f4071e55dba8c0f45f3a7f59135b34e5b81fdab8Brian Paul unsigned row_stride[LP_MAX_TEXTURE_LEVELS]; 91f4071e55dba8c0f45f3a7f59135b34e5b81fdab8Brian Paul /** Image stride (for cube maps or 3D textures) in bytes */ 92f4071e55dba8c0f45f3a7f59135b34e5b81fdab8Brian Paul unsigned img_stride[LP_MAX_TEXTURE_LEVELS]; 930639765b2850739af1678f10fc0c5706d5827776Brian Paul unsigned tiles_per_row[LP_MAX_TEXTURE_LEVELS]; 94202ff7db490f4a1d041a88f11665fbd3ccea2201Brian Paul unsigned tiles_per_image[LP_MAX_TEXTURE_LEVELS]; 95202ff7db490f4a1d041a88f11665fbd3ccea2201Brian Paul /** Number of 3D slices or cube faces per level */ 96202ff7db490f4a1d041a88f11665fbd3ccea2201Brian Paul unsigned num_slices_faces[LP_MAX_TEXTURE_LEVELS]; 978257bb963f0b21c0c35da479707b5cacbc1c2824Roland Scheidegger /** Offset to start of mipmap level, in bytes */ 988257bb963f0b21c0c35da479707b5cacbc1c2824Roland Scheidegger unsigned tiled_mip_offsets[LP_MAX_TEXTURE_LEVELS]; 998257bb963f0b21c0c35da479707b5cacbc1c2824Roland Scheidegger unsigned linear_mip_offsets[LP_MAX_TEXTURE_LEVELS]; 100946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 101e173a9bbd64dc38dba6b881ed7a9faea02861042José Fonseca /** 102287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell * Display target, for textures with the PIPE_BIND_DISPLAY_TARGET 103e173a9bbd64dc38dba6b881ed7a9faea02861042José Fonseca * usage. 104e173a9bbd64dc38dba6b881ed7a9faea02861042José Fonseca */ 10594ce4eb3c27706d992226d847d123c46b14b1c4fKeith Whitwell struct sw_displaytarget *dt; 106e173a9bbd64dc38dba6b881ed7a9faea02861042José Fonseca 107e173a9bbd64dc38dba6b881ed7a9faea02861042José Fonseca /** 108e173a9bbd64dc38dba6b881ed7a9faea02861042José Fonseca * Malloc'ed data for regular textures, or a mapping to dt above. 109946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca */ 1108257bb963f0b21c0c35da479707b5cacbc1c2824Roland Scheidegger struct llvmpipe_texture_image tiled_img; 1118257bb963f0b21c0c35da479707b5cacbc1c2824Roland Scheidegger struct llvmpipe_texture_image linear_img; 1120639765b2850739af1678f10fc0c5706d5827776Brian Paul 1130639765b2850739af1678f10fc0c5706d5827776Brian Paul /** 1140639765b2850739af1678f10fc0c5706d5827776Brian Paul * Data for non-texture resources. 1150639765b2850739af1678f10fc0c5706d5827776Brian Paul */ 116e173a9bbd64dc38dba6b881ed7a9faea02861042José Fonseca void *data; 117946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 118202ff7db490f4a1d041a88f11665fbd3ccea2201Brian Paul /** array [level][face or slice][tile_y][tile_x] of layout values) */ 119202ff7db490f4a1d041a88f11665fbd3ccea2201Brian Paul enum lp_texture_layout *layout[LP_MAX_TEXTURE_LEVELS]; 1200639765b2850739af1678f10fc0c5706d5827776Brian Paul 121287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell boolean userBuffer; /** Is this a user-space buffer? */ 1220f55a95b2faa16cc008143c53a8b82b19c5d750aKeith Whitwell unsigned timestamp; 1230639765b2850739af1678f10fc0c5706d5827776Brian Paul 1240639765b2850739af1678f10fc0c5706d5827776Brian Paul unsigned id; /**< temporary, for debugging */ 125fea189d6e4f0c09eb0d005c5fa06db43b56e2e37Brian Paul 126fea189d6e4f0c09eb0d005c5fa06db43b56e2e37Brian Paul#ifdef DEBUG 127fea189d6e4f0c09eb0d005c5fa06db43b56e2e37Brian Paul /** for linked list */ 128fea189d6e4f0c09eb0d005c5fa06db43b56e2e37Brian Paul struct llvmpipe_resource *prev, *next; 129fea189d6e4f0c09eb0d005c5fa06db43b56e2e37Brian Paul#endif 130946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca}; 131946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 1324414a1a73ca649df12b514daa82381a2dbde2ba4Brian Paul 133946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonsecastruct llvmpipe_transfer 134946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca{ 135946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca struct pipe_transfer base; 136946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 137946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca unsigned long offset; 138946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca}; 139946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 140946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 141946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca/** cast wrappers */ 142287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwellstatic INLINE struct llvmpipe_resource * 143287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwellllvmpipe_resource(struct pipe_resource *pt) 144946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca{ 145287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell return (struct llvmpipe_resource *) pt; 146946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca} 147946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 1484414a1a73ca649df12b514daa82381a2dbde2ba4Brian Paul 149287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwellstatic INLINE const struct llvmpipe_resource * 150287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwellllvmpipe_resource_const(const struct pipe_resource *pt) 1519be1feacf2dbd36fa9fb65b9932a74f04a7d9ccaBrian Paul{ 152287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell return (const struct llvmpipe_resource *) pt; 1539be1feacf2dbd36fa9fb65b9932a74f04a7d9ccaBrian Paul} 1549be1feacf2dbd36fa9fb65b9932a74f04a7d9ccaBrian Paul 1559be1feacf2dbd36fa9fb65b9932a74f04a7d9ccaBrian Paul 156946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonsecastatic INLINE struct llvmpipe_transfer * 157946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonsecallvmpipe_transfer(struct pipe_transfer *pt) 158946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca{ 159946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca return (struct llvmpipe_transfer *) pt; 160946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca} 161946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 162946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 163287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwellvoid llvmpipe_init_screen_resource_funcs(struct pipe_screen *screen); 164287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwellvoid llvmpipe_init_context_resource_funcs(struct pipe_context *pipe); 165287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell 1663abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonsecastatic INLINE unsigned 167d293c43c9a9658caa5224f710b95a848a912faa1Brian Paulllvmpipe_resource_stride(struct pipe_resource *resource, 1683abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonseca unsigned level) 1693abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonseca{ 170d293c43c9a9658caa5224f710b95a848a912faa1Brian Paul struct llvmpipe_resource *lpr = llvmpipe_resource(resource); 1713abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonseca assert(level < LP_MAX_TEXTURE_2D_LEVELS); 172f4071e55dba8c0f45f3a7f59135b34e5b81fdab8Brian Paul return lpr->row_stride[level]; 1733abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonseca} 1743abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonseca 1753abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonseca 1763abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonsecavoid * 177d293c43c9a9658caa5224f710b95a848a912faa1Brian Paulllvmpipe_resource_map(struct pipe_resource *resource, 1784c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned level, 1794c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned layer, 1800639765b2850739af1678f10fc0c5706d5827776Brian Paul enum lp_texture_usage tex_usage, 1810639765b2850739af1678f10fc0c5706d5827776Brian Paul enum lp_texture_layout layout); 1823abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonseca 1833abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonsecavoid 184d293c43c9a9658caa5224f710b95a848a912faa1Brian Paulllvmpipe_resource_unmap(struct pipe_resource *resource, 1853abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonseca unsigned level, 1864c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger unsigned layer); 1873abc7b985ce0787c5103d1a86bd0ba07b127a82fJosé Fonseca 188946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 1890639765b2850739af1678f10fc0c5706d5827776Brian Paulvoid * 1900639765b2850739af1678f10fc0c5706d5827776Brian Paulllvmpipe_resource_data(struct pipe_resource *resource); 1910639765b2850739af1678f10fc0c5706d5827776Brian Paul 1920639765b2850739af1678f10fc0c5706d5827776Brian Paul 1931db3a55b9c59093f7bf4df39579287eeb0cf0a2bBrian Paulunsigned 1941db3a55b9c59093f7bf4df39579287eeb0cf0a2bBrian Paulllvmpipe_resource_size(const struct pipe_resource *resource); 1951db3a55b9c59093f7bf4df39579287eeb0cf0a2bBrian Paul 1961db3a55b9c59093f7bf4df39579287eeb0cf0a2bBrian Paul 197a5460dc6d75b22473092b152d90b9092850bf51dVinson Leeubyte * 198d293c43c9a9658caa5224f710b95a848a912faa1Brian Paulllvmpipe_get_texture_image_address(struct llvmpipe_resource *lpr, 199ee7cf9d80ff962e714bc66487f621e03f21e1293Brian Paul unsigned face_slice, unsigned level, 2000639765b2850739af1678f10fc0c5706d5827776Brian Paul enum lp_texture_layout layout); 2010639765b2850739af1678f10fc0c5706d5827776Brian Paul 2020639765b2850739af1678f10fc0c5706d5827776Brian Paulvoid * 2030639765b2850739af1678f10fc0c5706d5827776Brian Paulllvmpipe_get_texture_image(struct llvmpipe_resource *resource, 204ee7cf9d80ff962e714bc66487f621e03f21e1293Brian Paul unsigned face_slice, unsigned level, 2050639765b2850739af1678f10fc0c5706d5827776Brian Paul enum lp_texture_usage usage, 2060639765b2850739af1678f10fc0c5706d5827776Brian Paul enum lp_texture_layout layout); 2070639765b2850739af1678f10fc0c5706d5827776Brian Paul 208202ff7db490f4a1d041a88f11665fbd3ccea2201Brian Paulvoid * 209202ff7db490f4a1d041a88f11665fbd3ccea2201Brian Paulllvmpipe_get_texture_image_all(struct llvmpipe_resource *lpr, 210202ff7db490f4a1d041a88f11665fbd3ccea2201Brian Paul unsigned level, 211202ff7db490f4a1d041a88f11665fbd3ccea2201Brian Paul enum lp_texture_usage usage, 212202ff7db490f4a1d041a88f11665fbd3ccea2201Brian Paul enum lp_texture_layout layout); 2130639765b2850739af1678f10fc0c5706d5827776Brian Paul 2140639765b2850739af1678f10fc0c5706d5827776Brian Paulubyte * 215d293c43c9a9658caa5224f710b95a848a912faa1Brian Paulllvmpipe_get_texture_tile_linear(struct llvmpipe_resource *lpr, 216ee7cf9d80ff962e714bc66487f621e03f21e1293Brian Paul unsigned face_slice, unsigned level, 2170639765b2850739af1678f10fc0c5706d5827776Brian Paul enum lp_texture_usage usage, 2180639765b2850739af1678f10fc0c5706d5827776Brian Paul unsigned x, unsigned y); 2190639765b2850739af1678f10fc0c5706d5827776Brian Paul 2200639765b2850739af1678f10fc0c5706d5827776Brian Paulubyte * 221d293c43c9a9658caa5224f710b95a848a912faa1Brian Paulllvmpipe_get_texture_tile(struct llvmpipe_resource *lpr, 222ee7cf9d80ff962e714bc66487f621e03f21e1293Brian Paul unsigned face_slice, unsigned level, 2230639765b2850739af1678f10fc0c5706d5827776Brian Paul enum lp_texture_usage usage, 2240639765b2850739af1678f10fc0c5706d5827776Brian Paul unsigned x, unsigned y); 2250639765b2850739af1678f10fc0c5706d5827776Brian Paul 2260639765b2850739af1678f10fc0c5706d5827776Brian Paul 2272f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwellvoid 2282f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwellllvmpipe_unswizzle_cbuf_tile(struct llvmpipe_resource *lpr, 2292f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwell unsigned face_slice, unsigned level, 2302f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwell unsigned x, unsigned y, 2312f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwell uint8_t *tile); 2322f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwell 2332f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwellvoid 2342f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwellllvmpipe_swizzle_cbuf_tile(struct llvmpipe_resource *lpr, 2352f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwell unsigned face_slice, unsigned level, 2362f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwell unsigned x, unsigned y, 2372f6d47a7c8d6e69e5154de44115aab9ba35a41d2Keith Whitwell uint8_t *tile); 2380639765b2850739af1678f10fc0c5706d5827776Brian Paul 2390639765b2850739af1678f10fc0c5706d5827776Brian Paulextern void 240fea189d6e4f0c09eb0d005c5fa06db43b56e2e37Brian Paulllvmpipe_print_resources(void); 241fea189d6e4f0c09eb0d005c5fa06db43b56e2e37Brian Paul 242fea189d6e4f0c09eb0d005c5fa06db43b56e2e37Brian Paul 243fea189d6e4f0c09eb0d005c5fa06db43b56e2e37Brian Paulextern void 2440639765b2850739af1678f10fc0c5706d5827776Brian Paulllvmpipe_init_screen_texture_funcs(struct pipe_screen *screen); 2450639765b2850739af1678f10fc0c5706d5827776Brian Paul 2460639765b2850739af1678f10fc0c5706d5827776Brian Paulextern void 2470639765b2850739af1678f10fc0c5706d5827776Brian Paulllvmpipe_init_context_texture_funcs(struct pipe_context *pipe); 2480639765b2850739af1678f10fc0c5706d5827776Brian Paul 24925485f4b69447514ab8b595aced90c75606a99bdMarek Olšák 25025485f4b69447514ab8b595aced90c75606a99bdMarek Olšák#define LP_UNREFERENCED 0 25125485f4b69447514ab8b595aced90c75606a99bdMarek Olšák#define LP_REFERENCED_FOR_READ (1 << 0) 25225485f4b69447514ab8b595aced90c75606a99bdMarek Olšák#define LP_REFERENCED_FOR_WRITE (1 << 1) 25325485f4b69447514ab8b595aced90c75606a99bdMarek Olšák 25425485f4b69447514ab8b595aced90c75606a99bdMarek Olšákunsigned int 25525485f4b69447514ab8b595aced90c75606a99bdMarek Olšákllvmpipe_is_resource_referenced( struct pipe_context *pipe, 25625485f4b69447514ab8b595aced90c75606a99bdMarek Olšák struct pipe_resource *presource, 25725485f4b69447514ab8b595aced90c75606a99bdMarek Olšák unsigned level, int layer); 25825485f4b69447514ab8b595aced90c75606a99bdMarek Olšák 2594414a1a73ca649df12b514daa82381a2dbde2ba4Brian Paul#endif /* LP_TEXTURE_H */ 260