Lines Matching refs:level
111 unsigned level; in llvmpipe_texture_layout() local
120 for (level = 0; level <= pt->last_level; level++) { in llvmpipe_texture_layout()
140 lpr->row_stride[level] = align(nblocksx * block_size, 16); in llvmpipe_texture_layout()
142 lpr->img_stride[level] = lpr->row_stride[level] * nblocksy; in llvmpipe_texture_layout()
149 lpr->tiles_per_row[level] = width_t; in llvmpipe_texture_layout()
150 lpr->tiles_per_image[level] = width_t * height_t; in llvmpipe_texture_layout()
164 lpr->num_slices_faces[level] = num_slices; in llvmpipe_texture_layout()
166 lpr->layout[level] = alloc_layout_array(num_slices, width, height); in llvmpipe_texture_layout()
167 if (!lpr->layout[level]) { in llvmpipe_texture_layout()
172 total_size += lpr->num_slices_faces[level] * lpr->img_stride[level]; in llvmpipe_texture_layout()
186 for (level = 0; level <= pt->last_level; level++) { in llvmpipe_texture_layout()
187 if (lpr->layout[level]) { in llvmpipe_texture_layout()
188 FREE(lpr->layout[level]); in llvmpipe_texture_layout()
325 uint level; in llvmpipe_resource_destroy() local
328 for (level = 0; level < Elements(lpr->linear); level++) { in llvmpipe_resource_destroy()
329 if (lpr->linear[level].data) { in llvmpipe_resource_destroy()
330 align_free(lpr->linear[level].data); in llvmpipe_resource_destroy()
331 lpr->linear[level].data = NULL; in llvmpipe_resource_destroy()
336 for (level = 0; level < Elements(lpr->tiled); level++) { in llvmpipe_resource_destroy()
337 if (lpr->tiled[level].data) { in llvmpipe_resource_destroy()
338 align_free(lpr->tiled[level].data); in llvmpipe_resource_destroy()
339 lpr->tiled[level].data = NULL; in llvmpipe_resource_destroy()
344 for (level = 0; level < Elements(lpr->tiled); level++) { in llvmpipe_resource_destroy()
345 FREE(lpr->layout[level]); in llvmpipe_resource_destroy()
346 lpr->layout[level] = NULL; in llvmpipe_resource_destroy()
368 unsigned level, in llvmpipe_resource_map() argument
376 assert(level < LP_MAX_TEXTURE_LEVELS); in llvmpipe_resource_map()
377 assert(layer < (u_minify(resource->depth0, level) + resource->array_size - 1)); in llvmpipe_resource_map()
401 assert(level == 0); in llvmpipe_resource_map()
408 lpr->linear[level].data = map; in llvmpipe_resource_map()
419 map = llvmpipe_get_texture_image(lpr, layer, level, in llvmpipe_resource_map()
434 unsigned level, in llvmpipe_resource_unmap() argument
444 assert(level == 0); in llvmpipe_resource_unmap()
448 (void) llvmpipe_get_texture_image(lpr, layer, level, in llvmpipe_resource_unmap()
562 assert(surf_tmpl->u.tex.level <= pt->last_level); in llvmpipe_create_surface()
570 ps->width = u_minify(pt->width0, surf_tmpl->u.tex.level); in llvmpipe_create_surface()
571 ps->height = u_minify(pt->height0, surf_tmpl->u.tex.level); in llvmpipe_create_surface()
574 ps->u.tex.level = surf_tmpl->u.tex.level; in llvmpipe_create_surface()
599 unsigned level, in llvmpipe_get_transfer() argument
608 assert(level <= resource->last_level); in llvmpipe_get_transfer()
618 level, in llvmpipe_get_transfer()
640 pt->level = level; in llvmpipe_get_transfer()
641 pt->stride = lprex->row_stride[level]; in llvmpipe_get_transfer()
642 pt->layer_stride = lprex->img_stride[level]; in llvmpipe_get_transfer()
676 assert(transfer->level < LP_MAX_TEXTURE_LEVELS); in llvmpipe_transfer_map()
706 transfer->level, in llvmpipe_transfer_map()
735 transfer->level, in llvmpipe_transfer_unmap()
742 unsigned level, int layer) in llvmpipe_is_resource_referenced() argument
791 tex_image_face_size(const struct llvmpipe_resource *lpr, unsigned level, in tex_image_face_size() argument
794 const unsigned width = u_minify(lpr->base.width0, level); in tex_image_face_size()
795 const unsigned height = u_minify(lpr->base.height0, level); in tex_image_face_size()
813 return lpr->img_stride[level]; in tex_image_face_size()
823 tex_image_size(const struct llvmpipe_resource *lpr, unsigned level, in tex_image_size() argument
826 const unsigned buf_size = tex_image_face_size(lpr, level, layout); in tex_image_size()
827 return buf_size * lpr->num_slices_faces[level]; in tex_image_size()
896 unsigned face_slice, unsigned level, in llvmpipe_get_texture_image_address() argument
903 img = &lpr->linear[level]; in llvmpipe_get_texture_image_address()
907 img = &lpr->tiled[level]; in llvmpipe_get_texture_image_address()
911 offset = face_slice * tex_image_face_size(lpr, level, layout); in llvmpipe_get_texture_image_address()
921 unsigned face_slice, unsigned level, in llvmpipe_get_texture_tile_layout() argument
926 assert(x < lpr->tiles_per_row[level]); in llvmpipe_get_texture_tile_layout()
927 i = face_slice * lpr->tiles_per_image[level] in llvmpipe_get_texture_tile_layout()
928 + y * lpr->tiles_per_row[level] + x; in llvmpipe_get_texture_tile_layout()
929 return lpr->layout[level][i]; in llvmpipe_get_texture_tile_layout()
935 unsigned face_slice, unsigned level, in llvmpipe_set_texture_tile_layout() argument
941 assert(x < lpr->tiles_per_row[level]); in llvmpipe_set_texture_tile_layout()
942 i = face_slice * lpr->tiles_per_image[level] in llvmpipe_set_texture_tile_layout()
943 + y * lpr->tiles_per_row[level] + x; in llvmpipe_set_texture_tile_layout()
944 lpr->layout[level][i] = layout; in llvmpipe_set_texture_tile_layout()
953 unsigned face_slice, unsigned level, in llvmpipe_set_texture_image_layout() argument
957 const unsigned start = face_slice * lpr->tiles_per_image[level]; in llvmpipe_set_texture_image_layout()
961 lpr->layout[level][start + i] = layout; in llvmpipe_set_texture_image_layout()
971 alloc_image_data(struct llvmpipe_resource *lpr, unsigned level, in alloc_image_data() argument
977 assert(level == 0); in alloc_image_data()
981 uint buffer_size = tex_image_size(lpr, level, layout); in alloc_image_data()
982 lpr->tiled[level].data = align_malloc(buffer_size, alignment); in alloc_image_data()
983 if (lpr->tiled[level].data) { in alloc_image_data()
984 memset(lpr->tiled[level].data, 0, buffer_size); in alloc_image_data()
1002 uint buffer_size = tex_image_size(lpr, level, LP_TEX_LAYOUT_LINEAR); in alloc_image_data()
1003 lpr->linear[level].data = align_malloc(buffer_size, alignment); in alloc_image_data()
1004 if (lpr->linear[level].data) { in alloc_image_data()
1005 memset(lpr->linear[level].data, 0, buffer_size); in alloc_image_data()
1023 unsigned face_slice, unsigned level, in llvmpipe_get_texture_image() argument
1037 const unsigned width = u_minify(lpr->base.width0, level); in llvmpipe_get_texture_image()
1038 const unsigned height = u_minify(lpr->base.height0, level); in llvmpipe_get_texture_image()
1062 assert(lpr->linear[level].data); in llvmpipe_get_texture_image()
1067 target_img = &lpr->linear[level]; in llvmpipe_get_texture_image()
1068 other_img = &lpr->tiled[level]; in llvmpipe_get_texture_image()
1072 target_img = &lpr->tiled[level]; in llvmpipe_get_texture_image()
1073 other_img = &lpr->linear[level]; in llvmpipe_get_texture_image()
1082 alloc_image_data(lpr, level, layout); in llvmpipe_get_texture_image()
1089 target_offset = face_slice * tex_image_face_size(lpr, level, layout); in llvmpipe_get_texture_image()
1090 other_offset = face_slice * tex_image_face_size(lpr, level, other_layout); in llvmpipe_get_texture_image()
1115 llvmpipe_get_texture_tile_layout(lpr, face_slice, level, x, y); in llvmpipe_get_texture_image()
1126 lpr->row_stride[level], in llvmpipe_get_texture_image()
1127 lpr->tiles_per_row[level]); in llvmpipe_get_texture_image()
1135 lpr->row_stride[level], in llvmpipe_get_texture_image()
1136 lpr->tiles_per_row[level]); in llvmpipe_get_texture_image()
1141 llvmpipe_set_texture_tile_layout(lpr, face_slice, level, x, y, in llvmpipe_get_texture_image()
1148 llvmpipe_set_texture_image_layout(lpr, face_slice, level, in llvmpipe_get_texture_image()
1164 unsigned level, in llvmpipe_get_texture_image_all() argument
1168 const int slices = lpr->num_slices_faces[level]; in llvmpipe_get_texture_image_all()
1175 map = llvmpipe_get_texture_image(lpr, slice, level, usage, layout); in llvmpipe_get_texture_image_all()
1190 unsigned face_slice, unsigned level, in llvmpipe_get_texture_tile_linear() argument
1194 struct llvmpipe_texture_image *linear_img = &lpr->linear[level]; in llvmpipe_get_texture_tile_linear()
1206 alloc_image_data(lpr, level, LP_TEX_LAYOUT_LINEAR); in llvmpipe_get_texture_tile_linear()
1210 tiled_image = llvmpipe_get_texture_image_address(lpr, face_slice, level, in llvmpipe_get_texture_tile_linear()
1212 linear_image = llvmpipe_get_texture_image_address(lpr, face_slice, level, in llvmpipe_get_texture_tile_linear()
1216 cur_layout = llvmpipe_get_texture_tile_layout(lpr, face_slice, level, tx, ty); in llvmpipe_get_texture_tile_linear()
1224 lpr->row_stride[level], in llvmpipe_get_texture_tile_linear()
1225 lpr->tiles_per_row[level]); in llvmpipe_get_texture_tile_linear()
1229 llvmpipe_set_texture_tile_layout(lpr, face_slice, level, tx, ty, new_layout); in llvmpipe_get_texture_tile_linear()
1241 unsigned face_slice, unsigned level, in llvmpipe_get_texture_tile() argument
1245 struct llvmpipe_texture_image *tiled_img = &lpr->tiled[level]; in llvmpipe_get_texture_tile()
1257 alloc_image_data(lpr, level, LP_TEX_LAYOUT_TILED); in llvmpipe_get_texture_tile()
1261 tiled_image = llvmpipe_get_texture_image_address(lpr, face_slice, level, in llvmpipe_get_texture_tile()
1263 linear_image = llvmpipe_get_texture_image_address(lpr, face_slice, level, in llvmpipe_get_texture_tile()
1267 cur_layout = llvmpipe_get_texture_tile_layout(lpr, face_slice, level, tx, ty); in llvmpipe_get_texture_tile()
1273 lpr->row_stride[level], in llvmpipe_get_texture_tile()
1274 lpr->tiles_per_row[level]); in llvmpipe_get_texture_tile()
1281 llvmpipe_set_texture_tile_layout(lpr, face_slice, level, tx, ty, new_layout); in llvmpipe_get_texture_tile()
1284 tile_offset = (ty * lpr->tiles_per_row[level] + tx) in llvmpipe_get_texture_tile()
1297 unsigned face_slice, unsigned level, in llvmpipe_unswizzle_cbuf_tile() argument
1301 struct llvmpipe_texture_image *linear_img = &lpr->linear[level]; in llvmpipe_unswizzle_cbuf_tile()
1310 alloc_image_data(lpr, level, LP_TEX_LAYOUT_LINEAR); in llvmpipe_unswizzle_cbuf_tile()
1314 linear_image = llvmpipe_get_texture_image_address(lpr, face_slice, level, in llvmpipe_unswizzle_cbuf_tile()
1331 lpr->row_stride[level], in llvmpipe_unswizzle_cbuf_tile()
1335 llvmpipe_set_texture_tile_layout(lpr, face_slice, level, tx, ty, in llvmpipe_unswizzle_cbuf_tile()
1346 unsigned face_slice, unsigned level, in llvmpipe_swizzle_cbuf_tile() argument
1356 linear_image = llvmpipe_get_texture_image_address(lpr, face_slice, level, in llvmpipe_swizzle_cbuf_tile()
1373 lpr->row_stride[level], in llvmpipe_swizzle_cbuf_tile()