[Mesa-dev] [PATCH 1/6] i965: implement get_size for 2_10_10_10 formats
Eric Anholt
eric at anholt.net
Mon Oct 22 09:37:05 PDT 2012
Chris Forbes <chrisf at ijw.co.nz> writes:
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
> src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
> index f5f65ca..8ffcc57 100644
> --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
> +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
> @@ -290,6 +290,10 @@ static GLuint get_size( GLenum type )
> case GL_UNSIGNED_SHORT: return sizeof(GLushort);
> case GL_UNSIGNED_BYTE: return sizeof(GLubyte);
> case GL_FIXED: return sizeof(GLuint);
> + /* packed formats: always have 4 components, and element size is
> + * 4 bytes, so pretend each component is 1 byte. */
> + case GL_INT_2_10_10_10_REV: return sizeof(GLbyte);
> + case GL_UNSIGNED_INT_2_10_10_10_REV: return sizeof(GLubyte);
Nitpicky: Something went weird with whitespace here. Our current Mesa
style is that you never use tabs for indents, and if you do, they're 8
spaces anyway. Also, closing */ on its own line unless it's a single
line comment.
It looks like we ought to be able to replace this size calculation with
glarray->_ElementSize, except that that's being calculated wrong for
2_10_10_10 formats.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121022/3f6a671b/attachment.pgp>
More information about the mesa-dev
mailing list