nouveau: Support X8R8G8B8 textures on nv30, nv40 and RTs on nv10-nv40.
authorYounes Manton <younes.m@gmail.com>
Sat, 24 Oct 2009 21:36:48 +0000 (17:36 -0400)
committerYounes Manton <younes.m@gmail.com>
Sat, 31 Oct 2009 13:42:49 +0000 (09:42 -0400)
src/gallium/drivers/nv04/nv04_surface_2d.c
src/gallium/drivers/nv10/nv10_state_emit.c
src/gallium/drivers/nv20/nv20_state_emit.c
src/gallium/drivers/nv30/nv30_fragtex.c
src/gallium/drivers/nv30/nv30_state_fb.c
src/gallium/drivers/nv40/nv40_fragtex.c
src/gallium/drivers/nv40/nv40_state_fb.c

index 8c7eb367e2eed7b9b9a45e747033ee48e8297e16..8be134b83dd8898dc8ef00f30c54c9f382c19a55 100644 (file)
@@ -42,6 +42,7 @@ nv04_rect_format(enum pipe_format format)
        case PIPE_FORMAT_A8L8_UNORM:
        case PIPE_FORMAT_Z16_UNORM:
                return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5;
+       case PIPE_FORMAT_X8R8G8B8_UNORM:
        case PIPE_FORMAT_A8R8G8B8_UNORM:
        case PIPE_FORMAT_Z24S8_UNORM:
        case PIPE_FORMAT_Z24X8_UNORM:
index d8691ef9c67ebdaed9872953914a307dba87658a..2577ab73b5672f064431246c970fc5118fd9cf3f 100644 (file)
@@ -129,6 +129,9 @@ static void nv10_state_emit_framebuffer(struct nv10_context* nv10)
        rt_format = NV10TCL_RT_FORMAT_TYPE_LINEAR;
 
        switch (colour_format) {
+       case PIPE_FORMAT_X8R8G8B8_UNORM:
+               rt_format |= NV10TCL_RT_FORMAT_COLOR_X8R8G8B8;
+               break;
        case PIPE_FORMAT_A8R8G8B8_UNORM:
        case 0:
                rt_format |= NV10TCL_RT_FORMAT_COLOR_A8R8G8B8;
index 4042f46d0530c6ad2008dbbe13f03ddcae9a1fcb..0122b1c2cdbd70eeefb3b05635f58dd117204e53 100644 (file)
@@ -135,6 +135,9 @@ static void nv20_state_emit_framebuffer(struct nv20_context* nv20)
        rt_format = NV20TCL_RT_FORMAT_TYPE_LINEAR | 0x20;
 
        switch (colour_format) {
+       case PIPE_FORMAT_X8R8G8B8_UNORM:
+               rt_format |= NV20TCL_RT_FORMAT_COLOR_X8R8G8B8;
+               break;
        case PIPE_FORMAT_A8R8G8B8_UNORM:
        case 0:
                rt_format |= NV20TCL_RT_FORMAT_COLOR_A8R8G8B8;
index 3dd636f4ee249a747f95dc4da38cd913a6e16758..dca760cae62c40c121d88fa87f4d485895be8b72 100644 (file)
@@ -21,6 +21,7 @@ struct nv30_texture_format {
 
 static struct nv30_texture_format
 nv30_texture_formats[] = {
+       _(X8R8G8B8_UNORM, A8R8G8B8,   S1,   S1,   S1,  ONE, X, Y, Z, W),
        _(A8R8G8B8_UNORM, A8R8G8B8,   S1,   S1,   S1,   S1, X, Y, Z, W),
        _(A1R5G5B5_UNORM, A1R5G5B5,   S1,   S1,   S1,   S1, X, Y, Z, W),
        _(A4R4G4B4_UNORM, A4R4G4B4,   S1,   S1,   S1,   S1, X, Y, Z, W),
index 4d6a67e56dfc5063c534c75b432d2f19333d83d6..6f6d1740d6ef821013c2343f8cf5584b0a912fdb 100644 (file)
@@ -66,6 +66,9 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
        }
 
        switch (colour_format) {
+       case PIPE_FORMAT_X8R8G8B8_UNORM:
+               rt_format |= NV34TCL_RT_FORMAT_COLOR_X8R8G8B8;
+               break;
        case PIPE_FORMAT_A8R8G8B8_UNORM:
        case 0:
                rt_format |= NV34TCL_RT_FORMAT_COLOR_A8R8G8B8;
index f6cdf31dfee282093fdccb91186821b4cba4bca8..e2ec57564d14a142c6b3692f7655a4f6f9178bd8 100644 (file)
@@ -23,6 +23,7 @@ struct nv40_texture_format {
 
 static struct nv40_texture_format
 nv40_texture_formats[] = {
+       _(X8R8G8B8_UNORM, A8R8G8B8,   S1,   S1,   S1,  ONE, X, Y, Z, W, 0, 0, 0, 0),
        _(A8R8G8B8_UNORM, A8R8G8B8,   S1,   S1,   S1,   S1, X, Y, Z, W, 0, 0, 0, 0),
        _(A1R5G5B5_UNORM, A1R5G5B5,   S1,   S1,   S1,   S1, X, Y, Z, W, 0, 0, 0, 0),
        _(A4R4G4B4_UNORM, A4R4G4B4,   S1,   S1,   S1,   S1, X, Y, Z, W, 0, 0, 0, 0),
index c2f739157ad5f7f9409bbc3f9ccf484c3dd893dc..1c7a7cd64f051ce0aa0db7597c235a318e585fc2 100644 (file)
@@ -57,6 +57,9 @@ nv40_state_framebuffer_validate(struct nv40_context *nv40)
                rt_format = NV40TCL_RT_FORMAT_TYPE_LINEAR;
 
        switch (colour_format) {
+       case PIPE_FORMAT_X8R8G8B8_UNORM:
+               rt_format |= NV40TCL_RT_FORMAT_COLOR_X8R8G8B8;
+               break;
        case PIPE_FORMAT_A8R8G8B8_UNORM:
        case 0:
                rt_format |= NV40TCL_RT_FORMAT_COLOR_A8R8G8B8;