Bug 61828 - [softpipe] tgsi/tgsi_exec.c:1936:exec_tex: Assertion `modifier != 1' failed.
Summary: [softpipe] tgsi/tgsi_exec.c:1936:exec_tex: Assertion `modifier != 1' failed.
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium critical
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: have-backtrace, regression
Depends on:
Blocks:
 
Reported: 2013-03-05 02:43 UTC by Vinson Lee
Modified: 2013-03-05 19:14 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2013-03-05 02:43:19 UTC
mesa: e21460b4d515a7ea41e2694c89b5d94b0bd84d54 (master)

Run piglit array-texture test on softpipe.

$ ./bin/array-texture -auto
Mesa warning: failed to remap glClampColorARB
Mesa warning: failed to remap glTexBufferARB
Mesa warning: failed to remap glFramebufferTextureARB
Mesa warning: failed to remap glVertexAttribDivisorARB
Mesa warning: failed to remap glProgramParameteriARB
tgsi/tgsi_exec.c:1936:exec_tex: Assertion `modifier != 1' failed.
Trace/breakpoint trap (core dumped)

(gdb) bt
#0  0x00007f28bca0d722 in _debug_assert_fail (expr=0x7f28bcc2b24e "modifier != 1", file=0x7f28bcc2afc4 "tgsi/tgsi_exec.c", line=1936, function=0x7f28bcc2b93d "exec_tex")
    at util/u_debug.c:278
#1  0x00007f28bc9ee42c in exec_tex (mach=0x7f28b29e3010, inst=0x28ab2d0, modifier=1, sampler=1) at tgsi/tgsi_exec.c:1936
#2  0x00007f28bc9f55c1 in exec_instruction (mach=0x7f28b29e3010, inst=0x28ab2d0, pc=0x7ffff33b9298) at tgsi/tgsi_exec.c:3862
#3  0x00007f28bc9f7b0f in tgsi_exec_machine_run (mach=0x7f28b29e3010) at tgsi/tgsi_exec.c:4484
#4  0x00007f28bcabe8d6 in exec_run (var=0x28aac90, machine=0x7f28b29e3010, quad=0x2501710) at sp_fs_exec.c:129
#5  0x00007f28bcac6ca8 in shade_quad (qs=0x24355f0, quad=0x2501710) at sp_quad_fs.c:78
#6  0x00007f28bcac6e5c in shade_quads (qs=0x24355f0, quads=0x2503b90, nr=1) at sp_quad_fs.c:131
#7  0x00007f28bcad0237 in flush_spans (setup=0x2501690) at sp_setup.c:250
#8  0x00007f28bcad161b in subtriangle (setup=0x2501690, eleft=0x25016e8, eright=0x25016b8, lines=100) at sp_setup.c:759
#9  0x00007f28bcad18d3 in sp_setup_tri (setup=0x2501690, v0=0x2674f10, v1=0x2674f30, v2=0x2674ef0) at sp_setup.c:848
#10 0x00007f28bcac2428 in sp_vbuf_draw_arrays (vbr=0x2501600, start=0, nr=4) at sp_prim_vbuf.c:577
#11 0x00007f28bc9be148 in draw_pt_emit_linear (emit=0x24fe3f0, vert_info=0x7ffff33b9660, prim_info=0x7ffff33b9710) at draw/draw_pt_emit.c:255
#12 0x00007f28bc9c0888 in emit (emit=0x24fe3f0, vert_info=0x7ffff33b9660, prim_info=0x7ffff33b9710) at draw/draw_pt_fetch_shade_pipeline.c:187
#13 0x00007f28bc9c0c03 in fetch_pipeline_generic (middle=0x24fe2b0, fetch_info=0x0, prim_info=0x7ffff33b9710) at draw/draw_pt_fetch_shade_pipeline.c:306
#14 0x00007f28bc9c0d31 in fetch_pipeline_linear_run (middle=0x24fe2b0, start=0, count=4, prim_flags=0) at draw/draw_pt_fetch_shade_pipeline.c:364
#15 0x00007f28bc9c861f in vsplit_segment_simple_linear (vsplit=0x24fb680, flags=0, istart=0, icount=4) at draw/draw_pt_vsplit_tmp.h:235
#16 0x00007f28bc9c8924 in vsplit_run_linear (frontend=0x24fb680, start=0, count=4) at draw/draw_split_tmp.h:61
#17 0x00007f28bc9bcaf1 in draw_pt_arrays (draw=0x24f1170, prim=9, start=0, count=4) at draw/draw_pt.c:148
#18 0x00007f28bc9bd75a in draw_vbo (draw=0x24f1170, info=0x7ffff33b9950) at draw/draw_pt.c:539
#19 0x00007f28bcac08a4 in softpipe_draw_vbo (pipe=0x2436020, info=0x7ffff33b9950) at sp_draw_arrays.c:109
#20 0x00007f28bc9a6f2d in cso_draw_vbo (cso=0x2585b60, info=0x7ffff33b9950) at cso_cache/cso_context.c:1347
#21 0x00007f28bc8bbe90 in st_draw_vbo (ctx=0x25253f0, prims=0x2570bac, nr_prims=1, ib=0x0, index_bounds_valid=1 '\001', min_index=0, max_index=3, tfb_vertcount=0x0)
    at ../../src/mesa/state_tracker/st_draw.c:287
#22 0x00007f28bc87d79b in vbo_exec_vtx_flush (exec=0x2570318, keepUnmapped=1 '\001') at ../../src/mesa/vbo/vbo_exec_draw.c:400
#23 0x00007f28bc876966 in vbo_exec_FlushVertices_internal (exec=0x2570318, unmap=1 '\001') at ../../src/mesa/vbo/vbo_exec_api.c:556
#24 0x00007f28bc878ebe in vbo_exec_FlushVertices (ctx=0x25253f0, flags=1) at ../../src/mesa/vbo/vbo_exec_api.c:1256
#25 0x00007f28bc7fa510 in _mesa_ReadnPixelsARB (x=50, y=150, width=1, height=1, format=6407, type=5126, bufSize=2147483647, pixels=0x7ffff33b9b70)
    at ../../src/mesa/main/readpix.c:735
#26 0x00007f28bc7faac5 in _mesa_ReadPixels (x=50, y=150, width=1, height=1, format=6407, type=5126, pixels=0x7ffff33b9b70) at ../../src/mesa/main/readpix.c:869
#27 0x00007f28c0462cd8 in piglit_probe_pixel_rgb (x=50, y=150, expected=0x6030a0) at piglit/tests/util/piglit-util-gl.c:414
#28 0x0000000000401861 in test_2d_array_texture (tex=1) at piglit/tests/texturing/array-texture.c:196
#29 0x0000000000401c6d in piglit_display () at piglit/tests/texturing/array-texture.c:299
#30 0x00007f28c03fd418 in display () at piglit/tests/util/piglit-framework-gl/piglit_glut_framework.c:60
#31 0x00007f28bfdb2137 in fghRedrawWindow (window=0x2431e60) at freeglut_main.c:210
#32 fghcbDisplayWindow (window=0x2431e60, enumerator=0x7ffff33b9cb0) at freeglut_main.c:227
#33 0x00007f28bfdb5889 in fgEnumWindows (enumCallback=0x7f28bfdb20d0 <fghcbDisplayWindow>, enumerator=0x7ffff33b9cb0) at freeglut_structure.c:394
#34 0x00007f28bfdb25fa in fghDisplayAll () at freeglut_main.c:249
#35 glutMainLoopEvent () at freeglut_main.c:1450
#36 0x00007f28bfdb2f05 in glutMainLoop () at freeglut_main.c:1498
#37 0x00007f28c03fd5f0 in run_test (gl_fw=0x7f28c06d0bc0, argc=1, argv=0x7ffff33ba078)
    at piglit/tests/util/piglit-framework-gl/piglit_glut_framework.c:127
#38 0x00007f28c03fb736 in piglit_gl_test_run (argc=1, argv=0x7ffff33ba078, config=0x7ffff33b9f60) at piglit/tests/util/piglit-framework-gl.c:127
#39 0x000000000040123e in main (argc=2, argv=0x7ffff33ba078) at piglit/tests/texturing/array-texture.c:42
(gdb) frame 1
#1  0x00007f28bc9ee42c in exec_tex (mach=0x7f28b29e3010, inst=0x28ab2d0, modifier=1, sampler=1) at tgsi/tgsi_exec.c:1936
1936	      assert(modifier != TEX_MODIFIER_PROJECTED);
(gdb) print modifier
$1 = 1

6ace2e41da7dded630d932d03bacb7e14a93d47a is the first bad commit
commit 6ace2e41da7dded630d932d03bacb7e14a93d47a
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 1 23:27:41 2013 +0100

    tgsi: add texel offsets and derivatives to sampler interface
    
    Something I never got around to implement, but this is the tgsi execution
    side for implementing texel offsets (for ordinary texturing) and explicit
    derivatives for sampling (though I guess the ordering of the components
    for the derivs parameters is debatable).
    There is certainly a runtime cost associated with this.
    Unless there are different interfaces used depending on the "complexity"
    of the texture instructions, this is impossible to avoid.
    Offsets are always active (I think checking if they are active or not is
    probably not worth it since it should mostly be an add), whereas the
    sampler_control is extended for explicit derivatives.
    For now softpipe (the only user of this) just drops all those new values
    on the floor (which is the part I never implemented...).
    
    Additionally this also fixes (discovered by accident) inconsistent
    projective divide for the comparison coord - the code did do the
    projection for shadow2d targets, but not shadow1d ones. This also
    drops checking for projection modifier on array targets, since they
    aren't possible in any extension I know of (hence we don't actually
    know if the array layer should also be divided or not).
    
    Reviewed-by: Brian Paul <brianp@vmware.com>

:040000 040000 66c6083ba0c2499337164c72d7d0a2cecc8c751f 1b24975b2a429c4c18c172ed2d5da13f83a03934 M	src
bisect run success
Comment 1 Roland Scheidegger 2013-03-05 03:11:32 UTC
Whoa I thought noone ever defined TXP for array textures. But it turns out I was wrong since apparently GL_MESA_texture_array supports array textures even with fixed function hence TXP. Sick. (The spec does not actually seem to define if the array coord should be projected or not, but I guess from previous softpipe behavior not. I don't think any real hw actually implements this correctly however.)
Well I will just kill those assertions again. I am quite sure we can't really handle that correctly everywhere however anyway (for instance the glsl-to-tgsi code lowering texture opcodes with lod and projection would do the projective divide itself on all coords but then again probably noone cares).
Comment 2 Roland Scheidegger 2013-03-05 19:14:09 UTC
Fixed by b9eb573600ff6d654bbc27d1fc5e935e5a74b071.
Though either llvmpipe or softpipe handle TXP wrong...


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.