r300: add half_float_vertex support
authorMarek Olšák <maraeo@gmail.com>
Sun, 14 Feb 2010 20:58:00 +0000 (21:58 +0100)
committerMarek Olšák <maraeo@gmail.com>
Sun, 14 Feb 2010 20:58:52 +0000 (21:58 +0100)
src/gallium/drivers/r300/r300_reg.h
src/gallium/drivers/r300/r300_state_inlines.h

index 361813891fb35b506c741e8599b4f15897b14c9a..a049da69e2e4edd8c1642606400db181e5a7eef7 100644 (file)
@@ -244,6 +244,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #       define R300_DATA_TYPE_SHORT_4                   7
 #       define R300_DATA_TYPE_VECTOR_3_TTT              8
 #       define R300_DATA_TYPE_VECTOR_3_EET              9
+#       define R300_DATA_TYPE_FLOAT_8                   10
+#       define R300_DATA_TYPE_FLT16_2                   11
+#       define R300_DATA_TYPE_FLT16_4                   12
 #       define R300_SKIP_DWORDS_SHIFT                   4
 #       define R300_DST_VEC_LOC_SHIFT                   8
 #       define R300_LAST_VEC                            (1 << 13)
index b7676e1715c6b554b78a230ff7393249fc8124c7..6ee6cd0e3f22a8793ec8796fa2832c7923777a45 100644 (file)
@@ -507,6 +507,14 @@ r300_translate_vertex_data_type(enum pipe_format format) {
         /* Half-floats, floats, doubles */
         case UTIL_FORMAT_TYPE_FLOAT:
             switch (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 0)) {
+                case 16:
+                    /* XXX Supported only on RV350 and later. */
+                    if (components > 2) {
+                        result = R300_DATA_TYPE_FLT16_4;
+                    } else {
+                        result = R300_DATA_TYPE_FLT16_2;
+                    }
+                    break;
                 case 32:
                     result = R300_DATA_TYPE_FLOAT_1 + (components - 1);
                     break;