Refactor stereo build flags and configs (#7857)

- Add option to build.sh to build for paritcular stereo
   techniques (default to NONE). Only applies to samples.
 - Consoldiate viewer checkbox for debugging stereo rendering
 - Add DriverConfig flag for stereoscopic type so that it can
   be used to determine availability of the feature and
   (to be completed) enable corresponding GPU features.

Co-authored-by: Mathias Agopian <mathias@google.com>
This commit is contained in:
Powei Feng
2024-05-16 17:37:27 +00:00
committed by GitHub
co-authored by Mathias Agopian
parent ab12984912
commit a9f3971989
25 changed files with 141 additions and 63 deletions
+4 -3
View File
@@ -539,15 +539,16 @@ bool GLSLPostProcessor::fullOptimization(const TShader& tShader,
if (config.variant.hasStereo() && config.shaderType == ShaderStage::VERTEX) {
switch (config.materialInfo->stereoscopicType) {
case StereoscopicType::INSTANCED:
// Nothing to generate
break;
case StereoscopicType::MULTIVIEW:
// For stereo variants using multiview feature, this generates the shader code below.
// #extension GL_OVR_multiview2 : require
// layout(num_views = 2) in;
glslOptions.ovr_multiview_view_count = config.materialInfo->stereoscopicEyeCount;
break;
case StereoscopicType::INSTANCED:
case StereoscopicType::NONE:
// Nothing to generate
break;
}
}