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.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_texture.cc b/source/blender/gpu/opengl/gl_texture.cc
index 37bf2f6b8b3..0a5c7f8e79e 100644
--- a/source/blender/gpu/opengl/gl_texture.cc
+++ b/source/blender/gpu/opengl/gl_texture.cc
@@ -175,6 +175,28 @@ bool GLTexture::init_internal(GPUVertBuf *vbo)
return true;
}
+bool GLTexture::init_internal(const GPUTexture *src, int mip_offset, int layer_offset)
+{
+ BLI_assert(GLContext::texture_storage_support);
+
+ const GLTexture *gl_src = static_cast<const GLTexture *>(unwrap(src));
+ GLenum internal_format = to_gl_internal_format(format_);
+ target_ = to_gl_target(type_);
+
+ glTextureView(tex_id_,
+ target_,
+ gl_src->tex_id_,
+ internal_format,
+ mip_offset,
+ mipmaps_,
+ layer_offset,
+ this->layer_count());
+
+ debug::object_label(GL_TEXTURE, tex_id_, name_);
+
+ return true;
+}
+
/** \} */
/* -------------------------------------------------------------------- */