diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-02-04 20:16:41 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-02-04 20:54:32 +0300 |
commit | 665997f1cd6c223f900a78b532ccc5c58091c2e4 (patch) | |
tree | 2ee1dd9e4bb0738fbbea9951160e80b69d3670c4 /source/blender/draw/intern/DRW_gpu_wrapper.hh | |
parent | b2f5540a0216fd41d4f7ae102deac18f77941540 (diff) |
DRW: Fix bug in cubemap creation in draw::Texture
The order of if clause made impossible to create a cubemap.
Diffstat (limited to 'source/blender/draw/intern/DRW_gpu_wrapper.hh')
-rw-r--r-- | source/blender/draw/intern/DRW_gpu_wrapper.hh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/draw/intern/DRW_gpu_wrapper.hh b/source/blender/draw/intern/DRW_gpu_wrapper.hh index 2809661c8c8..4d7325f6c2d 100644 --- a/source/blender/draw/intern/DRW_gpu_wrapper.hh +++ b/source/blender/draw/intern/DRW_gpu_wrapper.hh @@ -674,20 +674,20 @@ class Texture : NonCopyable { if (h == 0) { return GPU_texture_create_1d(name_, w, mips, format, data); } - else if (d == 0) { + else if (cubemap) { if (layered) { - return GPU_texture_create_1d_array(name_, w, h, mips, format, data); + return GPU_texture_create_cube_array(name_, w, d, mips, format, data); } else { - return GPU_texture_create_2d(name_, w, h, mips, format, data); + return GPU_texture_create_cube(name_, w, mips, format, data); } } - else if (cubemap) { + else if (d == 0) { if (layered) { - return GPU_texture_create_cube_array(name_, w, d, mips, format, data); + return GPU_texture_create_1d_array(name_, w, h, mips, format, data); } else { - return GPU_texture_create_cube(name_, w, mips, format, data); + return GPU_texture_create_2d(name_, w, h, mips, format, data); } } else { |