diff options
author | Tim Rowley <[email protected]> | 2016-10-04 13:14:32 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2016-10-11 11:22:04 -0500 |
commit | b3bd8bb611bb465d2e5efddd109cf633bf3cc9b9 (patch) | |
tree | 122e3eeb760af40347a40d5e15075190aa986a4b | |
parent | 2966d9c691fd0cd51d83204cac6b3194b9dcb878 (diff) |
swr: [rasterizer core] add support for "RAW" surface format
Signed-off-by: Tim Rowley <[email protected]>
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/common/formats.cpp | 23 | ||||
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/common/formats.h | 6 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/common/formats.cpp b/src/gallium/drivers/swr/rasterizer/common/formats.cpp index 8a6588678ab..2d2bf21f36e 100644 --- a/src/gallium/drivers/swr/rasterizer/common/formats.cpp +++ b/src/gallium/drivers/swr/rasterizer/common/formats.cpp @@ -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 + } }; diff --git a/src/gallium/drivers/swr/rasterizer/common/formats.h b/src/gallium/drivers/swr/rasterizer/common/formats.h index 117cf3e4b84..1f5fe190ff5 100644 --- a/src/gallium/drivers/swr/rasterizer/common/formats.h +++ b/src/gallium/drivers/swr/rasterizer/common/formats.h @@ -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]; } |