Advertisement

glCompileShader segfaults in fragment shader when using samplerCube with a uvec2 bindless texture handle

Started by August 07, 2024 04:48 AM
12 comments, last by Tyranna 1 month, 1 week ago

Right. I got a bug report there already , but no information on what to do was offered. The link to that bug report is up above.

I am sure it segfaults on glCompileShader , but just on a fragment shader using a bindless texture handle passed to samplerCube as a uvec2. I believe the type converting function of samplerCube is damaged somehow. What I do not know is if the problem is local to my installation or Meas itself , or the X driver radeon_dri.so.

I do not really know how to diagnose it.

And thanks for the help O do appreciate it. Its not fun when you are stuck.

UPDATE: This was posted at freedesktop.org about my problem.

https://gitlab.freedesktop.org/mesa/mesa/-/issues/11648

I do not know what that text is , maybe a debugger output?

Timothy Arceri @tarceri · 8 hours ago

Developer

I was wrong this is a different existing issue:

#0  ir_variable_replacement_visitor::visit_leave (this=0x7fffffffd1f0, ir=0xb569de0) at ../src/compiler/glsl/opt_function_inlining.cpp:425
#1  0x00007fffecee60f5 in ir_assignment::accept (this=0xb57e6f0, v=0x7fffffffd1f0) at ../src/compiler/glsl/ir_hv_accept.cpp:311
#2  0x00007fffecee5bcd in visit_list_elements (v=v@entry=0x7fffffffd1f0, l=l@entry=0x7fffffffd1d0, statement_list=statement_list@entry=true) at ../src/compiler/glsl/ir_hv_accept.cpp:55
#3  0x00007fffecf025f5 in do_variable_replacement (instructions=0x7fffffffd1d0, orig=0xb14b060, repl=0xb57d1c0) at ../src/compiler/glsl/opt_function_inlining.cpp:460
#4  ir_call::generate_inline (this=this@entry=0xb57d710, next_ir=next_ir@entry=0xb57d710) at ../src/compiler/glsl/opt_function_inlining.cpp:279
#5  0x00007fffecef32db in (anonymous namespace)::lower_builtins_visitor::visit_leave (this=0x7fffffffd370, ir=0xb57d710) at ../src/compiler/glsl/lower_builtins.cpp:61
#6  (anonymous namespace)::lower_builtins_visitor::visit_leave (this=0x7fffffffd370, ir=0xb57d710) at ../src/compiler/glsl/lower_builtins.cpp:53
#7  0x00007fffecee5bcd in visit_list_elements (v=v@entry=0x7fffffffd370, l=l@entry=0xb57c9b0, statement_list=statement_list@entry=true) at ../src/compiler/glsl/ir_hv_accept.cpp:55
#8  0x00007fffecee5d47 in ir_function_signature::accept (this=0xb57c960, v=0x7fffffffd370) at ../src/compiler/glsl/ir_hv_accept.cpp:115
#9  0x00007fffecee5bcd in visit_list_elements (v=v@entry=0x7fffffffd370, l=l@entry=0xb571b38, statement_list=statement_list@entry=false) at ../src/compiler/glsl/ir_hv_accept.cpp:55
#10 0x00007fffecee5dbe in ir_function::accept (this=0xb571b10, v=0x7fffffffd370) at ../src/compiler/glsl/ir_hv_accept.cpp:127
#11 0x00007fffecee5bcd in visit_list_elements (v=v@entry=0x7fffffffd370, l=l@entry=0xb56c770, statement_list=statement_list@entry=true) at ../src/compiler/glsl/ir_hv_accept.cpp:55
#12 0x00007fffecef3331 in lower_builtins (instructions=0xb56c770) at ../src/compiler/glsl/lower_builtins.cpp:48
#13 0x00007fffecec712b in _mesa_glsl_compile_shader (ctx=ctx@entry=0xadc76b0, shader=shader@entry=0xab66c90, dump_ast=dump_ast@entry=false, dump_hir=dump_hir@entry=false, force_recompile=force_recompile@entry=false)
    at ../src/compiler/glsl/glsl_parser_extras.cpp:2411
#14 0x00007fffecde81f7 in _mesa_compile_shader (ctx=0xadc76b0, sh=0xab66c90) at ../src/mesa/main/shaderapi.c:1234

I'm working on a fix and a test for this issue. Thanks for the report.

Advertisement

UPDATE: I was sent this and it works. Also, it is not localized to samplerCube , it also affects sampler2D and sampler2DArry. Probably all of them but these are the only ones I am using.

Timothy Arceri commented on a discussion:

If you want to avoid the current issue in mesa you should be able to change you code from:

FragColor = texture( samplerCube( reflection_map_bindless_texture ) , R );

to

sampleCube s = samplerCube( reflection_map_bindless_texture )
FragColor = texture( s , R );

This topic is closed to new replies.

Advertisement