nouveau: Update nv30 swizzling.
authorYounes Manton <younes.m@gmail.com>
Sat, 10 Jan 2009 19:09:59 +0000 (14:09 -0500)
committerYounes Manton <younes.m@gmail.com>
Sat, 10 Jan 2009 19:09:59 +0000 (14:09 -0500)
src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv30/nv30_screen.c

index aa670b9a45b5f7606dfb102604be2abd1aaaeb73..37d297cc0f48ec8fb019852066ed3ec0099bd40a 100644 (file)
@@ -21,7 +21,7 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt)
        } else {
                nr_faces = 1;
        }
-       
+
        pitch = pt->width[0];
        for (l = 0; l <= pt->last_level; l++) {
                pt->width[l] = width;
@@ -76,13 +76,15 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
        if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY |
                             PIPE_TEXTURE_USAGE_DISPLAY_TARGET))
                mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
+       else
+       if (pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC)
+               mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
        else {
                switch (pt->format) {
                /* TODO: Figure out which formats can be swizzled */
                case PIPE_FORMAT_A8R8G8B8_UNORM:
                case PIPE_FORMAT_X8R8G8B8_UNORM:
-               /* XXX: Re-enable when SIFM size limits are fixed */
-               /*case PIPE_FORMAT_R16_SNORM:*/
+               case PIPE_FORMAT_R16_SNORM:
                        break;
                default:
                        mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
@@ -192,4 +194,3 @@ nv30_screen_init_miptree_functions(struct pipe_screen *pscreen)
        pscreen->get_tex_surface = nv30_miptree_surface_new;
        pscreen->tex_surface_release = nv30_miptree_surface_del;
 }
-
index d7548922994dd77d53083d37284c8db045f47e40..29356e8c1e536cc7cf5119c5ed7594b24f9464ab 100644 (file)
@@ -98,7 +98,7 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen,
        if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) {
                switch (format) {
                case PIPE_FORMAT_A8R8G8B8_UNORM:
-               case PIPE_FORMAT_R5G6B5_UNORM: 
+               case PIPE_FORMAT_R5G6B5_UNORM:
                case PIPE_FORMAT_Z24S8_UNORM:
                case PIPE_FORMAT_Z16_UNORM:
                        return TRUE;
@@ -110,7 +110,7 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen,
                case PIPE_FORMAT_A8R8G8B8_UNORM:
                case PIPE_FORMAT_A1R5G5B5_UNORM:
                case PIPE_FORMAT_A4R4G4B4_UNORM:
-               case PIPE_FORMAT_R5G6B5_UNORM: 
+               case PIPE_FORMAT_R5G6B5_UNORM:
                case PIPE_FORMAT_L8_UNORM:
                case PIPE_FORMAT_A8_UNORM:
                case PIPE_FORMAT_I8_UNORM:
@@ -139,7 +139,8 @@ nv30_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
 
                if (!mt->shadow_tex) {
                        unsigned old_tex_usage = surface->texture->tex_usage;
-                       surface->texture->tex_usage = NOUVEAU_TEXTURE_USAGE_LINEAR;
+                       surface->texture->tex_usage = NOUVEAU_TEXTURE_USAGE_LINEAR |
+                                                     PIPE_TEXTURE_USAGE_DYNAMIC;
                        mt->shadow_tex = screen->texture_create(screen, surface->texture);
                        surface->texture->tex_usage = old_tex_usage;
 
@@ -326,7 +327,7 @@ nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
        so_data  (so, 3);
        so_method(so, screen->rankine, 0x1450, 1);
        so_data  (so, 0x00030004);
-       
+
        /* NEW */
        so_method(so, screen->rankine, 0x1e98, 1);
        so_data  (so, 0);
@@ -382,4 +383,3 @@ nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
 
        return &screen->pipe;
 }
-