mirror of
https://github.com/libretro/ppsspp.git
synced 2024-12-04 23:16:41 +00:00
Generate a texture name even for fbo textures.
Otherwise, when it stops being a render-to-texture, we won't have a texture name and we'll get confused. A texture name shouldn't be expensive to generate in this case anyway.
This commit is contained in:
parent
453be5530e
commit
30bf067787
@ -1008,6 +1008,11 @@ void TextureCache::SetTexture(bool force) {
|
||||
gstate_c.curTextureWidth = w;
|
||||
gstate_c.curTextureHeight = h;
|
||||
|
||||
// Always generate a texture name, we might need it if the texture is replaced later.
|
||||
if (!replaceImages) {
|
||||
glGenTextures(1, &entry->texture);
|
||||
}
|
||||
|
||||
// Before we go reading the texture from memory, let's check for render-to-texture.
|
||||
for (size_t i = 0, n = fbCache_.size(); i < n; ++i) {
|
||||
auto framebuffer = fbCache_[i];
|
||||
@ -1032,10 +1037,6 @@ void TextureCache::SetTexture(bool force) {
|
||||
entry->lastFrame = gpuStats.numFlips;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!replaceImages) {
|
||||
glGenTextures(1, &entry->texture);
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, entry->texture);
|
||||
lastBoundTexture = entry->texture;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user