Skip to content

Commit 9fe303d

Browse files
authored
Merge pull request #261 from AlchemyViewer/rye/fixglerrs
Fix various GL errors and a startup crash
2 parents 8fabb3e + efc081f commit 9fe303d

7 files changed

Lines changed: 16 additions & 19 deletions

File tree

indra/cmake/LLPhysicsExtensions.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,15 @@ if (HAVOK)
2323
use_prebuilt_binary(llphysicsextensions_source)
2424
set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src)
2525
target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions)
26+
target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 )
2627
elseif (HAVOK_TPV)
2728
use_prebuilt_binary(llphysicsextensions_tpv)
28-
target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions_tpv)
29+
if(WINDOWS)
30+
target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/llphysicsextensions_tpv.lib)
31+
else()
32+
target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/libllphysicsextensions_tpv.a)
33+
endif()
34+
target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 )
2935
else (HAVOK)
3036
use_prebuilt_binary(llphysicsextensions_stub)
3137
set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub)

indra/llrender/llcubemaparray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, bool us
156156
bind(0);
157157
free_cur_tex_image();
158158

159-
U32 format = components == 4 ? GL_RGBA16F : GL_R11F_G11F_B10F;
159+
U32 format = components == 4 ? GL_RGBA16F : GL_RGB16F;
160160
if (!hdr)
161161
{
162162
format = components == 4 ? GL_RGBA8 : GL_RGB8;

indra/newview/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,17 +1839,6 @@ if (WINDOWS)
18391839
list(APPEND viewer_SOURCE_FILES ${viewer_INSTALLER_FILES})
18401840
endif (WINDOWS)
18411841

1842-
if (HAVOK OR HAVOK_TPV)
1843-
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_HAVOK")
1844-
endif (HAVOK OR HAVOK_TPV)
1845-
1846-
if( DEFINED LLSTARTUP_COMPILE_FLAGS )
1847-
# progress view disables/enables icons based on available packages
1848-
set_source_files_properties(llprogressview.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}")
1849-
1850-
set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}")
1851-
endif()
1852-
18531842
list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES})
18541843

18551844
add_executable(${VIEWER_BINARY_NAME}

indra/newview/llagentcamera.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,8 +2242,8 @@ LLVector3d LLAgentCamera::getFocusOffsetInitial()
22422242
// [RLVa:KB] - @setcam_eyeoffsetscale
22432243
F32 LLAgentCamera::getCameraOffsetScale() const
22442244
{
2245-
static LLCachedControl<F32> camera_offset_scale(gSavedSettings, "CameraOffsetScale");
2246-
static LLCachedControl<F32> camera_offset_scale_rlv(gSavedSettings, "CameraOffsetScaleRLVa");
2245+
static LLCachedControl<F32> camera_offset_scale(gSavedSettings, "CameraOffsetScale", 1.0f);
2246+
static LLCachedControl<F32> camera_offset_scale_rlv(gSavedSettings, "CameraOffsetScaleRLVa", 0.0f);
22472247
return (ECameraPreset::CAMERA_RLV_SETCAM_VIEW != mCameraPreset) ? camera_offset_scale : camera_offset_scale_rlv;
22482248
}
22492249
// [/RLVa:KB]

indra/newview/llreflectionmapmanager.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ void LLReflectionMapManager::update()
274274

275275
if (!mRenderTarget.isComplete())
276276
{
277-
U32 color_fmt = render_hdr ? GL_R11F_G11F_B10F : GL_RGB8;
277+
U32 color_fmt = render_hdr ? GL_RGB16F : GL_RGB8;
278278
U32 targetRes = mProbeResolution * 4; // super sample
279279
mRenderTarget.allocate(targetRes, targetRes, color_fmt, true);
280280
}
@@ -287,7 +287,7 @@ void LLReflectionMapManager::update()
287287
mMipChain.resize(count);
288288
for (U32 i = 0; i < count; ++i)
289289
{
290-
mMipChain[i].allocate(res, res, render_hdr ? GL_R11F_G11F_B10F : GL_RGB8);
290+
mMipChain[i].allocate(res, res, render_hdr ? GL_RGB16F : GL_RGB8);
291291
res /= 2;
292292
}
293293
}
@@ -1442,13 +1442,15 @@ void LLReflectionMapManager::initReflectionMaps()
14421442
mTexture->getWidth() != mProbeResolution ||
14431443
mReflectionProbeCount + 2 != mTexture->getCount())
14441444
{
1445+
#if 0 // LLCubeMapArray copy critically flawed
14451446
if (mTexture)
14461447
{
14471448
mTexture = new LLCubeMapArray(*mTexture, mProbeResolution, mReflectionProbeCount + 2);
14481449

14491450
mIrradianceMaps = new LLCubeMapArray(*mIrradianceMaps, LL_IRRADIANCE_MAP_RESOLUTION, mReflectionProbeCount);
14501451
}
14511452
else
1453+
#endif
14521454
{
14531455
mTexture = new LLCubeMapArray();
14541456

indra/newview/llreflectionmapmanager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class LLViewerObject;
3838
#define LL_MAX_REFLECTION_PROBE_COUNT 256
3939

4040
// reflection probe resolution
41-
#define LL_IRRADIANCE_MAP_RESOLUTION 16
41+
#define LL_IRRADIANCE_MAP_RESOLUTION 64
4242

4343
// reflection probe mininum scale
4444
#define LL_REFLECTION_PROBE_MINIMUM_SCALE 1.f;

indra/newview/pipeline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9463,7 +9463,7 @@ void LLPipeline::bindReflectionProbes(LLGLSLShader& shader)
94639463

94649464
void LLPipeline::unbindReflectionProbes(LLGLSLShader& shader)
94659465
{
9466-
S32 channel = shader.disableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP);
9466+
S32 channel = shader.disableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP_ARRAY);
94679467
if (channel > -1 && mReflectionMapManager.mTexture.notNull())
94689468
{
94699469
mReflectionMapManager.mTexture->unbind();

0 commit comments

Comments
 (0)