Skip to content
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

When using multipass in multiple shaders, the buffers will persist between shaders if they share the same name. #240

Open
sp4ghet opened this issue Jun 3, 2020 · 2 comments

Comments

@sp4ghet
Copy link
Contributor

sp4ghet commented Jun 3, 2020

I think the behaviour we expect is for the buffers to reset when we change shaders, so that a buffer write from one shader doesn't persist in the next shader. If this is expected behaviour, feel free to close.

I'll try and fix it and send a PR within the week but if it's a no-brainer also feel free to fix it for me :p

@fand
Copy link
Owner

fand commented Jun 10, 2020

ah, I wasn't aware that buffers don't reset on changing shaders...
The expected behavior is exactly that you wrote above.

@sp4ghet
Copy link
Contributor Author

sp4ghet commented Jun 11, 2020

Unfortunately, I can't seem to replicate the issue I was having enough to pinpoint what the cause is...

Essentially, when I was writing the ray tracing code, occasionally a shader that I hadn't modified would render very differently than it usually does because I was using a different shader for a while, which had normals pointing the wrong way. Thus, my assumption was that the "accumulate" pass buffer was persisting between shaders. I'm unsure what the actual problem was, but I solved it by reloading the window whenever that happened.

It might have something to do with filling buffers with NaNs, but I'm not really sure what caused it. In any case, under normal use, it seems like the buffers don't persist, but I definitely experienced some cases where it did persist (I also had a shader which purely played vided, and another shader which would render raytracing, and the accumulate buffer would show the video)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants