Hash :
4cd889ec
Author :
Date :
2017-10-20T11:19:57
Remove unnecessary work from VariablePacker The VariablePacker does not check the staticUse flag, variables should be pre-filtered according to their staticUse flag before passing them to CheckVariablesInPackingLimits if that's desired. The names of the variables are also not relevant to the packing. We keep the "name" field to make the code easier to debug, but updating the mappedName is not useful. This will make implementing arrays of arrays simpler. BUG=angleproject:2125 TEST=angle_unittests Change-Id: I5ce91885f6478ad436e6fa60ca9675e161d10256 Reviewed-on: https://chromium-review.googlesource.com/730104 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
//
// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Check whether variables fit within packing limits according to the packing rules from the GLSL ES
// 1.00.17 spec, Appendix A, section 7.
#ifndef COMPILER_TRANSLATOR_VARIABLEPACKER_H_
#define COMPILER_TRANSLATOR_VARIABLEPACKER_H_
#include <vector>
#include <GLSLANG/ShaderLang.h>
namespace sh
{
// Gets how many components in a row a data type takes.
int GetTypePackingComponentsPerRow(sh::GLenum type);
// Gets how many rows a data type takes.
int GetTypePackingRows(sh::GLenum type);
// Returns true if the passed in variables pack in maxVectors.
// T should be ShaderVariable or one of the subclasses of ShaderVariable.
template <typename T>
bool CheckVariablesInPackingLimits(unsigned int maxVectors, const std::vector<T> &variables);
} // namespace sh
#endif // COMPILER_TRANSLATOR_VARIABLEPACKER_H_