-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
wip: constexpr vec (constructors) when using simd #1313
base: master
Are you sure you want to change the base?
Conversation
Todo:
|
I did a small amount of testing, (though only with aligned highp vec4), so far things are seeming to work OK~~, except:~~
|
… passed to memcpy
9dad7df
to
d5f8676
Compare
5716d8e
to
7144171
Compare
…other misc changes
also add custom simd swizzling functions that are available by default
New feature added: swizzling functions (enabled by default) Tho you have to specify at least two swizzle members, max N swizzle members for vec of length N, and you can’t have duplicate members (you can’t swizzle vec1’s because that’d be silly). Example: |
…for simd select from mask
… vec-to-return directly from the GccVec thingy
Yes this is creating a whole new vec implementation, because trying to add
std::is_constant_evaluated()
while also making both constexpr and simd work well, and also maintain backwards compatibility would be too complicated to incorporate into the pre-existing vec classes.oh also this is only compatible with gcc and clang, because it makes use of gcc’s vector extension for simd in vec’s comstructors (for when
std::is_constant_evaluated() = false
)This is because it allows me to write one simd construction function that works for all vec lengths (and I will be adding support for use w/ packed vecs soon)
I don't intend this separate vec implementation to make the pre-existing vec implementations deprecated, this is just the most straightforward way to make constexpr work well w/ simd, without making the entire codebase unreadable