fix GL texture state change, DX texture reload
This commit is contained in:
parent
d2e1cb779d
commit
34064f07ad
|
|
@ -84,7 +84,6 @@ create_texture(DXScreenData &scrn) {
|
|||
nassertr(IS_VALID_PTR(get_texture()), false);
|
||||
|
||||
delete_texture();
|
||||
mark_loaded();
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
update_data_size_bytes(get_texture()->estimate_texture_memory());
|
||||
|
|
@ -695,6 +694,7 @@ create_texture(DXScreenData &scrn) {
|
|||
}
|
||||
|
||||
get_texture()->texture_uploaded();
|
||||
mark_loaded();
|
||||
return true;
|
||||
|
||||
error_exit:
|
||||
|
|
|
|||
|
|
@ -837,6 +837,7 @@ create_texture(DXScreenData &scrn) {
|
|||
}
|
||||
get_texture()->texture_uploaded();
|
||||
}
|
||||
mark_loaded();
|
||||
|
||||
return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -6558,6 +6558,7 @@ upload_texture(CLP(TextureContext) *gtc) {
|
|||
|
||||
if (success) {
|
||||
gtc->_already_applied = true;
|
||||
gtc->_uses_mipmaps = uses_mipmaps;
|
||||
gtc->_internal_format = internal_format;
|
||||
gtc->_width = width;
|
||||
gtc->_height = height;
|
||||
|
|
@ -6673,6 +6674,7 @@ upload_texture_image(CLP(TextureContext) *gtc,
|
|||
|
||||
|
||||
if (!gtc->_already_applied ||
|
||||
gtc->_uses_mipmaps != uses_mipmaps ||
|
||||
gtc->_internal_format != internal_format ||
|
||||
gtc->_width != width ||
|
||||
gtc->_height != height ||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ public:
|
|||
// glTexImage2D() call. If none of these have changed, we can
|
||||
// reload the texture image with a glTexSubImage2D().
|
||||
bool _already_applied;
|
||||
bool _uses_mipmaps;
|
||||
GLint _internal_format;
|
||||
GLsizei _width;
|
||||
GLsizei _height;
|
||||
|
|
|
|||
Loading…
Reference in New Issue