summaryrefslogtreecommitdiff
path: root/indra/llrender/llcubemaparray.cpp
diff options
context:
space:
mode:
authornat-goodspeed <nat@lindenlab.com>2024-09-05 15:40:12 -0400
committerGitHub <noreply@github.com>2024-09-05 15:40:12 -0400
commit04568da18d2261f3f7b851cf5341b766c9648204 (patch)
tree83d5db1c173636bb77ebb33e860fac77ab5d79e8 /indra/llrender/llcubemaparray.cpp
parent18d81e20f0b0044c16615953d7b69d7fb34d3449 (diff)
parentff2d79906ccef217194d5d9ec9d7025db03592a8 (diff)
Merge pull request #2513 from secondlife/lua-merge-dev
Merge develop branch into Lua project branch.
Diffstat (limited to 'indra/llrender/llcubemaparray.cpp')
-rw-r--r--indra/llrender/llcubemaparray.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp
index be69b997da..4f5e13765a 100644
--- a/indra/llrender/llcubemaparray.cpp
+++ b/indra/llrender/llcubemaparray.cpp
@@ -125,27 +125,25 @@ 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)
{
- 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);
if (!use_mips)
{
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);