Retrieve depth texture from correct stage and for the correct eye #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current code in
Display.cpp
that retrieves the depth textures seems wrong. All the textures variables (m_UnityTextures
,m_pNativeColorTextures
andm_pNativeDepthTextures
) have the stage as first dimension and the eye as second dimension. On top of that, when single pass rendering is used, only the (depth) texture of the left eye is relevant (as it's a texture array holding both eyes).This is easily fixed, and AFAICS didn't cause any regression in what I was able to test. But additional testing would be nice, since I'm not even sure if I was testing it properly. The flags are set to
vr::Submit_Default
, so does that cause the compositor to infer the type of the texture? Or does this actually make the entiretex.depth.handle
go unnoticed? In case of the latter, that might explain how this mistake went unnoticed and would require a fix to pick the right flags as well.