Repository navigation
WGSL: describe resource interface of a shader - #1214
Conversation
|
|
||
| Bindings must not alias within a shader stage: | ||
| two different variables in the resource interface of a given | ||
| shader must not have the same set and binding values, when considered as a pair of values. |
There was a problem hiding this comment.
I have to check this no-overlap-bindings rule for samplers and their associated sampled textures.
There was a problem hiding this comment.
I think the only cases were:
- buffer resources that alias the same memory. But I believe that won't be allowed in WebGPU
- Vulkan has combined image+sampler, and you can make OpTypeSampler, OpTypeImage, and OpTypeSampledImage variables to reference that descriptor, all with the same set and binding. But I believe WebGPU won't have that.
So I think this i the right rule. Yay.
- define 'block' attribute on structure type - text from 'uniform' and 'storage' rows of storage classes table out to resource interface section - define 'set' and 'binding' attribute on structure type - relate resources in WGSL to WebGPU GPUBindingType
059c982 to
01bce53
Compare
* Add cross-referencd to description of block attribute * Rewrite non-nesting validation rules for 'block'-decorated struct. * Convert a Note to a TODO about the next MR * Use not-yet defined terms 'read-write storage buffer' and 'read-only storage buffer' pending resolution of discussion on PR 1183 * Add a comparison_sampler row to the binding compatibility table
| </table> | ||
|
|
||
|
|
||
| A structure type with the [=block=] attribute must not be: |
There was a problem hiding this comment.
Can I declare a variable of that structure type locally in a function?
If I can do that, can I declare a variable of an array of these structures, locally?
| <tr><td>`builtin`<td>a Builtin Decoration Identifier (listed below) | ||
| <tr><td>`location`<td>u32 literal | ||
| <tr><td>`set`<td>u32 literal | ||
| <tr><td>`binding`<td>non-negative i32 literal<td>See [[#resource-interface]] |
There was a problem hiding this comment.
Doesn't SPIR-V allow specialization constants here? If so, can we add an issue for allowing that in WGSL some time in the future as well?
There was a problem hiding this comment.
No. Set and binding are literals in SPIR-V.
|
|
||
| * [=uniform buffers=] | ||
| * [=storage buffers=] | ||
| * textures |
There was a problem hiding this comment.
speaking of consistency, why are we separating the uniform/storage buffers into different resource, but not separating the sampled/storage textures?
|
Discussed at 2020-11-17 meeting. |
Prints all the unimplemented tests.
out to resource interface section