[Mesa-dev] [PATCH V3 1/7] i965: implement get_size for 2_10_10_10 formats

Chris Forbes chrisf at ijw.co.nz
Wed Nov 21 19:23:19 PST 2012


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 51531ce..58803f5 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);
    default: assert(0); return 0;
    }
 }
-- 
1.8.0



More information about the mesa-dev mailing list