Bug 94199

Summary: Shader abort/crash
Product: Mesa Reporter: Marc-Andre Lureau <marcandre.lureau>
Component: Drivers/DRI/i965Assignee: Matt Turner <mattst88>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Marc-Andre Lureau 2016-02-17 23:21:01 UTC
The following snippet crashes with mesa

shader_runner: glsl/ir_validate.cpp:565: virtual ir_visitor_status {anonymous}::ir_validate::visit_leave(ir_expression*): Assertion `ir->operands[0]->type == glsl_type::uint_type' failed.

#4  0x00007ffff08b0dd4 in (anonymous namespace)::ir_validate::visit_leave (this=<optimized out>, ir=<optimized out>) at glsl/ir_validate.cpp:565
#5  0x00007ffff08ac206 in ir_assignment::accept (this=0x790fa0, v=0x7fffffffd4b0) at glsl/ir_hv_accept.cpp:304
#6  0x00007ffff08abc46 in visit_list_elements (v=v@entry=0x7fffffffd4b0, l=l@entry=0x7f9398, statement_list=statement_list@entry=true) at glsl/ir_hv_accept.cpp:55
#7  0x00007ffff08abda7 in ir_function_signature::accept (this=0x7f9350, v=0x7fffffffd4b0) at glsl/ir_hv_accept.cpp:115
#8  0x00007ffff08abc46 in visit_list_elements (v=v@entry=0x7fffffffd4b0, l=l@entry=0x78af78, statement_list=statement_list@entry=false) at glsl/ir_hv_accept.cpp:55
#9  0x00007ffff08abe1e in ir_function::accept (this=0x78af50, v=0x7fffffffd4b0) at glsl/ir_hv_accept.cpp:127
#10 0x00007ffff08abc46 in visit_list_elements (v=v@entry=0x7fffffffd4b0, l=l@entry=0x788c90, statement_list=statement_list@entry=true) at glsl/ir_hv_accept.cpp:55
#11 0x00007ffff08abaaa in ir_hierarchical_visitor::run (this=this@entry=0x7fffffffd4b0, instructions=instructions@entry=0x788c90) at glsl/ir_hierarchical_visitor.cpp:364
#12 0x00007ffff08b1e3b in validate_ir_tree (instructions=0x788c90) at glsl/ir_validate.cpp:912
#13 0x00007ffff0968544 in process_glsl_ir (shader_prog=0x794930, shader=0x793dd0, shader=0x793dd0, brw=0x7ffff7f71040, stage=MESA_SHADER_VERTEX) at brw_link.cpp:165
#14 brw_link_shader (ctx=0x7ffff7f71040, shProg=0x794930) at brw_link.cpp:205
#15 0x00007ffff0804892 in _mesa_glsl_link_shader (ctx=0x7ffff7f71040, prog=0x794930) at program/ir_to_mesa.cpp:3040
#16 0x00007ffff069c4ff in link_program (ctx=0x7ffff7f71040, program=3) at main/shaderapi.c:1048


[require]
GLSL >= 1.40

[vertex shader]
#version 140
in vec4 in_0;
smooth out vec4 ex_g9;
vec4 temp0[1];
uniform vsubo2 { vec4 vsubo2contents[1]; };
void main(void)
{
temp0[0].x = vsubo2contents[0].x;
temp0[0].y = vsubo2contents[0].y;
ex_g9 = vec4(( temp0[0] ));
}

[fragment shader]
#version 140
smooth in vec4 ex_g9;
out vec4 fsout_c0;
void main(void)
{
fsout_c0 = vec4(((ex_g9)));
}

[test]
Comment 1 Matt Turner 2016-02-18 00:35:14 UTC
I strongly suspect the vectorizer is combining the ubo_loads. I'll investigate.
Comment 2 Matt Turner 2016-02-22 17:40:11 UTC
I've sent a patch which fixes this:

[PATCH] glsl: Consider ubo_load to be a horizontal operation.

It should be upstream in a few days, and I've tagged it for stable.
Comment 3 Matt Turner 2016-02-25 18:53:17 UTC
Fixed by

commit 3da789f1e9e3eb027bcfdb9d9170e7b37160b5b9
Author: Matt Turner <mattst88@gmail.com>
Date:   Mon Feb 22 09:36:48 2016 -0800

    glsl: Consider ubo_load to be a horizontal operation.

Thanks for the report!

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.