GPU: Texture: Expose depth dimension extent
This function was not exposed outside of internal GPU module. Renaming `draw::Texture::depth()` to `is_depth` for consistency and removing the ambiguity.
This commit is contained in:
@@ -766,12 +766,17 @@ class Texture : NonCopyable {
|
||||
return GPU_texture_height(tx_);
|
||||
}
|
||||
|
||||
int depth() const
|
||||
{
|
||||
return GPU_texture_depth(tx_);
|
||||
}
|
||||
|
||||
int pixel_count() const
|
||||
{
|
||||
return GPU_texture_width(tx_) * GPU_texture_height(tx_);
|
||||
}
|
||||
|
||||
bool depth() const
|
||||
bool is_depth() const
|
||||
{
|
||||
return GPU_texture_has_depth_format(tx_);
|
||||
}
|
||||
|
||||
@@ -940,6 +940,12 @@ int GPU_texture_width(const GPUTexture *texture);
|
||||
*/
|
||||
int GPU_texture_height(const GPUTexture *texture);
|
||||
|
||||
/**
|
||||
* Return the depth of \a tex . Correspond to number of layers for 2D array texture.
|
||||
* NOTE: return 0 for 1D & 2D textures.
|
||||
*/
|
||||
int GPU_texture_depth(const GPUTexture *texture);
|
||||
|
||||
/**
|
||||
* Return the number of layers of \a tex . Return 1 if the texture is not layered.
|
||||
*/
|
||||
|
||||
@@ -716,6 +716,11 @@ int GPU_texture_height(const GPUTexture *tex)
|
||||
return reinterpret_cast<const Texture *>(tex)->height_get();
|
||||
}
|
||||
|
||||
int GPU_texture_depth(const GPUTexture *tex)
|
||||
{
|
||||
return reinterpret_cast<const Texture *>(tex)->depth_get();
|
||||
}
|
||||
|
||||
int GPU_texture_layer_count(const GPUTexture *tex)
|
||||
{
|
||||
return reinterpret_cast<const Texture *>(tex)->layer_count();
|
||||
|
||||
Reference in New Issue
Block a user