You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wgpu-types/src/instance.rs
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,26 @@ bitflags::bitflags! {
101
101
102
102
/// Validate indirect buffer content prior to issuing indirect draws/dispatches.
103
103
///
104
+
/// This validation will transform indirect calls into no-ops if they are not valid:
105
+
///
106
+
/// - When calling `dispatch_workgroups_indirect`, all 3 indirect arguments encoded in the buffer
107
+
/// must be less than the `max_compute_workgroups_per_dimension` device limit.
108
+
/// - When calling `draw_indirect`/`draw_indexed_indirect`/`multi_draw_indirect`/`multi_draw_indexed_indirect`:
109
+
/// - If `Features::INDIRECT_FIRST_INSTANCE` is not enabled on the device, the `first_instance` indirect argument must be 0.
110
+
/// - The `first_instance` & `instance_count` indirect arguments must form a range that fits within all bound vertex buffers with `step_mode` set to `Instance`.
111
+
/// - When calling `draw_indirect`/`multi_draw_indirect`:
112
+
/// - The `first_vertex` & `vertex_count` indirect arguments must form a range that fits within all bound vertex buffers with `step_mode` set to `Vertex`.
113
+
/// - When calling `draw_indexed_indirect`/`multi_draw_indexed_indirect`:
114
+
/// - The `first_index` & `index_count` indirect arguments must form a range that fits within the bound index buffer.
115
+
///
116
+
/// __Behavior is undefined if this validation is disabled and the rules above are not satisfied.__
117
+
///
118
+
/// Disabling this will also cause the following built-ins to not report the right values on the D3D12 backend:
119
+
///
120
+
/// - the 3 components of `@builtin(num_workgroups)` will be 0
121
+
/// - the value of `@builtin(vertex_index)` will not take into account the value of the `first_vertex`/`base_vertex` argument present in the indirect buffer
122
+
/// - the value of `@builtin(instance_index)` will not take into account the value of the `first_instance` argument present in the indirect buffer
123
+
///
104
124
/// When `Self::from_env()` is used takes value from `WGPU_VALIDATION_INDIRECT_CALL` environment variable.
0 commit comments