summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/libGLESv2/Uniform.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/angle/src/libGLESv2/Uniform.h')
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Uniform.h47
1 files changed, 39 insertions, 8 deletions
diff --git a/src/3rdparty/angle/src/libGLESv2/Uniform.h b/src/3rdparty/angle/src/libGLESv2/Uniform.h
index 8ab0fbe234..24f834f3c6 100644
--- a/src/3rdparty/angle/src/libGLESv2/Uniform.h
+++ b/src/3rdparty/angle/src/libGLESv2/Uniform.h
@@ -10,38 +10,69 @@
#include <string>
#include <vector>
-#define GL_APICALL
-#include <GLES2/gl2.h>
+#include "angle_gl.h"
#include "common/debug.h"
+#include "angletypes.h"
+#include "common/shadervars.h"
+#include "common/blocklayout.h"
namespace gl
{
// Helper struct representing a single shader uniform
-struct Uniform
+struct LinkedUniform
{
- Uniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize);
+ LinkedUniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize, const int blockIndex, const sh::BlockMemberInfo &blockInfo);
- ~Uniform();
+ ~LinkedUniform();
bool isArray() const;
unsigned int elementCount() const;
+ bool isReferencedByVertexShader() const;
+ bool isReferencedByFragmentShader() const;
+ bool isInDefaultBlock() const;
+ size_t dataSize() const;
+ bool isSampler() const;
const GLenum type;
const GLenum precision;
const std::string name;
const unsigned int arraySize;
+ const int blockIndex;
+ const sh::BlockMemberInfo blockInfo;
unsigned char *data;
bool dirty;
- int psRegisterIndex;
- int vsRegisterIndex;
+ unsigned int psRegisterIndex;
+ unsigned int vsRegisterIndex;
unsigned int registerCount;
+
+ // Register "elements" are used for uniform structs in ES3, to appropriately identify single uniforms
+ // inside aggregate types, which are packed according C-like structure rules.
+ unsigned int registerElement;
};
-typedef std::vector<Uniform*> UniformArray;
+// Helper struct representing a single shader uniform block
+struct UniformBlock
+{
+ // use GL_INVALID_INDEX for non-array elements
+ UniformBlock(const std::string &name, unsigned int elementIndex, unsigned int dataSize);
+
+ bool isArrayElement() const;
+ bool isReferencedByVertexShader() const;
+ bool isReferencedByFragmentShader() const;
+
+ const std::string name;
+ const unsigned int elementIndex;
+ const unsigned int dataSize;
+
+ std::vector<unsigned int> memberUniformIndexes;
+
+ unsigned int psRegisterIndex;
+ unsigned int vsRegisterIndex;
+};
}