shannonwoods@chromium.org | 7e0904d | 2013-05-30 00:06:45 +0000 | [diff] [blame] | 1 | // |
| 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 | |
| 9 | namespace sh |
| 10 | { |
| 11 | |
Jamie Madill | defb674 | 2013-06-20 11:55:51 -0400 | [diff] [blame] | 12 | ShaderVariable::ShaderVariable() |
| 13 | : type(GL_NONE), |
| 14 | precision(GL_NONE), |
| 15 | arraySize(0), |
| 16 | location(-1) |
| 17 | { |
| 18 | } |
| 19 | |
Jamie Madill | 46131a3 | 2013-06-20 11:55:50 -0400 | [diff] [blame] | 20 | ShaderVariable::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 Madill | 010fffa | 2013-06-20 11:55:53 -0400 | [diff] [blame] | 29 | Uniform::Uniform(GLenum type, GLenum precision, const char *name, unsigned int arraySize, unsigned int registerIndex, bool isRowMajorMatrix) |
shannonwoods@chromium.org | 7e0904d | 2013-05-30 00:06:45 +0000 | [diff] [blame] | 30 | { |
| 31 | this->type = type; |
| 32 | this->precision = precision; |
| 33 | this->name = name; |
| 34 | this->arraySize = arraySize; |
| 35 | this->registerIndex = registerIndex; |
Jamie Madill | 010fffa | 2013-06-20 11:55:53 -0400 | [diff] [blame] | 36 | this->isRowMajorMatrix = isRowMajorMatrix; |
shannonwoods@chromium.org | 7e0904d | 2013-05-30 00:06:45 +0000 | [diff] [blame] | 37 | } |
| 38 | |
shannonwoods@chromium.org | d778417 | 2013-05-30 00:07:03 +0000 | [diff] [blame] | 39 | BlockMemberInfo::BlockMemberInfo(int offset, int arrayStride, int matrixStride, bool isRowMajorMatrix) |
| 40 | : offset(offset), |
| 41 | arrayStride(arrayStride), |
| 42 | matrixStride(matrixStride), |
| 43 | isRowMajorMatrix(isRowMajorMatrix) |
| 44 | { |
| 45 | } |
| 46 | |
| 47 | const BlockMemberInfo BlockMemberInfo::defaultBlockInfo(-1, -1, -1, false); |
| 48 | |
shannonwoods@chromium.org | 1500f09 | 2013-05-30 00:11:20 +0000 | [diff] [blame] | 49 | InterfaceBlock::InterfaceBlock(const char *name, unsigned int arraySize, unsigned int registerIndex) |
| 50 | : name(name), |
| 51 | arraySize(arraySize), |
shannonwoods@chromium.org | 70961b3 | 2013-05-30 00:17:48 +0000 | [diff] [blame] | 52 | layout(BLOCKLAYOUT_SHARED), |
Jamie Madill | 9060a4e | 2013-08-12 16:22:57 -0700 | [diff] [blame^] | 53 | registerIndex(registerIndex), |
| 54 | isRowMajorLayout(false) |
shannonwoods@chromium.org | 1500f09 | 2013-05-30 00:11:20 +0000 | [diff] [blame] | 55 | { |
| 56 | } |
| 57 | |
shannonwoods@chromium.org | 7e0904d | 2013-05-30 00:06:45 +0000 | [diff] [blame] | 58 | } |