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

Nicolai Hähnle nhaehnle at gmail.com
Tue Apr 18 13:35:11 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Found by inspection.

Cc: mesa-stable at lists.freedesktop.org
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;
-- 
2.9.3



More information about the mesa-dev mailing list