[Mesa-dev] [PATCH] i965/gen7: Only advertise 4 samples for RGBA32F on GLES

Samuel Iglesias Gonsálvez siglesias at igalia.com
Tue Nov 22 09:09:48 UTC 2016


Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

On Tue, 2016-11-22 at 00:17 -0800, Jordan Justen wrote:
> We can't render to 8x MSAA if the width is greater than 64 bits. (see
> brw_render_target_supported)
> 
> Fixes ES31-CTS.sample_variables.mask.rgba32f.samples_8.mask_*
> 
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_formatquery.c | 22
> +++++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_formatquery.c
> b/src/mesa/drivers/dri/i965/brw_formatquery.c
> index 8f7a910..96cc6e0 100644
> --- a/src/mesa/drivers/dri/i965/brw_formatquery.c
> +++ b/src/mesa/drivers/dri/i965/brw_formatquery.c
> @@ -23,6 +23,7 @@
>  
>  #include "brw_context.h"
>  #include "brw_state.h"
> +#include "main/context.h"
>  #include "main/formatquery.h"
>  #include "main/glformats.h"
>  
> @@ -50,9 +51,24 @@ brw_query_samples_for_format(struct gl_context
> *ctx, GLenum target,
>        return 3;
>  
>     case 7:
> -      samples[0] = 8;
> -      samples[1] = 4;
> -      return 2;
> +      if (internalFormat == GL_RGBA32F && _mesa_is_gles(ctx)) {
> +         /* For GLES, we are allowed to return a smaller number of
> samples for
> +          * GL_RGBA32F. See OpenGLES 3.2 spec, section 20.3.1
> Internal Format
> +          * Query Parameters, under SAMPLES:
> +          *
> +          * "A value less than or equal to the value of MAX_SAMPLES,
> if
> +          *  internalformat is RGBA16F, R32F, RG32F, or RGBA32F."
> +          *
> +          * In brw_render_target_supported, we prevent formats with
> a size
> +          * greater than 8 bytes from using 8x MSAA on gen7.
> +          */
> +         samples[0] = 4;
> +         return 1;
> +      } else {
> +         samples[0] = 8;
> +         samples[1] = 4;
> +         return 2;
> +      }
>  
>     case 6:
>        samples[0] = 4;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161122/89d91bb3/attachment.sig>


More information about the mesa-dev mailing list