You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The path tracer reaches its materials through a bindless texture array declared
as `layout(set = 1, binding = 0) uniform texture2D bindless_textures[]`, a
runtime-sized descriptor array. The reflection already carried an `unbounded`
flag for such bindings all the way through the shader container, but the Vulkan
driver ignored it, so the descriptor set layout reserved a single descriptor and
every sample returned zero.
Adds the missing driver support:
- Query and enable the descriptor indexing features
(shaderSampledImageArrayNonUniformIndexing, descriptorBindingPartiallyBound,
descriptorBindingVariableDescriptorCount, runtimeDescriptorArray), following
the per-feature struct style already used for buffer device address and the
memory model rather than switching this driver to a unified
VkPhysicalDeviceVulkan12Features.
- Reserve a large maximum descriptor count for an unbounded binding in the set
layout, and mark it partially bound and variable count.
- Pin the real descriptor count with
VkDescriptorSetVariableDescriptorCountAllocateInfo when the set is allocated.
With this the path tracer renders. Measured on an RTX 4070 Laptop with a scene
of a floor and eight boxes at 640x360, mean image intensity: the albedo debug
view goes from 0.0000 to 0.3312, and the final path traced image from 0.0000 to
0.4860 against 0.5446 for the raster path. Ray traversal, BLAS/TLAS and the
geometry attributes were already correct; only material evaluation was affected,
because textures were the only thing reached through the bindless set.
Verified at one and eight samples per pixel, and with the denoiser off. With a
sky background the path traced and rasterized images cover the frame equally
(99.9% versus 100% of pixels lit). A flat background colour still renders black
under path tracing: the miss shader only handles sky, which is a gap in the
ported renderer rather than in this change.
DLSS is unaffected: frame to frame difference stays at 0.001788 on Vulkan and
0.001795 on D3D12, and reconstruction error against a native reference at 0.042,
matching the values measured before the path tracer was ported.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgxxgYZUnriDqgepZHiKpY
ERR_FAIL_COND_V_MSG(variable_descriptor_count > 0, UniformSetID(), "Trying to create a uniform set with multiple variable bindings. Only the last binding can be variable.");
0 commit comments