[Mesa-dev] [PATCH 5/6] i965: support 2_10_10_10 formats in get_surface_type.
Chris Forbes
chrisf at ijw.co.nz
Tue Oct 9 02:33:41 PDT 2012
---
src/mesa/drivers/dri/i965/brw_draw_upload.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 6b073ad..f2d177a 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -253,10 +253,33 @@ static GLuint get_surface_type( GLenum type, GLuint size,
else {
return ubyte_types_norm[size];
}
+ /* See GL_ARB_vertex_type_2_10_10_10_rev */
+ case GL_INT_2_10_10_10_REV:
+ assert(size == 4);
+ return (format == GL_RGBA)
+ ? BRW_SURFACEFORMAT_R10G10B10A2_SNORM
+ : BRW_SURFACEFORMAT_B10G10R10A2_SNORM;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ assert(size == 4);
+ return (format == GL_RGBA)
+ ? BRW_SURFACEFORMAT_R10G10B10A2_UNORM
+ : BRW_SURFACEFORMAT_B10G10R10A2_UNORM;
default: assert(0); return 0;
- }
+ }
}
else {
+ /* See GL_ARB_vertex_type_2_10_10_10_rev */
+ if (type == GL_INT_2_10_10_10_REV) {
+ assert(size == 4);
+ return (format == GL_RGBA)
+ ? BRW_SURFACEFORMAT_R10G10B10A2_SSCALED
+ : BRW_SURFACEFORMAT_B10G10R10A2_SSCALED;
+ } else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
+ assert(size == 4);
+ return (format == GL_RGBA)
+ ? BRW_SURFACEFORMAT_R10G10B10A2_USCALED
+ : BRW_SURFACEFORMAT_B10G10R10A2_USCALED;
+ }
assert(format == GL_RGBA); /* sanity check */
switch (type) {
case GL_DOUBLE: return double_types[size];
--
1.7.12.2
More information about the mesa-dev
mailing list