Lines Matching defs:tc
49 struct softpipe_tex_tile_cache *tc;
55 tc = CALLOC_STRUCT( softpipe_tex_tile_cache );
56 if (tc) {
57 tc->pipe = pipe;
59 tc->entries[pos].addr.bits.invalid = 1;
61 tc->last_tile = &tc->entries[0]; /* any tile */
63 return tc;
68 sp_destroy_tex_tile_cache(struct softpipe_tex_tile_cache *tc)
70 if (tc) {
74 /*assert(tc->entries[pos].x < 0);*/
76 if (tc->transfer) {
77 tc->pipe->transfer_destroy(tc->pipe, tc->transfer);
79 if (tc->tex_trans) {
80 tc->pipe->transfer_destroy(tc->pipe, tc->tex_trans);
83 FREE( tc );
91 sp_tex_tile_cache_map_transfers(struct softpipe_tex_tile_cache *tc)
93 if (tc->tex_trans && !tc->tex_trans_map)
94 tc->tex_trans_map = tc->pipe->transfer_map(tc->pipe, tc->tex_trans);
99 sp_tex_tile_cache_unmap_transfers(struct softpipe_tex_tile_cache *tc)
101 if (tc->tex_trans_map) {
102 tc->pipe->transfer_unmap(tc->pipe, tc->tex_trans);
103 tc->tex_trans_map = NULL;
112 sp_tex_tile_cache_validate_texture(struct softpipe_tex_tile_cache *tc)
116 assert(tc);
117 assert(tc->texture);
120 tc->entries[i].addr.bits.invalid = 1;
125 sp_tex_tile_is_compat_view(struct softpipe_tex_tile_cache *tc,
130 return (tc->texture == view->texture &&
131 tc->format == view->format &&
132 tc->swizzle_r == view->swizzle_r &&
133 tc->swizzle_g == view->swizzle_g &&
134 tc->swizzle_b == view->swizzle_b &&
135 tc->swizzle_a == view->swizzle_a);
142 sp_tex_tile_cache_set_sampler_view(struct softpipe_tex_tile_cache *tc,
148 assert(!tc->transfer);
150 if (!sp_tex_tile_is_compat_view(tc, view)) {
151 pipe_resource_reference(&tc->texture, texture);
153 if (tc->tex_trans) {
154 if (tc->tex_trans_map) {
155 tc->pipe->transfer_unmap(tc->pipe, tc->tex_trans);
156 tc->tex_trans_map = NULL;
159 tc->pipe->transfer_destroy(tc->pipe, tc->tex_trans);
160 tc->tex_trans = NULL;
164 tc->swizzle_r = view->swizzle_r;
165 tc->swizzle_g = view->swizzle_g;
166 tc->swizzle_b = view->swizzle_b;
167 tc->swizzle_a = view->swizzle_a;
168 tc->format = view->format;
174 tc->entries[i].addr.bits.invalid = 1;
177 tc->tex_face = -1; /* any invalid value here */
189 sp_flush_tex_tile_cache(struct softpipe_tex_tile_cache *tc)
193 if (tc->texture) {
196 tc->entries[pos].addr.bits.invalid = 1;
198 tc->tex_face = -1;
228 sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc,
232 boolean zs = util_format_is_depth_or_stencil(tc->format);
234 tile = tc->entries + tex_cache_pos( addr );
251 if (!tc->tex_trans ||
252 tc->tex_face != addr.bits.face ||
253 tc->tex_level != addr.bits.level ||
254 tc->tex_z != addr.bits.z) {
258 if (tc->tex_trans) {
259 if (tc->tex_trans_map) {
260 tc->pipe->transfer_unmap(tc->pipe, tc->tex_trans);
261 tc->tex_trans_map = NULL;
264 tc->pipe->transfer_destroy(tc->pipe, tc->tex_trans);
265 tc->tex_trans = NULL;
268 width = u_minify(tc->texture->width0, addr.bits.level);
269 if (tc->texture->target == PIPE_TEXTURE_1D_ARRAY) {
270 height = tc->texture->array_size;
274 height = u_minify(tc->texture->height0, addr.bits.level);
278 tc->tex_trans =
279 pipe_get_transfer(tc->pipe, tc->texture,
285 tc->tex_trans_map = tc->pipe->transfer_map(tc->pipe, tc->tex_trans);
287 tc->tex_face = addr.bits.face;
288 tc->tex_level = addr.bits.level;
289 tc->tex_z = addr.bits.z;
295 if (!zs && util_format_is_pure_uint(tc->format)) {
296 pipe_get_tile_ui_format(tc->pipe,
297 tc->tex_trans,
302 tc->format,
304 } else if (!zs && util_format_is_pure_sint(tc->format)) {
305 pipe_get_tile_i_format(tc->pipe,
306 tc->tex_trans,
311 tc->format,
314 pipe_get_tile_rgba_format(tc->pipe,
315 tc->tex_trans,
320 tc->format,
326 tc->last_tile = tile;