zed-industries/zed · error
could not create render pipeline state
Error message
could not create render pipeline state
What it means
After configuring the RenderPipelineDescriptor, device.newRenderPipelineState failed (returned an error) and the code unwraps/panics: the GPU rejected the pipeline (unsupported pixel format, invalid blend settings, missing functions). Pipeline creation failure prevents any drawing.
Source
Thrown at crates/gpui_apple/src/metal_renderer.rs:1307
.expect("error locating fragment function");
let descriptor = metal::RenderPipelineDescriptor::new();
descriptor.set_label(label);
descriptor.set_vertex_function(Some(vertex_fn.as_ref()));
descriptor.set_fragment_function(Some(fragment_fn.as_ref()));
let color_attachment = descriptor.color_attachments().object_at(0).unwrap();
color_attachment.set_pixel_format(pixel_format);
color_attachment.set_blending_enabled(true);
color_attachment.set_rgb_blend_operation(metal::MTLBlendOperation::Add);
color_attachment.set_alpha_blend_operation(metal::MTLBlendOperation::Add);
color_attachment.set_source_rgb_blend_factor(metal::MTLBlendFactor::SourceAlpha);
color_attachment.set_source_alpha_blend_factor(metal::MTLBlendFactor::One);
color_attachment.set_destination_rgb_blend_factor(metal::MTLBlendFactor::OneMinusSourceAlpha);
color_attachment.set_destination_alpha_blend_factor(metal::MTLBlendFactor::One);
device
.new_render_pipeline_state(&descriptor)
.expect("could not create render pipeline state")
}
fn build_path_sprite_pipeline_state(
device: &metal::DeviceRef,
library: &metal::LibraryRef,
label: &str,
vertex_fn_name: &str,
fragment_fn_name: &str,
pixel_format: metal::MTLPixelFormat,
) -> metal::RenderPipelineState {
let vertex_fn = library
.get_function(vertex_fn_name, None)
.expect("error locating vertex function");
let fragment_fn = library
.get_function(fragment_fn_name, None)
.expect("error locating fragment function");
let descriptor = metal::RenderPipelineDescriptor::new();View on GitHub (pinned to 9d272b0363)
Solutions
- Check the pixel format is supported on the target device (MTLPixelFormat::BGRA8Unorm)
- Log the underlying NSError detail to identify the rejected state
- Verify vertex/fragment functions were set and compatible with the vertex descriptor
- Update GPU drivers or fall back to a supported configuration
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/gpui_apple/src/metal_renderer.rs:1300 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20).
Data as JSON: /api/errors/cde17b05aeb92df4.
Report an issue: GitHub.