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

Specialization constant conversion to float is disallowed by VkGLSL spec, but is used in an example. #169

Open
NicolBolas opened this issue Sep 27, 2021 · 0 comments
Labels
Vulkan Functionality applies to Vulkan API

Comments

@NicolBolas
Copy link

The GL_KHR_vulkan_glsl specification states that you cannot do a specialization constant conversion from an integer type to a floating-point type. It states this by omission, as the "Specialization Constant Operations" section lists the allowable operations on a specialization constant (that still yields a specialization constant). And while integer-to-integer conversions are allowed, conversions between integers and floats are disallowed.

However, the spec also has this example:

    layout(constant_id = 18) const int scX = 1;
    layout(constant_id = 19) const int scZ = 1;
    const vec3 scVec = vec3(scX, 1, scZ);  // partially specialized vector

This performs implicit conversions from scX and scZ to floating-point types, which is not permitted. As such, this should use ivec3 instead of vec3.

@pdaniell-nv pdaniell-nv added the Vulkan Functionality applies to Vulkan API label Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Vulkan Functionality applies to Vulkan API
Projects
None yet
Development

No branches or pull requests

2 participants