Bug 42835 - [llvmpipe] src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c:2577:lp_build_system_values_array: Assertion `0 && "unexpected semantic in build_system_values_array()"' failed.
Summary: [llvmpipe] src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c:2577:lp_build_syst...
Status: CLOSED DUPLICATE of bug 42834
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: x86 (IA32) All
: medium critical
Assignee: Eric Anholt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-11 14:46 UTC by Vinson Lee
Modified: 2011-11-16 15:35 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2011-11-11 14:46:03 UTC
mesa: bf8ad170c5af58fe9f49b3ce0f92c4eda9e5d845 (master)

Run piglit draw-instanced on llvmpipe.

$ ./bin/draw-instanced 
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c:2577:lp_build_system_values_array: Assertion `0 && "unexpected semantic in build_system_values_array()"' failed.
Trace/breakpoint trap (core dumped)

(gdb) bt
#0  0x00007fe2f3359837 in _debug_assert_fail (
    expr=0x7fe2f3b54850 "0 && \"unexpected semantic in build_system_values_array()\"", 
    file=0x7fe2f3b53ff0 "src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c", line=2577, 
    function=0x7fe2f3b54890 "lp_build_system_values_array") at src/gallium/auxiliary/util/u_debug.c:282
#1  0x00007fe2f33d6e5f in lp_build_system_values_array (gallivm=0x1748390, info=0x18e6170, instance_id=0x18fc420, facing=0x0)
    at src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c:2577
#2  0x00007fe2f33db72a in draw_llvm_generate (llvm=0x17a05b0, variant=0x177c770, elts=0 '\000')
    at src/gallium/auxiliary/draw/draw_llvm.c:1274
#3  0x00007fe2f33d8c1c in draw_llvm_create_variant (llvm=0x17a05b0, num_inputs=3, key=0x7fffdd36e890)
    at src/gallium/auxiliary/draw/draw_llvm.c:447
#4  0x00007fe2f33dea13 in llvm_middle_end_prepare (middle=0x17ab530, in_prim=9, opt=3, max_vertices=0x17a8718)
    at src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c:169
#5  0x00007fe2f3337290 in vsplit_prepare (frontend=0x17a86e0, in_prim=9, middle=0x17ab530, opt=3)
    at src/gallium/auxiliary/draw/draw_pt_vsplit.c:175
#6  0x00007fe2f332bef7 in draw_pt_arrays (draw=0x179f530, prim=9, start=0, count=4) at src/gallium/auxiliary/draw/draw_pt.c:111
#7  0x00007fe2f332cb59 in draw_vbo (draw=0x179f530, info=0x7fffdd36ecf0) at src/gallium/auxiliary/draw/draw_pt.c:491
#8  0x00007fe2f303b99b in llvmpipe_draw_vbo (pipe=0x1747490, info=0x7fffdd36ecf0)
    at src/gallium/drivers/llvmpipe/lp_draw_arrays.c:84
#9  0x00007fe2f31bad69 in st_draw_vbo (ctx=0x1801c90, arrays=0x186ee78, prims=0x7fffdd36edb0, nr_prims=1, ib=0x0, 
    index_bounds_valid=1 '\001', min_index=0, max_index=3) at src/mesa/state_tracker/st_draw.c:1014
#10 0x00007fe2f324c6de in vbo_draw_arrays (ctx=0x1801c90, mode=9, start=0, count=4, numInstances=8)
    at src/mesa/vbo/vbo_exec_array.c:650
#11 0x00007fe2f324c983 in vbo_exec_DrawArraysInstanced (mode=9, start=0, count=4, numInstances=8)
    at src/mesa/vbo/vbo_exec_array.c:714
#12 0x000000000042a738 in test_instancing () at piglit/tests/general/draw-instanced.c:110
#13 0x000000000042a7fd in piglit_display () at piglit/tests/general/draw-instanced.c:141
#14 0x000000000042aff1 in display () at piglit/tests/util/piglit-framework.c:56
#15 0x00007fe2f2932e0d in ?? () from /usr/lib/libglut.so.3
#16 0x00007fe2f29369f9 in fgEnumWindows () from /usr/lib/libglut.so.3
#17 0x00007fe2f29332d2 in glutMainLoopEvent () from /usr/lib/libglut.so.3
#18 0x00007fe2f2933c67 in glutMainLoop () from /usr/lib/libglut.so.3
#19 0x000000000042b6d5 in main (argc=1, argv=0x7fffdd36f2d8) at piglit/tests/util/piglit-framework.c:294
(gdb) frame 1
#1  0x00007fe2f33d6e5f in lp_build_system_values_array (gallivm=0x1748390, info=0x18e6170, instance_id=0x18fc420, facing=0x0)
    at src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c:2577
2577	         assert(0 && "unexpected semantic in build_system_values_array()");
(gdb) print info->system_value_semantic_name[i]
$1 = 0 '\000'


src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
  2552  LLVMValueRef
  2553  lp_build_system_values_array(struct gallivm_state *gallivm,
  2554                               const struct tgsi_shader_info *info,
  2555                               LLVMValueRef instance_id,
  2556                               LLVMValueRef facing)
  2557  {
  2558     LLVMValueRef size = lp_build_const_int32(gallivm, 4 * info->num_system_values);
  2559     LLVMTypeRef float_t = LLVMFloatTypeInContext(gallivm->context);
  2560     LLVMValueRef array = lp_build_array_alloca(gallivm, float_t,
  2561                                                size, "sysvals_array");
  2562     unsigned i;
  2563  
  2564     for (i = 0; i < info->num_system_values; i++) {
  2565        LLVMValueRef index = lp_build_const_int32(gallivm, i * 4);
  2566        LLVMValueRef ptr, value = 0;
  2567  
  2568        switch (info->system_value_semantic_name[i]) {
  2569        case TGSI_SEMANTIC_INSTANCEID:
  2570           /* convert instance ID from int to float */
  2571           value = LLVMBuildSIToFP(gallivm->builder, instance_id, float_t,
  2572                                   "sysval_instanceid");
  2573           break;
  2574        case TGSI_SEMANTIC_FACE:
  2575           /* fall-through */
  2576        default:
  2577           assert(0 && "unexpected semantic in build_system_values_array()");
  2578        }
  2579  
  2580        ptr = LLVMBuildGEP(gallivm->builder, array, &index, 1, "");
  2581        LLVMBuildStore(gallivm->builder, value, ptr);
  2582     }
  2583        
  2584     return array;
  2585  }
Comment 1 Vinson Lee 2011-11-11 14:57:26 UTC
919c53e87a1f6f5322bc1f1486bb3e6b954b00d5 is the first bad commit
commit 919c53e87a1f6f5322bc1f1486bb3e6b954b00d5
Author: Eric Anholt <eric@anholt.net>
Date:   Tue Nov 8 14:49:07 2011 -0800

    mesa: Make gl_VertexID be a system value like gl_InstanceID.
    
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

:040000 040000 c94615f2206621e7c5c9e89b79aecc75ade27e0c 13ecaad4c946809375375a62fef590f4dfe540b8 M	src
bisect run success
Comment 2 Jose Fonseca 2011-11-14 06:38:52 UTC
Same as bug 42834.

*** This bug has been marked as a duplicate of bug 42834 ***
Comment 3 Vinson Lee 2011-11-16 15:35:26 UTC
mesa: f4c03da3276bee39802236c21a0b5a31f05e2541 (master)

draw-instanced passes on llvmpipe now.


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.