1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Implement support for array textures in GL driver

note: feature detection was not implemented in the legacy driver, but the code itself probably works.
This commit is contained in:
sfan5 2025-04-06 22:16:17 +02:00
parent d5bf094f9a
commit 46db688cc8
14 changed files with 111 additions and 72 deletions

View file

@ -132,6 +132,9 @@ enum E_VIDEO_DRIVER_FEATURE
//! Support for multisample textures.
EVDF_TEXTURE_MULTISAMPLE,
//! Support for 2D array textures.
EVDF_TEXTURE_2D_ARRAY,
//! Only used for counting the elements of this enum
EVDF_COUNT
};

View file

@ -129,7 +129,10 @@ enum E_TEXTURE_TYPE
ETT_2D_MS,
//! Cubemap texture.
ETT_CUBEMAP
ETT_CUBEMAP,
//! 2D array texture
ETT_2D_ARRAY
};
//! Interface of a Video Driver dependent Texture.

View file

@ -232,6 +232,15 @@ public:
information. */
virtual ITexture *addTexture(const io::path &name, IImage *image) = 0;
/**
* Creates an array texture from IImages.
* @param name A name for the texture.
* @param images Pointer to array of images
* @param count Number of images (must be at least 1)
* @return Pointer to the newly created texture
*/
virtual ITexture *addArrayTexture(const io::path &name, IImage **images, u32 count) = 0;
//! Creates a cubemap texture from loaded IImages.
/** \param name A name for the texture. Later calls of getTexture() with this name will return this texture.
The name can _not_ be empty.