Skip to content

Conversation

@Vecvec
Copy link
Contributor

@Vecvec Vecvec commented Nov 25, 2025

Connections
Initial proposal for the wgsl front-end of #6760

Description
Adds wgsl-in and (partial) validation for the simplest version of ray tracing pipelines. This matches the spirv and hlsl specs to the best of my knowledge (though with less than complete validation). Things may change in the future though. @JMS55 may wish to check the naming ect. I don't normally open a naga PR w/o a full way through, but last time I tried pipelines I did that and struggled to keep it up to date.

Naming differences from vulkan
LaunchId -> ray_invocation_id (I think its clearer what it is talking about)
LaunchSize -> num_ray_invocations
InstanceCustomIndex -> instance_custom_data (like ray queries)
RayTmax -> ray_t_current_max (unlike RayTmin, it changes over the life cycle of the ray, and doesn't match the field of the ray desc)

Testing
Snapshot test from wgsl to IR.

Squash or Rebase?
Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests.
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@Vecvec Vecvec changed the title Naga ray tracing pipelines [wgsl in and IR] naga ray tracing pipelines Nov 25, 2025
@JMS55
Copy link
Collaborator

JMS55 commented Nov 26, 2025

Very exciting!! I will take a look sometime this week for sure!

@cwfitzgerald cwfitzgerald self-assigned this Nov 26, 2025
@Vecvec Vecvec force-pushed the naga-ray-tracing-pipelines branch from 0b9dc42 to bee83af Compare November 26, 2025 21:04
@Vecvec Vecvec force-pushed the naga-ray-tracing-pipelines branch from 1d0dfca to ee8883c Compare November 26, 2025 21:47
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Some small things then lets land and iterate, the tests look nice.

@Vecvec Vecvec requested a review from cwfitzgerald November 27, 2025 00:52
@Vecvec Vecvec force-pushed the naga-ray-tracing-pipelines branch from 3c5a680 to fc50128 Compare November 27, 2025 01:46
@Vecvec
Copy link
Contributor Author

Vecvec commented Nov 27, 2025

Just going to note that spv-out is being worked on. Right now built-ins aren't yet supported, as I wanted to first implement traceRay (which is the most different part compared to everything else, the built-ins should just be mapping really).

@JMS55
Copy link
Collaborator

JMS55 commented Nov 29, 2025

Lgtm in terms of RT pipelines 1.0/1.1, but we should keep in mind future support for SER hit objects (DX: https://github.com/microsoft/DirectX-Specs/blob/master/d3d/Raytracing.md#hitobject. VK: https://www.khronos.org/blog/boosting-ray-tracing-performance-with-shader-execution-reordering-introducing-vk-ext-ray-tracing-invocation-reorder).

The main draw of RT pipelines for me is SER, so we should try and keep the API similar/transparent if we can.

@Vecvec Vecvec force-pushed the naga-ray-tracing-pipelines branch from 5bf4a3d to ec1c25b Compare November 30, 2025 04:04
@Vecvec
Copy link
Contributor Author

Vecvec commented Nov 30, 2025

The main draw of RT pipelines for me is SER, so we should try and keep the API similar/transparent if we can.

The API can't be transparent (without making many concessions), but changes for it should be limited to the trace ray calls (which even now reorder, just without any hints).

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