width = width0;
height = height0;
- depth = surflevel[0].npix_z;
+ depth = texture->depth0;
pitch = surflevel[0].nblk_x * util_format_get_blockwidth(pipe_format);
non_disp_tiling = tmp->non_disp_tiling;
const struct pipe_box *src_box)
{
struct r600_context *rctx = (struct r600_context *)ctx;
- struct r600_texture *rsrc = (struct r600_texture*)src;
- struct r600_texture *rdst = (struct r600_texture*)dst;
struct pipe_surface *dst_view, dst_templ;
struct pipe_sampler_view src_templ, *src_view;
unsigned dst_width, dst_height, src_width0, src_height0, src_widthFL, src_heightFL;
return; /* error */
}
- dst_width = rdst->surface.level[dst_level].npix_x;
- dst_height = rdst->surface.level[dst_level].npix_y;
+ dst_width = u_minify(dst->width0, dst_level);
+ dst_height = u_minify(dst->height0, dst_level);
src_width0 = src->width0;
src_height0 = src->height0;
- src_widthFL = rsrc->surface.level[src_level].npix_x;
- src_heightFL = rsrc->surface.level[src_level].npix_y;
+ src_widthFL = u_minify(src->width0, src_level);
+ src_heightFL = u_minify(src->height0, src_level);
util_blitter_default_dst_texture(&dst_templ, dst, dst_level, dstz);
util_blitter_default_src_texture(&src_templ, src, src_level);
src_templ.format = PIPE_FORMAT_R32G32B32A32_UINT; /* 128-bit block */
dst_templ.format = src_templ.format;
- dst_width = util_format_get_nblocksx(dst->format, rdst->surface.level[dst_level].npix_x);
- dst_height = util_format_get_nblocksy(dst->format, rdst->surface.level[dst_level].npix_y);
- src_width0 = util_format_get_nblocksx(src->format, src->width0);
- src_height0 = util_format_get_nblocksy(src->format, src->height0);
- src_widthFL = util_format_get_nblocksx(src->format, rsrc->surface.level[src_level].npix_x);
- src_heightFL = util_format_get_nblocksy(src->format, rsrc->surface.level[src_level].npix_y);
+ dst_width = util_format_get_nblocksx(dst->format, dst_width);
+ dst_height = util_format_get_nblocksy(dst->format, dst_height);
+ src_width0 = util_format_get_nblocksx(src->format, src_width0);
+ src_height0 = util_format_get_nblocksy(src->format, src_height0);
+ src_widthFL = util_format_get_nblocksx(src->format, src_widthFL);
+ src_heightFL = util_format_get_nblocksy(src->format, src_heightFL);
dstx = util_format_get_nblocksx(dst->format, dstx);
dsty = util_format_get_nblocksy(dst->format, dsty);
src_templ.format = PIPE_FORMAT_R8G8B8A8_UINT;
dst_templ.format = PIPE_FORMAT_R8G8B8A8_UINT;
- dst_width = util_format_get_nblocksx(dst->format, rdst->surface.level[dst_level].npix_x);
- src_width0 = util_format_get_nblocksx(src->format, src->width0);
- src_widthFL = util_format_get_nblocksx(src->format, rsrc->surface.level[src_level].npix_x);
+ dst_width = util_format_get_nblocksx(dst->format, dst_width);
+ src_width0 = util_format_get_nblocksx(src->format, src_width0);
+ src_widthFL = util_format_get_nblocksx(src->format, src_widthFL);
dstx = util_format_get_nblocksx(dst->format, dstx);
last_level = state->u.tex.last_level - offset_level;
width = width_first_level;
height = height_first_level;
- depth = tmp->surface.level[offset_level].npix_z;
+ depth = u_minify(texture->depth0, offset_level);
pitch = tmp->surface.level[offset_level].nblk_x * util_format_get_blockwidth(state->format);
if (texture->target == PIPE_TEXTURE_1D_ARRAY) {
struct pipe_resource *tex,
const struct pipe_sampler_view *state)
{
- struct r600_texture *rtex = (struct r600_texture*)tex;
-
return r600_create_sampler_view_custom(ctx, tex, state,
- rtex->surface.level[state->u.tex.first_level].npix_x,
- rtex->surface.level[state->u.tex.first_level].npix_y);
+ u_minify(tex->width0, state->u.tex.first_level),
+ u_minify(tex->height0, state->u.tex.first_level));
}
static void r600_emit_clip_state(struct r600_context *rctx, struct r600_atom *atom)
"nblk_z=%u, pitch_bytes=%u, mode=%u\n",
i, (unsigned long long)rtex->surface.level[i].offset,
(unsigned long long)rtex->surface.level[i].slice_size,
- rtex->surface.level[i].npix_x,
- rtex->surface.level[i].npix_y,
- rtex->surface.level[i].npix_z,
+ u_minify(rtex->resource.b.b.width0, i),
+ u_minify(rtex->resource.b.b.height0, i),
+ u_minify(rtex->resource.b.b.depth0, i),
rtex->surface.level[i].nblk_x,
rtex->surface.level[i].nblk_y,
rtex->surface.level[i].nblk_z,
"nblk_z=%u, pitch_bytes=%u, mode=%u\n",
i, (unsigned long long)rtex->surface.stencil_level[i].offset,
(unsigned long long)rtex->surface.stencil_level[i].slice_size,
- rtex->surface.stencil_level[i].npix_x,
- rtex->surface.stencil_level[i].npix_y,
- rtex->surface.stencil_level[i].npix_z,
+ u_minify(rtex->resource.b.b.width0, i),
+ u_minify(rtex->resource.b.b.height0, i),
+ u_minify(rtex->resource.b.b.depth0, i),
rtex->surface.stencil_level[i].nblk_x,
rtex->surface.stencil_level[i].nblk_y,
rtex->surface.stencil_level[i].nblk_z,
}
static struct pipe_surface *r600_create_surface(struct pipe_context *pipe,
- struct pipe_resource *texture,
+ struct pipe_resource *tex,
const struct pipe_surface *templ)
{
- struct r600_texture *rtex = (struct r600_texture*)texture;
unsigned level = templ->u.tex.level;
- return r600_create_surface_custom(pipe, texture, templ,
- rtex->surface.level[level].npix_x,
- rtex->surface.level[level].npix_y);
+ return r600_create_surface_custom(pipe, tex, templ,
+ u_minify(tex->width0, level),
+ u_minify(tex->height0, level));
}
static void r600_surface_destroy(struct pipe_context *pipe,