Commit 15de9262 by Olli Etuaho Committed by Commit Bot

Add array size functions to ShaderVars

These can be used instead of direct access of the arraySize field in Chromium, so that arrays of arrays support can be implemented inside ANGLE without breaking the Chromium build. BUG=angleproject:2125 TEST=angle_unittests Change-Id: I123c2a18549e8f6e40ade946870a5437faf2155e Reviewed-on: https://chromium-review.googlesource.com/718201Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 45f5d6f8
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
// Version number for shader translation API. // Version number for shader translation API.
// It is incremented every time the API changes. // It is incremented every time the API changes.
#define ANGLE_SH_VERSION 182 #define ANGLE_SH_VERSION 183
enum ShShaderSpec enum ShShaderSpec
{ {
......
...@@ -68,6 +68,10 @@ struct ShaderVariable ...@@ -68,6 +68,10 @@ struct ShaderVariable
unsigned int elementCount() const { return std::max(1u, arraySize); } unsigned int elementCount() const { return std::max(1u, arraySize); }
bool isStruct() const { return !fields.empty(); } bool isStruct() const { return !fields.empty(); }
// Array size 0 means not an array when passed to or returned from these functions.
unsigned int getOutermostArraySize() const { return arraySize; }
void setArraySize(unsigned int size) { arraySize = size; }
// All of the shader's variables are described using nested data // All of the shader's variables are described using nested data
// structures. This is needed in order to disambiguate similar looking // structures. This is needed in order to disambiguate similar looking
// types, such as two structs containing the same fields, but in // types, such as two structs containing the same fields, but in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment