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 bvhvec4slice to Build()/BuildHQ() #39

Merged
merged 1 commit into from
Dec 7, 2024
Merged

Conversation

DavidPeicho
Copy link
Contributor

@DavidPeicho DavidPeicho commented Dec 7, 2024

Sorry for the drive by cleanup, I have a plugin to remove trailing whitespaces, didn't realize since it autoruns on save :) If you want I can eventually revert those changes.

Would be great to add bound checks to the slice in debug mode. Haven't done that yet. Should we add a DEBUG define?

@DavidPeicho DavidPeicho changed the title [WIP] Add bvhvec4slice to Build()/BuildHQ() Add bvhvec4slice to Build()/BuildHQ() Dec 7, 2024
@jbikker
Copy link
Owner

jbikker commented Dec 7, 2024

That looks good! For the new 'fast builder' this will be trivial to include as well, and for the AVX / NEON builders the slices can simply be union'ed with __m128 or the NEON equivalent.
Don't worry about the spaces, I will see if Visual Studio can delete those automatically as well. I use a code standard template, but deleting trailing spaces appears to be missing from it.
This does bring up two follow-up 'issues':

  1. The bvhvec4 requirement is really just there for the AVX and NEON builders. Perhaps this will make more sense to the user if it is exclusively enforced for those; ::Build can then simply take bvhvec3 slices.
  2. I see your nice auto-documentation comment and realize I need this everywhere now. :)
    Is it proper etiquette on Github if I create issues like that for myself (or others, if they beat me to it, I guess)?

@jbikker jbikker merged commit 847b3b4 into jbikker:dev Dec 7, 2024
6 checks passed
@DavidPeicho
Copy link
Contributor Author

  1. Makes perfect sense yes. We should just keep a separate API for those, and indeed accept bvhvec3 then for Build.
  2. Don't know if there is a "proper" way, whatever you like the most. I like to create issues, label them, and assign them yes

if we create slices for other types, like bvhvec3, we should think about just creating a template slice type. I know you probably have converns about template, but we could explicitly instantiate them for the types we use (vec3/vec4?)

jbikker added a commit that referenced this pull request Dec 7, 2024
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