r600g: Get rid of r600_translate_vertex_data_type().
authorHenri Verbeet <hverbeet@gmail.com>
Sat, 15 Jan 2011 18:39:52 +0000 (19:39 +0100)
committerHenri Verbeet <hverbeet@gmail.com>
Sat, 15 Jan 2011 18:48:43 +0000 (19:48 +0100)
This has been replaced with r600_vertex_data_type().

src/gallium/drivers/r600/eg_state_inlines.h
src/gallium/drivers/r600/r600_state_inlines.h

index ecea1db4f159c70e102cf6924ba2075a7d275410..5a39d7cdeec2483b6b90f1d6f43406275bbccab8 100644 (file)
@@ -506,139 +506,4 @@ static INLINE boolean r600_is_vertex_format_supported(enum pipe_format format)
        return r600_translate_colorformat(format) != ~0;
 }
 
-static INLINE uint32_t r600_translate_vertex_data_type(enum pipe_format format)
-{
-       uint32_t result = 0;
-       const struct util_format_description *desc;
-       unsigned i;
-
-       desc = util_format_description(format);
-       if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) {
-               goto out_unknown;
-       }
-
-       /* Find the first non-VOID channel. */
-       for (i = 0; i < 4; i++) {
-               if (desc->channel[i].type != UTIL_FORMAT_TYPE_VOID) {
-                       break;
-               }
-       }
-
-       switch (desc->channel[i].type) {
-               /* Half-floats, floats, doubles */
-       case UTIL_FORMAT_TYPE_FLOAT:
-               switch (desc->channel[i].size) {
-               case 16:
-                       switch (desc->nr_channels) {
-                       case 1:
-                               result = FMT_16_FLOAT;
-                               break;
-                       case 2:
-                               result = FMT_16_16_FLOAT;
-                               break;
-                       case 3:
-                               result = FMT_16_16_16_FLOAT;
-                               break;
-                       case 4:
-                               result = FMT_16_16_16_16_FLOAT;
-                               break;
-                       }
-                       break;
-               case 32:
-                       switch (desc->nr_channels) {
-                       case 1:
-                               result = FMT_32_FLOAT;
-                               break;
-                       case 2:
-                               result = FMT_32_32_FLOAT;
-                               break;
-                       case 3:
-                               result = FMT_32_32_32_FLOAT;
-                               break;
-                       case 4:
-                               result = FMT_32_32_32_32_FLOAT;
-                               break;
-                       }
-                       break;
-               default:
-                       goto out_unknown;
-               }
-               break;
-       /* Unsigned ints */
-       case UTIL_FORMAT_TYPE_UNSIGNED:
-       /* Signed ints */
-       case UTIL_FORMAT_TYPE_SIGNED:
-               switch (desc->channel[i].size) {
-               case 8:
-                       switch (desc->nr_channels) {
-                       case 1:
-                               result = FMT_8;
-                               break;
-                       case 2:
-                               result = FMT_8_8;
-                               break;
-                       case 3:
-//                             result = V_038008_FMT_8_8_8; /* fails piglit draw-vertices test */
-//                             break;
-                       case 4:
-                               result = FMT_8_8_8_8;
-                               break;
-                       }
-                       break;
-               case 16:
-                       switch (desc->nr_channels) {
-                       case 1:
-                               result = FMT_16;
-                               break;
-                       case 2:
-                               result = FMT_16_16;
-                               break;
-                       case 3:
-//                             result = V_038008_FMT_16_16_16; /* fails piglit draw-vertices test */
-//                             break;
-                       case 4:
-                               result = FMT_16_16_16_16;
-                               break;
-                       }
-                       break;
-               case 32:
-                       switch (desc->nr_channels) {
-                       case 1:
-                               result = FMT_32;
-                               break;
-                       case 2:
-                               result = FMT_32_32;
-                               break;
-                       case 3:
-                               result = FMT_32_32_32;
-                               break;
-                       case 4:
-                               result = FMT_32_32_32_32;
-                               break;
-                       }
-                       break;
-               default:
-                       goto out_unknown;
-               }
-               break;
-       default:
-               goto out_unknown;
-       }
-
-       result = S_030008_DATA_FORMAT(result);
-
-       if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) {
-               result |= S_030008_FORMAT_COMP_ALL(1);
-       }
-       if (desc->channel[i].normalized) {
-               result |= S_030008_NUM_FORMAT_ALL(0);
-       } else {
-               result |= S_030008_NUM_FORMAT_ALL(2);
-       }
-       return result;
-out_unknown:
-       R600_ERR("unsupported vertex format %s\n", util_format_name(format));
-       return ~0;
-}
-
 #endif
index d994196e19d25e5f9e6ae7c0ae93a062bbee18a9..d5dabdc69b62df78957f61d2c0d82b26c22e0c75 100644 (file)
@@ -500,139 +500,4 @@ static INLINE boolean r600_is_vertex_format_supported(enum pipe_format format)
        return r600_translate_colorformat(format) != ~0;
 }
 
-static INLINE uint32_t r600_translate_vertex_data_type(enum pipe_format format)
-{
-       uint32_t result = 0;
-       const struct util_format_description *desc;
-       unsigned i;
-
-       desc = util_format_description(format);
-       if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) {
-               goto out_unknown;
-       }
-
-       /* Find the first non-VOID channel. */
-       for (i = 0; i < 4; i++) {
-               if (desc->channel[i].type != UTIL_FORMAT_TYPE_VOID) {
-                       break;
-               }
-       }
-
-       switch (desc->channel[i].type) {
-               /* Half-floats, floats, doubles */
-        case UTIL_FORMAT_TYPE_FLOAT:
-               switch (desc->channel[i].size) {
-                case 16:
-                       switch (desc->nr_channels) {
-                       case 1:
-                               result = FMT_16_FLOAT;
-                               break;
-                       case 2:
-                               result = FMT_16_16_FLOAT;
-                               break;
-                       case 3:
-                               result = FMT_16_16_16_FLOAT;
-                               break;
-                       case 4:
-                               result = FMT_16_16_16_16_FLOAT;
-                               break;
-                       }
-                       break;
-                case 32:
-                       switch (desc->nr_channels) {
-                       case 1:
-                               result = FMT_32_FLOAT;
-                               break;
-                       case 2:
-                               result = FMT_32_32_FLOAT;
-                               break;
-                       case 3:
-                               result = FMT_32_32_32_FLOAT;
-                               break;
-                       case 4:
-                               result = FMT_32_32_32_32_FLOAT;
-                               break;
-                       }
-                       break;
-                default:
-                       goto out_unknown;
-               }
-               break;
-               /* Unsigned ints */
-        case UTIL_FORMAT_TYPE_UNSIGNED:
-               /* Signed ints */
-        case UTIL_FORMAT_TYPE_SIGNED:
-               switch (desc->channel[i].size) {
-                case 8:
-                       switch (desc->nr_channels) {
-                       case 1:
-                               result = FMT_8;
-                               break;
-                       case 2:
-                               result = FMT_8_8;
-                               break;
-                       case 3:
-                       //      result = FMT_8_8_8; /* fails piglit draw-vertices test */
-                       //      break;
-                       case 4:
-                               result = FMT_8_8_8_8;
-                               break;
-                       }
-                       break;
-                case 16:
-                       switch (desc->nr_channels) {
-                       case 1:
-                               result = FMT_16;
-                               break;
-                       case 2:
-                               result = FMT_16_16;
-                               break;
-                       case 3:
-                       //      result = FMT_16_16_16; /* fails piglit draw-vertices test */
-                       //      break;
-                       case 4:
-                               result = FMT_16_16_16_16;
-                               break;
-                       }
-                       break;
-                case 32:
-                       switch (desc->nr_channels) {
-                       case 1:
-                               result = FMT_32;
-                               break;
-                       case 2:
-                               result = FMT_32_32;
-                               break;
-                       case 3:
-                               result = FMT_32_32_32;
-                               break;
-                       case 4:
-                               result = FMT_32_32_32_32;
-                               break;
-                       }
-                       break;
-                default:
-                       goto out_unknown;
-               }
-               break;
-        default:
-               goto out_unknown;
-       }
-       
-       result = S_038008_DATA_FORMAT(result);
-
-       if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) {
-               result |= S_038008_FORMAT_COMP_ALL(1);
-       }
-       if (desc->channel[i].normalized) {
-               result |= S_038008_NUM_FORMAT_ALL(0);
-       } else {
-               result |= S_038008_NUM_FORMAT_ALL(2);
-       }
-       return result;
-out_unknown:
-       R600_ERR("unsupported vertex format %s\n", util_format_name(format));
-       return ~0;
-}
-
 #endif