Implicit layout behavior of create_render_pipeline
is not documented.
#6254
Labels
area: documentation
Documentation for crate items, public or private
type: bug
Something isn't working
I was reading wgpu examples when I saw this code:
wgpu/examples/src/mipmap/mod.rs
Lines 89 to 114 in f3cbd6c
This code supplies
layout: None
inRenderPipelineDescriptor
and then usespipeline..get_bind_group_layout(0)
to get aBindGroupLayout
.This is new to me; all the examples of wgpu I had seen online up to this point manually specified
BindGroupLayout
s in theRenderPipelineDescriptor
.I didn't know what this code should do when reading it. Does
None
mean that the pipeline expects no bindings? DoesNone
mean that wgpu will deduce the layout from the shader module(s)? I guessed that it must be the latter, since the shaders in this example do require bindings.So I went to the docs and looked up
RenderPipeline::get_bind_group_layout
andRenderPipelineDescriptor::layout
, but neither of them mention anything about this implicit layout behavior. In the source code though, I found evidence for "implicit layout" behavior.My request: please document the implicit layout behavior of
RenderPipelineDescriptor
Furthermore, it's not documented what happens if you call
RenderPipeline::get_bind_group_layout
with a bind group index that doesn't exist in the layout.Request 2: Document behavior of
RenderPipeline::get_bind_group_layout
when index is out of boundsHere's what I suggest based on my current understanding. I don't know if it's all correct.
The text was updated successfully, but these errors were encountered: