summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r--src/gallium/drivers/r600/r600_blit.c12
-rw-r--r--src/gallium/drivers/r600/r600_pipe.h16
-rw-r--r--src/gallium/drivers/r600/r600_texture.c6
3 files changed, 9 insertions, 25 deletions
diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index 046eab54c42..3e0d89c06f0 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -150,7 +150,7 @@ void r600_blit_decompress_depth(struct pipe_context *ctx,
/* The smaller the mipmap level, the less layers there are
* as far as 3D textures are concerned. */
- max_layer = u_max_layer(&texture->resource.b.b, level);
+ max_layer = util_max_layer(&texture->resource.b.b, level);
checked_last_layer = last_layer < max_layer ? last_layer : max_layer;
for (layer = first_layer; layer <= checked_last_layer; layer++) {
@@ -222,7 +222,7 @@ static void r600_blit_decompress_depth_in_place(struct r600_context *rctx,
/* The smaller the mipmap level, the less layers there are
* as far as 3D textures are concerned. */
- max_layer = u_max_layer(&texture->resource.b.b, level);
+ max_layer = util_max_layer(&texture->resource.b.b, level);
checked_last_layer = last_layer < max_layer ? last_layer : max_layer;
for (layer = first_layer; layer <= checked_last_layer; layer++) {
@@ -273,11 +273,11 @@ void r600_decompress_depth_textures(struct r600_context *rctx,
r600_can_read_depth(tex)) {
r600_blit_decompress_depth_in_place(rctx, tex,
view->u.tex.first_level, view->u.tex.last_level,
- 0, u_max_layer(&tex->resource.b.b, view->u.tex.first_level));
+ 0, util_max_layer(&tex->resource.b.b, view->u.tex.first_level));
} else {
r600_blit_decompress_depth(&rctx->context, tex, NULL,
view->u.tex.first_level, view->u.tex.last_level,
- 0, u_max_layer(&tex->resource.b.b, view->u.tex.first_level),
+ 0, util_max_layer(&tex->resource.b.b, view->u.tex.first_level),
0, u_max_sample(&tex->resource.b.b));
}
}
@@ -319,7 +319,7 @@ static void r600_blit_decompress_color(struct pipe_context *ctx,
/* The smaller the mipmap level, the less layers there are
* as far as 3D textures are concerned. */
- max_layer = u_max_layer(&rtex->resource.b.b, level);
+ max_layer = util_max_layer(&rtex->resource.b.b, level);
checked_last_layer = last_layer < max_layer ? last_layer : max_layer;
for (layer = first_layer; layer <= checked_last_layer; layer++) {
@@ -366,7 +366,7 @@ void r600_decompress_color_textures(struct r600_context *rctx,
r600_blit_decompress_color(&rctx->context, tex,
view->u.tex.first_level, view->u.tex.last_level,
- 0, u_max_layer(&tex->resource.b.b, view->u.tex.first_level));
+ 0, util_max_layer(&tex->resource.b.b, view->u.tex.first_level));
}
}
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index de9c205cf7b..88b587e50a7 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -988,22 +988,6 @@ static INLINE uint64_t r600_resource_va(struct pipe_screen *screen, struct pipe_
return rscreen->ws->buffer_get_virtual_address(rresource->cs_buf);
}
-static INLINE unsigned u_max_layer(struct pipe_resource *r, unsigned level)
-{
- switch (r->target) {
- case PIPE_TEXTURE_CUBE:
- return 6 - 1;
- case PIPE_TEXTURE_3D:
- return u_minify(r->depth0, level) - 1;
- case PIPE_TEXTURE_1D_ARRAY:
- case PIPE_TEXTURE_2D_ARRAY:
- case PIPE_TEXTURE_CUBE_ARRAY:
- return r->array_size - 1;
- default:
- return 0;
- }
-}
-
static INLINE void r600_context_add_resource_size(struct pipe_context *ctx, struct pipe_resource *r)
{
struct r600_context *rctx = (struct r600_context *)ctx;
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 7f5752d81e6..acea19d7744 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -609,8 +609,8 @@ struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe,
{
struct r600_surface *surface = CALLOC_STRUCT(r600_surface);
- assert(templ->u.tex.first_layer <= u_max_layer(texture, templ->u.tex.level));
- assert(templ->u.tex.last_layer <= u_max_layer(texture, templ->u.tex.level));
+ assert(templ->u.tex.first_layer <= util_max_layer(texture, templ->u.tex.level));
+ assert(templ->u.tex.last_layer <= util_max_layer(texture, templ->u.tex.level));
assert(templ->u.tex.first_layer == templ->u.tex.last_layer);
if (surface == NULL)
return NULL;
@@ -821,7 +821,7 @@ static void *r600_texture_transfer_map(struct pipe_context *ctx,
resource.flags = R600_RESOURCE_FLAG_TRANSFER;
/* We must set the correct texture target and dimensions if needed for a 3D transfer. */
- if (box->depth > 1 && u_max_layer(texture, level) > 0)
+ if (box->depth > 1 && util_max_layer(texture, level) > 0)
resource.target = texture->target;
else
resource.target = PIPE_TEXTURE_2D;