KhronosGroup / KhronosGroup/glslang
Implementing UINT64_C in GLSL
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
I'd like to reuse a C header file in GLSL that makes use of the UINT64_C() macro. To make this work in GLSL, I'm enabling the GL_ARB_gpu_shader_int64 extension and defining UINT64_C() as follows:
`#define UINT64_C(x) x##ul`
Unfortunately, when the macro argument is a 64-bit value, the compiler generates the "hexadecimal literal too big" error before the macro is expanded. E.g.:
`#define BLAH UINT64_C(0x12345678912);`
Is this a bug or is this the intended behaviour?
Thanks,
Dae
Contributor guide
Research direction
Reproduce the reported case using the UINT64_C and BLAH macro definitions with GL_ARB_gpu_shader_int64 enabled. Trace preprocessing and hexadecimal-literal validation to determine whether the diagnostic occurs before macro expansion; done means establishing the intended behavior and documenting or correcting it with a regression check.
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