mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
set_size_padded should not pad z for cube maps and 2d texture arrays
This commit is contained in:
parent
4690cb4bbf
commit
a6eeaf42b5
@ -1756,7 +1756,14 @@ set_size_padded(int x, int y, int z) {
|
|||||||
if (do_get_auto_texture_scale(cdata) != ATS_none) {
|
if (do_get_auto_texture_scale(cdata) != ATS_none) {
|
||||||
do_set_x_size(cdata, up_to_power_2(x));
|
do_set_x_size(cdata, up_to_power_2(x));
|
||||||
do_set_y_size(cdata, up_to_power_2(y));
|
do_set_y_size(cdata, up_to_power_2(y));
|
||||||
|
|
||||||
|
if (cdata->_texture_type == TT_3d_texture) {
|
||||||
|
// Only pad 3D textures. It does not make sense
|
||||||
|
// to do so for cube maps or 2D texture arrays.
|
||||||
do_set_z_size(cdata, up_to_power_2(z));
|
do_set_z_size(cdata, up_to_power_2(z));
|
||||||
|
} else {
|
||||||
|
do_set_z_size(cdata, z);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
do_set_x_size(cdata, x);
|
do_set_x_size(cdata, x);
|
||||||
do_set_y_size(cdata, y);
|
do_set_y_size(cdata, y);
|
||||||
@ -5013,7 +5020,7 @@ do_set_component_type(CData *cdata, Texture::ComponentType component_type) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case T_unsigned_int_24_8:
|
case T_unsigned_int_24_8:
|
||||||
//FIXME: I have no idea...
|
cdata->_component_width = 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user