dri/nouveau: Clean up magic numbers in get_rt_format
authorViktor Novotný <noviktor@seznam.cz>
Tue, 16 Nov 2010 22:22:33 +0000 (23:22 +0100)
committerFrancisco Jerez <currojerez@riseup.net>
Fri, 19 Nov 2010 18:04:50 +0000 (19:04 +0100)
Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/nouveau/nv04_state_fb.c
src/mesa/drivers/dri/nouveau/nv10_state_fb.c
src/mesa/drivers/dri/nouveau/nv20_state_fb.c

index 730f91f10f639e6091050be3f1df2732a310e58b..854571d07e033211c96cf931d0202fbad0c12ab7 100644 (file)
@@ -36,11 +36,11 @@ get_rt_format(gl_format format)
 {
        switch (format) {
        case MESA_FORMAT_XRGB8888:
-               return 0x05;
+               return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_X8R8G8B8;
        case MESA_FORMAT_ARGB8888:
-               return 0x08;
+               return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_A8R8G8B8;
        case MESA_FORMAT_RGB565:
-               return 0x03;
+               return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_R5G6B5;
        default:
                assert(0);
        }
index 056054e964c92c2dc71979e107bd65016260591f..05055474218a46be6c7d3f450a02e8fb8baba8d5 100644 (file)
@@ -37,15 +37,15 @@ get_rt_format(gl_format format)
 {
        switch (format) {
        case MESA_FORMAT_XRGB8888:
-               return 0x05;
+               return NV10_3D_RT_FORMAT_COLOR_X8R8G8B8;
        case MESA_FORMAT_ARGB8888:
-               return 0x08;
+               return NV10_3D_RT_FORMAT_COLOR_A8R8G8B8;
        case MESA_FORMAT_RGB565:
-               return 0x03;
+               return NV10_3D_RT_FORMAT_COLOR_R5G6B5;
        case MESA_FORMAT_Z16:
-               return 0x10;
+               return NV10_3D_RT_FORMAT_DEPTH_Z16;
        case MESA_FORMAT_Z24_S8:
-               return 0x0;
+               return NV10_3D_RT_FORMAT_DEPTH_Z24S8;
        default:
                assert(0);
        }
index 8cabb5546fb5c72782781c444d8292603f4ca9b8..cbde74e4fc68ded1a086116341f9473a737c3ed1 100644 (file)
@@ -37,15 +37,15 @@ get_rt_format(gl_format format)
 {
        switch (format) {
        case MESA_FORMAT_XRGB8888:
-               return 0x05;
+               return NV20_3D_RT_FORMAT_COLOR_X8R8G8B8;
        case MESA_FORMAT_ARGB8888:
-               return 0x08;
+               return NV20_3D_RT_FORMAT_COLOR_A8R8G8B8;
        case MESA_FORMAT_RGB565:
-               return 0x03;
+               return NV20_3D_RT_FORMAT_COLOR_R5G6B5;
        case MESA_FORMAT_Z16:
-               return 0x10;
+               return NV20_3D_RT_FORMAT_DEPTH_Z16;
        case MESA_FORMAT_Z24_S8:
-               return 0x20;
+               return NV20_3D_RT_FORMAT_DEPTH_Z24S8;
        default:
                assert(0);
        }