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 full swizzle set support for vector types #1409

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

blinkfrog
Copy link
Contributor

This PR introduces an expansion of the swizzle operation support in AdaptiveCpp, allowing for the full set of swizzle permutations with repetition for 1D, 2D and 3D vectors. This change aligns AdaptiveCpp's functionality more closely with GLSL/HLSL and DPC++, enhancing its flexibility and utility for developers.

In practice, the full range of swizzle operations greatly simplifies the process of porting code from GLSL/HLSL to SYCL. This feature is supported by DPC++ and is in line with the behavior observed in other shading languages, indicating a common expectation among developers for how swizzle operations should behave. Despite the current ambiguity in the SYCL specification, providing comprehensive swizzle support in AdaptiveCpp can significantly improve developer productivity and the ease of codebase transitions.

The SYCL specification's current ambiguity regarding swizzle operations for vectors smaller than 4 elements has led to differing implementations. This PR assumes a more permissive interpretation, aiming to standardize the user experience across SYCL implementations.

Related discussions:

This commit updates swizzle operations to allow permutations with repetition for vectors of all sizes, aligning AdaptiveCpp's behavior more closely with GLSL/HLSL and DPC++. This enhancement facilitates easier porting of GLSL/HLSL code to SYCL, offering a more flexible and intuitive interface for developers working with vector data types.
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.

None yet

1 participant