[Mesa-dev] [PATCH] i965: Add the ability to render to I8/L8 and I16/L16 UNORM formats.

Ian Romanick idr at freedesktop.org
Tue Apr 7 14:31:54 PDT 2015


On 04/06/2015 05:06 PM, Kenneth Graunke wrote:
> This allows those formats to work with the meta PBO upload path.
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_surface_formats.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c
> index 7261c01..7524ad9 100644
> --- a/src/mesa/drivers/dri/i965/brw_surface_formats.c
> +++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c
> @@ -582,6 +582,14 @@ brw_init_surface_formats(struct brw_context *brw)
>        case BRW_SURFACEFORMAT_L16_FLOAT:
>  	 render = BRW_SURFACEFORMAT_R16_FLOAT;
>  	 break;
> +      case BRW_SURFACEFORMAT_I8_UNORM:
> +      case BRW_SURFACEFORMAT_L8_UNORM:
> +         render = BRW_SURFACEFORMAT_R8_UNORM;
> +         break;

I wasn't sure this was correct, so I spent some time digging in the GL
spec.  Table 3.15 on page 179 (page 195 of the PDF) of the OpenGL 3.0
spec shows that this mapping is correct.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> +      case BRW_SURFACEFORMAT_I16_UNORM:
> +      case BRW_SURFACEFORMAT_L16_UNORM:
> +         render = BRW_SURFACEFORMAT_R16_UNORM;
> +         break;
>        case BRW_SURFACEFORMAT_B8G8R8X8_UNORM:
>  	 /* XRGB is handled as ARGB because the chips in this family
>  	  * cannot render to XRGB targets.  This means that we have to
> 



More information about the mesa-dev mailing list