[Mesa-dev] [PATCH v2 1/4] mesa: fix remaining xfb prims check for GLES with multiple instances

Timothy Arceri tarceri at itsqueeze.com
Fri Apr 14 01:04:04 UTC 2017


On 14/04/17 05:29, Nicolai Hähnle wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> Found by inspection.

Nice find. It seems to have broken July 2016 with 23b2bcd460c5e91 so 
maybe CC stable?

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>


> ---
>  src/mesa/main/api_validate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
> index af4f7cb..8f83432 100644
> --- a/src/mesa/main/api_validate.c
> +++ b/src/mesa/main/api_validate.c
> @@ -858,21 +858,21 @@ validate_draw_arrays(struct gl_context *ctx, const char *func,
>      *     RESOLVED: Yes. Because dynamic geometry amplification in a geometry
>      *     shader can make it difficult if not impossible to predict the amount
>      *     of geometry that may be generated in advance of executing the shader,
>      *     the draw-time error for transform feedback buffer overflow conditions
>      *     is removed and replaced with the GL behavior (primitives are not
>      *     written and the corresponding counter is not updated)..."
>      */
>     if (_mesa_is_gles3(ctx) && _mesa_is_xfb_active_and_unpaused(ctx) &&
>         !_mesa_has_OES_geometry_shader(ctx) &&
>         !_mesa_has_OES_tessellation_shader(ctx)) {
> -      size_t prim_count = vbo_count_tessellated_primitives(mode, count, 1);
> +      size_t prim_count = vbo_count_tessellated_primitives(mode, count, numInstances);
>        if (xfb_obj->GlesRemainingPrims < prim_count) {
>           _mesa_error(ctx, GL_INVALID_OPERATION,
>                       "%s(exceeds transform feedback size)", func);
>           return false;
>        }
>        xfb_obj->GlesRemainingPrims -= prim_count;
>     }
>
>     if (count == 0)
>        return false;
>


More information about the mesa-dev mailing list