d3d1x: update format mapping table
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 13 Oct 2011 17:31:51 +0000 (19:31 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 21 Oct 2011 21:00:37 +0000 (23:00 +0200)
Use the proper integer formats.
Fix mapping of some PIPE depth formats to DXGI.

src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h
src/gallium/state_trackers/d3d1x/d3d1xstutil/src/dxgi_enums.cpp

index e197c0ca797f046397c2a93d6231bb3c60f3cc2d..1e96066874b0389aad5076992e02ed64977e2f0b 100644 (file)
@@ -982,7 +982,7 @@ struct GalliumMultiPrivateDataComObject : public GalliumMultiComObject<BaseClass
        }
 };
 
-#define DXGI_FORMAT_COUNT 100
+#define DXGI_FORMAT_COUNT 116
 extern pipe_format dxgi_to_pipe_format[DXGI_FORMAT_COUNT];
 extern DXGI_FORMAT pipe_to_dxgi_format[PIPE_FORMAT_COUNT];
 
index a6a8eb7022a18d41e31ca1a9456b15f14db676bc..d6dcae08666673f1028e1d9abd6b5a9cd6eefb57 100644 (file)
 pipe_format dxgi_to_pipe_format[DXGI_FORMAT_COUNT] =
 {
        PIPE_FORMAT_NONE,
-       PIPE_FORMAT_R32G32B32A32_FLOAT, /* TYPELESS */
+       PIPE_FORMAT_R32G32B32A32_UINT, /* TYPELESS */
        PIPE_FORMAT_R32G32B32A32_FLOAT,
-       PIPE_FORMAT_R32G32B32A32_USCALED,
-       PIPE_FORMAT_R32G32B32A32_SSCALED,
-       PIPE_FORMAT_R32G32B32_FLOAT, /* TYPELESS */
+       PIPE_FORMAT_R32G32B32A32_UINT,
+       PIPE_FORMAT_R32G32B32A32_SINT,
+       PIPE_FORMAT_R32G32B32_UINT, /* TYPELESS */
        PIPE_FORMAT_R32G32B32_FLOAT,
-       PIPE_FORMAT_R32G32B32_USCALED,
-       PIPE_FORMAT_R32G32B32_SSCALED,
-       PIPE_FORMAT_R16G16B16A16_FLOAT, /* TYPELESS */
+       PIPE_FORMAT_R32G32B32_UINT,
+       PIPE_FORMAT_R32G32B32_SINT,
+       PIPE_FORMAT_R16G16B16A16_UINT, /* TYPELESS */
        PIPE_FORMAT_R16G16B16A16_FLOAT,
        PIPE_FORMAT_R16G16B16A16_UNORM,
-       PIPE_FORMAT_R16G16B16A16_USCALED,
+       PIPE_FORMAT_R16G16B16A16_UINT,
        PIPE_FORMAT_R16G16B16A16_SNORM,
-       PIPE_FORMAT_R16G16B16A16_SSCALED,
-       PIPE_FORMAT_R32G32_FLOAT, /* TYPELESS */
+       PIPE_FORMAT_R16G16B16A16_SINT,
+       PIPE_FORMAT_R32G32_UINT, /* TYPELESS */
        PIPE_FORMAT_R32G32_FLOAT,
-       PIPE_FORMAT_R32G32_USCALED,
-       PIPE_FORMAT_R32G32_SSCALED,
-       PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, /* PIPE_FORMAT_R32G8X24_FLOAT_TYPELESS */
+       PIPE_FORMAT_R32G32_UINT,
+       PIPE_FORMAT_R32G32_SINT,
+       PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, /* PIPE_FORMAT_R32_G8X24_TYPELESS */
        PIPE_FORMAT_Z32_FLOAT_S8X24_UINT,
-       PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, /* PIPE_FORMAT_R32_FLOAT_X8X24_TYPELESS */
-       PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, /* PIPE_FORMAT_X32_TYPELESS_G8X24_UINT */
+       PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, /* PIPE_FORMAT_R32_X8X24_FLOAT */
+       PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, /* PIPE_FORMAT_X32_G8X24_UINT */
        PIPE_FORMAT_R10G10B10A2_UNORM, /* TYPELESS */
        PIPE_FORMAT_R10G10B10A2_UNORM,
-       PIPE_FORMAT_R10G10B10A2_USCALED,
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_R10G10B10A2_UINT */
        PIPE_FORMAT_R11G11B10_FLOAT,
-       PIPE_FORMAT_R8G8B8A8_UNORM, /* TYPELESS */
+       PIPE_FORMAT_R8G8B8A8_UINT, /* TYPELESS */
        PIPE_FORMAT_R8G8B8A8_UNORM,
        PIPE_FORMAT_R8G8B8A8_SRGB,
-       PIPE_FORMAT_R8G8B8A8_USCALED,
+       PIPE_FORMAT_R8G8B8A8_UINT,
        PIPE_FORMAT_R8G8B8A8_SNORM,
-       PIPE_FORMAT_R8G8B8A8_SSCALED,
-       PIPE_FORMAT_R16G16_FLOAT, /* TYPELESS */
+       PIPE_FORMAT_R8G8B8A8_SINT,
+       PIPE_FORMAT_R16G16_UINT, /* TYPELESS */
        PIPE_FORMAT_R16G16_FLOAT,
        PIPE_FORMAT_R16G16_UNORM,
-       PIPE_FORMAT_R16G16_USCALED,
+       PIPE_FORMAT_R16G16_UINT,
        PIPE_FORMAT_R16G16_SNORM,
-       PIPE_FORMAT_R16G16_SSCALED,
-       PIPE_FORMAT_R32_FLOAT, /* TYPELESS */
+       PIPE_FORMAT_R16G16_SINT,
+       PIPE_FORMAT_R32_UINT, /* TYPELESS */
        PIPE_FORMAT_Z32_FLOAT,
        PIPE_FORMAT_R32_FLOAT,
-       PIPE_FORMAT_R32_USCALED,
-       PIPE_FORMAT_R32_SSCALED,
+       PIPE_FORMAT_R32_UINT,
+       PIPE_FORMAT_R32_SINT,
        PIPE_FORMAT_Z24_UNORM_S8_UINT, /* PIPE_FORMAT_R24G8_TYPELESS */
        PIPE_FORMAT_Z24_UNORM_S8_UINT,
-       PIPE_FORMAT_Z24X8_UNORM, /* PIPE_FORMAT_R24_UNORM_X8_TYPELESS */
-       PIPE_FORMAT_Z24_UNORM_S8_UINT, /* PIPE_FORMAT_X24_TYPELESS_G8_UINT */
-       PIPE_FORMAT_R8G8_UNORM, /* TYPELESS */
+       PIPE_FORMAT_Z24X8_UNORM, /* PIPE_FORMAT_R24X8_UNORM */
+       PIPE_FORMAT_Z24_UNORM_S8_UINT, /* PIPE_FORMAT_X24G8_UINT */
+       PIPE_FORMAT_R8G8_UINT, /* TYPELESS */
        PIPE_FORMAT_R8G8_UNORM,
-       PIPE_FORMAT_R8G8_USCALED,
+       PIPE_FORMAT_R8G8_UINT,
        PIPE_FORMAT_R8G8_SNORM,
-       PIPE_FORMAT_R8G8_SSCALED,
-       PIPE_FORMAT_R16_FLOAT, /* TYPELESS */
+       PIPE_FORMAT_R8G8_SINT,
+       PIPE_FORMAT_R16_UINT, /* TYPELESS */
        PIPE_FORMAT_R16_FLOAT,
        PIPE_FORMAT_Z16_UNORM,
        PIPE_FORMAT_R16_UNORM,
-       PIPE_FORMAT_R16_USCALED,
+       PIPE_FORMAT_R16_UINT,
        PIPE_FORMAT_R16_SNORM,
-       PIPE_FORMAT_R16_SSCALED,
-       PIPE_FORMAT_R8_UNORM, /* TYPELESS */
+       PIPE_FORMAT_R16_SINT,
+       PIPE_FORMAT_R8_UINT, /* TYPELESS */
        PIPE_FORMAT_R8_UNORM,
-       PIPE_FORMAT_R8_USCALED,
+       PIPE_FORMAT_R8_UINT,
        PIPE_FORMAT_R8_SNORM,
-       PIPE_FORMAT_R8_SSCALED,
+       PIPE_FORMAT_R8_SINT,
        PIPE_FORMAT_A8_UNORM,
        PIPE_FORMAT_R1_UNORM,
        PIPE_FORMAT_R9G9B9E5_FLOAT,
@@ -131,6 +131,22 @@ pipe_format dxgi_to_pipe_format[DXGI_FORMAT_COUNT] =
        PIPE_FORMAT_NONE, /* PIPE_FORMAT_BC7_TYPELESS */
        PIPE_FORMAT_NONE, /* PIPE_FORMAT_BC7_UNORM */
        PIPE_FORMAT_NONE, /* PIPE_FORMAT_BC7_UNORM_SRGB */
+       PIPE_FORMAT_AYUV,
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_Y410 */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_Y416 */
+       PIPE_FORMAT_NV12,
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_P010 */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_P016 */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_420_OPAQUE */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_YUV2 */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_Y210 */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_Y216 */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_NV11 */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_AI44 (palettized) */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_IA44 (palettized) */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_P8 (palettized) */
+       PIPE_FORMAT_NONE, /* PIPE_FORMAT_A8P8 (palettized) */
+       PIPE_FORMAT_B4G4R4A4_UNORM,
 };
 
 DXGI_FORMAT pipe_to_dxgi_format[PIPE_FORMAT_COUNT];
@@ -142,6 +158,8 @@ void init_pipe_to_dxgi_format()
                for(unsigned i = 0; i < DXGI_FORMAT_COUNT; ++i)
                        pipe_to_dxgi_format[dxgi_to_pipe_format[i]] = (DXGI_FORMAT)i;
                pipe_to_dxgi_format[PIPE_FORMAT_NONE] = DXGI_FORMAT_UNKNOWN;
+               pipe_to_dxgi_format[PIPE_FORMAT_Z32_FLOAT_S8X24_UINT] = DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
+               pipe_to_dxgi_format[PIPE_FORMAT_Z24_UNORM_S8_UINT] = DXGI_FORMAT_D24_UNORM_S8_UINT;
                pipe_to_dxgi_format_initialized = 1;
        }
 }