blob: 7c35a3cf1902b0dd7cae368517dd4e9982d43945 [file] [log] [blame]
daniel@transgaming.com15186aa2012-12-20 21:08:23 +00001//
daniel@transgaming.come76b64b2013-01-11 04:10:08 +00002// Copyright (c) 2010-2013 The ANGLE Project Authors. All rights reserved.
daniel@transgaming.com15186aa2012-12-20 21:08:23 +00003// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7#ifndef LIBGLESV2_UNIFORM_H_
8#define LIBGLESV2_UNIFORM_H_
9
10#include <string>
daniel@transgaming.comf9561862012-12-20 21:12:07 +000011#include <vector>
daniel@transgaming.com15186aa2012-12-20 21:08:23 +000012
13#define GL_APICALL
shannon.woods%transgaming.com@gtempaccount.comf26ddae2013-04-13 03:29:13 +000014#include <GLES3/gl3.h>
daniel@transgaming.com15186aa2012-12-20 21:08:23 +000015#include <GLES2/gl2.h>
16
17#include "common/debug.h"
daniel@transgaming.com15186aa2012-12-20 21:08:23 +000018
19namespace gl
20{
21
22// Helper struct representing a single shader uniform
23struct Uniform
24{
shannon.woods@transgaming.comd5a91b92013-02-28 23:17:30 +000025 Uniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize);
daniel@transgaming.com15186aa2012-12-20 21:08:23 +000026
27 ~Uniform();
28
daniel@transgaming.come6d12e92012-12-20 21:12:47 +000029 bool isArray() const;
30 unsigned int elementCount() const;
daniel@transgaming.com15186aa2012-12-20 21:08:23 +000031
32 const GLenum type;
shannon.woods@transgaming.comd5a91b92013-02-28 23:17:30 +000033 const GLenum precision;
daniel@transgaming.comdb019952012-12-20 21:13:32 +000034 const std::string name;
daniel@transgaming.com15186aa2012-12-20 21:08:23 +000035 const unsigned int arraySize;
36
37 unsigned char *data;
38 bool dirty;
39
daniel@transgaming.come76b64b2013-01-11 04:10:08 +000040 int psRegisterIndex;
41 int vsRegisterIndex;
42 unsigned int registerCount;
daniel@transgaming.com15186aa2012-12-20 21:08:23 +000043};
44
45typedef std::vector<Uniform*> UniformArray;
46
47}
48
49#endif // LIBGLESV2_UNIFORM_H_