-
Notifications
You must be signed in to change notification settings - Fork 837
Add float int32 vulkan shader #17382
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,5 +18,6 @@ view_convert_buffer: | |
| - parameter_values: [uint8, float] | ||
| - parameter_values: [uint8, half] | ||
| - parameter_values: [uint8, int32] | ||
| - parameter_values: [float, int32] | ||
|
||
| shader_variants: | ||
| - NAME: view_convert_buffer | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the float→int32 combo makes
view_convert_bufferperform a direct GLSL cast from float to int (OUT_T(t_inp[...])whereOUT_Tbecomesint). In GLSL, float-to-int conversion is undefined/unspecified for NaNs and for values outside the representable int32 range, which can lead to non-deterministic results. Consider updating the shader logic for this combo to explicitly define behavior (e.g., clamp to int32 min/max before casting and decide how to handle NaNs), so the new variant is robust and matches the expected runtime semantics.