diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py index 42c236c7a6a..edc0324e60b 100644 --- a/src/mesa/main/format_info.py +++ b/src/mesa/main/format_info.py @@ -128,6 +128,8 @@ def get_channel_bits(fmat, chan_name): return bits if fmat.has_channel(chan_name) else 0 elif fmat.layout == 'atc': return 8 if fmat.has_channel(chan_name) else 0 + elif fmat.layout == 'other' and ('RG_RB' in fmat.name or 'GR_BR' in fmat.name): + return 8 if fmat.has_channel(chan_name) else 0 else: assert False else: diff --git a/src/mesa/main/format_parser.py b/src/mesa/main/format_parser.py index c0d73c9d22e..3b1cb54260a 100644 --- a/src/mesa/main/format_parser.py +++ b/src/mesa/main/format_parser.py @@ -518,7 +518,7 @@ def _get_datatype(type, size): else: assert False -def _parse_channels(fields, layout, colorspace, swizzle): +def _parse_channels(fields): channels = [] for field in fields: if not field: @@ -569,6 +569,7 @@ def parse(filename): swizzle = Swizzle(fields[9]) except: sys.exit("error parsing swizzle for format " + name) - channels = _parse_channels(fields[5:9], layout, colorspace, swizzle) + + channels = _parse_channels(fields[5:9]) yield Format(name, layout, block_width, block_height, block_depth, channels, swizzle, colorspace) diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index ac00a21306b..9cd026f7507 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -1024,6 +1024,8 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format, case MESA_FORMAT_YCBCR: case MESA_FORMAT_YCBCR_REV: + case MESA_FORMAT_RG_RB_UNORM8: + case MESA_FORMAT_GR_BR_UNORM8: *datatype = GL_UNSIGNED_SHORT; *comps = 2; return; diff --git a/src/mesa/main/formats.csv b/src/mesa/main/formats.csv index e2b54e935bb..21cdea26e08 100644 --- a/src/mesa/main/formats.csv +++ b/src/mesa/main/formats.csv @@ -93,6 +93,9 @@ MESA_FORMAT_A2R10G10B10_UNORM , packed, 1, 1, 1, un2 , un10, un10, u MESA_FORMAT_YCBCR , other , 1, 1, 1, x16 , , , , xyzw, yuv MESA_FORMAT_YCBCR_REV , other , 1, 1, 1, x16 , , , , xyzw, yuv +MESA_FORMAT_RG_RB_UNORM8 , other , 2, 1, 1, x16 , , , , xyz1, rgb +MESA_FORMAT_GR_BR_UNORM8 , other , 2, 1, 1, x16 , , , , xyz1, rgb + # Array normalized formats MESA_FORMAT_A_UNORM8 , array , 1, 1, 1, un8 , , , , 000x, rgb MESA_FORMAT_A_UNORM16 , array , 1, 1, 1, un16, , , , 000x, rgb diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 29c1308c383..508c9c342d2 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -385,6 +385,8 @@ typedef enum pipe_format mesa_format; #define MESA_FORMAT_A2R10G10B10_UNORM PIPE_FORMAT_A2R10G10B10_UNORM #define MESA_FORMAT_YCBCR PIPE_FORMAT_UYVY #define MESA_FORMAT_YCBCR_REV PIPE_FORMAT_YUYV +#define MESA_FORMAT_RG_RB_UNORM8 PIPE_FORMAT_R8G8_R8B8_UNORM +#define MESA_FORMAT_GR_BR_UNORM8 PIPE_FORMAT_G8R8_B8R8_UNORM #define MESA_FORMAT_A_UNORM8 PIPE_FORMAT_A8_UNORM #define MESA_FORMAT_A_UNORM16 PIPE_FORMAT_A16_UNORM #define MESA_FORMAT_L_UNORM8 PIPE_FORMAT_L8_UNORM