Re: [Mesa-dev] [PATCH 1/3] gallium: add PIPE_FORMAT_A1B5G5R5_UNORM format

2017-10-06 Thread Eric Anholt
Nicolai Hähnle  writes:

> From: Nicolai Hähnle 
>
> This matches the GL_UNSIGNED_SHORT_5_5_5_1 type.

Sigh, I've sent a patch for this 3 times already and not been able to
get review.

https://lists.freedesktop.org/archives/mesa-dev/2017-August/166569.html

I found that I also needed X1B5G5R5, or GL_RGB5 would give me failures.


signature.asc
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/3] gallium: add PIPE_FORMAT_A1B5G5R5_UNORM format

2017-10-06 Thread Nicolai Hähnle
From: Nicolai Hähnle 

This matches the GL_UNSIGNED_SHORT_5_5_5_1 type.
---
 src/gallium/auxiliary/util/u_format.csv | 1 +
 src/gallium/auxiliary/util/u_format_tests.c | 7 +++
 src/gallium/drivers/svga/svga_format.c  | 1 +
 src/gallium/include/pipe/p_format.h | 1 +
 4 files changed, 10 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_format.csv 
b/src/gallium/auxiliary/util/u_format.csv
index be86acca9bd..252e8b21578 100644
--- a/src/gallium/auxiliary/util/u_format.csv
+++ b/src/gallium/auxiliary/util/u_format.csv
@@ -67,20 +67,21 @@ PIPE_FORMAT_NONE  , plain, 1, 1, u8  , 
, , , x001, r
 PIPE_FORMAT_B8G8R8A8_UNORM, plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, 
rgb
 PIPE_FORMAT_B8G8R8X8_UNORM, plain, 1, 1, un8 , un8 , un8 , x8  , zyx1, 
rgb
 PIPE_FORMAT_A8R8G8B8_UNORM, plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, 
rgb
 PIPE_FORMAT_X8R8G8B8_UNORM, plain, 1, 1, x8  , un8 , un8 , un8 , yzw1, 
rgb
 PIPE_FORMAT_A8B8G8R8_UNORM, plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, 
rgb
 PIPE_FORMAT_X8B8G8R8_UNORM, plain, 1, 1, x8  , un8 , un8 , un8 , wzy1, 
rgb
 # PIPE_FORMAT_R8G8B8A8_UNORM is below
 PIPE_FORMAT_R8G8B8X8_UNORM, plain, 1, 1, un8 , un8 , un8 , x8  , xyz1, 
rgb
 PIPE_FORMAT_B5G5R5X1_UNORM, plain, 1, 1, un5 , un5 , un5 , x1  , zyx1, 
rgb, x1  , un5 , un5 , un5 , yzw1
 PIPE_FORMAT_B5G5R5A1_UNORM, plain, 1, 1, un5 , un5 , un5 , un1 , zyxw, 
rgb, un1 , un5 , un5 , un5 , yzwx
+PIPE_FORMAT_A1B5G5R5_UNORM, plain, 1, 1, un1 , un5 , un5 , un5 , wzyx, 
rgb, un5 , un5 , un5 , un1 , xyzw
 PIPE_FORMAT_B4G4R4A4_UNORM, plain, 1, 1, un4 , un4 , un4 , un4 , zyxw, 
rgb, un4 , un4 , un4 , un4 , yzwx
 PIPE_FORMAT_B4G4R4X4_UNORM, plain, 1, 1, un4 , un4 , un4 , x4  , zyx1, 
rgb, x4  , un4 , un4 , un4 , yzw1
 PIPE_FORMAT_B5G6R5_UNORM  , plain, 1, 1, un5 , un6 , un5 , , zyx1, 
rgb, un5 , un6 , un5 , , xyz1
 PIPE_FORMAT_R10G10B10A2_UNORM , plain, 1, 1, un10, un10, un10, un2 , xyzw, 
rgb, un2 , un10, un10, un10, wzyx
 PIPE_FORMAT_R10G10B10X2_UNORM , plain, 1, 1, un10, un10, un10, x2,   xyz1, 
rgb, x2  , un10, un10, un10, wzy1
 PIPE_FORMAT_B10G10R10A2_UNORM , plain, 1, 1, un10, un10, un10, un2 , zyxw, 
rgb, un2 , un10, un10, un10, yzwx
 PIPE_FORMAT_B2G3R3_UNORM  , plain, 1, 1, un2 , un3 , un3 , , zyx1, 
rgb, un3 , un3 , un2 , , xyz1
 
 # Luminance/Intensity/Alpha formats
 PIPE_FORMAT_L8_UNORM  , plain, 1, 1, un8 , , , , xxx1, 
rgb
diff --git a/src/gallium/auxiliary/util/u_format_tests.c 
b/src/gallium/auxiliary/util/u_format_tests.c
index dbf072a01e3..b4c562cac45 100644
--- a/src/gallium/auxiliary/util/u_format_tests.c
+++ b/src/gallium/auxiliary/util/u_format_tests.c
@@ -163,20 +163,27 @@ util_format_test_cases[] =
{PIPE_FORMAT_B5G5R5X1_UNORM, PACKED_1x16(0x7fff), PACKED_1x16(0x7c00), 
UNPACKED_1x1(1.0, 0.0, 0.0, 1.0)},
{PIPE_FORMAT_B5G5R5X1_UNORM, PACKED_1x16(0x7fff), PACKED_1x16(0x7fff), 
UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
 
{PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0x), PACKED_1x16(0x), 
UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0x), PACKED_1x16(0x001f), 
UNPACKED_1x1(0.0, 0.0, 1.0, 0.0)},
{PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0x), PACKED_1x16(0x03e0), 
UNPACKED_1x1(0.0, 1.0, 0.0, 0.0)},
{PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0x), PACKED_1x16(0x7c00), 
UNPACKED_1x1(1.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0x), PACKED_1x16(0x8000), 
UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
{PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0x), PACKED_1x16(0x), 
UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
 
+   {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0x), PACKED_1x16(0x), 
UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
+   {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0x), PACKED_1x16(0x003e), 
UNPACKED_1x1(0.0, 0.0, 1.0, 0.0)},
+   {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0x), PACKED_1x16(0x07c0), 
UNPACKED_1x1(0.0, 1.0, 0.0, 0.0)},
+   {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0x), PACKED_1x16(0xf800), 
UNPACKED_1x1(1.0, 0.0, 0.0, 0.0)},
+   {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0x), PACKED_1x16(0x0001), 
UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
+   {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0x), PACKED_1x16(0x), 
UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
+
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x), 
UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x000f), 
UNPACKED_1x1(0.0, 0.0, 1.0, 1.0)},
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x00f0), 
UNPACKED_1x1(0.0, 1.0, 0.0, 1.0)},
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x0f00), 
UNPACKED_1x1(1.0, 0.0, 0.0, 1.0)},
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x0fff), 
UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},