{"record":{"id":"26c30b5102dac308","repo":"zed-industries/zed","slug":"instance-data-needs-required-bytes-above-the-ma","errorCode":null,"errorMessage":"instance data needs {required} bytes, above the maximum of {}","messagePattern":"instance data needs (.+?) bytes, above the maximum of (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_wgpu/src/wgpu_renderer.rs","lineNumber":1934,"sourceCode":"                    offset: 0,\n                    bytes_per_row: Some(INSTANCE_TEXTURE_TEXEL_SIZE as u32),\n                    rows_per_image: None,\n                },\n                wgpu::Extent3d {\n                    width: 1,\n                    height: 1,\n                    depth_or_array_layers: 1,\n                },\n            );\n            break;\n        }\n    }\n\n    fn grow_instance_data(&mut self, required: u64) -> Result<()> {\n        let capacity = (self.instance_data_capacity * 2)\n            .max(required.next_power_of_two())\n            .min(self.max_instance_data_size);\n        anyhow::ensure!(\n            capacity >= required,\n            \"instance data needs {required} bytes, above the maximum of {}\",\n            self.max_instance_data_size\n        );\n        anyhow::ensure!(\n            capacity > self.instance_data_capacity,\n            \"frame instance data exceeds the {}-byte maximum\",\n            self.max_instance_data_size\n        );\n        log::debug!(\n            \"instance data grown from {} to {capacity}\",\n            self.instance_data_capacity\n        );\n        // Bind groups created earlier in the frame keep the previous buffer or\n        // texture alive, so allocations written before the grow remain valid;\n        // only subsequent writes land in the new allocation.\n        let uses_webgl_instance_data = self.uses_webgl_instance_data;\n        let resources = self.resources_mut();","sourceCodeStart":1916,"sourceCodeEnd":1952,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_wgpu/src/wgpu_renderer.rs#L1916-L1952","documentation":"Guard inside `grow_instance_data`: the per-frame GPU instance buffer would need `required` bytes (doubled capacity, power-of-two) above `max_instance_data_size`, so growing is refused. Fires when a single frame's instance data exceeds the compile-time maximum, indicating an unbounded/atlas-sized batch that must be split.","triggerScenarios":"Thrown at crates/gpui_wgpu/src/wgpu_renderer.rs:1934 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Split the frame's instance batches so no single draw exceeds max_instance_data_size.","Raise max_instance_data_size if scenes legitimately need more instances.","Check for pathological geometry counts (e.g. unbounded path tessellation) upstream.","Clamp batch size and flush multiple draw calls within the same buffer."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}