Bug 38729 - [softpipe] sp_quad_depth_test.c:215:convert_quad_stencil: Assertion `0' failed.
Summary: [softpipe] sp_quad_depth_test.c:215:convert_quad_stencil: Assertion `0' failed.
Status: CLOSED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: medium critical
Assignee: Brian Paul
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-27 20:21 UTC by Vinson Lee
Modified: 2011-07-08 08:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2011-06-27 20:21:35 UTC
mesa: c191c87c81deafd3c8e2ea48251c8e0a1cc65253 (master)

Run piglit "EXT_framebuffer_object fbo-stencil GL_STENCIL_INDEX" test.

$ ./bin/fbo-stencil -auto drawpixels GL_STENCIL_INDEX1
Testing GL_STENCIL_INDEX1.
Testing glDrawPixels(stencil).
sp_quad_depth_test.c:215:convert_quad_stencil: Assertion `0' failed.


(gdb) bt
#0  0x003f324c in _debug_assert_fail (expr=0x44295d "0", file=0x442948 "sp_quad_depth_test.c", line=215, function=0x442ad8 "convert_quad_stencil") at util/u_debug.c:282
#1  0x001717a7 in convert_quad_stencil (data=0xbf828c38, quad=0x8bf1528) at sp_quad_depth_test.c:215
#2  0x00172f94 in depth_test_quads_fallback (qs=0x8bb8cd8, quads=0x8bf38e8, nr=1) at sp_quad_depth_test.c:762
#3  0x0017489a in choose_depth_test (qs=0x8bb8cd8, quads=0x8bf38e8, nr=1) at sp_quad_depth_test.c:908
#4  0x00174b9b in shade_quads (qs=0x8bb84a8, quads=0x8bf38e8, nr=1) at sp_quad_fs.c:131
#5  0x0017b079 in flush_spans (setup=0x8bf14c0) at sp_setup.c:243
#6  0x0017c0e3 in subtriangle (setup=0x8bf14c0, eleft=0x8bf14d4, eright=0x8bf1504, lines=123) at sp_setup.c:751
#7  0x0017c35d in sp_setup_tri (setup=0x8bf14c0, v0=0x8cb7010, v1=0x8cb7040, v2=0x8cb70a0) at sp_setup.c:846
#8  0x001708c7 in sp_vbuf_draw_arrays (vbr=0x8bf1468, start=0, nr=4) at sp_prim_vbuf.c:474
#9  0x0042b8f8 in draw_pt_emit_linear (emit=0x8bc2620, vert_info=0xbf828f48, prim_info=0xbf828fac) at draw/draw_pt_emit.c:265
#10 0x003c774e in emit (emit=0x8bc2620, vert_info=0xbf828f48, prim_info=0xbf828fac) at draw/draw_pt_fetch_shade_pipeline.c:168
#11 0x003c7a62 in fetch_pipeline_generic (middle=0x8bc2570, fetch_info=0x0, prim_info=0xbf828fac) at draw/draw_pt_fetch_shade_pipeline.c:286
#12 0x003c7b5a in fetch_pipeline_linear_run (middle=0x8bc2570, start=0, count=4, prim_flags=0) at draw/draw_pt_fetch_shade_pipeline.c:345
#13 0x003cc47a in vsplit_segment_simple_linear (vsplit=0x8bbfa88, flags=0, istart=0, icount=4) at draw/draw_pt_vsplit_tmp.h:237
#14 0x003cc7c2 in vsplit_run_linear (frontend=0x8bbfa88, start=0, count=4) at draw/draw_split_tmp.h:61
#15 0x003c52ff in draw_pt_arrays (draw=0x8bb8d20, prim=7, start=0, count=4) at draw/draw_pt.c:113
#16 0x003c5e39 in draw_vbo (draw=0x8bb8d20, info=0xbf829174) at draw/draw_pt.c:491
#17 0x0016f2c8 in softpipe_draw_vbo (pipe=0x8afeef8, info=0xbf829174) at sp_draw_arrays.c:143
#18 0x003f7ccc in util_draw_arrays (pipe=0x8afeef8, mode=7, start=0, count=4) at ./util/u_draw.h:63
#19 0x003f7da3 in util_draw_vertex_buffer (pipe=0x8afeef8, cso=0x8c4e148, vbuf=0x8cb51f8, offset=0, prim_type=7, num_verts=4, num_attribs=3) at util/u_draw_quad.c:69
#20 0x0037a88b in draw_quad (ctx=0x8bf78e0, x0=0, y0=0, z=-1, x1=123, y1=123, color=0x8bf89e8, invertTex=1 '\001', maxXcoord=1, maxYcoord=1)
    at state_tracker/st_cb_drawpixels.c:583
#21 0x0037aeaf in draw_textured_quad (ctx=0x8bf78e0, x=0, y=0, z=-1, width=123, height=123, zoomX=1, zoomY=1, sv=0xbf82945c, num_sampler_view=2, driver_vp=0x8c2abf8, 
    driver_fp=0x8c2cef8, color=0x8bf89e8, invertTex=1 '\001', write_depth=0 '\000', write_stencil=1 '\001') at state_tracker/st_cb_drawpixels.c:734
#22 0x0037bd5e in st_DrawPixels (ctx=0x8bf78e0, x=0, y=0, width=123, height=123, format=6401, type=5121, unpack=0x8c06280, pixels=0xbf829553)
    at state_tracker/st_cb_drawpixels.c:1055
#23 0x0031333e in _mesa_DrawPixels (width=123, height=123, format=6401, type=5121, pixels=0xbf829553) at main/drawpix.c:109
#24 0x0806a988 in test_drawpixels () at piglit/tests/fbo/fbo-stencil.c:199
#25 0x0806ad7d in piglit_display () at piglit/tests/fbo/fbo-stencil.c:284
#26 0x0806b9b3 in display () at piglit/tests/util/piglit-framework.c:48
#27 0x005e4820 in fghRedrawWindow (window=0x8afdfd8, enumerator=0xbf82d188) at freeglut_main.c:210
#28 fghcbDisplayWindow (window=0x8afdfd8, enumerator=0xbf82d188) at freeglut_main.c:227
#29 0x005e8660 in fgEnumWindows (enumCallback=0x5e4790 <fghcbDisplayWindow>, enumerator=0xbf82d188) at freeglut_structure.c:394
#30 0x005e4cdb in fghDisplayAll () at freeglut_main.c:249
#31 glutMainLoopEvent () at freeglut_main.c:1450
#32 0x005e5605 in glutMainLoop () at freeglut_main.c:1498
#33 0x0806bb57 in main (argc=3, argv=0xbf82d414) at piglit/tests/util/piglit-framework.c:116
(gdb) frame 1
#1  0x001717a7 in convert_quad_stencil (data=0xbf828c38, quad=0x8bf1528) at sp_quad_depth_test.c:215
215	      assert(0);
(gdb) print *data
$1 = {ps = 0x8c2b298, format = PIPE_FORMAT_S8_USCALED, bzzzz = {0, 0, 0, 0}, qzzzz = {2, 2, 2, 4294967295}, stencilVals = "\376\376\376\376", 
  use_shader_stencil_refs = 1 '\001', shader_stencil_refs = "\000\000\000\260", tile = 0x8cb72c0}


mesa/src/gallium/drivers/softpipe/sp_quad_depth_test.c
   191  /**
   192   * Compute the depth_data::shader_stencil_refs[] values from the float fragment stencil values.
   193   */
   194  static void
   195  convert_quad_stencil( struct depth_data *data, 
   196                        const struct quad_header *quad )
   197  {
   198     unsigned j;
   199  
   200     data->use_shader_stencil_refs = TRUE;
   201     /* Copy quads stencil values
   202      */
   203     switch (data->format) {
   204     case PIPE_FORMAT_Z24X8_UNORM:
   205     case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
   206     case PIPE_FORMAT_X8Z24_UNORM:
   207     case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
   208        {
   209           for (j = 0; j < QUAD_SIZE; j++) {
   210              data->shader_stencil_refs[j] = ((unsigned)(quad->output.stencil[j]));
   211           }
   212        }
   213        break;
   214     default:
   215        assert(0);
   216     }
   217  }
Comment 1 Brian Paul 2011-07-06 14:16:32 UTC
Fixed as of commit b786db06540472beda9cedd18937d6e12855b3eb

Note that I also fixed a few issues in the piglit test too so you'll want to grab the latest piglit sources and rebuild.
Comment 2 Vinson Lee 2011-07-08 08:48:18 UTC
mesa: fc98444bd58960e6cab28423365923bc7e7af3e1 (master)

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.