Format layout cannot be used to distinguish scaled/normalised formats.
authorMichal Krol <michal@vmware.com>
Tue, 8 Dec 2009 18:58:13 +0000 (19:58 +0100)
committerMichal Krol <michal@vmware.com>
Tue, 8 Dec 2009 18:58:13 +0000 (19:58 +0100)
src/gallium/drivers/nv50/nv50_vbo.c
src/gallium/drivers/r300/r300_state_inlines.h

index f3472f266e5d58745b862a51fc5d76b47f07fcbf..d1c9f3f59009f9d279dfbd9d98c32173fc1446ad 100644 (file)
@@ -75,25 +75,15 @@ nv50_vbo_type_to_hw(enum pipe_format format)
        case UTIL_FORMAT_TYPE_FLOAT:
                return NV50TCL_VERTEX_ARRAY_ATTRIB_TYPE_FLOAT;
        case UTIL_FORMAT_TYPE_UNSIGNED:
-               switch (desc->layout) {
-               case UTIL_FORMAT_LAYOUT_ARITH:
+               if (desc->channel[0].normalized) {
                        return NV50TCL_VERTEX_ARRAY_ATTRIB_TYPE_UNORM;
-               case UTIL_FORMAT_LAYOUT_ARRAY:
-                       return NV50TCL_VERTEX_ARRAY_ATTRIB_TYPE_USCALED;
-               default:
-                       return 0;
                }
-               break;
+               return NV50TCL_VERTEX_ARRAY_ATTRIB_TYPE_USCALED;
        case UTIL_FORMAT_TYPE_SIGNED:
-               switch (desc->layout) {
-               case UTIL_FORMAT_LAYOUT_ARITH:
+               if (desc->channel[0].normalized) {
                        return NV50TCL_VERTEX_ARRAY_ATTRIB_TYPE_SNORM;
-               case UTIL_FORMAT_LAYOUT_ARRAY:
-                       return NV50TCL_VERTEX_ARRAY_ATTRIB_TYPE_SSCALED;
-               default:
-                       return 0;
                }
-               break;
+               return NV50TCL_VERTEX_ARRAY_ATTRIB_TYPE_SSCALED;
        /*
        case PIPE_FORMAT_TYPE_UINT:
                return NV50TCL_VERTEX_ARRAY_ATTRIB_TYPE_UINT;
index 5c58655da1ae7184b84a395272d7b70ac9a8a7a4..7cd1f87630ecdbd92e8bc0564177ef593773b2b8 100644 (file)
@@ -528,7 +528,7 @@ r300_translate_vertex_data_type(enum pipe_format format) {
     if (desc->type == UTIL_FORMAT_TYPE_SIGNED) {
         result |= R300_SIGNED;
     }
-    if (desc->layout == UTIL_FORMAT_LAYOUT_ARITH) {
+    if (desc->channel[0].normalized) {
         result |= R300_NORMALIZE;
     }