swr: [rasterizer core] add support for "RAW" surface format
authorTim Rowley <timothy.o.rowley@intel.com>
Tue, 4 Oct 2016 18:14:32 +0000 (13:14 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Tue, 11 Oct 2016 16:22:04 +0000 (11:22 -0500)
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/rasterizer/common/formats.cpp
src/gallium/drivers/swr/rasterizer/common/formats.h

index 8a6588678ab9c8efeb5d1c6684563fbc87ca7a43..2d2bf21f36e476f834041459e958051b65731681 100644 (file)
@@ -6082,4 +6082,27 @@ const SWR_FORMAT_INFO gFormatInfo[] = {
         1, // bcWidth
         1, // bcHeight
     },
+    // <---- Add new "supported" formats here!
+
+
+    // ... skip a long range ...
+    // RAW (0x1ff)
+    {
+        "RAW",
+        { SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, },
+        { 0, 0, 0, 0 }, // Defaults for missing components
+        { 0, 1, 2, 3 }, // Swizzle
+        { 32, 0, 0, 0 }, // Bits per component
+        32, // Bits per element
+        4, // Bytes per element
+        1, // Num components
+        false, // isSRGB
+        false, // isBC
+        false, // isSubsampled
+        false, // isLuminance
+        { false, false, false, false }, // Is normalized?
+        { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor
+        1, // bcWidth
+        1, // bcHeight
+    }
 };
index 117cf3e4b842c12d46a5b95844fd450677c8f7be..1f5fe190ff5dae798fe9589ef92ae4887fd074b5 100644 (file)
@@ -216,6 +216,7 @@ enum SWR_FORMAT
     R8G8B8_UINT = 0x1C8,
     R8G8B8_SINT = 0x1C9,
     NUM_SWR_FORMATS = 0x1CA,
+    RAW = 0x1FF,
 };
 
 //////////////////////////////////////////////////////////////////////////
@@ -248,6 +249,11 @@ extern const SWR_FORMAT_INFO gFormatInfo[];
 /// @param format - SWR format
 INLINE const SWR_FORMAT_INFO& GetFormatInfo(SWR_FORMAT format)
 {
+    if (format == RAW)
+    {
+        format = NUM_SWR_FORMATS;
+    }
+    SWR_ASSERT(format <= NUM_SWR_FORMATS, "Invalid Surface Format: %d", format);
     return gFormatInfo[format];
 }