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

[HLSL] Declaring in/out variables in global scope triggers unhelpful assertion #2252

Closed
rdb opened this issue May 31, 2020 · 0 comments · Fixed by #2258
Closed

[HLSL] Declaring in/out variables in global scope triggers unhelpful assertion #2252

rdb opened this issue May 31, 2020 · 0 comments · Fixed by #2258

Comments

@rdb
Copy link
Contributor

rdb commented May 31, 2020

Running this:

glslangValidator -e main -G test.vert.hlsl

With this shader code:

out float4 l_position : SV_Position;

void main() {
    l_position = float4(0, 0, 0, 0);
}

Triggers an assert(false):

glslangValidator: ../SPIRV/GlslangToSpv.cpp:1233: spv::StorageClass {anonymous}::TGlslangToSpvTraverser::TranslateStorageClass(const glslang::TType&): Assertion `0' failed.

It would be more helpful to show an appropriate error message. For example, DXC shows this:

test.vert.hlsl:1:1: error: HLSL usage 'out' is only valid on a parameter
out float4 l_position : SV_Position;
^~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant