NVIDIAGameWorks / nvrhi

MIT License
798 stars 93 forks source link

Support PushConstants[RootConstants] in raytracing SBT and VolatileSRV[Versioned RootShaderResourceView] for command list. #15

Open HuazyYang opened 2 years ago

HuazyYang commented 2 years ago

Resource binding can be a area of very verbose. Can the following resource binding features be supported:

  1. PushConstants for Vulkan or RootConstants for D3D12 directly written into ray tracing shader binding table, maybe IBindingSet need to specify the constant buffer to create shader table entry.
  2. Volatile SRV[Versioned RootShaderResourceView] is just a resource type of StructuredBuffer<> compared to ConstantBuffer<> in HLSL, which can be bound to root shader resource view.
  3. for BindingSetItem of type "ConstantBuffer", buffer range can not be specified and not work properly, this may be a bug instead of a feature.
apanteleev commented 1 year ago

(3) implemented in https://github.com/NVIDIAGameWorks/nvrhi/commit/198b2d082963e916f0a00fb3350b44a46a1d2bfa with a test in https://github.com/NVIDIAGameWorks/donut_examples/blob/main/examples/vertex_buffer/vertex_buffer.cpp