Custom wgsl fragment shaders for the femtovg+wgpu backend#10874
Custom wgsl fragment shaders for the femtovg+wgpu backend#10874expenses wants to merge 1 commit intoslint-ui:masterfrom
Conversation
|
Very nice to see that this is not very intrusive and quite feasible. I think we may need to sit down and discuss with Nigel what the API really should look like. I have the feeling that it would be really good to be able to specify uniforms as Slint properties, and for that an element style API might be more suitable than a brush. I also have the feeling that we may indeed want to focus primarily on the shaders being separate files, so an include_string or Implementation wise, I have the feeling that since we'll need to implement this for other renderers like Skia or Vello in the future, we may need to have a generic implementation that uses wgpu and produces a texture, and then renderers (Skia, Vello, etc.) just blit that texture. For that we have import logic, and we just can't feed WGSL into Skia or Vello. But I might be missing something, so I'm curious what your thoughts are :) |
|
(FWIW, I suggest to create a sub-task of #612 and we continue to discuss spec and design there) |
|
@tronical will reply to the rest of this in a bit, but for now here's the @include_string implementation I got AI to bash out: master...expenses:slint:include-string-macro. Could potentially clean that up and merge it on it's own (might be valuable for large text blocks etc). |
I think |

Requires femtovg/femtovg#263.
Tested with the following:
It's a little tricky to use currently given that multiline strings aren't supported.