[Mesa-dev] [PATCH resend] mesa: Require mipmap completeness for glCopyImageSubData(), sometimes.

Roland Scheidegger sroland at vmware.com
Sat Mar 25 01:05:36 UTC 2017


Am 24.03.2017 um 22:51 schrieb Kenneth Graunke:
> This patch makes glCopyImageSubData require mipmap completeness when the
> texture object's built-in sampler object has a mipmapping MinFilter.
> 
> Fixes (on i965):
> dEQP-GLES31.functional.debug.negative_coverage.*.buffer.copy_image_sub_data
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/main/copyimage.c | 25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
> 
> Resending the same patch as before.  The Khronos OpenGL ARB and ES working
> group both decided that although this behavior is unfortunate and strange,
> Android's CTS requires it and so everybody else's implementations already
> work this way.

Sounds like a rather lame justification IMHO - especially since it
apparently breaks other CTS tests.
But ah well if everybody prefers simple hacks in their driver to make it
conformant to a pointless error behavior, so be it.

Reviewed-by: Roland Scheidegger <sroland at vmware.com>


> 
> This patch will break several Piglit tests.  You need these patches:
> 
>     https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.freedesktop.org_patch_146384_&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=_QIjpv-UJ77xEQY8fIYoQtr5qv8wKrPJc7v7_-CYAb0&m=ddCbljDQbqf2DE2Xfva-mHfiLudX_KuJxe_fLv1EgUE&s=tazFdPEIHji-rjtw6QZMUAwwD_4DXrcdpWl7Bpt14Ow&e= 
>     https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.freedesktop.org_patch_146385_&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=_QIjpv-UJ77xEQY8fIYoQtr5qv8wKrPJc7v7_-CYAb0&m=ddCbljDQbqf2DE2Xfva-mHfiLudX_KuJxe_fLv1EgUE&s=PXI9ONdY5AAYE1I-7Q-hWgGnFFr0C4scZjHwQsi3IrM&e= 
> 
> This patch will also break several GL 4.5 CTS tests.  You need this patch:
> 
>     https://urldefense.proofpoint.com/v2/url?u=https-3A__gerrit.khronos.org_849&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=_QIjpv-UJ77xEQY8fIYoQtr5qv8wKrPJc7v7_-CYAb0&m=ddCbljDQbqf2DE2Xfva-mHfiLudX_KuJxe_fLv1EgUE&s=g6bgMSK16HJnWNG5KqK_Watai5veMMjUPecpPLTOXJY&e= 
> 
>     Or for those without Khronos access:
>     https://urldefense.proofpoint.com/v2/url?u=http-3A__whitecape.org_paste_0001-2DSet-2Dnearest-2Dfiltering-2Din-2DGL-2DCopyImage-2Dtests.patch&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=_QIjpv-UJ77xEQY8fIYoQtr5qv8wKrPJc7v7_-CYAb0&m=ddCbljDQbqf2DE2Xfva-mHfiLudX_KuJxe_fLv1EgUE&s=rfg2sx4KrgcBqZO944MVa8YmdTKJkeQWqe9iBfSo1oY&e= 
> 
> diff --git a/src/mesa/main/copyimage.c b/src/mesa/main/copyimage.c
> index cf25159e880..877c8ac246d 100644
> --- a/src/mesa/main/copyimage.c
> +++ b/src/mesa/main/copyimage.c
> @@ -149,9 +149,30 @@ prepare_target(struct gl_context *ctx, GLuint name, GLenum target,
>           return false;
>        }
>  
> +      /* The ARB_copy_image specification says:
> +       *
> +       *    "INVALID_OPERATION is generated if either object is a texture and
> +       *     the texture is not complete (as defined in section 3.9.14)"
> +       *
> +       * The cited section says:
> +       *
> +       *    "Using the preceding definitions, a texture is complete unless any
> +       *     of the following conditions hold true: [...]
> +       *
> +       *     * The minification filter requires a mipmap (is neither NEAREST
> +       *       nor LINEAR), and the texture is not mipmap complete."
> +       *
> +       * This imposes the bizarre restriction that glCopyImageSubData requires
> +       * mipmap completion at times, which dEQP mandates, and other drivers
> +       * appear to implement.  We don't have any texture units here, so we
> +       * can't look at any bound separate sampler objects...it appears that
> +       * you're supposed to use the sampler object which is built-in to the
> +       * texture object.
> +       *
> +       * See https://urldefense.proofpoint.com/v2/url?u=https-3A__cvs.khronos.org_bugzilla_show-5Fbug.cgi-3Fid-3D16224&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=_QIjpv-UJ77xEQY8fIYoQtr5qv8wKrPJc7v7_-CYAb0&m=ddCbljDQbqf2DE2Xfva-mHfiLudX_KuJxe_fLv1EgUE&s=vt4M9kQ3cwPeQwM-mZxfXsc1qDZfUR2jKf5RweuJLwY&e= .
> +       */
>        _mesa_test_texobj_completeness(ctx, texObj);
> -      if (!texObj->_BaseComplete ||
> -          (level != 0 && !texObj->_MipmapComplete)) {
> +      if (!_mesa_is_texture_complete(texObj, &texObj->Sampler)) {
>           _mesa_error(ctx, GL_INVALID_OPERATION,
>                       "glCopyImageSubData(%sName incomplete)", dbg_prefix);
>           return false;
> 



More information about the mesa-dev mailing list