Commit ae0120f2 authored by Jordan Justen's avatar Jordan Justen

texformat: use MESA_FORMAT_ARGB2101010 with GL_UNSIGNED_INT_2_10_10_10_REV

Choose MESA_FORMAT_ARGB2101010 when storing
GL_RGBA + GL_UNSIGNED_INT_2_10_10_10_REV or
GL_RGB + GL_UNSIGNED_INT_2_10_10_10_REV.
Signed-off-by: Jordan Justen's avatarJordan Justen <jordan.l.justen@intel.com>
parent 787bbe65
...@@ -75,7 +75,9 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, ...@@ -75,7 +75,9 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444);
} else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) { } else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) {
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555); RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555);
} } else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010);
}
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
break; break;
...@@ -111,6 +113,10 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, ...@@ -111,6 +113,10 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
/* shallow RGB formats */ /* shallow RGB formats */
case 3: case 3:
case GL_RGB: case GL_RGB:
if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010);
}
/* fallthrough */
case GL_RGB8: case GL_RGB8:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment