diff options
author | Tim Rowley <[email protected]> | 2017-04-25 18:53:18 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-05-30 17:20:27 -0500 |
commit | f094d582ece128eb66157d1058f6093bef743054 (patch) | |
tree | c17f1dda709d1b0311d35ecfde996eedd4253333 /src/gallium/drivers | |
parent | 42b4e7cb25733205d7fd3fe1c0a3c34f8fa307d7 (diff) |
swr/rast: add support for DX1_RGB{_SRGB} formats
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/common/formats.cpp | 80 | ||||
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/common/formats.h | 4 | ||||
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/core/format_traits.h | 46 |
3 files changed, 93 insertions, 37 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/common/formats.cpp b/src/gallium/drivers/swr/rasterizer/common/formats.cpp index 72020ee1936..263dec649a4 100644 --- a/src/gallium/drivers/swr/rasterizer/common/formats.cpp +++ b/src/gallium/drivers/swr/rasterizer/common/formats.cpp @@ -20,7 +20,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * -* @file gen_formats.cpp +* @file formats.cpp * * @brief auto-generated file * @@ -2729,26 +2729,16 @@ const SWR_FORMAT_INFO gFormatInfo[] = { { 0.0f, 0.0f, 0.0f, 0.0f }, 1, 1 }, - // R10G10B10_FLOAT_A2_UNORM (0xD5) + // padding (0xD5) { - "R10G10B10_FLOAT_A2_UNORM", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // 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 + nullptr, + { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, + { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, + 0, 0, 0, false, false, false, false, + { false, false, false, false }, + { 0.0f, 0.0f, 0.0f, 0.0f }, + 1, 1 }, - // R32_SINT (0xD6) { "R32_SINT", @@ -5179,16 +5169,26 @@ const SWR_FORMAT_INFO gFormatInfo[] = { { 0.0f, 0.0f, 0.0f, 0.0f }, 1, 1 }, - // padding (0x180) + // DXT1_RGB_SRGB (0x180) { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 + "DXT1_RGB_SRGB", + { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, + { 0, 0, 0, 0x3f800000 }, // Defaults for missing components + { 0, 1, 2, 3 }, // Swizzle + { 8, 8, 8, 8 }, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + { true, false, false, false }, // Is normalized? + { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, + // padding (0x181) { nullptr, @@ -5449,16 +5449,26 @@ const SWR_FORMAT_INFO gFormatInfo[] = { { 0.0f, 0.0f, 0.0f, 0.0f }, 1, 1 }, - // padding (0x191) + // DXT1_RGB (0x191) { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 + "DXT1_RGB", + { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, + { 0, 0, 0, 0x3f800000 }, // Defaults for missing components + { 0, 1, 2, 3 }, // Swizzle + { 8, 8, 8, 8 }, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + { true, false, false, false }, // Is normalized? + { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, + // padding (0x192) { nullptr, diff --git a/src/gallium/drivers/swr/rasterizer/common/formats.h b/src/gallium/drivers/swr/rasterizer/common/formats.h index 0056a56f829..f13f338f8b1 100644 --- a/src/gallium/drivers/swr/rasterizer/common/formats.h +++ b/src/gallium/drivers/swr/rasterizer/common/formats.h @@ -20,7 +20,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * -* @file gen_formats.h +* @file formats.h * * @brief auto-generated file * @@ -181,6 +181,7 @@ enum SWR_FORMAT L8_SINT = 0x153, I8_UINT = 0x154, I8_SINT = 0x155, + DXT1_RGB_SRGB = 0x180, YCRCB_SWAPUVY = 0x183, BC1_UNORM = 0x186, BC2_UNORM = 0x187, @@ -191,6 +192,7 @@ enum SWR_FORMAT BC2_UNORM_SRGB = 0x18C, BC3_UNORM_SRGB = 0x18D, YCRCB_SWAPUV = 0x18F, + DXT1_RGB = 0x191, R8G8B8_UNORM = 0x193, R8G8B8_SNORM = 0x194, R8G8B8_SSCALED = 0x195, diff --git a/src/gallium/drivers/swr/rasterizer/core/format_traits.h b/src/gallium/drivers/swr/rasterizer/core/format_traits.h index 6c428043878..478fe3e4f2a 100644 --- a/src/gallium/drivers/swr/rasterizer/core/format_traits.h +++ b/src/gallium/drivers/swr/rasterizer/core/format_traits.h @@ -20,7 +20,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * -* @file gen_format_traits.h +* @file format_traits.h * * @brief Format Traits. auto-generated file * @@ -2862,6 +2862,28 @@ template<> struct FormatTraits<I8_SINT> : }; ////////////////////////////////////////////////////////////////////////// +/// FormatTraits<DXT1_RGB_SRGB> - Format traits specialization for DXT1_RGB_SRGB +////////////////////////////////////////////////////////////////////////// +template<> struct FormatTraits<DXT1_RGB_SRGB> : + ComponentTraits<SWR_TYPE_UNORM, 8>, + FormatSwizzle<0>, + Defaults<0, 0, 0, 0x3f800000> +{ + static const uint32_t bpp{ 64 }; + static const uint32_t numComps{ 1 }; + static const bool hasAlpha{ true }; + static const uint32_t alphaComp{ 3 }; + static const bool isSRGB{ false }; + static const bool isBC{ true }; + static const bool isSubsampled{ false }; + static const uint32_t bcWidth{ 4 }; + static const uint32_t bcHeight{ 4 }; + + typedef TransposeSingleComponent<8> TransposeT; + typedef Format1<8> FormatT; +}; + +////////////////////////////////////////////////////////////////////////// /// FormatTraits<YCRCB_SWAPUVY> - Format traits specialization for YCRCB_SWAPUVY ////////////////////////////////////////////////////////////////////////// template<> struct FormatTraits<YCRCB_SWAPUVY> : @@ -3082,6 +3104,28 @@ template<> struct FormatTraits<YCRCB_SWAPUV> : }; ////////////////////////////////////////////////////////////////////////// +/// FormatTraits<DXT1_RGB> - Format traits specialization for DXT1_RGB +////////////////////////////////////////////////////////////////////////// +template<> struct FormatTraits<DXT1_RGB> : + ComponentTraits<SWR_TYPE_UNORM, 8>, + FormatSwizzle<0>, + Defaults<0, 0, 0, 0x3f800000> +{ + static const uint32_t bpp{ 64 }; + static const uint32_t numComps{ 1 }; + static const bool hasAlpha{ true }; + static const uint32_t alphaComp{ 3 }; + static const bool isSRGB{ false }; + static const bool isBC{ true }; + static const bool isSubsampled{ false }; + static const uint32_t bcWidth{ 4 }; + static const uint32_t bcHeight{ 4 }; + + typedef TransposeSingleComponent<8> TransposeT; + typedef Format1<8> FormatT; +}; + +////////////////////////////////////////////////////////////////////////// /// FormatTraits<R8G8B8_UNORM> - Format traits specialization for R8G8B8_UNORM ////////////////////////////////////////////////////////////////////////// template<> struct FormatTraits<R8G8B8_UNORM> : |