System Environment: -------------------------- Arch: x86_64 Platform: Haswell Libdrm: (master)libdrm-2.4.45-4-g8a88e349975a64676f143183e835e6d296f29627 Mesa: (master)60f9b722ef80c499a94b4e5ab7304dcd739ea569 Xserver:(master)xorg-server-1.14.99.1-119-gc21344add2fc589df83b29be5831c36a372201bd Xf86_video_intel:(master)2.21.8-8-g7f7c8087db6af58109e791763fe33582a1559646 Cairo: (master)631bf299256e11a17511977f357e0353fb5615f7 Libva: (staging)ef53340b19746589079d7ed5f9c67970fcc40401 Libva_intel_driver:(staging)9c698455fec340ced7dbf93cc5be004bb4a1eb22 Kernel: (drm-intel-nightly) c5ea23067eb3f0bc86dea95b8f544c7ef8dfea54 Bug detailed description: ------------------------- It core dumped on Haswell with mesa master branch. It works well on 9.1 branch. Following cases also core dumped with same bisect commit: GL3Tests_instanced_arrays_instanced_arrays_first.test GL3Tests_instanced_arrays_instanced_arrays_instance_id.test GL3Tests_instanced_arrays_instanced_arrays_mode.test GL3Tests_instanced_arrays_instanced_arrays_order.test GL3Tests_instanced_arrays_instanced_arrays_other_draw_calls.test GL3Tests_instanced_arrays_instanced_arrays_pointer.test GL3Tests_instanced_arrays_instanced_arrays_primcount.test GL3Tests_instanced_arrays_instanced_arrays_size.test GL3Tests_instanced_arrays_instanced_arrays_stride.test Bisect shows:7c87a3b5dac118697a9b67caa7b6d5cab60f316d is the first bad commit. commit 7c87a3b5dac118697a9b67caa7b6d5cab60f316d Author: Kenneth Graunke <kenneth@whitecape.org> AuthorDate: Fri May 24 09:28:56 2013 -0700 Commit: Kenneth Graunke <kenneth@whitecape.org> CommitDate: Wed May 29 14:22:06 2013 -0700 i965: Use the correct restart index for fixed index mode on Haswell. The code that updates the ctx->Array._RestartIndex derived state mashed it to 0xFFFFFFFF when GL_PRIMITIVE_RESTART_FIXED_INDEX was enabled regardless of the index buffer type. It's supposed to be 0xFF for byte, 0xFFFF for short, or 0xFFFFFFFF for integer types. The new _mesa_primitive_restart_index() helper gets this right. The hardware appears to compare against the full 32-bit value some of the time, causing primitive restart not to occur when it should. The fact that it works some of the time is rather frightening. Fixes sporadic failures in the ES 3 instanced_arrays_primitive_restart conformance test when run in combination with other tests. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> output: Running GTF (Graphics Test Framework) egl_vendor: Mesa Project egl_version: 1.4 ConfigID: 7 RGBA bits( 8, 8, 8, 8) Depth bits: 0 Stencil bits: 0 gtf_version: 3.0 mode: egl arg: /GFX/Test/Ogles3conform/ogles3conform/GTF_ES/glsl/GTF/GTF -width=64 -height=64 -run=/GFX/Test/Ogles3conform/ogles3conform/GTF_ES/glsl/GTF/GL3Tests/instanced_arrays/instanced_arrays_divisor.test gl_renderer: Mesa DRI Intel(R) Haswell Desktop gl_shading_language_version: OpenGL ES GLSL ES 3.0 gl_version: OpenGL ES 3.0 Mesa 9.2.0 (git-60f9b72) gl_vendor: Intel Open Source Technology Center gl_extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_filter_anisotropic GL_EXT_texture_compression_dxt1 GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_npot GL_OES_EGL_image GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_NV_fbo_color_attachments GL_OES_vertex_array_object GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_EXT_map_buffer_range GL_OES_depth_texture_cube_map GL_EXT_color_buffer_float stamp: 20130531100117 Zero epsilon: 0.000122, RGBA epsilon: ( 0.004044, 0.004044, 0.004044, 0.004044) instanced_arrays: Start GTF: ../../../src/mesa/main/varray.c:1168: _mesa_primitive_restart_index: Assertion `!"_mesa_primitive_restart_index: Invalid index buffer type."' failed. Aborted (core dumped) bt #0 0x0000003cc98362a5 in raise () from /lib64/libc.so.6 #1 0x0000003cc9837bbb in abort () from /lib64/libc.so.6 #2 0x0000003cc982eebe in __assert_fail_base () from /lib64/libc.so.6 #3 0x0000003cc982ef62 in __assert_fail () from /lib64/libc.so.6 #4 0x00007ffff5e411c9 in _mesa_primitive_restart_index (ctx=<optimized out>, ib_type=<optimized out>) at ../../../src/mesa/main/varray.c:1168 #5 0x00007ffff636a800 in haswell_upload_cut_index (brw=0xef7fa0) at brw_primitive_restart.c:199 #6 0x00007ffff63735a2 in brw_upload_state (brw=0xef7fa0) at brw_state_upload.c:506 #7 0x00007ffff633248f in brw_try_draw_prims (max_index=15787872, min_index=4294957160, ib=<optimized out>, nr_prims=<optimized out>, prim=0x7fffffffd850, arrays=<optimized out>, ctx=0xef7fa0) at brw_draw.c:446 #8 brw_draw_prims (ctx=0xef7fa0, prim=0x7fffffffd850, nr_prims=<optimized out>, ib=<optimized out>, index_bounds_valid=<optimized out>, min_index=0, max_index=3, tfb_vertcount=0x0) at brw_draw.c:531 #9 0x00007ffff5e63199 in vbo_draw_arrays (ctx=0xef7fa0, mode=5, start=0, count=<optimized out>, numInstances=2, baseInstance=<optimized out>) at ../../../src/mesa/vbo/vbo_exec_array.c:624 #10 0x000000000052ebde in GTFGL3DrawApply (p=0x7fffffffdb88) at ./Source/GL3Tests/GTFGL3Draw.c:385 #11 0x000000000056794c in TestApply (p=0x7fffffffdab0) at ./Source/GL3Tests/GTFGL3Tester.c:49 #12 0x0000000000567b5b in GTFGL3TesterApply (p=0x7fffffffdab0) at ./Source/GL3Tests/GTFGL3Tester.c:122 #13 0x00000000005e3229 in doTest (test=0x7fffffffdab0) at ./Source/GL3Tests/GTFTestInstancedArrays.c:371 #14 0x00000000005e32c0 in GTFTestGL3_instanced_arrays_divisor_Apply (parent=0x1071b60) at ./Source/GL3Tests/GTFTestInstancedArrays.c:387 #15 0x00000000005226e4 in GTFTestGL3VirtualCallApply (parent=0x1071b60, result=0x7fffffffdcff "\001\340\025\a\001") at ./Source/GL3Tests/GTFTestGL3VirtualCall.c:105 #16 0x000000000051b053 in GTFTestGL3Apply (pTestGL3Test=0x1071b60) at ./Source/GL3Tests/GTFTestGL3.c:486 #17 0x000000000042457f in GTFTestEncapsulateApply (pTestEncapsulate=0xffc960) at ./Source/GTFTest.c:278 #18 0x000000000042c25a in GTFRunTest (run_filename=0xedf9c0 "/GFX/Test/Ogles3conform/ogles3conform/GTF_ES/glsl/GTF/GL3Tests/instanced_arrays/instanced_arrays_divisor.test") at ./Source/GTFTestDriver.c:317 #19 0x000000000042d0d1 in GTFRunTestDriver ( run_filename=0xedf9c0 "/GFX/Test/Ogles3conform/ogles3conform/GTF_ES/glsl/GTF/GL3Tests/instanced_arrays/instanced_arrays_divisor.test") at ./Source/GTFTestDriver.c:679 #20 0x00000000004150ac in GTFRun () at ./Source/GTFMain.c:104 #21 0x000000000044a245 in GTFInitEGL (run=0x415050 <GTFRun>, argc=4, argv=0x7fffffffe158, argcx=0, argvx=0x0) at ./Source/GTFInitEGL.c:390 #22 0x0000000000415f54 in GTFMain (argc=4, argv=0x7fffffffe158) at ./Source/GTFMain.c:323 #23 0x000000000040de92 in main (argc=4, argv=0x7fffffffe158) at ./Source/main.c:197 Reproduce steps: ---------------- 1. xinit 2. ./GTF -width=64 -height=64 -run=GL3Tests/instanced_arrays/instanced_arrays_divisor.test
Yeah, I noticed this just after I pushed the patch...sadly. I was waiting for someone to review the patch, but I gave up on that and pushed it anyway: commit 4405ff4055685841c9d9545da52c7edc8708b14b Author: Kenneth Graunke <kenneth@whitecape.org> Date: Wed May 29 18:51:29 2013 -0700 i965: Fix haswell_upload_cut_index when there's no index buffer. brw->ib.type is reset to -1 at the start of each batch. If there's no index buffer, it won't get updated to a sensible value, resulting in _mesa_primitive_restart_index's "Invalid index buffer type" assertion tripping. Fixes a regression since 7c87a3b5dac118697a9b67caa7b6d5cab60f316d. NOTE: This is a candidate for the 9.1 branch (and should be squashed). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65195 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Verified. Fixed.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.