mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
OGL: Fix render-target texture mipmap allocation
The loop was allocating one-too-many levels, as well as incorrect sizes for each level. Probably not an issue as mipmapped render targets aren't used, but the logic should be correct anyway.
This commit is contained in:
@ -121,10 +121,11 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(const TCacheEntryConf
|
||||
|
||||
if (config.rendertarget)
|
||||
{
|
||||
for (u32 level = 0; level <= config.levels; level++)
|
||||
for (u32 level = 0; level < config.levels; level++)
|
||||
{
|
||||
glTexImage3D(GL_TEXTURE_2D_ARRAY, level, GL_RGBA, config.width, config.height, config.layers,
|
||||
0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
|
||||
glTexImage3D(GL_TEXTURE_2D_ARRAY, level, GL_RGBA, std::max(config.width >> level, 1u),
|
||||
std::max(config.height >> level, 1u), config.layers, 0, GL_RGBA,
|
||||
GL_UNSIGNED_BYTE, nullptr);
|
||||
}
|
||||
glGenFramebuffers(1, &entry->framebuffer);
|
||||
FramebufferManager::SetFramebuffer(entry->framebuffer);
|
||||
|
Reference in New Issue
Block a user