Skip to content

Commit 5beab0e

Browse files
committed
docs: correct BlasAabbGeometry stride reference and document AABB layout
The BlasAabbGeometry doc referred to a size.stride field, but BlasAABBGeometrySizeDescriptor has no stride; the stride lives on BlasAabbGeometry itself. Point the docs at the right field and, while there, document the packed AABB buffer layout (each primitive is a minimum then a maximum corner, two consecutive vec3<f32>, the 24-byte AABB_GEOMETRY_MIN_STRIDE) which was only implied before.
1 parent c97d22f commit 5beab0e

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ Bottom level categories:
100100

101101
- Fixed signed integer `%` (and `%=`) returning the wrong result for negative operands in the GLSL (OpenGL/GLES) backend, e.g. `-1 % 768` yielding `255` instead of `-1`. GLSL's `%` is undefined when either operand is negative, so signed remainder is now lowered as `a - b * (a / b)`, matching the SPIR-V, HLSL, and Metal backends. By @mstampfli in [#9687](https://github.com/gfx-rs/wgpu/pull/9687).
102102

103+
### Documentation
104+
105+
#### General
106+
107+
- Fix the `BlasAabbGeometry` docs to refer to the `stride` field instead of a nonexistent `size.stride`, and document the packed AABB buffer layout (each primitive a minimum then a maximum corner, two consecutive `vec3<f32>`). By @mstampfli in [#9999](https://github.com/gfx-rs/wgpu/pull/9999).
108+
103109
### Dependency Updates
104110

105111
#### General

wgpu/src/api/blas.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,18 @@ static_assertions::assert_impl_all!(BlasTriangleGeometry<'_>: WasmNotSendSync);
132132

133133
/// Definition for an axis-aligned bounding box geometry group for a bottom level acceleration structure.
134134
///
135-
/// Buffer data must contain `size.primitive_count` primitives at `primitive_offset`, each `size.stride` bytes,
136-
/// with `stride` at least [`AABB_GEOMETRY_MIN_STRIDE`] and a multiple of 8.
135+
/// Buffer data must contain `size.primitive_count` primitives at `primitive_offset`, each `stride` bytes
136+
/// apart, with `stride` at least [`AABB_GEOMETRY_MIN_STRIDE`] and a multiple of 8.
137137
#[derive(Debug)]
138138
pub struct BlasAabbGeometry<'a> {
139139
/// Sub descriptor for the size defining attributes of this geometry.
140140
pub size: &'a BlasAABBGeometrySizeDescriptor,
141141
/// Stride in bytes between consecutive AABB primitives in the buffer (at least
142142
/// [`AABB_GEOMETRY_MIN_STRIDE`], and must be a multiple of 8).
143143
pub stride: wgt::BufferAddress,
144-
/// Buffer containing packed AABB primitives (layout determined by `size.stride`).
144+
/// Buffer containing packed AABB primitives. Each primitive is a minimum corner
145+
/// then a maximum corner, two consecutive `vec3<f32>` (24 bytes, the
146+
/// [`AABB_GEOMETRY_MIN_STRIDE`]); consecutive primitives are `stride` bytes apart.
145147
pub aabb_buffer: &'a Buffer,
146148
/// Byte offset to the first AABB primitive (must be a multiple of 8).
147149
pub primitive_offset: u32,

0 commit comments

Comments
 (0)