diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-01-12 01:20:45 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-01-12 01:20:45 +0300 |
commit | ecd40a4bc2965718316f112eee6ca3a0f21e9995 (patch) | |
tree | f61377bd869360835152dc9753bead6a6d4b3981 /source/blender/draw | |
parent | d263ae4cde466890c700923a9cbaf29c913a7a65 (diff) |
Improve getters for draw::Texture
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/DRW_gpu_wrapper.hh | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/source/blender/draw/intern/DRW_gpu_wrapper.hh b/source/blender/draw/intern/DRW_gpu_wrapper.hh index f0c356c1090..f1b57fa4a98 100644 --- a/source/blender/draw/intern/DRW_gpu_wrapper.hh +++ b/source/blender/draw/intern/DRW_gpu_wrapper.hh @@ -547,10 +547,35 @@ class Texture : NonCopyable { return GPU_texture_height(tx_); } - int3 size(void) const + bool depth(void) const + { + return GPU_texture_depth(tx_); + } + + bool is_stencil(void) const + { + return GPU_texture_stencil(tx_); + } + + bool is_integer(void) const + { + return GPU_texture_integer(tx_); + } + + bool is_cube(void) const + { + return GPU_texture_cube(tx_); + } + + bool is_array(void) const + { + return GPU_texture_array(tx_); + } + + int3 size(int miplvl = 0) const { int3 size(0); - GPU_texture_get_mipmap_size(tx_, 0, size); + GPU_texture_get_mipmap_size(tx_, miplvl, size); return size; } |