blob: 6bfdef50309b8ded6a2324ca55945114ed452f76 [file] [log] [blame]
shannonwoods@chromium.org7e0904d2013-05-30 00:06:45 +00001//
2// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7#include "compiler/Uniform.h"
8
9namespace sh
10{
11
Jamie Madilldefb6742013-06-20 11:55:51 -040012ShaderVariable::ShaderVariable()
13 : type(GL_NONE),
14 precision(GL_NONE),
15 arraySize(0),
16 location(-1)
17{
18}
19
Jamie Madill46131a32013-06-20 11:55:50 -040020ShaderVariable::ShaderVariable(GLenum type, GLenum precision, const char *name, unsigned int arraySize, int location)
21 : type(type),
22 precision(precision),
23 name(name),
24 arraySize(arraySize),
25 location(location)
26{
27}
28
Jamie Madill010fffa2013-06-20 11:55:53 -040029Uniform::Uniform(GLenum type, GLenum precision, const char *name, unsigned int arraySize, unsigned int registerIndex, bool isRowMajorMatrix)
shannonwoods@chromium.org7e0904d2013-05-30 00:06:45 +000030{
31 this->type = type;
32 this->precision = precision;
33 this->name = name;
34 this->arraySize = arraySize;
35 this->registerIndex = registerIndex;
Jamie Madill010fffa2013-06-20 11:55:53 -040036 this->isRowMajorMatrix = isRowMajorMatrix;
shannonwoods@chromium.org7e0904d2013-05-30 00:06:45 +000037}
38
shannonwoods@chromium.orgd7784172013-05-30 00:07:03 +000039BlockMemberInfo::BlockMemberInfo(int offset, int arrayStride, int matrixStride, bool isRowMajorMatrix)
40 : offset(offset),
41 arrayStride(arrayStride),
42 matrixStride(matrixStride),
43 isRowMajorMatrix(isRowMajorMatrix)
44{
45}
46
47const BlockMemberInfo BlockMemberInfo::defaultBlockInfo(-1, -1, -1, false);
48
shannonwoods@chromium.org1500f092013-05-30 00:11:20 +000049InterfaceBlock::InterfaceBlock(const char *name, unsigned int arraySize, unsigned int registerIndex)
50 : name(name),
51 arraySize(arraySize),
shannonwoods@chromium.org70961b32013-05-30 00:17:48 +000052 layout(BLOCKLAYOUT_SHARED),
Jamie Madill9060a4e2013-08-12 16:22:57 -070053 registerIndex(registerIndex),
54 isRowMajorLayout(false)
shannonwoods@chromium.org1500f092013-05-30 00:11:20 +000055{
56}
57
shannonwoods@chromium.org7e0904d2013-05-30 00:06:45 +000058}