The batch kernel's own part: its bindings in group (rays in, results
out, and with rayMasks the batch's ray mask as a uniform at binding 2) and
the entry point bvhBatch, which traces arrayLength(bvhBatchRays) rays and
writes one result per ray. The trace module comes separately (the
platform's kernel builder puts it in group 0). It must be built with the
same rayMasks.
The ray count is the size of the bound rays range, so it needs no uniform.
The mask does: dispatches with different masks recorded into one command
buffer need a uniform buffer each.
Closest-hit results are BvhHitRecord (HIT_RECORD_BYTES, 40 bytes,
with material and normal) or, with hitNormal: false,
BvhHitRecordCompact (HIT_RECORD_COMPACT_BYTES, 24 bytes).
The batch kernel's own part: its bindings in
group(rays in, results out, and withrayMasksthe batch's ray mask as a uniform at binding 2) and the entry pointbvhBatch, which tracesarrayLength(bvhBatchRays)rays and writes one result per ray. The trace module comes separately (the platform's kernel builder puts it in group 0). It must be built with the samerayMasks.The ray count is the size of the bound
raysrange, so it needs no uniform. The mask does: dispatches with different masks recorded into one command buffer need a uniform buffer each.Closest-hit results are
BvhHitRecord(HIT_RECORD_BYTES, 40 bytes, with material and normal) or, withhitNormal: false,BvhHitRecordCompact(HIT_RECORD_COMPACT_BYTES, 24 bytes).