-
Notifications
You must be signed in to change notification settings - Fork 4
Add multipass pass support (buffers A-D) #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
it generally works, but I have tried a few complex shadertoys and run into various issues. For example this one https://www.shadertoy.com/view/Wf2SWK filickers really badly. I believe this might be an order of operations issue due to when we swap and when it actually gets drawn. Will need to look for more diagnostic shaders or write something myself. Another issue could be initialization/clearing |
Should be nearly ready for review. (looks like the screenshot differs because of the difference in channel order. It used to be bgra hardcoded and can no change based on device to the perferred format. the existing screenshot is the wrong order anyway, so needs to be updated. But I think either the .snapshot method or the testing script should normalize it to RGB(A) based on |
Turns out: it used to be bgra hardcoded, which no longer worked with offscreen in |
@Korijn can you help with a review for this? |
from .shadertoy import Shadertoy | ||
|
||
__version__ = "0.1.0" | ||
version_info = tuple(map(int, __version__.split("."))) | ||
version_info = tuple(map(int, __version__.split("."))) # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a hint, you can keep your code clean from # noqa
using the section at the bottom of your pyproject.toml
file where you already have this:
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
Just extend it with the specific warning you want to ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find any significant problems just by looking at the code. draw()
where the texture swap happens looks super simple and elegant. Nice work!!
the main part of #30
improvements over #30
with
wgpu-py>=0.21
we can actually setup a swap chain with back/front textures by making use of view-usages. This avoids doing a texture to texture copy for every single render target (could be 5 per frame) and should be much faster. We do however need to redo the bind groups and render pipeline every single frame. I might explore to only have two bind group/render pipeline s and just swapping between then - it feels faster and might work but could be way more complex with some shaders that use all four buffers with reflexivity.status
works and performs great, ready for review
todos: (might add more)