Bug 47630 - sp_texture.c:322:softpipe_get_transfer: Assertion `level <= resource->last_level' failed.
Summary: sp_texture.c:322:softpipe_get_transfer: Assertion `level <= resource->last_le...
Status: RESOLVED NOTABUG
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:
Depends on:
Blocks:
 
Reported: 2012-03-20 22:37 UTC by Vinson Lee
Modified: 2012-03-21 11:15 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2012-03-20 22:37:18 UTC
mesa: b4082f492b4b55df4c636445e47b97d1f1e4b5b2 (master)

Run piglit fs-texelFetch-isampler1D test on softpipe.

$ ./bin/texelFetch fs isampler1D 
Probe at (6,5)
  Expected: 0.015625 0.000000 0.000000 1.000000
  Observed: 0.000000 0.000000 0.000000 1.000000
sp_texture.c:322:softpipe_get_transfer: Assertion `level <= resource->last_level' failed.
Trace/breakpoint trap (core dumped)


(gdb) bt
#0  _debug_assert_fail (expr=<optimized out>, file=<optimized out>, 
    line=<optimized out>, function=<optimized out>) at util/u_debug.c:281
#1  0x00007ff8daf1a4ef in softpipe_get_transfer (pipe=0x151d7c0, 
    resource=0x1720a00, level=1, usage=1025, box=0x7fff2002c230)
    at sp_texture.c:322
#2  0x00007ff8daf33728 in pipe_get_transfer (h=<optimized out>, 
    w=<optimized out>, y=0, x=0, usage=1025, layer=<optimized out>, 
    level=<optimized out>, resource=<optimized out>, context=<optimized out>)
    at ../../../../src/gallium/auxiliary/util/u_inlines.h:411
#3  sp_find_cached_tile_tex (tc=0x7ff8da278010, addr=...)
    at sp_tex_tile_cache.c:279
#4  0x00007ff8daf31137 in sp_get_cached_tile_tex (addr=..., tc=<optimized out>)
    at sp_tex_tile_cache.h:160
#5  get_texel_2d_no_border (y=0, x=0, addr=..., samp=<optimized out>)
    at sp_tex_sample.c:660
#6  get_texel_2d (y=0, x=<optimized out>, addr=..., samp=0x18f0630)
    at sp_tex_sample.c:678
#7  sample_get_texels (tgsi_sampler=0x18f0630, v_i=<optimized out>, 
    v_j=<optimized out>, v_k=0x0, lod=<optimized out>, 
    offset=0x7fff2002c440 "", rgba=0x7fff2002c3c0) at sp_tex_sample.c:2661
#8  0x00007ff8db120c2f in exec_txf (mach=0x15dd430, inst=0x17c52e0)
    at tgsi/tgsi_exec.c:2048
#9  0x00007ff8db123371 in exec_instruction (mach=0x15dd430, inst=0x17c52e0, 
    pc=0x7fff2002c95c) at tgsi/tgsi_exec.c:3931
#10 0x00007ff8db1267f3 in tgsi_exec_machine_run (mach=0x15dd430)
    at tgsi/tgsi_exec.c:4288
#11 0x00007ff8daf34c18 in exec_run (var=0x1864450, machine=<optimized out>, 
    quad=0x1628ad0) at sp_fs_exec.c:133
#12 0x00007ff8daf1f9aa in shade_quad (quad=<optimized out>, qs=<optimized out>)
    at sp_quad_fs.c:78
#13 shade_quads (qs=0x152c970, quads=0x7fff2002cad8, nr=1) at sp_quad_fs.c:131
#14 0x00007ff8daf25ce3 in clip_emit_quad (quad=0x1628ad0, setup=0x1628a50)
    at sp_setup.c:166
#15 sp_setup_point (setup=0x1628a50, v0=<optimized out>) at sp_setup.c:1275
#16 0x00007ff8daf1bf68 in sp_vbuf_draw_arrays (vbr=<optimized out>, 
    start=<optimized out>, nr=32) at sp_prim_vbuf.c:370
#17 0x00007ff8db18c554 in draw_pt_emit_linear (emit=<optimized out>, 
    vert_info=<optimized out>, prim_info=0x7fff2002cce0)
    at draw/draw_pt_emit.c:255
#18 0x00007ff8db108bc8 in emit (prim_info=0x7fff2002cce0, 
    vert_info=0x7fff2002cc50, emit=<optimized out>)
    at draw/draw_pt_fetch_shade_pipeline.c:169
#19 fetch_pipeline_generic (middle=0x15201e0, fetch_info=0x0, 
    prim_info=0x7fff2002cce0) at draw/draw_pt_fetch_shade_pipeline.c:287
#20 0x00007ff8db108d04 in fetch_pipeline_linear_run (middle=<optimized out>, 
    start=<optimized out>, count=32, prim_flags=<optimized out>)
    at draw/draw_pt_fetch_shade_pipeline.c:346
#21 0x00007ff8db10c6a4 in vsplit_run_linear (frontend=0x15f8d90, start=65, 
    count=32) at draw/draw_split_tmp.h:61
#22 0x00007ff8db107068 in draw_pt_arrays (draw=0x15f2410, prim=0, start=65, 
    count=32) at draw/draw_pt.c:142
#23 0x00007ff8db107433 in draw_vbo (draw=0x15f2410, info=0x7fff2002cee0)
    at draw/draw_pt.c:534
#24 0x00007ff8daf1bcc9 in softpipe_draw_vbo (pipe=0x151d7c0, 
    info=0x7fff2002cee0) at sp_draw_arrays.c:99
#25 0x00007ff8dafde19b in st_draw_vbo (ctx=0x162e320, arrays=<optimized out>, 
    prims=<optimized out>, nr_prims=1, ib=0x0, 
    index_bounds_valid=<optimized out>, min_index=65, max_index=96, 
    tfb_vertcount=0x0) at state_tracker/st_draw.c:1110
#26 0x00007ff8db0b8947 in vbo_draw_arrays (ctx=0x162e320, 
    mode=<optimized out>, start=65, count=<optimized out>, numInstances=1)
    at vbo/vbo_exec_array.c:619
#27 0x000000000042b0d8 in piglit_display ()
    at piglit/tests/texturing/shaders/texelFetch.c:137
#28 0x000000000042d0cd in display ()
    at piglit/tests/util/piglit-framework.c:56
#29 0x00007ff8ddbdb220 in fghRedrawWindow (window=0x1519460)
    at freeglut_main.c:210
#30 fghcbDisplayWindow (window=0x1519460, enumerator=0x7fff2002d150)
    at freeglut_main.c:227
#31 0x00007ff8ddbde939 in fgEnumWindows (
    enumCallback=0x7ff8ddbdb120 <fghcbDisplayWindow>, 
    enumerator=0x7fff2002d150) at freeglut_structure.c:394
#32 0x00007ff8ddbdb65a in fghDisplayAll () at freeglut_main.c:249
#33 glutMainLoopEvent () at freeglut_main.c:1450
#34 0x00007ff8ddbdbf0e in glutMainLoop () at freeglut_main.c:1498
#35 0x000000000042d83f in main (argc=3, argv=0x7fff2002d4a8)
    at piglit/tests/util/piglit-framework.c:304
(gdb) frame 1
#1  0x00007ff8daf1a4ef in softpipe_get_transfer (pipe=0x151d7c0, 
    resource=0x1720a00, level=1, usage=1025, box=0x7fff2002c230)
    at sp_texture.c:322
322	   assert(level <= resource->last_level);
(gdb) print level
$1 = 1
(gdb) print resource->last_level
$2 = 0
Comment 1 Vinson Lee 2012-03-20 23:16:26 UTC
73fd269d2f5aa2a0b9bc03ef904b81e263e3cc37 is the first bad commit
commit 73fd269d2f5aa2a0b9bc03ef904b81e263e3cc37
Author: Brian Paul <brianp@vmware.com>
Date:   Sat Mar 17 16:30:03 2012 -0600

    mesa: add integer texture completeness check
    
    Per the spec, only nearest filtering is supported for integer textures.
    Otherwise, the texture is incomplete.
    
    Reviewed-by: José Fonseca <jfonseca@vmware.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
Comment 2 Kenneth Graunke 2012-03-20 23:25:57 UTC
It turns out that Brian's commit is correct.  I was using GL_LINEAR and GL_LINEAR_MIPMAP_LINEAR filtering on integer textures, which is illegal according to both the GL_EXT_texture_integer and OpenGL 3.0 specs.

I sent a patch to the piglit list to fix this earlier today.  I'll push it soon if there are no objections.
Comment 3 Christoph Bumiller 2012-03-21 03:32:26 UTC
If there's an assertion failure there's still a bug, isn't there ? Invalid user input is no excuse for crashing.
Comment 4 Brian Paul 2012-03-21 06:23:51 UTC
Vinson, I'm not seeing the failed assertion.  The test fails, but I believe that's because of the filtering issue.  Please retest after Ken's piglit patch and see what happens.
Comment 5 Kenneth Graunke 2012-03-21 11:15:09 UTC
(In reply to comment #3)
> If there's an assertion failure there's still a bug, isn't there ? Invalid user
> input is no excuse for crashing.

Good point.  That means somebody is not filtering out uses of incomplete textures.  Feel free to reopen; you'll need to revert my piglit patch ("Use nearest filtering in the texelFetch() and textureSize() tests.").


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.