diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-04 03:36:56 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-05 18:49:14 +0300 |
commit | b100b77fda0667d78cac0f219e0f6208d6b8f854 (patch) | |
tree | b33d85d887e43d712fe7797b99ed6b6b150af4d0 /source/blender/gpu/intern/gpu_texture_private.hh | |
parent | 31c77a14af7cac2bc52ecaffde1bae9775dc47ae (diff) |
GLTexture: Add back texture proxy check
Cleanup the feature itself:
- Check 3D textures size against the correct limit.
- Add check for compressed textures.
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture_private.hh')
-rw-r--r-- | source/blender/gpu/intern/gpu_texture_private.hh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_texture_private.hh b/source/blender/gpu/intern/gpu_texture_private.hh index 7b5aed9562e..e3872c4d4b5 100644 --- a/source/blender/gpu/intern/gpu_texture_private.hh +++ b/source/blender/gpu/intern/gpu_texture_private.hh @@ -188,6 +188,19 @@ class Texture { return 3; } } + /* Return number of array layer (or face layer) for texture array or 1 for the others. */ + int layer_count(void) const + { + switch (type_) { + case GPU_TEXTURE_1D_ARRAY: + return h_; + case GPU_TEXTURE_2D_ARRAY: + case GPU_TEXTURE_CUBE_ARRAY: + return d_; + default: + return 1; + } + } eGPUTextureFormat format_get(void) const { |