gobj: Properly initialize Texture object on all stages

Previously, forward stages would be uninitialized, resulting in cryptic errors with ahead-of-time preparation (although arguably ahead-of-time preparation is a bug in and of itself)
This commit is contained in:
rdb 2022-11-26 16:56:07 +01:00
parent 5db4b447a6
commit d00d4a44a0

View File

@ -380,8 +380,7 @@ Texture(const string &name) :
_reloading = false; _reloading = false;
CDWriter cdata(_cycler, true); CDWriter cdata(_cycler, true);
do_set_format(cdata, F_rgb); cdata->inc_properties_modified();
do_set_component_type(cdata, T_unsigned_byte);
} }
/** /**
@ -10677,11 +10676,10 @@ CData() {
_y_size = 1; _y_size = 1;
_z_size = 1; _z_size = 1;
_num_views = 1; _num_views = 1;
_num_components = 3;
// We will override the format in a moment (in the Texture constructor), but _component_width = 1;
// set it to something else first to avoid the check in do_set_format _format = F_rgb;
// depending on an uninitialized value. _component_type = T_unsigned_byte;
_format = F_rgba;
// Only used for buffer textures. // Only used for buffer textures.
_usage_hint = GeomEnums::UH_unspecified; _usage_hint = GeomEnums::UH_unspecified;