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 support for explicitly typed constants #118

Merged

Conversation

attackgoat
Copy link
Contributor

I found this testing attackgoat/screen-13#68

Example shader
#version 460 core
#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require
#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require
#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require
#extension GL_EXT_shader_explicit_arithmetic_types_float32 : require
#extension GL_EXT_shader_explicit_arithmetic_types_float64 : require

const int8_t INT8 = int8_t(1);
const int16_t INT16 = int16_t(1);
const int32_t INT32 = int32_t(1);
const int64_t INT64 = int64_t(1);

const uint8_t UINT8 = uint8_t(1);
const uint16_t UINT16 = uint16_t(1);
const uint32_t UINT32 = uint32_t(1);
const uint64_t UINT64 = uint64_t(1);

const float16_t FLOAT16 = float16_t(1.0);
const float32_t FLOAT32 = float32_t(1.0);
const float64_t FLOAT64 = float64_t(1.0);

void main() {
}

These constants probably don't need to be parsed, invalidating this change. If they should be parsed then maybe half could help with the f16 representation.

@PENGUINLIONG
Copy link
Owner

Thank you!

@PENGUINLIONG PENGUINLIONG merged commit ea2336e into PENGUINLIONG:master Dec 20, 2023
1 check passed
@attackgoat attackgoat deleted the explicit-arithmetic-types branch December 20, 2023 14:48
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 this pull request may close these issues.

2 participants