yuv sampler lowering regression
kmscube -M nv12-1img
is an easier way to reproduce (compared to android CTS, where we spotted this issue)
...
gl_nir_lower_images
shader: MESA_SHADER_FRAGMENT
name: GLSL3
inputs: 1
outputs: 1
uniforms: 0
shared: 0
decl_var shader_in INTERP_MODE_NONE mediump float packed:vTexCoord (VARYING_SLOT_VAR0.y, 0, 0)
decl_var shader_in INTERP_MODE_NONE mediump float packed:vTexCoord@0 (VARYING_SLOT_VAR0.z, 0, 0)
decl_var shader_in INTERP_MODE_NONE mediump float vVaryingColor (VARYING_SLOT_VAR0.x, 0, 0)
decl_var shader_in INTERP_MODE_NONE mediump vec3 vVaryingColor@1 (VARYING_SLOT_VAR0.xyz, 0, 0)
decl_var shader_out INTERP_MODE_NONE mediump vec4 gl_FragColor (FRAG_RESULT_COLOR.xyzw, 0, 0)
decl_function main (0 params)
impl main {
block block_0:
/* preds: */
vec1 32 ssa_0 = deref_var &vVaryingColor@1 (shader_in vec3)
vec3 32 ssa_1 = intrinsic load_deref (ssa_0) (0) /* access=0 */
vec1 16 ssa_2 = f2fmp ssa_1.x
vec2 32 ssa_3 = vec2 ssa_1.y, ssa_1.z
vec4 16 ssa_4 = (float16)tex ssa_3 (coord), 0 (texture), 0 (sampler)
vec1 32 ssa_14 = load_const (0x00000000 /* 0.000000 */)
vec4 16 ssa_15 = (float16)tex ssa_3 (coord), ssa_14 (plane), 0 (texture), 0 (sampler)
vec1 32 ssa_16 = load_const (0x00000001 /* 0.000000 */)
vec4 16 ssa_17 = (float16)tex ssa_3 (coord), ssa_16 (plane), 0 (texture), 0 (sampler)
vec1 16 ssa_18 = mov ssa_15.x
vec1 16 ssa_19 = mov ssa_17.x
vec1 16 ssa_20 = mov ssa_17.y
vec1 32 ssa_21 = load_const (0x3f800000 /* 1.000000 */)
vec1 32 ssa_22 = load_const (0xbf5fcbb7 /* -0.874202 */)
vec1 32 ssa_23 = load_const (0x3f081b62 /* 0.531668 */)
vec1 32 ssa_24 = load_const (0xbf8af5f3 /* -1.085631 */)
vec4 32 ssa_25 = vec4 ssa_22, ssa_23, ssa_24, ssa_21
vec4 16 ssa_26 = f2f16 ssa_25
vec4 32 ssa_27 = load_const (0x3f950a85 /* 1.164384 */, 0x3f950a85 /* 1.164384 */, 0x3f950a85 /* 1.164384 */, 0x00000000 /* 0.000000 */)
vec4 16 ssa_28 = f2f16 ssa_27
vec4 32 ssa_29 = load_const (0x00000000 /* 0.000000 */, 0xbec89511 /* -0.391762 */, 0x40011a55 /* 2.017232 */, 0x00000000 /* 0.000000 */)
vec4 16 ssa_30 = f2f16 ssa_29
vec4 32 ssa_31 = load_const (0x3fcc4a9b /* 1.596027 */, 0xbf501ea6 /* -0.812968 */, 0x00000000 /* 0.000000 */, 0x00000000 /* 0.000000 */)
vec4 16 ssa_32 = f2f16 ssa_31
vec4 16 ssa_33 = ffma ssa_20.xxxx, ssa_32, ssa_26
vec4 16 ssa_34 = ffma ssa_19.xxxx, ssa_30, ssa_33
vec4 16 ssa_35 = ffma ssa_18.xxxx, ssa_28, ssa_34
vec1 16 ssa_5 = fmul ssa_2, ssa_35.x
vec1 16 ssa_6 = fmul ssa_2, ssa_35.y
vec1 16 ssa_7 = fmul ssa_2, ssa_35.z
vec1 32 ssa_8 = f2f32 ssa_5
vec1 32 ssa_9 = f2f32 ssa_6
vec1 32 ssa_10 = f2f32 ssa_7
vec1 32 ssa_11 = f2f32 ssa_35.w
vec1 32 ssa_12 = deref_var &gl_FragColor (shader_out vec4)
vec4 32 ssa_13 = vec4 ssa_8, ssa_9, ssa_10, ssa_11
intrinsic store_deref (ssa_12, ssa_13) (15, 0) /* wrmask=xyzw */ /* access=0 */
/* succs: block_1 */
block block_1:
}
st_nir_lower_tex_src_plane
Thread 1 "kmscube" received signal SIGSEGV, Segmentation fault.
0x0000fffff62f2824 in add_sampler (state=0xffffffffd668, orig_binding=0, new_binding=1, ext=0xfffff7220ea9 "uv") at ../src/mesa/state_tracker/st_nir_lower_tex_src_plane.c:69
69 UNUSED int r = asprintf(&name, "%s:%s", orig_sampler->name, ext);
(gdb) print orig_sampler
$2 = (nir_variable *) 0x0
(gdb) bt
#0 0x0000fffff62f2824 in add_sampler (state=0xffffffffd668, orig_binding=0, new_binding=1, ext=0xfffff7220ea9 "uv") at ../src/mesa/state_tracker/st_nir_lower_tex_src_plane.c:69
#1 0x0000fffff62f26e0 in assign_extra_samplers (state=0xffffffffd668, free_slots=4294967292) at ../src/mesa/state_tracker/st_nir_lower_tex_src_plane.c:101
#2 0x0000fffff62f2524 in st_nir_lower_tex_src_plane (shader=0xd44f90, free_slots=4294967294, lower_2plane=1, lower_3plane=0) at ../src/mesa/state_tracker/st_nir_lower_tex_src_plane.c:190
#3 0x0000fffff629360c in st_create_fp_variant (st=0x7e63a0, stfp=0xd21ad0, key=0xffffffffde88) at ../src/mesa/state_tracker/st_program.c:1483
#4 0x0000fffff62923a0 in st_get_fp_variant (st=0x7e63a0, stfp=0xd21ad0, key=0xffffffffde88) at ../src/mesa/state_tracker/st_program.c:1672
#5 0x0000fffff62a3a00 in st_update_fp (st=0x7e63a0) at ../src/mesa/state_tracker/st_atom_shader.c:188
#6 0x0000fffff629d858 in st_validate_state (st=0x7e63a0, pipeline=ST_PIPELINE_RENDER) at ../src/mesa/state_tracker/st_atom.c:262
#7 0x0000fffff6288a64 in prepare_draw (st=0x7e63a0, ctx=0xfffff00da010) at ../src/mesa/state_tracker/st_draw.c:104
#8 0x0000fffff6287a38 in st_draw_gallium (ctx=0xfffff00da010, info=0xffffffffe008, draws=0xffffffffe000, num_draws=1) at ../src/mesa/state_tracker/st_draw.c:181
#9 0x0000fffff6474c48 in _mesa_draw_arrays (ctx=0xfffff00da010, mode=5, start=0, count=4, numInstances=1, baseInstance=0) at ../src/mesa/main/draw.c:1346
#10 0x0000fffff6474a6c in _mesa_DrawArrays (mode=5, start=0, count=4) at ../src/mesa/main/draw.c:1555
#11 0x0000fffff79aeff8 in shared_dispatch_stub_310 (mode=5, first=0, count=4) at src/mapi/shared-glapi/glapi_mapi_tmp.h:22239
#12 0x0000000000406ef0 in draw_cube_tex (i=0) at ../cube-tex.c:567
#13 0x0000000000409754 in legacy_run (gbm=0x590630 <gbm>, egl=0x5908b8 <gl>) at ../drm-legacy.c:95
#14 0x000000000040af1c in main (argc=3, argv=0xffffffffe528) at ../kmscube.c:235
(gdb)
Edited by Rob Clark