KhronosGroup / KhronosGroup/glslang

Implicit BuiltIn generate strange NonSemantic Shader Debug Info

Open
#3,862 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug ShaderDebugInfo SPIR-V
Dominant language
C++
Stars
3.6k
Forks
990
Avg merge
1d 3h
Merged PRs (30d)
32

Description

https://godbolt.org/z/bjjz6q5so

going

#version 450
void main(){ 
    gl_Position = vec4(0);
}

I get things like

%39 = OpString "gl_PointSize"
%42 = OpString "gl_CullDistance"

%38 = OpExtInst %void %1 DebugTypeMember %39 %29 %18 %uint_1 %uint_42 %uint_0 %uint_0 %uint_3
%41 = OpExtInst %void %1 DebugTypeMember %42 %33 %18 %uint_1 %uint_85 %uint_0 %uint_0 %uint_3

and it is pointing to Line 1and Column 42 and 85 which don't exists in the source

I guess I would imagine a 2nd DebugSource is created to store all these implicit built-ins (or at least someone way to know where these are from)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the Godbolt link and the provided GLSL source, then inspect the generated SPIR-V around the OpString and DebugTypeMember entries for implicit built-ins. Determine how their debug locations are assigned; done means the metadata no longer points to nonexistent source positions and identifies the built-in source appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.