{"record":{"id":"5924945949a17e13","repo":"gfx-rs/wgpu","slug":"surface-should-be-a-native-vulkan-surface","errorCode":null,"errorMessage":"Surface should be a native Vulkan surface","messagePattern":"Surface should be a native Vulkan surface","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu-hal/src/vulkan/mod.rs","lineNumber":359,"sourceCode":"    /// - `chain` must point to a valid `pNext` chain of structs that can extend\n    ///   [`vk::SwapchainCreateInfoKHR`]. The extensions in the chain must be enabled\n    ///   on the device the surface is configured with.\n    /// - The chain must stay valid until the configuration that consumes it returns\n    ///   or the surface is dropped. Don't read or write the chain during that time.\n    ///   Fields the driver wrote during swapchain creation may be read afterwards.\n    ///\n    /// # Panics\n    ///\n    /// - If the surface isn't a native Vulkan surface, such as a DXGI surface.\n    ///\n    /// [VK_NV_low_latency2]: https://registry.khronos.org/vulkan/specs/latest/man/html/VK_NV_low_latency2.html\n    #[track_caller]\n    pub unsafe fn set_next_swapchain_create_chain(&self, chain: *mut c_void) {\n        let surface = self\n            .inner\n            .as_any()\n            .downcast_ref::<swapchain::NativeSurface>()\n            .expect(\"Surface should be a native Vulkan surface\");\n        unsafe { surface.set_next_swapchain_create_chain(chain) };\n    }\n}\n\n#[derive(Debug)]\npub struct SurfaceTexture {\n    index: u32,\n    texture: Texture,\n    metadata: Box<dyn swapchain::SurfaceTextureMetadata>,\n}\n\nimpl crate::DynSurfaceTexture for SurfaceTexture {}\n\nimpl Borrow<Texture> for SurfaceTexture {\n    fn borrow(&self) -> &Texture {\n        &self.texture\n    }\n}","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu-hal/src/vulkan/mod.rs#L341-L377","documentation":"Panic in SurfaceTextureExt/compute_render_extent's mip_level_size call: the requested mip level exceeds the texture's mip level count, so no size exists for it. The faulty input is the out-of-range mip_level argument.","triggerScenarios":"Thrown at wgpu-hal/src/vulkan/mod.rs:359 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure mip_level < texture.mip_level_count before computing render extents","Validate the subresource range against the texture descriptor"],"exampleFix":null,"handlingStrategy":"validation","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"}