mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 13:10:10 +01:00
i965: Move unmap_s8 before map_s8
Reorder code to avoid a forward declaration in the next patch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
b3ad6f5ca6
commit
9e7e88049f
1 changed files with 30 additions and 30 deletions
|
|
@ -3265,6 +3265,36 @@ intel_miptree_map_movntdqa(struct brw_context *brw,
|
|||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
intel_miptree_unmap_s8(struct brw_context *brw,
|
||||
struct intel_mipmap_tree *mt,
|
||||
struct intel_miptree_map *map,
|
||||
unsigned int level,
|
||||
unsigned int slice)
|
||||
{
|
||||
if (map->mode & GL_MAP_WRITE_BIT) {
|
||||
unsigned int image_x, image_y;
|
||||
uint8_t *untiled_s8_map = map->ptr;
|
||||
uint8_t *tiled_s8_map = intel_miptree_map_raw(brw, mt, GL_MAP_WRITE_BIT);
|
||||
|
||||
intel_miptree_get_image_offset(mt, level, slice, &image_x, &image_y);
|
||||
|
||||
for (uint32_t y = 0; y < map->h; y++) {
|
||||
for (uint32_t x = 0; x < map->w; x++) {
|
||||
ptrdiff_t offset = intel_offset_S8(mt->surf.row_pitch,
|
||||
image_x + x + map->x,
|
||||
image_y + y + map->y,
|
||||
brw->has_swizzling);
|
||||
tiled_s8_map[offset] = untiled_s8_map[y * map->w + x];
|
||||
}
|
||||
}
|
||||
|
||||
intel_miptree_unmap_raw(mt);
|
||||
}
|
||||
|
||||
free(map->buffer);
|
||||
}
|
||||
|
||||
static void
|
||||
intel_miptree_map_s8(struct brw_context *brw,
|
||||
struct intel_mipmap_tree *mt,
|
||||
|
|
@ -3310,36 +3340,6 @@ intel_miptree_map_s8(struct brw_context *brw,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
intel_miptree_unmap_s8(struct brw_context *brw,
|
||||
struct intel_mipmap_tree *mt,
|
||||
struct intel_miptree_map *map,
|
||||
unsigned int level,
|
||||
unsigned int slice)
|
||||
{
|
||||
if (map->mode & GL_MAP_WRITE_BIT) {
|
||||
unsigned int image_x, image_y;
|
||||
uint8_t *untiled_s8_map = map->ptr;
|
||||
uint8_t *tiled_s8_map = intel_miptree_map_raw(brw, mt, GL_MAP_WRITE_BIT);
|
||||
|
||||
intel_miptree_get_image_offset(mt, level, slice, &image_x, &image_y);
|
||||
|
||||
for (uint32_t y = 0; y < map->h; y++) {
|
||||
for (uint32_t x = 0; x < map->w; x++) {
|
||||
ptrdiff_t offset = intel_offset_S8(mt->surf.row_pitch,
|
||||
image_x + x + map->x,
|
||||
image_y + y + map->y,
|
||||
brw->has_swizzling);
|
||||
tiled_s8_map[offset] = untiled_s8_map[y * map->w + x];
|
||||
}
|
||||
}
|
||||
|
||||
intel_miptree_unmap_raw(mt);
|
||||
}
|
||||
|
||||
free(map->buffer);
|
||||
}
|
||||
|
||||
static void
|
||||
intel_miptree_map_etc(struct brw_context *brw,
|
||||
struct intel_mipmap_tree *mt,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue