diff options
| author | Erik Kundiman <erik@megapahit.org> | 2024-10-12 16:39:32 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2024-10-12 16:39:32 +0800 |
| commit | 4f26fe6430cd12914b0d6edf33baabe19829d014 (patch) | |
| tree | 1e1ee5f7167b2d825cfea9a7e5ef8d0e0f9f37d3 /indra/newview/llreflectionmapmanager.cpp | |
| parent | 722c63cec4c4a1aee2fc5e9699a54da19a634f12 (diff) | |
Preprocess eTextureType like sGLTextureType
(cause eTextureType seems to have been designed to mirror sGLTextureType)
otherwise you'd get a GL error of invalid enum of the first argument
for glTexImage2D.
Diffstat (limited to 'indra/newview/llreflectionmapmanager.cpp')
| -rw-r--r-- | indra/newview/llreflectionmapmanager.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 2cad413d18..846f8a895a 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -825,8 +825,10 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face) gRadianceGenProgram.bind(); mVertexBuffer->setBuffer(); +#if GL_VERSION_4_0 S32 channel = gRadianceGenProgram.enableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP_ARRAY); mTexture->bind(channel); +#endif gRadianceGenProgram.uniform1i(sSourceIdx, sourceIdx); gRadianceGenProgram.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mMaxProbeLOD); gRadianceGenProgram.uniform1f(LLShaderMgr::REFLECTION_PROBE_STRENGTH, 1.f); @@ -873,8 +875,10 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face) { //generate irradiance map gIrradianceGenProgram.bind(); +#if GL_VERSION_4_0 S32 channel = gIrradianceGenProgram.enableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP_ARRAY); mTexture->bind(channel); +#endif gIrradianceGenProgram.uniform1i(sSourceIdx, sourceIdx); gIrradianceGenProgram.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mMaxProbeLOD); @@ -907,11 +911,11 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face) mVertexBuffer->drawArrays(gGL.TRIANGLE_STRIP, 0, 4); S32 res = mMipChain[i].getWidth(); - mIrradianceMaps->bind(channel); #if GL_VERSION_4_0 + mIrradianceMaps->bind(channel); glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, i - start_mip, 0, 0, probe->mCubeIndex * 6 + cf, 0, 0, res, res); -#endif mTexture->bind(channel); +#endif } } } |
