[Mesa-dev] [PATCH] mesa: Use _mesa_has_OES_geometry_shader() when validating draws
Ilia Mirkin
imirkin at alum.mit.edu
Thu Feb 23 18:46:54 UTC 2017
The assumption was that if you're setting that ext, you can do gles31. Is
there a driver/hw combo where that's not the case? If so, we should fix
that instead...
On Feb 23, 2017 3:05 AM, "Tomasz Figa" <tfiga at chromium.org> wrote:
> In validate_DrawElements_common() we need to check for OES_geometry_shader
> extension to determine if we should fail if transform feedback is
> unpaused. However current code reads ctx->Extensions.OES_geometry_shader
> directly, which does not take context version into account. This means
> that if the context is GLES 3.0, which makes the OES_geometry_shader
> inapplicable, we would not validate the draw properly. To fix it, let's
> replace the check with a call to _mesa_has_OES_geometry_shader().
>
> Fixes following dEQP tests on i965 with a GLES 3.0 context:
>
> dEQP-GLES3.functional.negative_api.vertex_array#draw_elements
> dEQP-GLES3.functional.negative_api.vertex_array#draw_elements_incomplete_
> primitive
> dEQP-GLES3.functional.negative_api.vertex_array#draw_elements_instanced
> dEQP-GLES3.functional.negative_api.vertex_array#draw_elements_instanced_
> incomplete_primitive
> dEQP-GLES3.functional.negative_api.vertex_array#draw_range_elements
> dEQP-GLES3.functional.negative_api.vertex_array#draw_range_elements_
> incomplete_primitive
>
> Change-Id: Iebc960b479fcd5f6c2b1501cb3e7798b575e6c4d
> Signed-off-by: Tomasz Figa <tfiga at chromium.org>
> ---
> src/mesa/main/api_validate.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
> index 1e8a714067..184bf143ed 100644
> --- a/src/mesa/main/api_validate.c
> +++ b/src/mesa/main/api_validate.c
> @@ -664,7 +664,8 @@ validate_DrawElements_common(struct gl_context *ctx,
> * to have been overlooked. The body of the spec only explicitly
> allows
> * the indirect versions.
> */
> - if (_mesa_is_gles3(ctx) && !ctx->Extensions.OES_geometry_shader &&
> + if (_mesa_is_gles3(ctx) &&
> + !_mesa_has_OES_geometry_shader(ctx) &&
> _mesa_is_xfb_active_and_unpaused(ctx)) {
> _mesa_error(ctx, GL_INVALID_OPERATION,
> "%s(transform feedback active)", caller);
> --
> 2.11.0.483.g087da7b7c-goog
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170223/ca068638/attachment.html>
More information about the mesa-dev
mailing list