compute-toys / wgpu-compute-toy

Cross-platform compute shader engine
https://compute.toys
MIT License
119 stars 16 forks source link

New blitter API #4

Closed pudnax closed 1 year ago

pudnax commented 1 year ago

For now, it's just a draft to show current progress. I'm trying to figure out how conversions with texture views work and if is it possible to remove linear to srgb functions from shader.

Main work is going in this repo

Tests

For first example I set surface format to Bgra8UnormSrgb and render png image on different viewports. rows: ordinary draw current blitter new blitter
columns: srgb tex srgb tex linr tex linr tex
srgb view linr view srgb view linr view

Things are changing when I set surface format to Bgra8Unorm.

Current blitter doesn't depend on the texture format and converts color spaces automatically.

Links

pudnax commented 1 year ago

I can't think of a way to remove conversion functions in shader. I'll need to pass textures and match on texture views, but it forces to create bind groups each time. Mipmap creation is a bit better, but the whole merge request feels bikeshedy.