-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Uniform buffer in vertex shader "disappears" when adding uniforms to fragment shader #220
Comments
Sounds like a bug in reflection. But you're saying it doesn't work when you specify layout manually which is odd. |
But you still read zeros in vertex shader instead of expected data? |
I'm not sure what you mean by that, but the uniform buffer gets uploaded correctly to the vertex shader. While poking around in RenderDoc, I also noticed that the texture doesn't get uploaded correctly. It lacks any color data and is completely transparent. This is likely what makes the triangle I'm trying to render invisible. What causes this isn't obvious to me and it doesn't help that RenderDoc doesn't emit any warnings now even though (I think) I haven't changed the code at all (there used to be "11 Errors and Warnings"). |
Can you share code that reproduces this bug? |
Here are all the files that should be relevant: |
If anything, the troubles I had getting this working should serve as a reminder that I should always read examples and documentation properly instead of skimming through it. There were two problems that managed to cripple my progress on porting this tutorial. 1: Shader reflection doesn't seem to remember that there's a uniform in the vertex shader once I add uniforms to the fragment shader (amethyst/rendy#220). This is remedied by specifying the uniform bindings manually. 2: The image I was trying to render onto the triangle wouldn't upload properly, leaving me with an entirely transparent black texture. The root cause of this issue was that I forgot to call `factory.maintain()` before running the graph (or at all, really).
I've managed to resolve the issue that was causing the texture to not upload. I forgot to call |
I'm currently trying to "port" glium's incomplete tutorial to rendy by looking at rendy's examples and API docs. I've unfortunately hit a roadblock on part 6 "Uploading a texture". The uniform buffer I was already using successfully "dissapears" when I add
uniform texture2D
anduniform sampler colorsampler
to the fragment shader.ShaderReflection.layout().unwrap()
returnseven though I haven't removed the uniform buffer that on its own is detected as
It doesn't work properly when I set the descriptor layout manually either.
The relevant code can be found here along with the vertex and fragment shaders. The bits that make it break in various ways are commented out.
The text was updated successfully, but these errors were encountered: