summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-07-24 21:32:53 +0200
committerMarek Olšák <maraeo@gmail.com>2010-07-25 10:25:21 +0200
commitd779a5d16ae6a17b3fc0c097f4eb477a80e54566 (patch)
tree82db8b25e46359d4f11cfa7d7a5eec318429e58f /src/gallium/drivers/r300/r300_blit.c
parent065e3f7ff2a9b6170e51b0104036088e8d163ea0 (diff)
downloadexternal_mesa3d-d779a5d16ae6a17b3fc0c097f4eb477a80e54566.zip
external_mesa3d-d779a5d16ae6a17b3fc0c097f4eb477a80e54566.tar.gz
external_mesa3d-d779a5d16ae6a17b3fc0c097f4eb477a80e54566.tar.bz2
r300g: cleanup texture creation code
This decouples initializing a texture layout/miptree description from an actual texture creation, it also partially unifies texture_create and texture_from_handle. r300_texture inherits r300_texture_desc, which inherits u_resource. The CBZB clear criteria are moved to r300_texture_desc::cbzb_allowed[level]. And other minor cleanups.
Diffstat (limited to 'src/gallium/drivers/r300/r300_blit.c')
-rw-r--r--src/gallium/drivers/r300/r300_blit.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index 895efaa..d125196 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -97,29 +97,12 @@ static boolean r300_cbzb_clear_allowed(struct r300_context *r300,
{
struct pipe_framebuffer_state *fb =
(struct pipe_framebuffer_state*)r300->fb_state.state;
- struct r300_surface *surf = r300_surface(fb->cbufs[0]);
- unsigned bpp;
/* Only color clear allowed, and only one colorbuffer. */
if (clear_buffers != PIPE_CLEAR_COLOR || fb->nr_cbufs != 1)
return FALSE;
- /* The colorbuffer must be point-sampled. */
- if (surf->base.texture->nr_samples > 1)
- return FALSE;
-
- bpp = util_format_get_blocksizebits(surf->base.format);
-
- /* ZB can only work with the two pixel sizes. */
- if (bpp != 16 && bpp != 32)
- return FALSE;
-
- /* If the midpoint ZB offset is not aligned to 2048, it returns garbage
- * with certain texture sizes. Macrotiling ensures the alignment. */
- if (!r300_texture(surf->base.texture)->mip_macrotile[surf->base.level])
- return FALSE;
-
- return TRUE;
+ return r300_surface(fb->cbufs[0])->cbzb_allowed;
}
/* Clear currently bound buffers. */