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:
Diffstat (limited to 'source/blender/gpu/opengl/gl_texture.cc')
-rw-r--r--source/blender/gpu/opengl/gl_texture.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_texture.cc b/source/blender/gpu/opengl/gl_texture.cc
index 9d070088802..4ab9360daaa 100644
--- a/source/blender/gpu/opengl/gl_texture.cc
+++ b/source/blender/gpu/opengl/gl_texture.cc
@@ -453,6 +453,19 @@ void GLTexture::swizzle_set(const char swizzle[4])
}
}
+void GLTexture::stencil_texture_mode_set(bool use_stencil)
+{
+ BLI_assert(GLContext::stencil_texturing_support);
+ GLint value = use_stencil ? GL_STENCIL_INDEX : GL_DEPTH_COMPONENT;
+ if (GLContext::direct_state_access_support) {
+ glTextureParameteri(tex_id_, GL_DEPTH_STENCIL_TEXTURE_MODE, value);
+ }
+ else {
+ GLContext::state_manager_active_get()->texture_bind_temp(this);
+ glTexParameteri(target_, GL_DEPTH_STENCIL_TEXTURE_MODE, value);
+ }
+}
+
void GLTexture::mip_range_set(int min, int max)
{
BLI_assert(min <= max && min >= 0 && max <= mipmaps_);