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

Add int8_t / uint8_t to the language #337

Open
AdamJMiles opened this issue Oct 11, 2024 · 0 comments
Open

Add int8_t / uint8_t to the language #337

AdamJMiles opened this issue Oct 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@AdamJMiles
Copy link
Member

Hi,

While this may/may not come naturally with other endeavours in the land of HLSL, I'd like to keep this on the radar.

HLSL currently lacks an 8-bit datatype both for arithmetic and for storage. The primary motivation for having an 8-bit datatype is not for general-purpose arithmetic, but rather:

  1. Support storage of smaller types in structures (e.g. StructuredBuffer) and in groupshared memory where space is always at a premium.
  2. Ease the sharing of code between C/C++ and HLSL.

It's very difficult to safely load, store and manipulate 8-bit datatypes in groupshared memory without resorting to bitwise operations, masking and even atomics to affect only a single byte of a uint16_t or uint type. CUDA supports char and unsigned char datatypes in its language.

Whether the 8-bit datatypes have any operators (such as +, -, /, * etc) depends on what the level of support for that is in the ecosystem, but Load/Store is the primary motivator here.

Thanks,

Adam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Triaged
Development

No branches or pull requests

2 participants