Hash :
a6f267f9
Author :
Date :
2014-08-27T11:44:15
Fix row-major layout tracking in interface blocks. Some block field types, such as nested structs, were bugged. This only affects our "CollectVariables" path, not our current HLSL UBO path. BUG=angle:466 Change-Id: I2b8daf58aa7ec1ad06a80d38f57e76087eacccdc Reviewed-on: https://chromium-review.googlesource.com/213503 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
//
// Copyright (c) 2014 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.
//
// ShaderVars.cpp:
// Methods for GL variable types (varyings, uniforms, etc)
//
#include <GLSLANG/ShaderLang.h>
namespace sh
{
ShaderVariable::ShaderVariable()
: type(0),
precision(0),
arraySize(0),
staticUse(false)
{}
ShaderVariable::ShaderVariable(GLenum typeIn, unsigned int arraySizeIn)
: type(typeIn),
precision(0),
arraySize(arraySizeIn),
staticUse(false)
{}
ShaderVariable::~ShaderVariable()
{}
ShaderVariable::ShaderVariable(const ShaderVariable &other)
: type(other.type),
precision(other.precision),
name(other.name),
mappedName(other.mappedName),
arraySize(other.arraySize),
staticUse(other.staticUse),
fields(other.fields),
structName(other.structName)
{}
ShaderVariable &ShaderVariable::operator=(const ShaderVariable &other)
{
type = other.type;
precision = other.precision;
name = other.name;
mappedName = other.mappedName;
arraySize = other.arraySize;
staticUse = other.staticUse;
fields = other.fields;
structName = other.structName;
return *this;
}
Uniform::Uniform()
{}
Uniform::~Uniform()
{}
Uniform::Uniform(const Uniform &other)
: ShaderVariable(other)
{}
Uniform &Uniform::operator=(const Uniform &other)
{
ShaderVariable::operator=(other);
return *this;
}
Attribute::Attribute()
: location(-1)
{}
Attribute::~Attribute()
{}
Attribute::Attribute(const Attribute &other)
: ShaderVariable(other),
location(other.location)
{}
Attribute &Attribute::operator=(const Attribute &other)
{
ShaderVariable::operator=(other);
location = other.location;
return *this;
}
InterfaceBlockField::InterfaceBlockField()
: isRowMajorLayout(false)
{}
InterfaceBlockField::~InterfaceBlockField()
{}
InterfaceBlockField::InterfaceBlockField(const InterfaceBlockField &other)
: ShaderVariable(other),
isRowMajorLayout(other.isRowMajorLayout)
{}
InterfaceBlockField &InterfaceBlockField::operator=(const InterfaceBlockField &other)
{
ShaderVariable::operator=(other);
isRowMajorLayout = other.isRowMajorLayout;
return *this;
}
Varying::Varying()
: interpolation(INTERPOLATION_SMOOTH),
isInvariant(false)
{}
Varying::~Varying()
{}
Varying::Varying(const Varying &other)
: ShaderVariable(other),
interpolation(other.interpolation),
isInvariant(other.isInvariant)
{}
Varying &Varying::operator=(const Varying &other)
{
ShaderVariable::operator=(other);
interpolation = other.interpolation;
isInvariant = other.isInvariant;
return *this;
}
InterfaceBlock::InterfaceBlock()
: arraySize(0),
layout(BLOCKLAYOUT_PACKED),
isRowMajorLayout(false),
staticUse(false)
{}
InterfaceBlock::~InterfaceBlock()
{}
InterfaceBlock::InterfaceBlock(const InterfaceBlock &other)
: name(other.name),
mappedName(other.mappedName),
instanceName(other.instanceName),
arraySize(other.arraySize),
layout(other.layout),
isRowMajorLayout(other.isRowMajorLayout),
staticUse(other.staticUse),
fields(other.fields)
{}
InterfaceBlock &InterfaceBlock::operator=(const InterfaceBlock &other)
{
name = other.name;
mappedName = other.mappedName;
instanceName = other.instanceName;
arraySize = other.arraySize;
layout = other.layout;
isRowMajorLayout = other.isRowMajorLayout;
staticUse = other.staticUse;
fields = other.fields;
return *this;
}
}