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

Free functions for texturing, point clouds, and trace #1852

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

curtisblack
Copy link
Contributor

@curtisblack curtisblack commented Aug 23, 2024

Description

Provides free function API for:

  • rs_texture
  • rs_texture3d
  • rs_environment
  • rs_get_texture_info
  • rs_get_texture_info_st
  • rs_pointcloud_search
  • rs_pointcloud_get
  • rs_pointcloud_write
  • rs_trace

Each of these match the existing signatures of the renderer services equivalents. A new function rs_trace_get is added to retrieve trace results and is intended to replace getmessage("trace", ...) which is currently not available on GPUs.

The fallback for each of these is to call the existing renderer services functions.

To achieve this, the helper structs TextureOpt, TraceOpt, NoiseOpt are removed from the host-only shading context, and are instead added into the LLVM generated code as stack allocations. These allocations only occur if the shader uses these features.

To allow these free functions to compile on GPUs, the texture per-thread context pointer is currently passed null. Future work will be needed to give this a proper home.

To make the pointcloud functions GPU friendly, they had to modified to not use variadic arguments and to avoid dynamic alloca.

Tests

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format v17 before submitting, I definitely will look at
    the CI test that runs clang-format and fix anything that it highlights as
    being nonconforming.

Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
Signed-off-by: Curtis Black <[email protected]>
@lgritz
Copy link
Collaborator

lgritz commented Sep 18, 2024

@curtisblack Can you please resolve the merge conflict so we can run the CI?

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.

3 participants