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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user