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

Major design flaw with ms-holographic-experimental #76

Open
mlfarrell opened this issue Aug 5, 2016 · 5 comments
Open

Major design flaw with ms-holographic-experimental #76

mlfarrell opened this issue Aug 5, 2016 · 5 comments

Comments

@mlfarrell
Copy link

mlfarrell commented Aug 5, 2016

I spent hours today debugging an issue that finally led to my discovery of this flaw:

glClear of the default framebuffer triggers a call to EGLint HolographicSwapChain11::updateHolographicRenderingParameters()

This method inspects the current shader and sets the uHolographicViewProjectionMatrix uniform for THAT shader at THAT time. This totally breaks down when using multiple shaders, since only the last bound shader receives the info, and clearing the framebuffer multiple times per frame isn't a valid solution. This mechanism is going to need to be rethought to ensure that multiple shaders can access the uHolographicViewProjectionMatrix state.

One solution would be to store the matrices in the GL state and allow a glGet(GL_HOLOGRAPHIC_VP_MATRICES_ANGLE, matrices); so I can set them for the shaders myself

@mlfarrell
Copy link
Author

Potential solution

mlfarrell@7a858fc

@MikeRiches
Copy link
Member

MikeRiches commented Sep 2, 2016

@mlfarrell: I agree that you should be able to get the matrices and apply them to the shader pipeline yourself. This will be better for multi-pass rendering techniques. I will investigate a fix for this in the next update.

@mlfarrell
Copy link
Author

mlfarrell commented Sep 2, 2016

Yea. I'm pretty forked from you guys at this point. Feel free to check my fork to see how I tackled this on my end. I'll try to update and sync up to your branch in the future as you guys continue to mature it.

https://github.com/mlfarrell/angle

@bouviervj
Copy link

Spend hours before seeing this issue ...
@mlfarrell I have seen your patch, should we implement instead a trigger when calling glUseProgram ? It would be more transparent and less platform dependant.

@mlfarrell
Copy link
Author

What I ended up doing was implementing a target I could call from angle to glGet to obtain the holo matrices myself instead of relying on automatic conversion. This allowed me to manage multiple shaders myself. I also have (in my engine) a flag I can check to see whether I'm targeting a stereo FBO or not and act accordingly.

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

No branches or pull requests

4 participants