Created attachment 142933 [details] bisect log 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: commit a45b6fb45246f6b8e2b4a06977f199cc77452289 Author: Jason Ekstrand <jason.ekstrand@intel.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 <itoral@igalia.com> 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. coredump: https://drive.google.com/open?id=13weXQtqouPYlJeER0kYXDJHDJGK7AZl9
Created attachment 142934 [details] backtrace
I was just about to post this as well. Seems to be caused by the last pass: https://github.com/libretro/slang-shaders/blob/master/crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.h 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] crt-royale-geometry-aa-last-pass.spirv 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.
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/67 fixes the crash parsing the fragment shader for me.
(In reply to Bas Nieuwenhuizen from comment #12) > https://gitlab.freedesktop.org/mesa/mesa/merge_requests/67 > > 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.
https://gitlab.freedesktop.org/mesa/mesa/commit/70ed049cc6a682fba084cf57e06728fa5934881b
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.