diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-09-28 18:01:02 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-10-18 18:38:25 +0800 |
commit | ad3cbb9f75c4ea7f0473225afc034c403b54fc82 (patch) | |
tree | 4e4239e97a405d2820e26a4f2215ad8ccb88af7e /indra/llrender/llcubemaparray.cpp | |
parent | 7fdb350e487acc35b26de6e243ff27f94185d3a5 (diff) | |
parent | 64c055f9be03861661f8c211ae36ba0db489b12d (diff) |
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
Diffstat (limited to 'indra/llrender/llcubemaparray.cpp')
-rw-r--r-- | indra/llrender/llcubemaparray.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp index 0242fe60ce..4e7fa7316e 100644 --- a/indra/llrender/llcubemaparray.cpp +++ b/indra/llrender/llcubemaparray.cpp @@ -125,17 +125,15 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, bool us mImage->setHasMipMaps(use_mips); bind(0); + free_cur_tex_image(); U32 format = components == 4 ? GL_RGBA16F : GL_RGB16F; - U32 mip = 0; - - free_cur_tex_image(); - - while (resolution >= 1) + U32 mip_resolution = resolution; + while (mip_resolution >= 1) { #if GL_VERSION_4_0 - glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, format, resolution, resolution, count * 6, 0, + glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, format, mip_resolution, mip_resolution, count * 6, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); #endif @@ -143,11 +141,11 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, bool us { break; } - resolution /= 2; + mip_resolution /= 2; ++mip; } - alloc_tex_image(resolution * 6, resolution, format); + alloc_tex_image(resolution, resolution, format, count * 6); mImage->setAddressMode(LLTexUnit::TAM_CLAMP); |