1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add external texture support (GLES3)

Co-authored-by: Fredia Huya-Kouadio <fhuyakou@gmail.com>
Co-authored-by: Mauricio Narvaez <nvz@meta.com>
This commit is contained in:
David Snopek
2023-10-14 03:58:59 -07:00
parent 2be730a05b
commit 1a6f8512bc
24 changed files with 355 additions and 5 deletions

View File

@@ -137,12 +137,14 @@ public:
virtual RID texture_2d_create(const Ref<Image> &p_image) = 0;
virtual RID texture_2d_layered_create(const Vector<Ref<Image>> &p_layers, TextureLayeredType p_layered_type) = 0;
virtual RID texture_3d_create(Image::Format, int p_width, int p_height, int p_depth, bool p_mipmaps, const Vector<Ref<Image>> &p_data) = 0; //all slices, then all the mipmaps, must be coherent
virtual RID texture_external_create(int p_width, int p_height, uint64_t p_external_buffer = 0) = 0;
virtual RID texture_proxy_create(RID p_base) = 0;
virtual RID texture_create_from_native_handle(TextureType p_type, Image::Format p_format, uint64_t p_native_handle, int p_width, int p_height, int p_depth, int p_layers = 1, TextureLayeredType p_layered_type = TEXTURE_LAYERED_2D_ARRAY) = 0;
virtual void texture_2d_update(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) = 0;
virtual void texture_3d_update(RID p_texture, const Vector<Ref<Image>> &p_data) = 0;
virtual void texture_external_update(RID p_texture, int p_width, int p_height, uint64_t p_external_buffer = 0) = 0;
virtual void texture_proxy_update(RID p_texture, RID p_proxy_to) = 0;
// These two APIs can be used together or in combination with the others.
@@ -1647,6 +1649,7 @@ public:
GLOBAL_VAR_TYPE_SAMPLER2DARRAY,
GLOBAL_VAR_TYPE_SAMPLER3D,
GLOBAL_VAR_TYPE_SAMPLERCUBE,
GLOBAL_VAR_TYPE_SAMPLEREXT,
GLOBAL_VAR_TYPE_MAX
};