Select viewport index in the GLSL/ESSL vertex shader
The patch enables viewport selection for multiview rendering in the
GLSL/ESSL vertex shader through the use of the GL_NV_viewport_array2
extension. The AST is modified only for GLSL and ESSL to include the
viewport selection expression after ViewID_OVR's initialization.
BUG=angleproject:2062
TEST=angle_unittests
Change-Id: Iee05bb5a4b687ed53ddbdd466f1572227b1f0cde
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 6e76fe1..a194071 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -431,7 +431,8 @@
if (success && (compileOptions & SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW) &&
parseContext.isMultiviewExtensionEnabled() && getShaderType() != GL_COMPUTE_SHADER)
{
- DeclareAndInitBuiltinsForInstancedMultiview(root, getNumViews(), getShaderType());
+ DeclareAndInitBuiltinsForInstancedMultiview(root, mNumViews, shaderType, compileOptions,
+ outputType);
}
// This pass might emit short circuits so keep it before the short circuit unfolding