{"record":{"id":"1f6bef8c2656b278","repo":"gfx-rs/wgpu","slug":"dispatchqueuewritebuffer-is-not-core","errorCode":null,"errorMessage":"DispatchQueueWriteBuffer is not core","messagePattern":"DispatchQueueWriteBuffer is not core","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu/src/backend/wgpu_core.rs","lineNumber":1547,"sourceCode":"        }\n    }\n\n    fn write_staging_buffer(\n        &self,\n        buffer: &dispatch::DispatchBuffer,\n        offset: crate::BufferAddress,\n        staging_buffer: dispatch::DispatchQueueWriteBuffer,\n    ) {\n        let buffer = buffer.as_core();\n        let staging_buffer = {\n            #[allow(\n                clippy::allow_attributes,\n                unreachable_patterns,\n                reason = \"features may be disabled\"\n            )]\n            match staging_buffer {\n                dispatch::DispatchQueueWriteBuffer::Core(value) => value,\n                _ => panic!(concat!(\n                    stringify!(DispatchQueueWriteBuffer),\n                    \" is not core\"\n                )),\n            }\n        };\n\n        match self.wgpu_queue.write_staging_buffer(\n            buffer.wgpu_buffer.clone(),\n            offset,\n            staging_buffer.wgpu_staging_buffer,\n        ) {\n            Ok(()) => (),\n            Err(err) => {\n                self.wgpu_queue\n                    .device()\n                    .handle_error_nolabel(err, \"Queue::write_buffer_with\");\n            }\n        }","sourceCodeStart":1529,"sourceCodeEnd":1565,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu/src/backend/wgpu_core.rs#L1529-L1565","documentation":"Panic in Queue::write_staging_buffer on the core backend: the DispatchQueueWriteBuffer argument is not the Core variant, meaning a staging buffer produced by a different backend (WebGPU/Custom) was passed to the core queue. The faulty input is the mismatched staging_buffer dispatch enum.","triggerScenarios":"Thrown at wgpu/src/backend/wgpu_core.rs:1547 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only pass staging buffers obtained from the same Context/Queue instance that will write them","Check the dispatch enum variant before crossing backend boundaries"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}