summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-08-18 17:28:08 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-08-20 12:04:00 +0200
commitae0ef6f69f351cacdc7eaa9b21097a7c1b414e44 (patch)
treedfc35d5587cb1d6977474eb3b86e5316adfae3f0 /src/gallium/drivers/r300
parent72b3e3fee37413fefe205fa03a111a0180ed19c1 (diff)
gallium: make all checks for PIPE_TEXTURE_2D check for PIPE_TEXTURE_RECT too
Searched for them with: git grep -E '[!=]=.*PIPE_TEXTURE_2D|PIPE_TEXTURE_2D.*[!=]=|case.*PIPE_TEXTURE_2D' Behavior hasn't been changed.
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_hyperz.c3
-rw-r--r--src/gallium/drivers/r300/r300_texture.c6
-rw-r--r--src/gallium/drivers/r300/r300_texture_desc.c6
3 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/drivers/r300/r300_hyperz.c b/src/gallium/drivers/r300/r300_hyperz.c
index b2526d6e41..eb5b0c36f8 100644
--- a/src/gallium/drivers/r300/r300_hyperz.c
+++ b/src/gallium/drivers/r300/r300_hyperz.c
@@ -354,7 +354,8 @@ void r300_zmask_alloc_block(struct r300_context *r300, struct r300_surface *surf
/* We currently don't handle decompression for 3D textures and cubemaps
* correctly. */
if (tex->desc.b.b.target != PIPE_TEXTURE_1D &&
- tex->desc.b.b.target != PIPE_TEXTURE_2D)
+ tex->desc.b.b.target != PIPE_TEXTURE_2D &&
+ tex->desc.b.b.target != PIPE_TEXTURE_RECT)
return;
/* Cannot flush zmask of 16-bit zbuffers. */
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index da8eadd3b5..852acdd462 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -754,7 +754,8 @@ struct pipe_resource *r300_texture_create(struct pipe_screen *screen,
/* Refuse to create a texture with size 0. */
if (!base->width0 ||
(!base->height0 && (base->target == PIPE_TEXTURE_2D ||
- base->target == PIPE_TEXTURE_CUBE)) ||
+ base->target == PIPE_TEXTURE_CUBE ||
+ base->target == PIPE_TEXTURE_RECT)) ||
(!base->depth0 && base->target == PIPE_TEXTURE_3D)) {
fprintf(stderr, "r300: texture_create: "
"Got invalid texture dimensions: %ix%ix%i\n",
@@ -787,7 +788,8 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen,
unsigned stride, size;
/* Support only 2D textures without mipmaps */
- if (base->target != PIPE_TEXTURE_2D ||
+ if ((base->target != PIPE_TEXTURE_2D &&
+ base->target != PIPE_TEXTURE_RECT) ||
base->depth0 != 1 ||
base->last_level != 0) {
return NULL;
diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c
index 5d690e8c33..2fe5d72188 100644
--- a/src/gallium/drivers/r300/r300_texture_desc.c
+++ b/src/gallium/drivers/r300/r300_texture_desc.c
@@ -184,7 +184,8 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture_desc *desc,
/* This is needed for the kernel checker, unfortunately. */
if ((desc->b.b.target != PIPE_TEXTURE_1D &&
- desc->b.b.target != PIPE_TEXTURE_2D) ||
+ desc->b.b.target != PIPE_TEXTURE_2D &&
+ desc->b.b.target != PIPE_TEXTURE_RECT) ||
desc->b.b.last_level != 0) {
height = util_next_power_of_two(height);
}
@@ -202,7 +203,8 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture_desc *desc,
* Do so for 3 or more macrotiles in the Y direction. */
if (level == 0 && desc->b.b.last_level == 0 &&
(desc->b.b.target == PIPE_TEXTURE_1D ||
- desc->b.b.target == PIPE_TEXTURE_2D) &&
+ desc->b.b.target == PIPE_TEXTURE_2D ||
+ desc->b.b.target == PIPE_TEXTURE_RECT) &&
height >= tile_height * 3) {
height = align(height, tile_height * 2);
}