[Mesa-dev] [PATCH 05/10] i965: Enable ChooseTexFormat for supported GL_EXT_texture_integer formats.

Kenneth Graunke kenneth at whitecape.org
Tue Nov 8 12:47:13 PST 2011


On 11/04/2011 03:01 PM, Eric Anholt wrote:
> We don't get to use the 3-component formats, but faking of RGB with
> RGBA seems to be working.
> ---
>   src/mesa/drivers/dri/intel/intel_context.c |   28 ++++++++++++++++++++++++++++
>   1 files changed, 28 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
> index 801b747..6b493e1 100644
> --- a/src/mesa/drivers/dri/intel/intel_context.c
> +++ b/src/mesa/drivers/dri/intel/intel_context.c
> @@ -706,6 +706,34 @@ intelInitContext(struct intel_context *intel,
>         ctx->TextureFormatSupported[MESA_FORMAT_SLA8] = true;
>      }
>
> +   if (intel->gen>= 4) {
> +      /* Each combination of 32-bit ints are supported, but the RGB 32-bit ints
> +       * don't support use as a render target (GPU hangs).
> +       */
> +      ctx->TextureFormatSupported[MESA_FORMAT_R_INT32] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RG_INT32] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RGBA_INT32] = GL_TRUE;
> +
> +      ctx->TextureFormatSupported[MESA_FORMAT_R_UINT32] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RG_UINT32] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RGBA_UINT32] = GL_TRUE;
> +
> +      /* For 16 and 8 bits, RGB is unsupported entirely. */
> +      ctx->TextureFormatSupported[MESA_FORMAT_R_UINT16] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RG_UINT16] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RGBA_UINT16] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_R_INT16] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RG_INT16] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RGBA_INT16] = GL_TRUE;
> +
> +      ctx->TextureFormatSupported[MESA_FORMAT_R_UINT8] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RG_UINT8] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RGBA_UINT8] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_R_INT8] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RG_INT8] = GL_TRUE;
> +      ctx->TextureFormatSupported[MESA_FORMAT_RGBA_INT8] = GL_TRUE;
> +   }
> +
>   #ifdef TEXTURE_FLOAT_ENABLED
>      ctx->TextureFormatSupported[MESA_FORMAT_RGBA_FLOAT32] = true;
>      ctx->TextureFormatSupported[MESA_FORMAT_RG_FLOAT32] = true;

I think you mean "true" here.  Otherwise,
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list