diff options
author | Chris Wilson <[email protected]> | 2018-04-30 10:25:44 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2018-04-30 14:06:23 -0700 |
commit | ab2825c898f7afbc505a6ec1820286fb7e23a87b (patch) | |
tree | 08dcddefbbc87565917f967ef403413102e67b56 /src | |
parent | 9e7e88049fc5a033b9374826e524a48c5bcf2d52 (diff) |
i965: Move unmap_etc before map_etc
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')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 048dfa54968..8cfbd492c64 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -3341,27 +3341,6 @@ intel_miptree_map_s8(struct brw_context *brw, } static void -intel_miptree_map_etc(struct brw_context *brw, - struct intel_mipmap_tree *mt, - struct intel_miptree_map *map, - unsigned int level, - unsigned int slice) -{ - assert(mt->etc_format != MESA_FORMAT_NONE); - if (mt->etc_format == MESA_FORMAT_ETC1_RGB8) { - assert(mt->format == MESA_FORMAT_R8G8B8X8_UNORM); - } - - assert(map->mode & GL_MAP_WRITE_BIT); - assert(map->mode & GL_MAP_INVALIDATE_RANGE_BIT); - - map->stride = _mesa_format_row_stride(mt->etc_format, map->w); - map->buffer = malloc(_mesa_format_image_size(mt->etc_format, - map->w, map->h, 1)); - map->ptr = map->buffer; -} - -static void intel_miptree_unmap_etc(struct brw_context *brw, struct intel_mipmap_tree *mt, struct intel_miptree_map *map, @@ -3392,6 +3371,27 @@ intel_miptree_unmap_etc(struct brw_context *brw, free(map->buffer); } +static void +intel_miptree_map_etc(struct brw_context *brw, + struct intel_mipmap_tree *mt, + struct intel_miptree_map *map, + unsigned int level, + unsigned int slice) +{ + assert(mt->etc_format != MESA_FORMAT_NONE); + if (mt->etc_format == MESA_FORMAT_ETC1_RGB8) { + assert(mt->format == MESA_FORMAT_R8G8B8X8_UNORM); + } + + assert(map->mode & GL_MAP_WRITE_BIT); + assert(map->mode & GL_MAP_INVALIDATE_RANGE_BIT); + + map->stride = _mesa_format_row_stride(mt->etc_format, map->w); + map->buffer = malloc(_mesa_format_image_size(mt->etc_format, + map->w, map->h, 1)); + map->ptr = map->buffer; +} + /** * Mapping function for packed depth/stencil miptrees backed by real separate * miptrees for depth and stencil. |