Quoting Maarten Lankhorst (2018-10-25 12:25:15) > Op 03-10-18 om 11:11 schreef Chris Wilson: > > Quoting Maarten Lankhorst (2018-08-01 13:41:33) > >> diff --git a/pixman/pixman.h b/pixman/pixman.h > >> index 509ba5e534a8..c9bf4faa80d4 100644 > >> --- a/pixman/pixman.h > >> +++ b/pixman/pixman.h > >> @@ -647,19 +647,24 @@ struct pixman_indexed > >> * sample implementation allows only packed RGB and GBR > >> * representations for data to simplify software rendering, > >> */ > >> -#define PIXMAN_FORMAT(bpp,type,a,r,g,b) (((bpp) << 24) | \ > >> +#define PIXMAN_FORMAT_PACKC(val) ((val) <= 10 ? (val) : \ > >> + (val) == 32 ? 11 : 0) > >> +#define PIXMAN_FORMAT_UNPACKC(val) ((val) <= 10 ? (val) : \ > >> + (val) == 11 ? 32 : 0) > > We have 4bits, why not reserve 0xf for float32? Certainly you > > want space for > > > > #define PIXMAN_FORMAT_PACKED_FLOAT16 0xb > > #define PIXMAN_FORMAT_PACKED_FLOAT32 0xc > > #define PIXMAN_FORMAT_PACKED_FLOAT64 0xd > > > > I just wonder if we may have 12bpc one day as well, so leaving 0xc clear > > has some some appeal. > > -Chris > > I don't think we support double precision in pixman yet, but here's v4. :) > > Apply with --scissors > ------8<------------------------------------ > Pixman is already using the floating point formats internally, expose > this capability in case someone wants to support higher bit per > component formats. > > This is useful for igt which depends on cairo to do the rendering. > It can use it to convert floats internally to planar Y'CbCr formats, > or to F16. > > Changes since v1: > - Use RGBA 128 bits and RGB 96 bits memory layouts, to better match the > opengl format. > Changes since v2: > - Add asserts in accessor and for strides to force alignment. > - Move test changes to their own commit. > Changes since v3: > - Define 32bpc as PIXMAN_FORMAT_PACKED_C32 > - Rename pixman accessors from rgb*_float_float to rgb*f_float > > Signed-off-by: Maarten Lankhorst <[email protected]>
I'm confident that we are not shooting ourselves in the foot here wrt to potential future api directions, so Reviewed-by: Chris Wilson <[email protected]> -Chris _______________________________________________ Pixman mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/pixman
