{"record":{"id":"b9b56881e0d50204","repo":"FyroxEngine/Fyrox","slug":"blit-to-scaling-not-supported-in-wgpu-backend-sk","errorCode":null,"errorMessage":"blit_to: scaling not supported in wgpu backend, skipping","messagePattern":"blit_to: scaling not supported in wgpu backend, skipping","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"fyrox-graphics-wgpu/src/framebuffer.rs","lineNumber":865,"sourceCode":"        dst_y1: i32,\n        copy_color: bool,\n        copy_depth: bool,\n        copy_stencil: bool,\n    ) {\n        let Some(server) = self.server.upgrade() else {\n            return;\n        };\n        let Some(dest) = dest.as_any().downcast_ref::<WgpuFrameBuffer>() else {\n            return;\n        };\n\n        let src_w = (src_x1 - src_x0) as u32;\n        let src_h = (src_y1 - src_y0) as u32;\n        let dst_w = (dst_x1 - dst_x0) as u32;\n        let dst_h = (dst_y1 - dst_y0) as u32;\n\n        if src_w != dst_w || src_h != dst_h {\n            Log::warn(\"blit_to: scaling not supported in wgpu backend, skipping\");\n            return;\n        }\n\n        server.flush_active_pass();\n\n        let mut encoder = server.frame_encoder.borrow_mut().take().unwrap_or_else(|| {\n            server\n                .state\n                .device\n                .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None })\n        });\n\n        if copy_color {\n            for (src_att, dst_att) in self.color_attachments.iter().zip(&dest.color_attachments) {\n                copy_attachment_texture(\n                    &mut encoder,\n                    src_att,\n                    dst_att,","sourceCodeStart":847,"sourceCodeEnd":883,"githubUrl":"https://github.com/FyroxEngine/Fyrox/blob/76c91aad8eca488ce527b1af707be8b3b24ad72d/fyrox-graphics-wgpu/src/framebuffer.rs#L847-L883","documentation":"wgpu's copy_texture_to_texture can only do 1:1 copies; it cannot scale pixel data. The wgpu backend's blit_to therefore refuses blits whose source and destination rectangles differ in size, logs this warning, and skips the operation instead of producing a stretched copy.","triggerScenarios":"Calling Framebuffer::blit_to (server.framebuffer_blit) with a destination rect whose width or height differs from the source rect in the wgpu backend.","commonSituations":"Code ported from the GL backend that relied on glBlitFramebuffer's free scaling (e.g. rendering a framebuffer into a resized viewport or thumbnail).","solutions":["Make the destination rect the same size as the source rect (1:1 copy)","Add an intermediate pass that renders the source texture into the destination with a scaling shader (fullscreen quad + sampler)","Use a filtering-capable copy path if a scaled blit is essential"],"exampleFix":"// before\nframebuffer.blit_to(server, dest, src_rect(0,0,512,512), dst_rect(0,0,256,256));\n// after\nframebuffer.blit_to(server, dest, src_rect(0,0,512,512), dst_rect(0,0,512,512));","handlingStrategy":"validation","validationCode":"if src_w != dst_w || src_h != dst_h {\n    // resolve with a scaling render pass instead of blit_to\n}\nframebuffer.blit_to(server, dest, src_rect, dst_rect);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use blit_to for 1:1 copies in cross-backend code","Implement a scaling draw pass for resized copies","Test graphics code against the wgpu backend, not just GL"],"tags":["wgpu","framebuffer","blit","scaling"],"backgroundTag":"unsupported-operation","analyzedSha":"76c91aad8eca488ce527b1af707be8b3b24ad72d","analyzedAt":"2026-09-10T16:04:01.633Z","contentChangedAt":"2026-09-10T16:04:01.633Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}