diff options
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_transfer.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_transfer.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/gallium/drivers/ilo/ilo_transfer.c b/src/gallium/drivers/ilo/ilo_transfer.c index f0d47de54a0..e80ed8bda9c 100644 --- a/src/gallium/drivers/ilo/ilo_transfer.c +++ b/src/gallium/drivers/ilo/ilo_transfer.c @@ -93,7 +93,7 @@ resource_get_transfer_method(struct pipe_resource *res, bool need_convert = false; /* we may need to convert on the fly */ - if (tex->layout.tiling == GEN8_TILING_W || tex->separate_s8) { + if (tex->image.tiling == GEN8_TILING_W || tex->separate_s8) { /* on GEN6, separate stencil is enabled only when HiZ is */ if (ilo_dev_gen(&is->dev) >= ILO_GEN(7) || ilo_texture_can_enable_hiz(tex, transfer->level, @@ -101,7 +101,7 @@ resource_get_transfer_method(struct pipe_resource *res, m = ILO_TRANSFER_MAP_SW_ZS; need_convert = true; } - } else if (tex->layout.format != tex->base.format) { + } else if (tex->image.format != tex->base.format) { m = ILO_TRANSFER_MAP_SW_CONVERT; need_convert = true; } @@ -114,7 +114,7 @@ resource_get_transfer_method(struct pipe_resource *res, return true; } - tiled = (tex->layout.tiling != GEN6_TILING_NONE); + tiled = (tex->image.tiling != GEN6_TILING_NONE); } if (tiled) @@ -202,7 +202,7 @@ xfer_alloc_staging_res(struct ilo_transfer *xfer) xfer->staging.res = res->screen->resource_create(res->screen, &templ); if (xfer->staging.res && xfer->staging.res->target != PIPE_BUFFER) { - assert(ilo_texture(xfer->staging.res)->layout.tiling == + assert(ilo_texture(xfer->staging.res)->image.tiling == GEN6_TILING_NONE); } @@ -354,11 +354,11 @@ tex_get_box_origin(const struct ilo_texture *tex, { unsigned x, y; - ilo_layout_get_slice_pos(&tex->layout, level, box->z + slice, &x, &y); + ilo_image_get_slice_pos(&tex->image, level, box->z + slice, &x, &y); x += box->x; y += box->y; - ilo_layout_pos_to_mem(&tex->layout, x, y, mem_x, mem_y); + ilo_image_pos_to_mem(&tex->image, x, y, mem_x, mem_y); } static unsigned @@ -369,13 +369,13 @@ tex_get_box_offset(const struct ilo_texture *tex, unsigned level, tex_get_box_origin(tex, level, 0, box, &mem_x, &mem_y); - return ilo_layout_mem_to_linear(&tex->layout, mem_x, mem_y); + return ilo_image_mem_to_linear(&tex->image, mem_x, mem_y); } static unsigned tex_get_slice_stride(const struct ilo_texture *tex, unsigned level) { - return ilo_layout_get_slice_stride(&tex->layout, level); + return ilo_image_get_slice_stride(&tex->image, level); } static unsigned @@ -523,21 +523,21 @@ static tex_tile_offset_func tex_tile_choose_offset_func(const struct ilo_texture *tex, unsigned *tiles_per_row) { - switch (tex->layout.tiling) { + switch (tex->image.tiling) { default: assert(!"unknown tiling"); /* fall through */ case GEN6_TILING_NONE: - *tiles_per_row = tex->layout.bo_stride; + *tiles_per_row = tex->image.bo_stride; return tex_tile_none_offset; case GEN6_TILING_X: - *tiles_per_row = tex->layout.bo_stride / 512; + *tiles_per_row = tex->image.bo_stride / 512; return tex_tile_x_offset; case GEN6_TILING_Y: - *tiles_per_row = tex->layout.bo_stride / 128; + *tiles_per_row = tex->image.bo_stride / 128; return tex_tile_y_offset; case GEN8_TILING_W: - *tiles_per_row = tex->layout.bo_stride / 64; + *tiles_per_row = tex->image.bo_stride / 64; return tex_tile_w_offset; } } @@ -551,7 +551,7 @@ tex_staging_sys_map_bo(struct ilo_texture *tex, const bool prefer_cpu = (is->dev.has_llc || for_read_back); void *ptr; - if (prefer_cpu && (tex->layout.tiling == GEN6_TILING_NONE || + if (prefer_cpu && (tex->image.tiling == GEN6_TILING_NONE || !linear_view)) ptr = intel_bo_map(tex->bo, !for_read_back); else @@ -584,7 +584,7 @@ tex_staging_sys_zs_read(struct ilo_texture *tex, tile_offset = tex_tile_choose_offset_func(tex, &tiles_per_row); - assert(tex->layout.block_width == 1 && tex->layout.block_height == 1); + assert(tex->image.block_width == 1 && tex->image.block_height == 1); if (tex->separate_s8) { struct ilo_texture *s8_tex = tex->separate_s8; @@ -602,7 +602,7 @@ tex_staging_sys_zs_read(struct ilo_texture *tex, s8_tile_offset = tex_tile_choose_offset_func(s8_tex, &s8_tiles_per_row); if (tex->base.format == PIPE_FORMAT_Z24_UNORM_S8_UINT) { - assert(tex->layout.format == PIPE_FORMAT_Z24X8_UNORM); + assert(tex->image.format == PIPE_FORMAT_Z24X8_UNORM); dst_cpp = 4; dst_s8_pos = 3; @@ -610,7 +610,7 @@ tex_staging_sys_zs_read(struct ilo_texture *tex, } else { assert(tex->base.format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT); - assert(tex->layout.format == PIPE_FORMAT_Z32_FLOAT); + assert(tex->image.format == PIPE_FORMAT_Z32_FLOAT); dst_cpp = 8; dst_s8_pos = 4; @@ -643,7 +643,7 @@ tex_staging_sys_zs_read(struct ilo_texture *tex, d[dst_s8_pos] = s8_src[s8_offset]; d += dst_cpp; - x += tex->layout.block_size; + x += tex->image.block_size; s8_x++; } @@ -656,7 +656,7 @@ tex_staging_sys_zs_read(struct ilo_texture *tex, tex_staging_sys_unmap_bo(s8_tex); } else { - assert(tex->layout.format == PIPE_FORMAT_S8_UINT); + assert(tex->image.format == PIPE_FORMAT_S8_UINT); for (slice = 0; slice < box->depth; slice++) { unsigned mem_x, mem_y; @@ -711,7 +711,7 @@ tex_staging_sys_zs_write(struct ilo_texture *tex, tile_offset = tex_tile_choose_offset_func(tex, &tiles_per_row); - assert(tex->layout.block_width == 1 && tex->layout.block_height == 1); + assert(tex->image.block_width == 1 && tex->image.block_height == 1); if (tex->separate_s8) { struct ilo_texture *s8_tex = tex->separate_s8; @@ -729,7 +729,7 @@ tex_staging_sys_zs_write(struct ilo_texture *tex, s8_tile_offset = tex_tile_choose_offset_func(s8_tex, &s8_tiles_per_row); if (tex->base.format == PIPE_FORMAT_Z24_UNORM_S8_UINT) { - assert(tex->layout.format == PIPE_FORMAT_Z24X8_UNORM); + assert(tex->image.format == PIPE_FORMAT_Z24X8_UNORM); src_cpp = 4; src_s8_pos = 3; @@ -737,7 +737,7 @@ tex_staging_sys_zs_write(struct ilo_texture *tex, } else { assert(tex->base.format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT); - assert(tex->layout.format == PIPE_FORMAT_Z32_FLOAT); + assert(tex->image.format == PIPE_FORMAT_Z32_FLOAT); src_cpp = 8; src_s8_pos = 4; @@ -770,7 +770,7 @@ tex_staging_sys_zs_write(struct ilo_texture *tex, s8_dst[s8_offset] = s[src_s8_pos]; s += src_cpp; - x += tex->layout.block_size; + x += tex->image.block_size; s8_x++; } @@ -783,7 +783,7 @@ tex_staging_sys_zs_write(struct ilo_texture *tex, tex_staging_sys_unmap_bo(s8_tex); } else { - assert(tex->layout.format == PIPE_FORMAT_S8_UINT); + assert(tex->image.format == PIPE_FORMAT_S8_UINT); for (slice = 0; slice < box->depth; slice++) { unsigned mem_x, mem_y; @@ -841,8 +841,8 @@ tex_staging_sys_convert_write(struct ilo_texture *tex, else dst_slice_stride = 0; - if (unlikely(tex->layout.format == tex->base.format)) { - util_copy_box(dst, tex->layout.format, tex->layout.bo_stride, + if (unlikely(tex->image.format == tex->base.format)) { + util_copy_box(dst, tex->image.format, tex->image.bo_stride, dst_slice_stride, 0, 0, 0, box->width, box->height, box->depth, xfer->staging.sys, xfer->base.stride, xfer->base.layer_stride, 0, 0, 0); @@ -854,14 +854,14 @@ tex_staging_sys_convert_write(struct ilo_texture *tex, switch (tex->base.format) { case PIPE_FORMAT_ETC1_RGB8: - assert(tex->layout.format == PIPE_FORMAT_R8G8B8X8_UNORM); + assert(tex->image.format == PIPE_FORMAT_R8G8B8X8_UNORM); for (slice = 0; slice < box->depth; slice++) { const void *src = xfer->staging.sys + xfer->base.layer_stride * slice; util_format_etc1_rgb8_unpack_rgba_8unorm(dst, - tex->layout.bo_stride, src, xfer->base.stride, + tex->image.bo_stride, src, xfer->base.stride, box->width, box->height); dst += dst_slice_stride; @@ -957,7 +957,7 @@ tex_map(struct ilo_transfer *xfer) ptr += tex_get_box_offset(tex, xfer->base.level, &xfer->base.box); /* stride is for a block row, not a texel row */ - xfer->base.stride = tex->layout.bo_stride; + xfer->base.stride = tex->image.bo_stride; /* note that slice stride is not always available */ xfer->base.layer_stride = (xfer->base.box.depth > 1) ? tex_get_slice_stride(tex, xfer->base.level) : 0; @@ -967,7 +967,7 @@ tex_map(struct ilo_transfer *xfer) ptr = xfer_map(xfer); if (ptr) { const struct ilo_texture *staging = ilo_texture(xfer->staging.res); - xfer->base.stride = staging->layout.bo_stride; + xfer->base.stride = staging->image.bo_stride; xfer->base.layer_stride = tex_get_slice_stride(staging, 0); } break; |