summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvfx/nvfx_miptree.c
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-01-18 23:40:22 +0100
committerLuca Barbieri <luca@luca-barbieri.com>2010-08-21 20:42:14 +0200
commitd983701267de0083cc702e460c841741292cc9b8 (patch)
treeb1fcfa84e9b5ed00c9bf00f39af895e71b3dfdd9 /src/gallium/drivers/nvfx/nvfx_miptree.c
parent9ed0686e8e6157ce38c9fa284cd7399289a2e698 (diff)
nvfx: new 2D: enable swizzling for all surfaces
Now that the new 2D code is in place, swizzling can be safely enabled. Render temporaries are needed in some cases, so this may degrade nv30 a bit until it gets render temporaries too.
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_miptree.c')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_miptree.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_miptree.c b/src/gallium/drivers/nvfx/nvfx_miptree.c
index b8ec726624..ffacf8a8e5 100644
--- a/src/gallium/drivers/nvfx/nvfx_miptree.c
+++ b/src/gallium/drivers/nvfx/nvfx_miptree.c
@@ -19,32 +19,19 @@ nvfx_miptree_choose_format(struct nvfx_miptree *mt)
unsigned uniform_pitch = 0;
static int no_swizzle = -1;
if(no_swizzle < 0)
- no_swizzle = debug_get_bool_option("NOUVEAU_NO_SWIZZLE", FALSE);
+ no_swizzle = debug_get_bool_option("NV40_NO_SWIZZLE", FALSE); /* this will break things on nv30 */
- /* Non-uniform pitch textures must be POT */
- if (pt->width0 & (pt->width0 - 1) ||
- pt->height0 & (pt->height0 - 1) ||
- pt->depth0 & (pt->depth0 - 1)
+ if (!util_is_pot(pt->width0) ||
+ !util_is_pot(pt->height0) ||
+ !util_is_pot(pt->depth0)
)
uniform_pitch = 1;
- /* All texture formats except compressed ones can be swizzled
- * Unsure about depth, let's prevent swizzling for now
- */
if (
(pt->bind & (PIPE_BIND_SCANOUT | PIPE_BIND_DISPLAY_TARGET))
|| (pt->usage & PIPE_USAGE_DYNAMIC) || (pt->usage & PIPE_USAGE_STAGING)
- || util_format_is_depth_or_stencil(pt->format)
|| util_format_is_compressed(pt->format)
- // disable swizzled textures on NV04-NV20 as our current drivers don't fully support that
- // TODO: hardware should support them, fix the drivers and reenable
- || nouveau_screen(pt->screen)->device->chipset < 0x30
|| no_swizzle
-
- // disable swizzling for non-RGBA 2D because our current 2D code can't handle anything
- // else correctly, and even that is semi-broken
- || pt->target != PIPE_TEXTURE_2D
- || (pt->format != PIPE_FORMAT_B8G8R8A8_UNORM && pt->format != PIPE_FORMAT_B8G8R8X8_UNORM)
)
mt->base.base.flags |= NVFX_RESOURCE_FLAG_LINEAR;