Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-02-16 00:20:25 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-02-16 00:20:49 +0300
commitd3b1cce4000b4b530d3ac8e2aa6b86b79b94cca0 (patch)
treef905a28a8d4c3683a1a42d88d047bf2c9bd567a8 /source/blender/gpu/GPU_texture.h
parentcbdd57864049f6f300494d56b623934a4134fa2b (diff)
GPUTexture: Add dimensions getter
Pretty straight forward. Returns the texture dimensions count. This is different from the size.
Diffstat (limited to 'source/blender/gpu/GPU_texture.h')
-rw-r--r--source/blender/gpu/GPU_texture.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index 9472aed79a5..d689fbe14b5 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -287,6 +287,12 @@ void GPU_texture_mipmap_mode(GPUTexture *tex, bool use_mipmap, bool use_filter);
void GPU_texture_wrap_mode(GPUTexture *tex, bool use_repeat, bool use_clamp);
void GPU_texture_swizzle_set(GPUTexture *tex, const char swizzle[4]);
+/**
+ * Return the number of dimensions of the texture ignoring dimension of layers (1, 2 or 3).
+ * Cube textures are considered 2D.
+ */
+int GPU_texture_dimensions(const GPUTexture *tex);
+
int GPU_texture_width(const GPUTexture *tex);
int GPU_texture_height(const GPUTexture *tex);
int GPU_texture_orig_width(const GPUTexture *tex);