gfx-rs/wgpu · error

This vulkan device is affected by [#8333](https://github.com

Error message

This vulkan device is affected by [#8333](https://github.com/gfx-rs/wgpu/issues/8333)

What it means

Certain Vulkan devices (issue gfx-rs/wgpu#8333) corrupt draws when a multiview pipeline is used and the instance range extends beyond a device-specific limit (`multiview_instance_index_limit`). Before `cmd_draw`, wgpu-hal checks `first_instance + instance_count - 1` against that limit and panics rather than emit a broken GPU command. It is a deliberate guard against a hardware/driver defect, not a validation error in the normal sense.

Source

Thrown at wgpu-hal/src/vulkan/command.rs:1117

            )
        };
    }
    unsafe fn set_blend_constants(&mut self, color: &[f32; 4]) {
        unsafe { self.device.raw.cmd_set_blend_constants(self.active, color) };
    }

    unsafe fn draw(
        &mut self,
        first_vertex: u32,
        vertex_count: u32,
        first_instance: u32,
        instance_count: u32,
    ) {
        if self.current_pipeline_is_multiview
            && (first_instance as u64 + instance_count as u64 - 1)
                > self.device.private_caps.multiview_instance_index_limit as u64
        {
            panic!("This vulkan device is affected by [#8333](https://github.com/gfx-rs/wgpu/issues/8333)");
        }
        unsafe {
            self.device.raw.cmd_draw(
                self.active,
                vertex_count,
                instance_count,
                first_vertex,
                first_instance,
            )
        };
    }
    unsafe fn draw_indexed(
        &mut self,
        first_index: u32,
        index_count: u32,
        base_vertex: i32,
        first_instance: u32,
        instance_count: u32,

View on GitHub (pinned to 3e11ff59bf)

Solutions

  1. Reduce instance counts and/or first_instance so the last instance index stays within the device limit
  2. Split the draw into multiple draws each fitting the limit (chunk instance ranges)
  3. Avoid multiview pipelines for those draws (render without multiview) if the device is affected
  4. Query the limit and clamp batching logic accordingly in your renderer

Example fix

// before
encoder.draw(0, verts, 0, 100_000); // exceeds multiview_instance_index_limit
// after
let limit = multiview_instance_index_limit;
for chunk in (0..100_000).step_by(limit) {
    encoder.draw(0, verts, 0, ((100_000 - chunk).min(limit)) as u32);
}
Defensive patterns

Strategy: validation

Validate before calling

if pipeline.is_multiview && (first_instance as u64 + instance_count as u64 - 1) > multiview_instance_index_limit as u64 {
    return Err("instance range exceeds multiview limit; chunk the draw");
}

Try / catch

std::panic::catch_unwind(|| encoder.draw(verts, instances))

Prevention

When it happens

Trigger: Recording a draw (`draw(vertex_count, instance_count, first_instance)`) on a Vulkan encoder whose active render pipeline is multiview, on an affected device, when `first_instance + instance_count - 1` exceeds `private_caps.multiview_instance_index_limit` (e.g. instanced rendering with large instance counts into a multiview pass).

Common situations: VR/XR rendering using multiview (VRAM TODO: e.g. Quest/Adreno devices) with heavy instancing; batching many instances into a single multiview pass; apps that changed instance counts after switching to multiview pipelines.

Related errors


AI-assisted analysis of gfx-rs/wgpu@3e11ff59bf (2026-09-03). Data as JSON: /api/errors/6282d6574376d0ef. Report an issue: GitHub.