diff options
author | Chris Forbes <[email protected]> | 2012-11-22 16:23:20 +1300 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-11-26 16:34:23 -0800 |
commit | 23f4411c41f96a1b755259c4a6b23747e95a5ece (patch) | |
tree | d96af0b74a62afd3d71504be0dd0900307c859e6 /src/mesa | |
parent | f9a08f7f0f9f65546db4c7388e445fa39f0842c6 (diff) |
i965: support 2_10_10_10 formats in get_surface_type.
Always use R10G10B10A2_UINT; Most of the other formats we'd like
don't actually work on the hardware. Will emit w/a for scaling,
sign recovery and BGRA swizzle in the VS.
Signed-off-by: Chris Forbes <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw_upload.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index d68aa8c97cf..b6ce0bd13a9 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -252,10 +252,28 @@ 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. + * W/A: the hardware doesn't really support the formats we'd + * like to use here, so upload everything as UINT and fix + * it in the shader + */ + case GL_INT_2_10_10_10_REV: + case GL_UNSIGNED_INT_2_10_10_10_REV: + assert(size == 4); + return BRW_SURFACEFORMAT_R10G10B10A2_UINT; default: assert(0); return 0; - } + } } else { + /* See GL_ARB_vertex_type_2_10_10_10_rev. + * W/A: the hardware doesn't really support the formats we'd + * like to use here, so upload everything as UINT and fix + * it in the shader + */ + if (type == GL_INT_2_10_10_10_REV || type == GL_UNSIGNED_INT_2_10_10_10_REV) { + assert(size == 4); + return BRW_SURFACEFORMAT_R10G10B10A2_UINT; + } assert(format == GL_RGBA); /* sanity check */ switch (type) { case GL_DOUBLE: return double_types[size]; |