diff options
| author | kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> | 2025-04-03 17:52:06 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-03 15:52:06 -0700 |
| commit | ac0dc491e1d39dc469b8879dc839b1ac2e76e33d (patch) | |
| tree | d09fed37aabf326183822efdd3202fce685aaf42 /tools/slang-cpp-parser/options.cpp | |
| parent | 6b44630afe4ff180ba608142e9515abcd369775e (diff) | |
Implement parameter block to slang-gfx for Metal backend (#6577)
* implement parameterblock for metal
Metal uses argument buffer to pass parameter buffer to pipeline, in this
change, we implement a simple way to copy the data to argument buffer.
In argument buffer tier2 rule, all the fields in parameter block will be
flatten to ordinary data, therefore
- we keep the m_data as in ShaderObjectImpl a CPU buffer to track on the data set in.
- For resource types, they will be represeted as device pointer or resource id in argument
buffer, we will just set their address or id at corresponsing offset in the CPU buffer
every time when 'setResource' or 'setSampler' is called.
- When binding the pipeline, we just simply copy the CPU argument buffer to GPU argument buffer.
- The only special case is nested parameter block. Because nested parameter block is represented
as a device pointer which will be another argument buffer, we will just recursively call
`_ensureArgumentBufferUpToDate` to get sub-object's argument buffer, and fill the GPU address of
those 'sub'-argument buffer to the root argument buffer at correct offset.
* Inform command encoder to hazard track the bindless resources
Since for all the resources within argument buffer are bindless, Metal
won't automatically hazard track those resources, we will have to call
'useResources' to inform Metal to hazard track those resources,
otherwise we will have to call wait fence after each command submission.
* nullptr check
* address comment
Diffstat (limited to 'tools/slang-cpp-parser/options.cpp')
0 files changed, 0 insertions, 0 deletions
