Module: Mesa Branch: main Commit: 7371efdb3abef6f80ee2b898e3d50ae0349a508d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7371efdb3abef6f80ee2b898e3d50ae0349a508d
Author: Emma Anholt <[email protected]> Date: Sat Sep 25 15:42:06 2021 -0700 i915g: Use the non-vbuf code path by default to fix index overflows. We were assertion failing on some large draws due to indices >16bits, despite asking draw to limit the max indices. I haven't managed to track it down, so flip us back to the older, non-index drawing path that doesn't hit this bug until it can get fixed. Leave an I915_DEBUG=vbuf flag around so we can look into this later. This is a pretty big performance hit for vertex shaders. Using glmark2 -b build:use-vbo=true: i915g-vbuf: 211 fps i915g-nonvbuf: 185 fps i915c: 41 fps Given how massively better i915g still is than i915c (llvmpipe VS instead of the classic swrast interpreter), I think it's still worth it to get i915g correct before we fix this perf regression. Fixes: #4971 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13052> --- .../drivers/i915/ci/deqp-i915-g33-fails.txt | 15 ----------- .../drivers/i915/ci/piglit-i915-g33-fails.txt | 31 ---------------------- src/gallium/drivers/i915/ci/traces-i915.yml | 8 +++--- src/gallium/drivers/i915/i915_context.c | 5 ++-- src/gallium/drivers/i915/i915_debug.c | 1 + src/gallium/drivers/i915/i915_debug.h | 1 + 6 files changed, 8 insertions(+), 53 deletions(-) diff --git a/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt b/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt index 895701ef8ac..f21887e6786 100644 --- a/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt +++ b/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt @@ -1,18 +1,3 @@ -# https://gitlab.freedesktop.org/mesa/mesa/-/issues/4971 -# "../src/gallium/drivers/i915/i915_prim_vbuf.c:628: i915_vbuf_render_draw_elements: Assertion `0' failed." -dEQP-GLES2.functional.buffer.write.random.0,Crash -dEQP-GLES2.functional.buffer.write.random.1,Crash -dEQP-GLES2.functional.buffer.write.random.2,Crash -dEQP-GLES2.functional.buffer.write.random.3,Crash -dEQP-GLES2.functional.buffer.write.random.4,Crash -dEQP-GLES2.functional.buffer.write.random.5,Crash -dEQP-GLES2.functional.buffer.write.random.8,Crash -dEQP-GLES2.functional.buffer.write.random.9,Crash -dEQP-GLES2.functional.buffer.write.recreate_store.random_1,Crash -dEQP-GLES2.functional.buffer.write.recreate_store.random_2,Crash -dEQP-GLES2.functional.buffer.write.recreate_store.random_3,Crash -dEQP-GLES2.functional.buffer.write.recreate_store.random_4,Crash - # Lines with the center outside the viewport clipped out when they shouldn't be? dEQP-GLES2.functional.clipping.line.wide_line_clip_viewport_center,Fail dEQP-GLES2.functional.clipping.line.wide_line_clip_viewport_corner,Fail diff --git a/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt b/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt index 11b1be0cdc2..b223028b13a 100644 --- a/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt +++ b/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt @@ -43,9 +43,6 @@ spec@!opengl [email protected],Fail # "MESA: error: Empty fragment shader" spec@!opengl [email protected],Fail -# "../src/gallium/drivers/i915/i915_prim_vbuf.c:470: draw_arrays_fallback: Assertion `0' failed." -spec@!opengl [email protected],Crash - # "Probe color at (74,4) # Expected: 1.000000 1.000000 1.000000 # Observed: 0.000000 0.000000 0.000000 @@ -60,35 +57,11 @@ spec@!opengl [email protected],Crash # Failure with Scissor Test set to fail mode." spec@!opengl [email protected],Fail -# "../src/gallium/drivers/i915/i915_prim_vbuf.c:470: draw_arrays_fallback: Assertion `0' failed." -spec@!opengl [email protected],Crash - spec@!opengl [email protected],Fail spec@!opengl [email protected],Fail -spec@!opengl 1.1@clipflat,Fail -spec@!opengl 1.1@clipflat@glBegin/End(GL_TRIANGLE_FAN)- glFrontFace(GL_CCW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glBegin/End(GL_TRIANGLE_FAN)- glFrontFace(GL_CW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glBegin/End(GL_QUADS)- glFrontFace(GL_CCW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glBegin/End(GL_QUADS)- glFrontFace(GL_CW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glBegin/End(GL_QUAD_STRIP)- glFrontFace(GL_CCW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glBegin/End(GL_QUAD_STRIP)- glFrontFace(GL_CW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawArrays(GL_TRIANGLE_FAN)- glFrontFace(GL_CCW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawArrays(GL_TRIANGLE_FAN)- glFrontFace(GL_CW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawArrays(GL_QUADS)- glFrontFace(GL_CCW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawArrays(GL_QUADS)- glFrontFace(GL_CW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawArrays(GL_QUAD_STRIP)- glFrontFace(GL_CCW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawArrays(GL_QUAD_STRIP)- glFrontFace(GL_CW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawElements(GL_TRIANGLE_FAN)- glFrontFace(GL_CCW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawElements(GL_TRIANGLE_FAN)- glFrontFace(GL_CW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawElements(GL_QUADS)- glFrontFace(GL_CCW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawElements(GL_QUADS)- glFrontFace(GL_CW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawElements(GL_QUAD_STRIP)- glFrontFace(GL_CCW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail -spec@!opengl 1.1@clipflat@glDrawElements(GL_QUAD_STRIP)- glFrontFace(GL_CW)- glPolygonMode(GL_FILL)- quadrant: center middle PV: FIRST,Fail spec@!opengl 1.1@depthstencil-default_fb-clear,Fail spec@!opengl 1.1@getteximage-formats,Fail -spec@!opengl [email protected] 100000 varray gl_quad_strip,Crash -spec@!opengl [email protected] 100000 vbo gl_quad_strip,Crash spec@!opengl [email protected],Fail spec@!opengl 1.1@line-flat-clip-color,Fail spec@!opengl 1.1@linestipple,Fail @@ -97,9 +70,6 @@ spec@!opengl 1.1@linestipple@Factor 3x,Fail spec@!opengl 1.1@linestipple@Line loop,Fail spec@!opengl 1.1@linestipple@Line strip,Fail -# longprim: ../src/gallium/drivers/i915/i915_prim_vbuf.c:470: draw_arrays_fallback: Assertion `0' failed. -spec@!opengl 1.1@longprim,Crash - # "../src/compiler/nir/nir_lower_int_to_float.c:102: lower_alu_instr: Assertion `nir_alu_type_get_base_type(info->output_type) != nir_type_int && nir_alu_type_get_base_type(info->output_type) != nir_type_uint' failed." spec@!opengl 1.1@point-line-no-cull,Crash @@ -310,7 +280,6 @@ spec@arb_occlusion_query@occlusion_query_conform,Fail spec@arb_occlusion_query@occlusion_query_meta_fragments,Fail spec@arb_occlusion_query@occlusion_query_meta_no_fragments,Fail spec@arb_occlusion_query@occlusion_query_meta_save,Fail -spec@arb_occlusion_query@occlusion_query_order,Crash spec@arb_pixel_buffer_object@cubemap npot pbo,Fail spec@arb_pixel_buffer_object@fbo-pbo-readpixels-small,Fail diff --git a/src/gallium/drivers/i915/ci/traces-i915.yml b/src/gallium/drivers/i915/ci/traces-i915.yml index f8ee679d474..85b8c4b4b3e 100644 --- a/src/gallium/drivers/i915/ci/traces-i915.yml +++ b/src/gallium/drivers/i915/ci/traces-i915.yml @@ -8,7 +8,7 @@ traces: - path: glxgears/glxgears-2.trace expectations: - device: i915-g33 - checksum: 83b1a41392bec71f7aeea6f1170cc23d + checksum: ee8dcdb3b9eaef2b32a2914b89373419 - path: gputest/plot3d.trace expectations: - device: i915-g33 @@ -41,7 +41,7 @@ traces: - path: humus/Portals.trace expectations: - device: i915-g33 - checksum: 4cb0eb98c89c4d7ff962a25cc7931d8c + checksum: f782469019417923831d5d53dbe6a507 # The shadow raytracing shader fails to compile #- path: humus/RaytracedShadows.trace # expectations: @@ -55,9 +55,9 @@ traces: - path: neverball/neverball.trace expectations: - device: i915-g33 - checksum: bb7f4ddd30c36418a94ad8f02fc6bd09 + checksum: f925aa92da47ebc757285f826113f4db - path: valve/counterstrike-v2.trace # Tree foliage rendering is extra aliased. expectations: - device: i915-g33 - checksum: 837c0aabe5d6bf75a071a3fa45cf448f + checksum: d17298ad3bb44b43b6c17e017f7c1e6a diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c index 1bbe2246fd7..71e9f5defa0 100644 --- a/src/gallium/drivers/i915/i915_context.c +++ b/src/gallium/drivers/i915/i915_context.c @@ -27,6 +27,7 @@ #include "i915_context.h" #include "i915_batch.h" +#include "i915_debug.h" #include "i915_query.h" #include "i915_resource.h" #include "i915_screen.h" @@ -42,8 +43,6 @@ #include "util/u_prim.h" #include "util/u_upload_mgr.h" -DEBUG_GET_ONCE_BOOL_OPTION(i915_no_vbuf, "I915_NO_VBUF", false) - /* * Draw functions */ @@ -216,7 +215,7 @@ i915_create_context(struct pipe_screen *screen, void *priv, unsigned flags) */ i915->draw = draw_create(&i915->base); assert(i915->draw); - if (!debug_get_option_i915_no_vbuf()) { + if (i915_debug & DBG_VBUF) { draw_set_rasterize_stage(i915->draw, i915_draw_vbuf_stage(i915)); } else { draw_set_rasterize_stage(i915->draw, i915_draw_render_stage(i915)); diff --git a/src/gallium/drivers/i915/i915_debug.c b/src/gallium/drivers/i915/i915_debug.c index fb258f0c857..e64c9b62453 100644 --- a/src/gallium/drivers/i915/i915_debug.c +++ b/src/gallium/drivers/i915/i915_debug.c @@ -43,6 +43,7 @@ static const struct debug_named_value i915_debug_options[] = { {"texture", DBG_TEXTURE, "Texture information"}, {"constants", DBG_CONSTANTS, "Constant buffers"}, {"fs", DBG_FS, "Dump fragment shaders"}, + {"vbuf", DBG_VBUF, "Use the WIP vbuf code path"}, DEBUG_NAMED_VALUE_END}; unsigned i915_debug = 0; diff --git a/src/gallium/drivers/i915/i915_debug.h b/src/gallium/drivers/i915/i915_debug.h index 8195832aed7..56db7cc88be 100644 --- a/src/gallium/drivers/i915/i915_debug.h +++ b/src/gallium/drivers/i915/i915_debug.h @@ -45,6 +45,7 @@ struct i915_winsys_batchbuffer; #define DBG_TEXTURE 0x10 #define DBG_CONSTANTS 0x20 #define DBG_FS 0x40 +#define DBG_VBUF 0x80 extern unsigned i915_debug;
