Clean up checking variable packing limits
This encapsulates expanding struct variables inside the VariablePacker
class that packs variables according to the GLSL ES spec.
The variable expansion step is no longer run twice when checking
uniforms against the max uniforms limit.
BUG=angleproject:2068
TEST=angle_unittests
Change-Id: I012ddaa249f71c0a78d937c98007c61352e64888
Reviewed-on: https://chromium-review.googlesource.com/608367
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 72a3259..8b7cb0e 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -484,13 +484,9 @@
}
if (compileOptions & SH_ENFORCE_PACKING_RESTRICTIONS)
{
- std::vector<sh::ShaderVariable> expandedUniforms;
- sh::ExpandUniforms(uniforms, &expandedUniforms);
- VariablePacker packer;
// Returns true if, after applying the packing rules in the GLSL ES 1.00.17 spec
// Appendix A, section 7, the shader does not use too many uniforms.
- success =
- packer.CheckVariablesWithinPackingLimits(maxUniformVectors, expandedUniforms);
+ success = CheckVariablesInPackingLimits(maxUniformVectors, uniforms);
if (!success)
{
mDiagnostics.globalError("too many uniforms");