GL: Remove lingering image binds

This updates image bind tracking to be the same as texture binds.
Adding a new bind flag to avoid conflict when the texture is used in
both slots.
Fixes a gl error in glBindImageTextures about invalid image binds.
This commit is contained in:
2022-08-01 17:57:33 +02:00
parent d629402054
commit 04d43e8dbb
3 changed files with 6 additions and 3 deletions

View File

@@ -563,14 +563,14 @@ void GLStateManager::image_bind(Texture *tex_, int unit)
}
images_[unit] = tex->tex_id_;
formats_[unit] = to_gl_internal_format(tex->format_);
tex->is_bound_ = true;
tex->is_bound_image_ = true;
dirty_image_binds_ |= 1ULL << unit;
}
void GLStateManager::image_unbind(Texture *tex_)
{
GLTexture *tex = static_cast<GLTexture *>(tex_);
if (!tex->is_bound_) {
if (!tex->is_bound_image_) {
return;
}
@@ -581,7 +581,7 @@ void GLStateManager::image_unbind(Texture *tex_)
dirty_image_binds_ |= 1ULL << i;
}
}
tex->is_bound_ = false;
tex->is_bound_image_ = false;
}
void GLStateManager::image_unbind_all()