[Mesa-dev] [PATCH 18/23] glformats: allow GL_RGB+GL_UNSIGNED_INT_2_10_10_10_REV for GLES2/3

Ian Romanick idr at freedesktop.org
Mon Jan 7 13:23:30 PST 2013


On 01/04/2013 06:41 PM, Jordan Justen wrote:
> This format is allowed by the GL_EXT_texture_type_2_10_10_10_REV
> extension.
>
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>   src/mesa/main/glformats.c |    9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> index 28bbddf..dd4dd8b 100644
> --- a/src/mesa/main/glformats.c
> +++ b/src/mesa/main/glformats.c
> @@ -1289,6 +1289,10 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
>             ctx->Extensions.ARB_texture_rgb10_a2ui) {
>            break; /* OK */
>         }
> +      if (type == GL_UNSIGNED_INT_2_10_10_10_REV && format == GL_RGB &&
> +          ctx->API == API_OPENGLES2) {
> +         break; /* OK by GL_EXT_texture_type_2_10_10_10_REV */
> +      }
>         return GL_INVALID_OPERATION;
>
>      case GL_UNSIGNED_INT_24_8:
> @@ -1402,6 +1406,11 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
>               case GL_UNSIGNED_SHORT_5_6_5:
>               case GL_UNSIGNED_SHORT_5_6_5_REV:
>                  return GL_NO_ERROR;
> +            case GL_UNSIGNED_INT_2_10_10_10_REV:
> +               /* OK by GL_EXT_texture_type_2_10_10_10_REV */
> +               if (ctx->API == API_OPENGLES2) {
> +                  return GL_NO_ERROR;
> +               }

Missing break or return for the "else" case.

>               case GL_HALF_FLOAT:
>                  return ctx->Extensions.ARB_half_float_pixel
>                     ? GL_NO_ERROR : GL_INVALID_ENUM;
>



More information about the mesa-dev mailing list