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:
-rw-r--r--source/blender/gpu/GPU_immediate.h4
-rw-r--r--source/blender/gpu/intern/gpu_immediate.c13
2 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_immediate.h b/source/blender/gpu/GPU_immediate.h
index d1db1d5f3e7..698c4585d20 100644
--- a/source/blender/gpu/GPU_immediate.h
+++ b/source/blender/gpu/GPU_immediate.h
@@ -31,6 +31,7 @@
#include "GPU_primitive.h"
#include "GPU_shader.h"
#include "GPU_shader_interface.h"
+#include "GPU_texture.h"
#include "GPU_vertex_format.h"
#ifdef __cplusplus
@@ -115,6 +116,9 @@ void immUniform4fv(const char *name, const float data[4]);
void immUniformArray4fv(const char *bare_name, const float *data, int count);
void immUniformMatrix4fv(const char *name, const float data[4][4]);
+void immBindTexture(const char *name, GPUTexture *tex);
+void immBindTextureSampler(const char *name, GPUTexture *tex, eGPUSamplerState state);
+
/* Convenience functions for setting "uniform vec4 color". */
/* The rgb functions have implicit alpha = 1.0. */
void immUniformColor4f(float r, float g, float b, float a);
diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c
index 9ea273f33cf..4f5cb3fcc91 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -29,6 +29,7 @@
#include "GPU_attr_binding.h"
#include "GPU_immediate.h"
+#include "GPU_texture.h"
#include "gpu_attr_binding_private.h"
#include "gpu_context_private.h"
@@ -853,6 +854,18 @@ void immUniform4iv(const char *name, const int data[4])
glUniform4iv(uniform->location, 1, data);
}
+void immBindTexture(const char *name, GPUTexture *tex)
+{
+ GET_UNIFORM
+ GPU_texture_bind(tex, uniform->binding);
+}
+
+void immBindTextureSampler(const char *name, GPUTexture *tex, eGPUSamplerState state)
+{
+ GET_UNIFORM
+ GPU_texture_bind_ex(tex, state, uniform->binding, true);
+}
+
/* --- convenience functions for setting "uniform vec4 color" --- */
void immUniformColor4f(float r, float g, float b, float a)