DRW: Fix bug in cubemap creation in draw::Texture

The order of if clause made impossible to create a cubemap.
This commit is contained in:
Clément Foucault
2022-02-04 18:16:41 +01:00
parent b2f5540a02
commit 665997f1cd

View File

@@ -674,14 +674,6 @@ class Texture : NonCopyable {
if (h == 0) {
return GPU_texture_create_1d(name_, w, mips, format, data);
}
else if (d == 0) {
if (layered) {
return GPU_texture_create_1d_array(name_, w, h, mips, format, data);
}
else {
return GPU_texture_create_2d(name_, w, h, mips, format, data);
}
}
else if (cubemap) {
if (layered) {
return GPU_texture_create_cube_array(name_, w, d, mips, format, data);
@@ -690,6 +682,14 @@ class Texture : NonCopyable {
return GPU_texture_create_cube(name_, w, mips, format, data);
}
}
else if (d == 0) {
if (layered) {
return GPU_texture_create_1d_array(name_, w, h, mips, format, data);
}
else {
return GPU_texture_create_2d(name_, w, h, mips, format, data);
}
}
else {
if (layered) {
return GPU_texture_create_2d_array(name_, w, h, d, mips, format, data);