[Mesa-dev] [PATCH] mesa: Fix error condition for multisample proxy texture targets

Kenneth Graunke kenneth at whitecape.org
Wed Apr 16 22:53:46 PDT 2014


On 04/03/2014 06:57 PM, Anuj Phogat wrote:
> Fixes failures in Khronos OpenGL CTS test proxy_textures_invalid_samples
> 
> Cc: <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/mesa/main/teximage.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 57a766f..aac3887 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -4374,7 +4374,7 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples,
>  {
>     struct gl_texture_object *texObj;
>     struct gl_texture_image *texImage;
> -   GLboolean sizeOK, dimensionsOK;
> +   GLboolean sizeOK, dimensionsOK, samplesOK;
>     mesa_format texFormat;
>     GLenum sample_count_error;
>  
> @@ -4411,7 +4411,17 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples,
>  
>     sample_count_error = _mesa_check_sample_count(ctx, target,
>           internalformat, samples);
> -   if (sample_count_error != GL_NO_ERROR) {
> +   samplesOK = sample_count_error == GL_NO_ERROR;
> +
> +   /* Page 254 of OpenGL 4.4 spec says:
> +    *   "Proxy arrays for two-dimensional multisample and two-dimensional
> +    *    multisample array textures are operated on in the same way when
> +    *    TexImage2DMultisample is called with target specified as
> +    *    PROXY_TEXTURE_2D_MULTISAMPLE, or TexImage3DMultisample is called
> +    *    with target specified as PROXY_TEXTURE_2D_- MULTISAMPLE_ARRAY.

I'd probably remove the stray hyphen and space above ^^^

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

> +    *    However, if samples is not supported, then no error is generated.
> +    */
> +   if (!samplesOK && !_mesa_is_proxy_texture(target)) {
>        _mesa_error(ctx, sample_count_error, "%s(samples)", func);
>        return;
>     }
> @@ -4443,7 +4453,7 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples,
>           width, height, depth, 0);
>  
>     if (_mesa_is_proxy_texture(target)) {
> -      if (dimensionsOK && sizeOK) {
> +      if (samplesOK && dimensionsOK && sizeOK) {
>           init_teximage_fields_ms(ctx, texImage, width, height, depth, 0,
>                                   internalformat, texFormat,
>                                   samples, fixedsamplelocations);
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140416/fe964329/attachment.sig>


More information about the mesa-dev mailing list