nvfx: add support for ARB_half_float_vertex
authorLuca Barbieri <luca@luca-barbieri.com>
Mon, 18 Jan 2010 16:38:29 +0000 (17:38 +0100)
committerLuca Barbieri <luca@luca-barbieri.com>
Mon, 12 Apr 2010 18:20:02 +0000 (20:20 +0200)
src/gallium/drivers/nouveau/nouveau_class.h
src/gallium/drivers/nvfx/nvfx_vbo.c

index a701b9d631d4ad0609765f2033b8b26cc069737b..adfdd37b1b64a6eaf2ea0cced614f52605079e67 100644 (file)
@@ -6183,6 +6183,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define   NV34TCL_VTXFMT_TYPE_SHIFT                                                    0
 #define   NV34TCL_VTXFMT_TYPE_MASK                                                     0x0000000f
 #define    NV34TCL_VTXFMT_TYPE_FLOAT                                                   0x00000002
+#define    NV34TCL_VTXFMT_TYPE_HALF                                                    0x00000003
 #define    NV34TCL_VTXFMT_TYPE_UBYTE                                                   0x00000004
 #define    NV34TCL_VTXFMT_TYPE_USHORT                                                  0x00000005
 #define   NV34TCL_VTXFMT_SIZE_SHIFT                                                    4
index 8c71aa3d1b16feb606ea4595d0b83c240b79bbc5..f40e24061ffae8b7e257fecb20205dfc10a24610 100644 (file)
@@ -21,6 +21,12 @@ nvfx_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, unsigned *ncomp)
        case PIPE_FORMAT_R32G32B32A32_FLOAT:
                *fmt = NV34TCL_VTXFMT_TYPE_FLOAT;
                break;
+       case PIPE_FORMAT_R16_FLOAT:
+       case PIPE_FORMAT_R16G16_FLOAT:
+       case PIPE_FORMAT_R16G16B16_FLOAT:
+       case PIPE_FORMAT_R16G16B16A16_FLOAT:
+               *fmt = NV34TCL_VTXFMT_TYPE_HALF;
+               break;
        case PIPE_FORMAT_R8_UNORM:
        case PIPE_FORMAT_R8G8_UNORM:
        case PIPE_FORMAT_R8G8B8_UNORM:
@@ -41,21 +47,25 @@ nvfx_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, unsigned *ncomp)
        switch (pipe) {
        case PIPE_FORMAT_R8_UNORM:
        case PIPE_FORMAT_R32_FLOAT:
+       case PIPE_FORMAT_R16_FLOAT:
        case PIPE_FORMAT_R16_SSCALED:
                *ncomp = 1;
                break;
        case PIPE_FORMAT_R8G8_UNORM:
        case PIPE_FORMAT_R32G32_FLOAT:
+       case PIPE_FORMAT_R16G16_FLOAT:
        case PIPE_FORMAT_R16G16_SSCALED:
                *ncomp = 2;
                break;
        case PIPE_FORMAT_R8G8B8_UNORM:
        case PIPE_FORMAT_R32G32B32_FLOAT:
+       case PIPE_FORMAT_R16G16B16_FLOAT:
        case PIPE_FORMAT_R16G16B16_SSCALED:
                *ncomp = 3;
                break;
        case PIPE_FORMAT_R8G8B8A8_UNORM:
        case PIPE_FORMAT_R32G32B32A32_FLOAT:
+       case PIPE_FORMAT_R16G16B16A16_FLOAT:
        case PIPE_FORMAT_R16G16B16A16_SSCALED:
                *ncomp = 4;
                break;