diff options
author | Chris Wilson <[email protected]> | 2018-04-30 10:25:43 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2018-04-30 14:06:23 -0700 |
commit | 9e7e88049fc5a033b9374826e524a48c5bcf2d52 (patch) | |
tree | fb076b6744105a562830b5b006db309b28720720 /src/mesa | |
parent | b3ad6f5ca69749f71987be086a97e6442bbe05fb (diff) |
i965: Move unmap_s8 before map_s8
Reorder code to avoid a forward declaration in the next patch.
Signed-off-by: Chris Wilson <[email protected]>
Acked-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 0548ec2d8f5..048dfa54968 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -3266,6 +3266,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, struct intel_miptree_map *map, @@ -3311,36 +3341,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, struct intel_miptree_map *map, |