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/intern/gpu_texture.cc')
-rw-r--r--source/blender/gpu/intern/gpu_texture.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc
index c3e9058c6c7..997064e82a2 100644
--- a/source/blender/gpu/intern/gpu_texture.cc
+++ b/source/blender/gpu/intern/gpu_texture.cc
@@ -60,6 +60,12 @@ Texture::~Texture()
fb_[i]->attachment_remove(fb_attachment_[i]);
}
}
+
+#ifndef GPU_NO_USE_PY_REFERENCES
+ if (this->py_ref) {
+ *this->py_ref = nullptr;
+ }
+#endif
}
bool Texture::init_1D(int w, int layers, eGPUTextureFormat format)
@@ -581,6 +587,19 @@ bool GPU_texture_array(const GPUTexture *tex)
return (reinterpret_cast<const Texture *>(tex)->type_get() & GPU_TEXTURE_ARRAY) != 0;
}
+#ifndef GPU_NO_USE_PY_REFERENCES
+void **GPU_texture_py_reference_get(GPUTexture *tex)
+{
+ return unwrap(tex)->py_ref;
+}
+
+void GPU_texture_py_reference_set(GPUTexture *tex, void **py_ref)
+{
+ BLI_assert(py_ref == nullptr || unwrap(tex)->py_ref == nullptr);
+ unwrap(tex)->py_ref = py_ref;
+}
+#endif
+
/* TODO remove */
int GPU_texture_opengl_bindcode(const GPUTexture *tex)
{