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

Validation error "DXIL intrinsic overload must be valid" #2202

Open
SirTimothy opened this issue May 22, 2019 · 2 comments
Open

Validation error "DXIL intrinsic overload must be valid" #2202

SirTimothy opened this issue May 22, 2019 · 2 comments
Labels
bug Bug, regression, crash
Milestone

Comments

@SirTimothy
Copy link

Hey, I encountered a problem while compiling some shaders through dxcompile (normally we're using d3dcompile), with a cryptic validation error message.

Managed to narrow it down, and can reproduce with the attached shader: test.txt

Gives for output:

dxc -E ps_main -T ps_6_0 test.hlsl

error: validation errors
at 0x280ab609bc0 inside block #0 of function ps_main DXIL intrinsic overload must be valid

Validation failed.

My guess is that it can't decide whether to implicitly convert the ?: result from float3 down to float, or bump the 1.0 second dot argument up to float3. I think some improved error message for this would be useful (didn't get any line number or anything) :)

@tristanlabelle
Copy link
Contributor

tristanlabelle commented May 22, 2019

Thanks for reporting! It looks like the ternary operator with two literal float values resolves to the double type, which there is no overload of dot for. The poor error message would be because the semantic analysis thinks there is a dot overload for double but the codegen disagrees. A workaround is to suffix the two values with f.

@llvm-beanz
Copy link
Collaborator

Godbolt link: https://godbolt.org/z/e54rbcoPn

Clang does not exhibit this bug, but it is still present in DXC.

@llvm-beanz llvm-beanz added this to the Dormant milestone Jun 11, 2024
@llvm-beanz llvm-beanz moved this to Triaged in HLSL Triage Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash
Projects
Status: Triaged
Development

No branches or pull requests

3 participants