Lines Matching refs:map

645  * For cube map textures, either the \c face parameter can be used, of course,
662 /* This branch may be taken even if the texture target is a cube map. In
1070 struct intel_miptree_map *map,
1076 int x = map->x;
1077 int y = map->y;
1087 base = intel_region_map(intel, mt->region, map->mode);
1090 map->ptr = NULL;
1099 map->stride = mt->region->pitch * mt->cpp;
1100 map->ptr = base + y * map->stride + x * mt->cpp;
1104 map->x, map->y, map->w, map->h,
1106 x, y, map->ptr, map->stride);
1112 struct intel_miptree_map *map,
1122 struct intel_miptree_map *map,
1126 int x = map->x;
1127 int y = map->y;
1131 map->stride = ALIGN(map->w * mt->region->cpp, 4);
1133 map->bo = drm_intel_bo_alloc(intel->bufmgr, "intel_miptree_map_blit() temp",
1134 map->stride * map->h, 4096);
1135 if (!map->bo) {
1148 map->stride / mt->region->cpp, map->bo,
1152 map->w, map->h,
1159 ret = drm_intel_bo_map(map->bo, (map->mode & GL_MAP_WRITE_BIT) != 0);
1161 fprintf(stderr, "Failed to map blit temporary\n");
1165 map->ptr = map->bo->virtual;
1168 map->x, map->y, map->w, map->h,
1170 x, y, map->ptr, map->stride);
1175 drm_intel_bo_unreference(map->bo);
1176 map->ptr = NULL;
1177 map->stride = 0;
1183 struct intel_miptree_map *map,
1187 assert(!(map->mode & GL_MAP_WRITE_BIT));
1189 drm_intel_bo_unmap(map->bo);
1190 drm_intel_bo_unreference(map->bo);
1196 struct intel_miptree_map *map,
1199 map->stride = map->w;
1200 map->buffer = map->ptr = malloc(map->stride * map->h);
1201 if (!map->buffer)
1209 if (!(map->mode & GL_MAP_INVALIDATE_RANGE_BIT)) {
1210 uint8_t *untiled_s8_map = map->ptr;
1217 for (uint32_t y = 0; y < map->h; y++) {
1218 for (uint32_t x = 0; x < map->w; x++) {
1220 x + image_x + map->x,
1221 y + image_y + map->y,
1223 untiled_s8_map[y * map->w + x] = tiled_s8_map[offset];
1230 map->x, map->y, map->w, map->h,
1231 mt, map->x + image_x, map->y + image_y, map->ptr, map->stride);
1234 map->x, map->y, map->w, map->h,
1235 mt, map->ptr, map->stride);
1242 struct intel_miptree_map *map,
1246 if (map->mode & GL_MAP_WRITE_BIT) {
1248 uint8_t *untiled_s8_map = map->ptr;
1249 uint8_t *tiled_s8_map = intel_region_map(intel, mt->region, map->mode);
1253 for (uint32_t y = 0; y < map->h; y++) {
1254 for (uint32_t x = 0; x < map->w; x++) {
1256 x + map->x,
1257 y + map->y,
1259 tiled_s8_map[offset] = untiled_s8_map[y * map->w + x];
1266 free(map->buffer);
1272 struct intel_miptree_map *map,
1290 assert(map->mode & GL_MAP_WRITE_BIT);
1291 assert(map->mode & GL_MAP_INVALIDATE_RANGE_BIT);
1292 assert(map->x == 0);
1293 assert(map->y == 0);
1296 map->stride = 2 * map->w;
1297 map->buffer = map->ptr = malloc(map->stride * map->h);
1303 struct intel_miptree_map *map,
1311 uint8_t *xbgr = intel_region_map(intel, mt->region, map->mode)
1316 map->ptr, map->stride,
1317 map->w, map->h);
1320 free(map->buffer);
1330 * be able to map that memory for texture storage and glReadPixels-type
1337 struct intel_miptree_map *map,
1345 map->stride = map->w * packed_bpp;
1346 map->buffer = map->ptr = malloc(map->stride * map->h);
1347 if (!map->buffer)
1355 if (!(map->mode & GL_MAP_INVALIDATE_RANGE_BIT)) {
1356 uint32_t *packed_map = map->ptr;
1367 for (uint32_t y = 0; y < map->h; y++) {
1368 for (uint32_t x = 0; x < map->w; x++) {
1369 int map_x = map->x + x, map_y = map->y + y;
1380 packed_map[(y * map->w + x) * 2 + 0] = z;
1381 packed_map[(y * map->w + x) * 2 + 1] = s;
1383 packed_map[y * map->w + x] = (s << 24) | (z & 0x00ffffff);
1393 map->x, map->y, map->w, map->h,
1394 z_mt, map->x + z_image_x, map->y + z_image_y,
1395 s_mt, map->x + s_image_x, map->y + s_image_y,
1396 map->ptr, map->stride);
1399 map->x, map->y, map->w, map->h,
1400 mt, map->ptr, map->stride);
1407 struct intel_miptree_map *map,
1415 if (map->mode & GL_MAP_WRITE_BIT) {
1416 uint32_t *packed_map = map->ptr;
1417 uint8_t *s_map = intel_region_map(intel, s_mt->region, map->mode);
1418 uint32_t *z_map = intel_region_map(intel, z_mt->region, map->mode);
1427 for (uint32_t y = 0; y < map->h; y++) {
1428 for (uint32_t x = 0; x < map->w; x++) {
1430 x + s_image_x + map->x,
1431 y + s_image_y + map->y,
1437 z_map[z_offset] = packed_map[(y * map->w + x) * 2 + 0];
1438 s_map[s_offset] = packed_map[(y * map->w + x) * 2 + 1];
1440 uint32_t packed = packed_map[y * map->w + x];
1452 map->x, map->y, map->w, map->h,
1454 map->x + z_image_x, map->y + z_image_y,
1455 s_mt, map->x + s_image_x, map->y + s_image_y,
1456 map->ptr, map->stride);
1459 free(map->buffer);
1463 * Create and attach a map to the miptree at (level, slice). Return the
1464 * attached map.
1476 struct intel_miptree_map *map = calloc(1, sizeof(*map));
1478 if (!map)
1481 assert(mt->level[level].slice[slice].map == NULL);
1482 mt->level[level].slice[slice].map = map;
1484 map->mode = mode;
1485 map->x = x;
1486 map->y = y;
1487 map->w = w;
1488 map->h = h;
1490 return map;
1494 * Release the map at (level, slice).
1501 struct intel_miptree_map **map;
1503 map = &mt->level[level].slice[slice].map;
1504 free(*map);
1505 *map = NULL;
1521 struct intel_miptree_map *map;
1525 map = intel_miptree_attach_map(mt, level, slice, x, y, w, h, mode);
1526 if (!map){
1533 if (map->mode & GL_MAP_WRITE_BIT) {
1538 intel_miptree_map_s8(intel, mt, map, level, slice);
1540 intel_miptree_map_etc1(intel, mt, map, level, slice);
1542 intel_miptree_map_depthstencil(intel, mt, map, level, slice);
1547 intel_miptree_map_blit(intel, mt, map, level, slice);
1549 intel_miptree_map_gtt(intel, mt, map, level, slice);
1552 *out_ptr = map->ptr;
1553 *out_stride = map->stride;
1555 if (map->ptr == NULL)
1565 struct intel_miptree_map *map = mt->level[level].slice[slice].map;
1569 if (!map)
1576 intel_miptree_unmap_s8(intel, mt, map, level, slice);
1578 intel_miptree_unmap_etc1(intel, mt, map, level, slice);
1580 intel_miptree_unmap_depthstencil(intel, mt, map, level, slice);
1581 } else if (map->bo) {
1582 intel_miptree_unmap_blit(intel, mt, map, level, slice);
1584 intel_miptree_unmap_gtt(intel, mt, map, level, slice);
1603 struct intel_miptree_map *map;
1611 _mesa_problem(&intel->ctx, "attempt to map a multisample miptree for "
1617 map = intel_miptree_attach_map(mt, level, slice, x, y, w, h, mode);
1618 if (!map)
1631 map->singlesample_mt_is_tmp = true;
1655 struct intel_miptree_map *map = mt->level[level].slice[slice].map;
1659 if (!map)
1665 if (map->mode & GL_MAP_WRITE_BIT)
1668 if (map->singlesample_mt_is_tmp)