Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spirv-link generates invalid debug ids with non semantic shader debug info #5747

Open
danginsburg opened this issue Jul 24, 2024 · 2 comments

Comments

@danginsburg
Copy link
Contributor

danginsburg commented Jul 24, 2024

I have two valid SPIR-V files (pass spirv-val) with non-semantic shader debug info that when linked together with spirv-link generate invalid SPIR-V with the following error:

error: line 6093: ID '5071[%5071]' has not been defined
  %5070 = OpExtInst %void %1 DebugLine %449 %465 %465 %5071 %_arr_v2float_int_3

This leads to a crash later on when I run the spirv-opt aggressive DCE pass on it. I am unable to provide the shaders publicly, but I will provide them in private to @jeremy-lunarg. I'm filing the issue publicly so that it is tracked.

The repro steps are:

spirv-link test_spirv_link_0.spv test_spirv_link_1.spv --create-library -o test.spv
spirv-val test.spv
error: line 6093: ID '5071[%5071]' has not been defined
  %5070 = OpExtInst %void %1 DebugLine %449 %465 %465 %5071 %_arr_v2float_int_3
@pierremoreau
Copy link
Contributor

Yes, there is an issue where the code updating the IDs does not run on debug-line instructions. I have a fix ready, but still need to add new tests to validate it.

@pierremoreau
Copy link
Contributor

@jeremy-lunarg I won’t have time to finish the MR tonight, but if you want to give the fix a try locally, you simply need to change this line to }, true);.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants