Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2017-02-14 16:32:14 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-02-15 14:28:26 +0300
commit1f139beee3be4ef3cc4b2bccd534a3437fe7dd43 (patch)
treec40870208f7290ada0a0a40bdb2084dc5f5b9a14 /source/blender/gpu
parente30bc6f5175cb22037696649e4de618bbb20d87a (diff)
Clay Engine: Added immUniform functions...
for vec3 arrays and matrix4.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/gawain/immediate.c23
-rw-r--r--source/blender/gpu/gawain/immediate.h2
2 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/gpu/gawain/immediate.c b/source/blender/gpu/gawain/immediate.c
index e5ac2dbfcf2..cda0e98ac29 100644
--- a/source/blender/gpu/gawain/immediate.c
+++ b/source/blender/gpu/gawain/immediate.c
@@ -771,6 +771,18 @@ void immUniform3fv(const char* name, const float data[3])
glUniform3fv(loc, 1, data);
}
+void immUniformArray3fv(const char* name, const float *data, int count)
+ {
+ int loc = glGetUniformLocation(imm.bound_program, name);
+
+#if TRUST_NO_ONE
+ assert(loc != -1);
+ assert(count > 0);
+#endif
+
+ glUniform3fv(loc, count, data);
+ }
+
void immUniform4f(const char* name, float x, float y, float z, float w)
{
int loc = glGetUniformLocation(imm.bound_program, name);
@@ -793,6 +805,17 @@ void immUniform4fv(const char* name, const float data[4])
glUniform4fv(loc, 1, data);
}
+void immUniformMatrix4fv(const char* name, const float data[4][4])
+ {
+ int loc = glGetUniformLocation(imm.bound_program, name);
+
+#if TRUST_NO_ONE
+ assert(loc != -1);
+#endif
+
+ glUniformMatrix4fv(loc, 1, GL_FALSE, (float *)data);
+ }
+
void immUniform1i(const char* name, int x)
{
int loc = glGetUniformLocation(imm.bound_program, name);
diff --git a/source/blender/gpu/gawain/immediate.h b/source/blender/gpu/gawain/immediate.h
index db0e4af3f20..1e5729e5cce 100644
--- a/source/blender/gpu/gawain/immediate.h
+++ b/source/blender/gpu/gawain/immediate.h
@@ -83,8 +83,10 @@ void immUniform2f(const char* name, float x, float y);
void immUniform2fv(const char* name, const float data[2]);
void immUniform3f(const char* name, float x, float y, float z);
void immUniform3fv(const char* name, const float data[3]);
+void immUniformArray3fv(const char* name, const float *data, int count);
void immUniform4f(const char* name, float x, float y, float z, float w);
void immUniform4fv(const char* name, const float data[4]);
+void immUniformMatrix4fv(const char* name, const float data[4][4]);
// convenience functions for setting "uniform vec4 color"