diff options
author | Tim Rowley <[email protected]> | 2016-12-07 17:04:20 -0600 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2016-12-09 16:20:13 -0600 |
commit | 2a127b780b343ed042aaaa03c8a1cec1a3729f0e (patch) | |
tree | 66eaceb8bcd9e3a98c1dc32f5499852bb70ceff9 /src/gallium/drivers/swr/rasterizer/common | |
parent | d0d21532f9efec7d080db72e4bf2980c0d715a23 (diff) |
swr: [rasterizer common/core/jitter] fetch support for GL_FIXED
v2: use fmul(1/65536) instead of fdiv(65535)
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/common')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/common/formats.cpp | 104 | ||||
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/common/formats.h | 7 |
2 files changed, 78 insertions, 33 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/common/formats.cpp b/src/gallium/drivers/swr/rasterizer/common/formats.cpp index b3a95f2bf03..aba4c3f3380 100644 --- a/src/gallium/drivers/swr/rasterizer/common/formats.cpp +++ b/src/gallium/drivers/swr/rasterizer/common/formats.cpp @@ -449,16 +449,26 @@ const SWR_FORMAT_INFO gFormatInfo[] = { { 0.0f, 0.0f, 0.0f, 0.0f }, 1, 1 }, - // padding (0x20) + // R32G32B32A32_SFIXED (0x20) { - 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 + "R32G32B32A32_SFIXED", + { SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_SFIXED }, + { 0, 0, 0, 0x3f800000 }, // Defaults for missing components + { 0, 1, 2, 3 }, // Swizzle + { 32, 32, 32, 32 }, // Bits per component + 128, // Bits per element + 16, // 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 }, + // padding (0x21) { nullptr, @@ -979,16 +989,26 @@ const SWR_FORMAT_INFO gFormatInfo[] = { { 0.0f, 0.0f, 0.0f, 0.0f }, 1, 1 }, - // padding (0x50) + // R32G32B32_SFIXED (0x50) { - 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 + "R32G32B32_SFIXED", + { SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_UNKNOWN }, + { 0, 0, 0, 0x3f800000 }, // Defaults for missing components + { 0, 1, 2, 0 }, // Swizzle + { 32, 32, 32, 0 }, // Bits per component + 96, // Bits per element + 12, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + { false, false, false, false }, // Is normalized? + { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, + // padding (0x51) { nullptr, @@ -1969,16 +1989,26 @@ const SWR_FORMAT_INFO gFormatInfo[] = { { 0.0f, 0.0f, 0.0f, 0.0f }, 1, 1 }, - // padding (0xA0) + // R32G32_SFIXED (0xA0) { - 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 + "R32G32_SFIXED", + { SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, + { 0, 0, 0, 0x3f800000 }, // Defaults for missing components + { 0, 1, 0, 0 }, // Swizzle + { 32, 32, 0, 0 }, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + { false, false, false, false }, // Is normalized? + { 1.0f, 1.0f, 0, 0 }, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, + // padding (0xA1) { nullptr, @@ -5909,16 +5939,26 @@ const SWR_FORMAT_INFO gFormatInfo[] = { 1, // bcHeight }, - // padding (0x1B2) + // R32_SFIXED (0x1B2) { - 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_SFIXED", + { SWR_TYPE_SFIXED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, + { 0, 0, 0, 0x3f800000 }, // Defaults for missing components + { 0, 0, 0, 0 }, // 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, 0, 0, 0 }, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, + // R10G10B10A2_SNORM (0x1B3) { "R10G10B10A2_SNORM", diff --git a/src/gallium/drivers/swr/rasterizer/common/formats.h b/src/gallium/drivers/swr/rasterizer/common/formats.h index dd5b4999e39..3d686d3e0b0 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 formats.h +* @file gen_formats.h * * @brief auto-generated file * @@ -46,6 +46,7 @@ enum SWR_TYPE SWR_TYPE_FLOAT, SWR_TYPE_SSCALED, SWR_TYPE_USCALED, + SWR_TYPE_SFIXED, }; ////////////////////////////////////////////////////////////////////////// @@ -59,11 +60,13 @@ enum SWR_FORMAT R32G32B32X32_FLOAT = 0x6, R32G32B32A32_SSCALED = 0x7, R32G32B32A32_USCALED = 0x8, + R32G32B32A32_SFIXED = 0x20, R32G32B32_FLOAT = 0x40, R32G32B32_SINT = 0x41, R32G32B32_UINT = 0x42, R32G32B32_SSCALED = 0x45, R32G32B32_USCALED = 0x46, + R32G32B32_SFIXED = 0x50, R16G16B16A16_UNORM = 0x80, R16G16B16A16_SNORM = 0x81, R16G16B16A16_SINT = 0x82, @@ -83,6 +86,7 @@ enum SWR_FORMAT R16G16B16A16_USCALED = 0x94, R32G32_SSCALED = 0x95, R32G32_USCALED = 0x96, + R32G32_SFIXED = 0xA0, B8G8R8A8_UNORM = 0xC0, B8G8R8A8_UNORM_SRGB = 0xC1, R10G10B10A2_UNORM = 0xC2, @@ -203,6 +207,7 @@ enum SWR_FORMAT R8G8B8_UNORM_SRGB = 0x1A8, R16G16B16_UINT = 0x1B0, R16G16B16_SINT = 0x1B1, + R32_SFIXED = 0x1B2, R10G10B10A2_SNORM = 0x1B3, R10G10B10A2_USCALED = 0x1B4, R10G10B10A2_SSCALED = 0x1B5, |