wgpu_glyph icon indicating copy to clipboard operation
wgpu_glyph copied to clipboard

Switched to Queue based rendering

Open genusistimelord opened this issue 4 years ago • 8 comments

So based on #69 I have updated this to use the latest version and have Temporarily fixed the Scissoring issue.

The issue seems to be the Command buffer if using staging belt would be copy draw copy draw while with queue would be copy copy copy draw draw draw. So Until you decide to change the way the system buffers the rendering into a single Draw call that holds onto index's in a uniform array or something else we will be forced to use Fragment Shader scissoring.

When switching to use queue over the staging belt we gain the benefit of being able to render with Tokio async on Main with winit Event loop.

Also the Clipper is not the Greatest as it is Actual Screen coords so the best way to improve upon this would probably be to calculate offsets into the Region before passing it onto the GPU.

genusistimelord avatar Oct 08 '21 20:10 genusistimelord

this does fix the region scissor issue.

image

genusistimelord avatar Oct 08 '21 20:10 genusistimelord

Hah, nice way to handle it 👀 Glad someone else got it in!

I do wonder what the impact of the fragment shader based discard might be, but maybe it's alright

profan avatar Jan 21 '22 00:01 profan

Hah, nice way to handle it 👀 Glad someone else got it in!

I do wonder what the impact of the fragment shader based discard might be, but maybe it's alright

there should not be much impact since the GPU should optimize the rendering based on that. Though if we figured out a way to stream render glyphs which would mean to render an entire string in the shader versus inserting the string into a texture. we could still use the other method of clipping then.

genusistimelord avatar Jan 21 '22 03:01 genusistimelord

just updated this so it is now inline with master. Sadly had to do this the hard way since git did not want to auto merge =[.

genusistimelord avatar Jan 21 '22 13:01 genusistimelord

Hey, thank you for making this PR, I was having similar issues as #78 except in other browsers, and this PR fixed it (as people suspected, it was some kind of caching thing). I made a small extra modification here that made the API work better with my app.

pimlu avatar Jan 31 '22 03:01 pimlu

I have updated this which fixes the scissor and rendering issues that it originally had. it works without the staging belt! @hecrj

image

genusistimelord avatar May 05 '22 00:05 genusistimelord

@hecrj will this be merged anytime soon ?

VincentJousse avatar May 24 '22 10:05 VincentJousse

@VincentJousse probably not as he is looking into another renderer first to see if it will work better or not. But feel free to use it from my repo.

genusistimelord avatar May 24 '22 11:05 genusistimelord