Home | History | Annotate | Download | only in llvmpipe

Lines Matching full:level

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