FyroxEngine/Fyrox · warning

blit_to: scaling not supported in wgpu backend, skipping

Error message

blit_to: scaling not supported in wgpu backend, skipping

What it means

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.

Solutions

  1. Make the destination rect the same size as the source rect (1:1 copy)
  2. Add an intermediate pass that renders the source texture into the destination with a scaling shader (fullscreen quad + sampler)
  3. Use a filtering-capable copy path if a scaled blit is essential

Example fix

// before
framebuffer.blit_to(server, dest, src_rect(0,0,512,512), dst_rect(0,0,256,256));
// after
framebuffer.blit_to(server, dest, src_rect(0,0,512,512), dst_rect(0,0,512,512));
Defensive patterns

Strategy: validation

Validate before calling

if src_w != dst_w || src_h != dst_h {
    // resolve with a scaling render pass instead of blit_to
}
framebuffer.blit_to(server, dest, src_rect, dst_rect);

Prevention

When it happens

Trigger: Calling Framebuffer::blit_to (server.framebuffer_blit) with a destination rect whose width or height differs from the source rect in the wgpu backend.

Common situations: Code ported from the GL backend that relied on glBlitFramebuffer's free scaling (e.g. rendering a framebuffer into a resized viewport or thumbnail).

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of FyroxEngine/Fyrox@76c91aad8e (2026-09-10). Data as JSON: /api/errors/b9b56881e0d50204. Report an issue: GitHub.

Appendix: source

Thrown at fyrox-graphics-wgpu/src/framebuffer.rs:865

        dst_y1: i32,
        copy_color: bool,
        copy_depth: bool,
        copy_stencil: bool,
    ) {
        let Some(server) = self.server.upgrade() else {
            return;
        };
        let Some(dest) = dest.as_any().downcast_ref::<WgpuFrameBuffer>() else {
            return;
        };

        let src_w = (src_x1 - src_x0) as u32;
        let src_h = (src_y1 - src_y0) as u32;
        let dst_w = (dst_x1 - dst_x0) as u32;
        let dst_h = (dst_y1 - dst_y0) as u32;

        if src_w != dst_w || src_h != dst_h {
            Log::warn("blit_to: scaling not supported in wgpu backend, skipping");
            return;
        }

        server.flush_active_pass();

        let mut encoder = server.frame_encoder.borrow_mut().take().unwrap_or_else(|| {
            server
                .state
                .device
                .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None })
        });

        if copy_color {
            for (src_att, dst_att) in self.color_attachments.iter().zip(&dest.color_attachments) {
                copy_attachment_texture(
                    &mut encoder,
                    src_att,
                    dst_att,

View on GitHub (pinned to 76c91aad8e)