summaryrefslogtreecommitdiffstats
path: root/drivers/gles3/storage/texture_storage.cpp
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2023-03-10 21:24:25 +1100
committerBastiaan Olij <mux213@gmail.com>2023-05-09 13:47:22 +1000
commitc328676d960897abe6f00aaceee4c34801415940 (patch)
treee6bcf62a9af43fedd102626363ad3e1324727f53 /drivers/gles3/storage/texture_storage.cpp
parent6980b2bf1761b9b980920dc5a4d32f240d88e211 (diff)
downloadredot-engine-c328676d960897abe6f00aaceee4c34801415940.tar.gz
For GDExternal use, provides access to internal graphics handles for textures
Diffstat (limited to 'drivers/gles3/storage/texture_storage.cpp')
-rw-r--r--drivers/gles3/storage/texture_storage.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp
index d147cee54f..3fd54e9180 100644
--- a/drivers/gles3/storage/texture_storage.cpp
+++ b/drivers/gles3/storage/texture_storage.cpp
@@ -1140,6 +1140,13 @@ RID TextureStorage::texture_get_rd_texture(RID p_texture, bool p_srgb) const {
return RID();
}
+uint64_t TextureStorage::texture_get_native_handle(RID p_texture, bool p_srgb) const {
+ const Texture *texture = texture_owner.get_or_null(p_texture);
+ ERR_FAIL_COND_V(!texture, 0);
+
+ return texture->tex_id;
+}
+
void TextureStorage::texture_set_data(RID p_texture, const Ref<Image> &p_image, int p_layer) {
Texture *texture = texture_owner.get_or_null(p_texture);