Store compact and expanded shader variables.
The current shader API ShGetVariableInfo relies on an expanded
list of shader variables. That means that struct, or user-defined
variables, are expanded into separate entries for the app to
easily query struct members. The new API will preserve the struct
layout, so we can store both to support both the old and new
queries.
BUG=angle:466
Change-Id: Id30a1d7d1bb49c7e745510e0d699f94ad3184b9c
Reviewed-on: https://chromium-review.googlesource.com/206569
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
diff --git a/src/compiler/translator/ShaderLang.cpp b/src/compiler/translator/ShaderLang.cpp
index 7c6c173..e41cd1c 100644
--- a/src/compiler/translator/ShaderLang.cpp
+++ b/src/compiler/translator/ShaderLang.cpp
@@ -64,9 +64,9 @@
case SH_ACTIVE_ATTRIBUTES:
return ReturnVariable(compiler->getAttributes(), index);
case SH_ACTIVE_UNIFORMS:
- return ReturnVariable(compiler->getUniforms(), index);
+ return ReturnVariable(compiler->getExpandedUniforms(), index);
case SH_VARYINGS:
- return ReturnVariable(compiler->getVaryings(), index);
+ return ReturnVariable(compiler->getExpandedVaryings(), index);
default:
UNREACHABLE();
return NULL;
@@ -250,7 +250,7 @@
*params = compiler->getInfoSink().obj.size() + 1;
break;
case SH_ACTIVE_UNIFORMS:
- *params = compiler->getUniforms().size();
+ *params = compiler->getExpandedUniforms().size();
break;
case SH_ACTIVE_UNIFORM_MAX_LENGTH:
*params = 1 + GetGlobalMaxTokenSize(compiler->getShaderSpec());
@@ -262,7 +262,7 @@
*params = 1 + GetGlobalMaxTokenSize(compiler->getShaderSpec());
break;
case SH_VARYINGS:
- *params = compiler->getVaryings().size();
+ *params = compiler->getExpandedVaryings().size();
break;
case SH_VARYING_MAX_LENGTH:
*params = 1 + GetGlobalMaxTokenSize(compiler->getShaderSpec());