diff options
author | Kevin Strasser <[email protected]> | 2019-01-24 16:11:11 -0800 |
---|---|---|
committer | Adam Jackson <[email protected]> | 2019-08-21 18:36:57 +0000 |
commit | 5a747306ce6dd3021c15cfabc83465ec3fb4bb1c (patch) | |
tree | b2023d6e7d6f91aeb169a13b7cfd47ced1b344ee /src/mesa/main | |
parent | 9328e7c04cd86c0eff00fb91061a0fdbf7b1e149 (diff) |
dri: Add config attributes for color channel shift
The existing mask attributes can only support up to 32 bpp. Introduce
per-channel SHIFT attributes that indicate how many bits, from lsb towards
msb, the bit field is offset. A shift of -1 will indicate that there is no
bit field set for the channel.
As old loaders will still be looking for masks, we set the masks to 0 for
any formats wider than 32 bpp.
Signed-off-by: Kevin Strasser <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/context.c | 9 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 0128fe12d86..c68be8d01e5 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1564,9 +1564,12 @@ check_compatible(const struct gl_context *ctx, ctxvis->foo != bufvis->foo) \ return GL_FALSE - check_component(redMask); - check_component(greenMask); - check_component(blueMask); + check_component(redShift); + check_component(greenShift); + check_component(blueShift); + check_component(redBits); + check_component(greenBits); + check_component(blueBits); check_component(depthBits); check_component(stencilBits); diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index b38d0a29009..b740671559b 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -170,6 +170,7 @@ struct gl_config GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ GLuint redMask, greenMask, blueMask, alphaMask; + GLint redShift, greenShift, blueShift, alphaShift; GLint rgbBits; /* total bits for rgb */ GLint indexBits; /* total bits for colorindex */ |