mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 05:51:03 +01:00
chore(core): Add comments on bind group init actions (#10224)
This commit is contained in:
1 parent
bd54ab2c0e
commit
55c7f91ef6
1 file changed
+7
@@ -3403,6 +3403,9 @@ impl Device {
|
||||
bb.offset..bb.offset + visible_size
|
||||
};
|
||||
|
||||
// Once a buffer is initialized, nothing can cause the contents to revert to an
|
||||
// unknown state, so we do not record an init action in the bind group when that is
|
||||
// the case. (The same is not true of textures.)
|
||||
buffer_init_actions.extend(buffer.initialization_status.read().create_action(
|
||||
buffer,
|
||||
init_range,
|
||||
@@ -3484,6 +3487,10 @@ impl Device {
|
||||
|
||||
let texture = &view.parent;
|
||||
|
||||
// Unlike buffers, textures contents can revert to being undefined if used as a
|
||||
// render attachment with `StoreOp::Discard`. Therefore, we must always register
|
||||
// the init action in the bind group, and check the initialization state every
|
||||
// time the binding is used.
|
||||
texture_init_actions.push(TextureInitTrackerAction {
|
||||
texture: texture.clone(),
|
||||
range: TextureInitRange {
|
||||
|
||||
Reference in new issue
Block a user