summaryrefslogtreecommitdiffstats
path: root/drivers/gles3/storage/texture_storage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/storage/texture_storage.cpp')
-rw-r--r--drivers/gles3/storage/texture_storage.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp
index 54012c20e9..bd824a076e 100644
--- a/drivers/gles3/storage/texture_storage.cpp
+++ b/drivers/gles3/storage/texture_storage.cpp
@@ -729,7 +729,7 @@ void TextureStorage::texture_free(RID p_texture) {
}
}
} else {
- must_free_data = t->tex_id != 0 && !t->is_external;
+ must_free_data = t->tex_id != 0 && !t->is_from_native_handle;
}
if (must_free_data) {
GLES3::Utilities::get_singleton()->texture_free_data(t->tex_id);
@@ -874,26 +874,28 @@ void TextureStorage::texture_proxy_initialize(RID p_texture, RID p_base) {
texture_owner.initialize_rid(p_texture, proxy_tex);
}
-RID TextureStorage::texture_create_external(GLES3::Texture::Type p_type, Image::Format p_format, unsigned int p_image, int p_width, int p_height, int p_depth, int p_layers, RS::TextureLayeredType p_layered_type) {
+RID TextureStorage::texture_create_from_native_handle(RS::TextureType p_type, Image::Format p_format, uint64_t p_native_handle, int p_width, int p_height, int p_depth, int p_layers, RS::TextureLayeredType p_layered_type) {
Texture texture;
texture.active = true;
- texture.is_external = true;
- texture.type = p_type;
+ texture.is_from_native_handle = true;
switch (p_type) {
- case Texture::TYPE_2D: {
+ case RS::TEXTURE_TYPE_2D: {
+ texture.type = Texture::TYPE_2D;
texture.target = GL_TEXTURE_2D;
} break;
- case Texture::TYPE_3D: {
+ case RS::TEXTURE_TYPE_3D: {
+ texture.type = Texture::TYPE_3D;
texture.target = GL_TEXTURE_3D;
} break;
- case Texture::TYPE_LAYERED: {
+ case RS::TEXTURE_TYPE_LAYERED: {
+ texture.type = Texture::TYPE_LAYERED;
texture.target = GL_TEXTURE_2D_ARRAY;
} break;
}
texture.real_format = texture.format = p_format;
- texture.tex_id = p_image;
+ texture.tex_id = p_native_handle;
texture.alloc_width = texture.width = p_width;
texture.alloc_height = texture.height = p_height;
texture.depth = p_depth;