Created attachment 142933 [details]
When running retroarch with any of the crt-royale shaders applied, it crashed within libvulkan_radeon.so.
This affects Mesa 18.3.1 and current -git 8c93ef5de98a90a93, 18.2.8 works fine. LLVM version doesn't seem to make a difference. AMDVLK also works as expected.
Bisecting produced the first bad commit as:
Author: Jason Ekstrand <email@example.com>
Date: Sat Sep 22 09:46:26 2018 -0500
spirv: Pass SSA values through functions
Previously, we would create temporary variables and fill them out.
Instead, we create as many function parameters as we need and pass them
through as SSA defs.
Reviewed-by: Iago Toral Quiroga <firstname.lastname@example.org>
The crt-royale slang shader can be found here: https://github.com/libretro/slang-shaders/tree/master/crt
I'll attach the bisect log, a gdb backtrace, and a coredump.
Created attachment 142934 [details]
I was just about to post this as well.
Seems to be caused by the last pass:
I can't pinpoint an exact cause. It might just be crashing because the number of constants is overflowing something.
Swapping out the last stage for the no-geom version works fine.
It would be appreciated if someone could get me the SPIR-V for a failing shader, instead of me having to figure out how to get the retroarch build system to spit one out myself.
Created attachment 142941 [details]
It seems to be indeed the shader mentioned in #2 which causes the crash.
I believe i managed to get a dump of the spirv via RADV_DEBUG=spirv.
Created attachment 142942 [details]
Fragment shader GLSL
Created attachment 142943 [details]
Fragment shader SPV
Created attachment 142944 [details]
Vertex shader GLSL
Created attachment 142945 [details]
Vertex shader SPV
I added the full generated GLSL for the vertex and fragment shaders and the SPV produced. The glsl is in the form it's passed to the glslang compiler, and it compiles with the command-line compiler. I believe it's the vertex shader that's causing the crash, but since it occurs on pipeline creation I don't really know.
Thanks, was able to reproduce with src/compiler/spirv2nir on the fragment shader.
I think the issue is that a matrix being passed to a function is not handled correctly in vtn_ssa_value_add_to_call_params .
I'll continue debugging later.
fixes the crash parsing the fragment shader for me.
(In reply to Bas Nieuwenhuizen from comment #12)
> fixes the crash parsing the fragment shader for me.
With this patch applied it works correctly again, thanks!
(In reply to oschowa from comment #13)
> With this patch applied it works correctly again, thanks!
Also confirmed here.