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] Only allow 16-bit types for HLSL 2018+ and SM 6.2+ #57876

Closed
llvm-beanz opened this issue Sep 21, 2022 · 1 comment · Fixed by #85340
Closed

[HLSL] Only allow 16-bit types for HLSL 2018+ and SM 6.2+ #57876

llvm-beanz opened this issue Sep 21, 2022 · 1 comment · Fixed by #85340
Assignees
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' HLSL HLSL Language Support

Comments

@llvm-beanz
Copy link
Collaborator

llvm-beanz commented Sep 21, 2022

16-bit native types were introduced in HLSL 2018 and SM 6.2, so we should enforce those requirements, or at least issue warnings for the language version. In older shader models these 16 bit integer types are disallowed and 16 bit float types are treated as 32-bits. The later part of this is already implemented.

AC
Validate that the enable 16 bit flag is used in only the correct circumstances.

@bob80905 bob80905 self-assigned this Feb 28, 2024
bob80905 added a commit that referenced this issue Mar 28, 2024
Previously, the clang compiler with the dxc driver would accept the
-enable-16bit-types flag without checking to see if the required
conditions are met for proper processing of the flag.
Specifically, -enable-16bit-types requires a shader model of at least
6.2 and an HLSL version of at least 2021.
This PR adds a validation check for these other options having the
required values, and emits an error if these constraints are not met.
Fixes #57876

---------

Co-authored-by: Damyan Pepper <damyanp@microsoft.com>
Co-authored-by: Chris B <cbieneman@microsoft.com>
@EugeneZelenko EugeneZelenko added the clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' label Mar 28, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 28, 2024

@llvm/issue-subscribers-clang-driver

Author: Chris B (llvm-beanz)

16-bit native types were introduced in HLSL 2018 and SM 6.2, so we should enforce those requirements, or at least issue warnings for the language version. In older shader models these 16 bit integer types are disallowed and 16 bit float types are treated as 32-bits. The later part of this is already implemented.

AC
Validate that the enable 16 bit flag is used in only the correct circumstances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' HLSL HLSL Language Support
Projects
Status: Done
4 participants