SL-18190 Don't allocate mips for irradiance maps because they're never generated. Disable OpenGL core profile on Intel by default.
parent
7a9811ee11
commit
1eeee12ecb
|
|
@ -107,18 +107,18 @@ LLCubeMapArray::~LLCubeMapArray()
|
|||
{
|
||||
}
|
||||
|
||||
void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count)
|
||||
void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, BOOL use_mips)
|
||||
{
|
||||
U32 texname = 0;
|
||||
|
||||
LLImageGL::generateTextures(1, &texname);
|
||||
|
||||
mImage = new LLImageGL(resolution, resolution, components, TRUE);
|
||||
mImage = new LLImageGL(resolution, resolution, components, use_mips);
|
||||
mImage->setTexName(texname);
|
||||
mImage->setTarget(sTargets[0], LLTexUnit::TT_CUBE_MAP_ARRAY);
|
||||
|
||||
mImage->setUseMipMaps(TRUE);
|
||||
mImage->setHasMipMaps(TRUE);
|
||||
mImage->setUseMipMaps(use_mips);
|
||||
mImage->setHasMipMaps(use_mips);
|
||||
|
||||
bind(0);
|
||||
|
||||
|
|
@ -127,9 +127,15 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count)
|
|||
|
||||
mImage->setAddressMode(LLTexUnit::TAM_CLAMP);
|
||||
|
||||
mImage->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
|
||||
|
||||
glGenerateMipmap(GL_TEXTURE_CUBE_MAP_ARRAY);
|
||||
if (use_mips)
|
||||
{
|
||||
mImage->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
|
||||
glGenerateMipmap(GL_TEXTURE_CUBE_MAP_ARRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
mImage->setFilteringOption(LLTexUnit::TFO_BILINEAR);
|
||||
}
|
||||
|
||||
unbind();
|
||||
}
|
||||
|
|
@ -137,7 +143,7 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count)
|
|||
void LLCubeMapArray::bind(S32 stage)
|
||||
{
|
||||
mTextureStage = stage;
|
||||
gGL.getTexUnit(stage)->bindManual(LLTexUnit::TT_CUBE_MAP_ARRAY, getGLName(), TRUE);
|
||||
gGL.getTexUnit(stage)->bindManual(LLTexUnit::TT_CUBE_MAP_ARRAY, getGLName(), mImage->getUseMipMaps());
|
||||
}
|
||||
|
||||
void LLCubeMapArray::unbind()
|
||||
|
|
|
|||
|
|
@ -51,7 +51,8 @@ public:
|
|||
// res - resolution of each cube face
|
||||
// components - number of components per pixel
|
||||
// count - number of cube maps in the array
|
||||
void allocate(U32 res, U32 components, U32 count);
|
||||
// use_mips - if TRUE, mipmaps will be allocated for this cube map array and anisotropic filtering will be used
|
||||
void allocate(U32 res, U32 components, U32 count, BOOL use_mips = TRUE);
|
||||
void bind(S32 stage);
|
||||
void unbind();
|
||||
|
||||
|
|
|
|||
|
|
@ -9924,7 +9924,7 @@
|
|||
<key>RenderGLContextCoreProfile</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Don't use a compatibility profile OpenGL context. Requires restart. Basic shaders MUST be enabled.</string>
|
||||
<string>Don't use a compatibility profile OpenGL context. Requires restart.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ vec3 tapIrradianceMap(vec3 pos, vec3 dir, vec3 c, float r2, int i)
|
|||
v -= c;
|
||||
v = env_mat * v;
|
||||
{
|
||||
return textureLod(irradianceProbes, vec4(v.xyz, refIndex[i].x), 0).rgb * refParams[i].x;
|
||||
return texture(irradianceProbes, vec4(v.xyz, refIndex[i].x)).rgb * refParams[i].x;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -287,6 +287,7 @@ list Intel
|
|||
RenderAnisotropic 1 0
|
||||
RenderFSAASamples 1 0
|
||||
RenderGLMultiThreaded 1 0
|
||||
RenderGLContextCoreProfile 1 0
|
||||
|
||||
// HACK: Current AMD drivers have bugged cubemap arrays, limit number of reflection probes to 16
|
||||
list AMD
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ static void settings_to_globals()
|
|||
|
||||
LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize"));
|
||||
|
||||
LLRender::sGLCoreProfile = TRUE; // Now required, ignoring gSavedSettings.getBOOL("RenderGLContextCoreProfile");
|
||||
LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLContextCoreProfile");
|
||||
LLRender::sNsightDebugSupport = gSavedSettings.getBOOL("RenderNsightDebugSupport");
|
||||
LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO");
|
||||
LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic");
|
||||
|
|
|
|||
|
|
@ -846,6 +846,6 @@ void LLReflectionMapManager::initReflectionMaps()
|
|||
mTexture->allocate(LL_REFLECTION_PROBE_RESOLUTION, 3, mReflectionProbeCount + 2);
|
||||
|
||||
mIrradianceMaps = new LLCubeMapArray();
|
||||
mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount);
|
||||
mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount, FALSE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue