summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-07-18 18:23:30 -0700
committerJason Ekstrand <[email protected]>2014-07-23 16:48:35 -0700
commit6bac86cd85bf85dd03df7e788232059dc63b9f65 (patch)
treef08b1f447ac6d7952e294452b05b09e771945487 /src
parent5072d0e7fc6120fe7d1a02f0d4ba3daed4a03573 (diff)
i965: Accelerate uploads of RGBA and BGRA GL_UNSIGNED_INT_8_8_8_8_REV textures
Since intel is always going to be little-endian, GL_UNSIGNED_INT_8_8_8_8_REV is the same as GL_UNSIGNED_BYTE for RGBA and BGRA textures, so the same acceleration code will work. We might as well use it. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_subimage.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index c73cf10f588..875190ff737 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -560,7 +560,7 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
* we need tests.
*/
if (!brw->has_llc ||
- type != GL_UNSIGNED_BYTE ||
+ !(type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_INT_8_8_8_8_REV) ||
texImage->TexObject->Target != GL_TEXTURE_2D ||
pixels == NULL ||
_mesa_is_bufferobj(packing->BufferObj) ||
@@ -573,6 +573,10 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
packing->Invert)
return false;
+ if (type == GL_UNSIGNED_INT_8_8_8_8_REV &&
+ !(format == GL_RGBA || format == GL_BGRA))
+ return false; /* Invalid type/format combination */
+
if ((texImage->TexFormat == MESA_FORMAT_L_UNORM8 && format == GL_LUMINANCE) ||
(texImage->TexFormat == MESA_FORMAT_A_UNORM8 && format == GL_ALPHA)) {
cpp = 1;