swr/rast: add support for DX1_RGB{_SRGB} formats

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
Tim Rowley
2017-04-25 18:53:18 -05:00
parent 42b4e7cb25
commit f094d582ec
3 changed files with 93 additions and 37 deletions
@@ -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,
@@ -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,
@@ -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
*
@@ -2861,6 +2861,28 @@ template<> struct FormatTraits<I8_SINT> :
typedef Format1<8> FormatT;
};
//////////////////////////////////////////////////////////////////////////
/// 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
//////////////////////////////////////////////////////////////////////////
@@ -3081,6 +3103,28 @@ template<> struct FormatTraits<YCRCB_SWAPUV> :
typedef Format4<8, 8, 8, 8> FormatT;
};
//////////////////////////////////////////////////////////////////////////
/// 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
//////////////////////////////////////////////////////////////////////////