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

Generate nonsemantic shader debug information with source doesn't work on large shaders #3497

Closed
helviett opened this issue Feb 4, 2024 · 4 comments
Assignees
Labels
bug sev:crash A valid input causes a crash in glslang SPIR-V

Comments

@helviett
Copy link

helviett commented Feb 4, 2024

If you take almost any preprocessed shader from https://github.com/ConfettiFX/The-Forge you won't be able to compile it with -gVS option. Reproduction steps:

  1. Clone latest https://github.com/ConfettiFX/The-Forge release
  2. Apply this patch to avoid python warning and get error message: glslang_gVS.patch
  3. set FSL_COMPILER_VK env variable to the folder that contains desired glslangValidator executable (e.g. $env:FSL_COMPILER_VK="C:\VulkanSDK\1.3.268.0\Bin\" in powershell)
  4. Run from the root of the git repository py.exe .\Common_3\Tools\ForgeShadingLanguage\fsl.py --compile -b CompiledShaders -d PreprocessedShaders -l VULKAN --debug .\Examples_3\Unit_Tests\src\01_Transformations\Shaders\FSL\ShaderList.fsl
  5. Converted GLSL from FSL will be in PreprocessedShader/VULKAN folder, compiled SPIR-V will be in CompiledShaders/VULKAN folder
  6. You can try the same with any file named ShaderList.fsl inside Examples_3 folder

If you're a bit lazy to follow all the steps:

  1. Here is preprocessed shaders from 01_Transformations: PreprocessedShaders.zip
  2. You can compiler them with the following command: glslangValidator.exe -D_DEBUG -gVS -V PreprocessedShaders/VULKAN/skybox.vert -o CompiledShaders/VULKAN/skybox.vert_0.spv -IPath\To\The-Forge\Common_3\Tools\ForgeShadingLanguage -S vert --target-env spirv1.3 -DVK_EXT_DESCRIPTOR_INDEXING_ENABLED=0 -DVK_FEATURE_TEXTURE_ARRAY_DYNAMIC_INDEXING_ENABLED=0

I can preprocess entire The-Forge for you if you're going to fix this annoying issue. Debugging SPIR-V is okay but I prefer to look at GLSL code.

@arcady-lunarg
Copy link
Contributor

Thanks, I can indeed reproduce this issue. Preliminarily I think the issue is with how #line directives are handled in preprocessed code and how that corresponds to OpDebugSource opcodes. This is definitely something that should be fixed.

@arcady-lunarg arcady-lunarg self-assigned this Feb 5, 2024
@arcady-lunarg arcady-lunarg added bug SPIR-V sev:crash A valid input causes a crash in glslang labels Feb 5, 2024
@arcady-lunarg
Copy link
Contributor

Good news, looks like this is also fixed by #3496 so I will try to get that reviewed and merged as soon as I can.

@arcady-lunarg
Copy link
Contributor

Update, #3496 has been merged, could you confirm that your issue is fixed and close it if so?

@helviett
Copy link
Author

@arcady-lunarg sorry, couldn't check it earlier. I tested every ShaderList in https://github.com/ConfettiFX/The-Forge and can confirm that everything compiles now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug sev:crash A valid input causes a crash in glslang SPIR-V
Projects
None yet
Development

No branches or pull requests

2 participants