{"record":{"id":"48709fa536043725","repo":"neovide/neovide","slug":"failed-to-create-skia-context","errorCode":null,"errorMessage":"Failed to create Skia context","messagePattern":"Failed to create Skia context","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/renderer/d3d.rs","lineNumber":241,"sourceCode":"                .expect(\"Failed to create fence\")\n        };\n\n        let fence_event = unsafe {\n            CreateEventW(None, false, false, PCWSTR::null()).expect(\"Failed to create event\")\n        };\n        let frame_index = unsafe { swap_chain.GetCurrentBackBufferIndex() as usize };\n\n        let backend_context = BackendContext {\n            adapter: adapter.clone(),\n            device: device.clone(),\n            queue: command_queue.clone(),\n            memory_allocator: None,\n            protected_context: Protected::No,\n        };\n        let gr_context = unsafe {\n            tracy_zone!(\"create skia context\");\n            direct_contexts::make_d3d(&backend_context, None)\n                .expect(\"Failed to create Skia context\")\n        };\n\n        let mut ret = Self {\n            _adapter: adapter,\n            #[cfg(feature = \"gpu_profiling\")]\n            device,\n            command_queue,\n            swap_chain,\n            swap_chain_desc,\n            swap_chain_waitable,\n            gr_context,\n            _backend_context: backend_context,\n            buffers: Vec::new(),\n            surfaces: Vec::new(),\n            fence_values,\n            fence,\n            fence_event,\n            frame_swapped: true,","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/neovide/neovide/blob/ade2d9cda777879975b1852f77dc672f5ff43b78/src/renderer/d3d.rs#L223-L259","documentation":"Thrown when Skia's direct_contexts::make_d3d(&backend_context, None) cannot create a GrDirectContext over the D3D12 backend. Skia wraps the supplied adapter/device/queue into its own GPU context; failure means the backend context is invalid (device lost, unsupported adapter/feature level) or Skia's D3D backend couldn't initialize (memory, unsupported format/query support).","triggerScenarios":"BackendContext carries a device-removed or feature-level-incompatible ID3D12Device; memory_allocator None combined with an adapter lacking required features; Skia build without D3D backend support; out-of-memory creating internal command lists/queries.","commonSituations":"Old GPU/driver below D3D12 feature requirements; software rendering environments; mismatched skia-safe versions where make_d3d semantics changed; WARP adapter with limited feature support.","solutions":["Verify the D3D12 device is healthy (GetDeviceRemovedReason == S_OK) before make_d3d","Confirm the adapter supports the required D3D12 feature level; try WARP adapter to isolate hardware issues","Check that the skia-safe build enables D3D support (correct feature flags)","Print the returned error HRESULT/Error to distinguish unsupported-adapter from OOM"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let reason = unsafe { device.GetDeviceRemovedReason() };\nif reason.is_err() { eprintln!(\"cannot build Skia context on removed device: {reason:?}\"); }\n// also confirm feature level:\n// device.CheckFeatureSupport(D3D12_FEATURE_FEATURE_LEVELS, ...)","typeGuard":null,"tryCatchPattern":"let gr_context = unsafe { direct_contexts::make_d3d(&backend_context, None) }\n    .map_err(|e| { log::error!(\"make_d3d failed: {e:?}\"); RendererInitError::SkiaContext(e) })?;","preventionTips":["Verify device health (GetDeviceRemovedReason) right before make_d3d","Test with the WARP adapter to separate driver/hardware problems from Skia issues","Keep skia-safe versions in sync with your Skia feature requirements","Surface the underlying error instead of expect()-panicking so users get actionable messages"],"tags":["skia","d3d12","directx","graphics","windows"],"backgroundTag":"module-init-failed","analyzedSha":"ade2d9cda777879975b1852f77dc672f5ff43b78","analyzedAt":"2026-09-06T04:14:57.389Z","contentChangedAt":"2026-09-06T04:14:57.389Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}