Git Product home page Git Product logo

Comments (5)

pacmancoder avatar pacmancoder commented on August 28, 2024

UPD: Huh... Looks like it reproduces only on Firefox (v93)....

from wgpu_glyph.

pacmancoder avatar pacmancoder commented on August 28, 2024

When wgpu is updated to thje latest master (gfx-rs/wgpu@d46c39a) It produces even more bizarre results (still, only on Firefox)

image

UPD1: Decreasing initial cache cache makes this bug even funnier (yep, still reproduces only in Firefox):

WARNING: Quickli changing images (gif)

bug

UPD2: Set draw_cache_align_4x4(true) (I missed the fact that is should be enabled on WebGL), but still, no visible change.

from wgpu_glyph.

hecrj avatar hecrj commented on August 28, 2024
  • Are we sure the example is leveraging WebGL and not the experimental WebGPU API?
  • The example in your fork does not match the screenshots you shared. There is no "Frame #" text in the source.
  • If I had to guess, I'd say that there is something up with the cache upload logic here:
    // It is a webgpu requirement that:
    // BufferCopyView.layout.bytes_per_row % wgpu::COPY_BYTES_PER_ROW_ALIGNMENT == 0
    // So we calculate padded_width by rounding width
    // up to the next multiple of wgpu::COPY_BYTES_PER_ROW_ALIGNMENT.
    let align = wgpu::COPY_BYTES_PER_ROW_ALIGNMENT as usize;
    let padded_width_padding = (align - width % align) % align;
    let padded_width = width + padded_width_padding;
    let padded_data_size = (padded_width * height) as u64;
    if self.upload_buffer_size < padded_data_size {
    self.upload_buffer =
    device.create_buffer(&wgpu::BufferDescriptor {
    label: Some("wgpu_glyph::Cache upload buffer"),
    size: padded_data_size,
    usage: wgpu::BufferUsages::COPY_DST
    | wgpu::BufferUsages::COPY_SRC,
    mapped_at_creation: false,
    });
    self.upload_buffer_size = padded_data_size;
    }
    let mut padded_data = staging_belt.write_buffer(
    encoder,
    &self.upload_buffer,
    0,
    NonZeroU64::new(padded_data_size).unwrap(),
    device,
    );
    for row in 0..height {
    padded_data[row * padded_width..row * padded_width + width]
    .copy_from_slice(&data[row * width..(row + 1) * width])
    }
    // TODO: Move to use Queue for less buffer usage
    encoder.copy_buffer_to_texture(
    wgpu::ImageCopyBuffer {
    buffer: &self.upload_buffer,
    layout: wgpu::ImageDataLayout {
    offset: 0,
    bytes_per_row: NonZeroU32::new(padded_width as u32),
    rows_per_image: NonZeroU32::new(height as u32),
    },
    },
    wgpu::ImageCopyTexture {
    texture: &self.texture,
    mip_level: 0,
    origin: wgpu::Origin3d {
    x: u32::from(offset[0]),
    y: u32::from(offset[1]),
    z: 0,
    },
    aspect: wgpu::TextureAspect::All,
    },
    wgpu::Extent3d {
    width: size[0] as u32,
    height: size[1] as u32,
    depth_or_array_layers: 1,
    },
    );

from wgpu_glyph.

pacmancoder avatar pacmancoder commented on August 28, 2024

@hecrj Wow, I forgot to push local changes to the fork 🥴... Now it is in place, sorry for that!

Well, I explicitly ask wgpu for wgpu::Backends::GL backend, so unless if something is completely broken in wgpu, it should use WebGL, I guess...

Yea, my bet is too on the broken caching logic, but I not yet figured out what shat is specifically wrong with it...

from wgpu_glyph.

Tnze avatar Tnze commented on August 28, 2024

Similar problems were encountered when i was using iced v0.3.0. the last few words are not rendered.

not the web but default wgpu

from wgpu_glyph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.