From 1c2bc202c0ca9b1690c054e589b33ed5d2f16b28 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Mon, 12 Dec 2022 00:54:43 -0500 Subject: [PATCH] Fix linux build --- indra/cmake/00-Common.cmake | 5 +++++ indra/cmake/UI.cmake | 4 ---- indra/llrender/CMakeLists.txt | 4 ---- indra/llrender/llgl.cpp | 6 +++--- indra/llrender/llimagegl.cpp | 6 +++--- indra/llrender/llrender.cpp | 6 +++--- indra/llwindow/CMakeLists.txt | 6 ------ indra/newview/CMakeLists.txt | 4 ---- indra/newview/llvosky.h | 12 ++++++------ 9 files changed, 20 insertions(+), 33 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 2f1a1b03342..6a91c241615 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -18,6 +18,7 @@ set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") include(CheckCXXCompilerFlag) include(Variables) +include(SDL2) # Portable compilation flags. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DADDRESS_SIZE=${ADDRESS_SIZE}") @@ -359,5 +360,9 @@ else() add_definitions(-DAL_ENABLE_ALL_TIMERS=0) endif() +if(SDL_FOUND) + add_definitions(-DLL_SDL=1) +endif() + endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 58af48f1ca1..8f7c8f1dd6c 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -24,9 +24,7 @@ if (LINUX) if(USE_X11) list(APPEND PKGCONFIG_PACKAGES - pangoxft x11 - xinerama ) endif() @@ -42,13 +40,11 @@ if (LINUX) gdk-3.0 gtk+-3.0 x11 - xinerama ) if(USE_X11) list(APPEND PKGCONFIG_PACKAGES x11 - xinerama ) endif() diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index b344d0d11b4..f8fee2c7b29 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -110,10 +110,6 @@ add_library (llrender ${llrender_SOURCE_FILES}) set_target_properties(llrender PROPERTIES POSITION_INDEPENDENT_CODE TRUE) -if (SDL_FOUND) - target_compile_definitions(llrender PUBLIC LL_SDL=1) -endif (SDL_FOUND) - # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level target_link_libraries(llrender diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 7bdcc8e2d2b..dd060826775 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1732,7 +1732,7 @@ void LLGLState::resetTextureStates() for (S32 j = maxTextureUnits-1; j >=0; j--) { gGL.getTexUnit(j)->activate(); - glClientActiveTextureARB(GL_TEXTURE0_ARB+j); + glClientActiveTexture(GL_TEXTURE0_ARB+j); j == 0 ? gGL.getTexUnit(j)->enable(LLTexUnit::TT_TEXTURE) : gGL.getTexUnit(j)->disable(); } } @@ -1880,7 +1880,7 @@ void LLGLState::checkTextureChannels(const std::string& msg) if (i < gGLManager.mNumTextureUnits) { - glClientActiveTextureARB(GL_TEXTURE0_ARB+i); + glClientActiveTexture(GL_TEXTURE0_ARB+i); stop_glerror(); glGetIntegerv(GL_TEXTURE_STACK_DEPTH, &stackDepth); stop_glerror(); @@ -1965,7 +1965,7 @@ void LLGLState::checkTextureChannels(const std::string& msg) stop_glerror(); gGL.getTexUnit(0)->activate(); - glClientActiveTextureARB(GL_TEXTURE0_ARB); + glClientActiveTexture(GL_TEXTURE0_ARB); stop_glerror(); if (error) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 00254ca4464..c330dc2661e 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -747,7 +747,7 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 if (is_compressed) { S32 tex_size = dataFormatBytes(mFormatPrimary, w, h); - glCompressedTexImage2DARB(mTarget, gl_level, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in); + glCompressedTexImage2D(mTarget, gl_level, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in); stop_glerror(); } else @@ -942,7 +942,7 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 if (is_compressed) { S32 tex_size = dataFormatBytes(mFormatPrimary, w, h); - glCompressedTexImage2DARB(mTarget, 0, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in); + glCompressedTexImage2D(mTarget, 0, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in); stop_glerror(); } else @@ -1876,7 +1876,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre return FALSE ; } - glGetCompressedTexImageARB(mTarget, gl_discard, (GLvoid*)(imageraw->getData())); + glGetCompressedTexImage(mTarget, gl_discard, (GLvoid*)(imageraw->getData())); //stop_glerror(); } else diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 310a561a8c1..fe4acfa64de 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -127,7 +127,7 @@ void LLTexUnit::refreshState(void) gGL.flush(); - glActiveTextureARB(GL_TEXTURE0_ARB + mIndex); + glActiveTexture(GL_TEXTURE0_ARB + mIndex); if (mCurrTexType != TT_NONE) { @@ -148,7 +148,7 @@ void LLTexUnit::activate(void) if ((S32)gGL.mCurrTextureUnitIndex != mIndex || gGL.mDirty) { gGL.flush(); - glActiveTextureARB(GL_TEXTURE0_ARB + mIndex); + glActiveTexture(GL_TEXTURE0_ARB + mIndex); gGL.mCurrTextureUnitIndex = mIndex; } } @@ -192,7 +192,7 @@ void LLTexUnit::bindFast(LLTexture* texture) { LLImageGL* gl_tex = texture->getGLTexture(); - glActiveTextureARB(GL_TEXTURE0_ARB + mIndex); + glActiveTexture(GL_TEXTURE0_ARB + mIndex); gGL.mCurrTextureUnitIndex = mIndex; mCurrTexture = gl_tex->getTexName(); if (!mCurrTexture) diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 56bf8302e14..9c5543cbe0e 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -188,12 +188,6 @@ add_library (llwindow ${viewer_SOURCE_FILES} ) -if (SDL_FOUND) - set_property(TARGET llwindow - PROPERTY COMPILE_DEFINITIONS LL_SDL=1 - ) -endif (SDL_FOUND) - target_link_libraries (llwindow llcommon ${llwindow_LINK_LIBRARIES} readerwriterqueue) if (DARWIN) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 756d1741082..ca769f76e05 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1860,10 +1860,6 @@ add_executable(${VIEWER_BINARY_NAME} ${viewer_SOURCE_FILES} ) -if (SDL_FOUND) - target_compile_definitions(${VIEWER_BINARY_NAME} PRIVATE LL_SDL=1) -endif (SDL_FOUND) - if (USE_SENTRY) target_compile_definitions(${VIEWER_BINARY_NAME} PRIVATE ${SENTRY_DEFINE}) diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index 5b7a4281d89..3789f7431de 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -38,13 +38,13 @@ #include "llsettingssky.h" #include "lllegacyatmospherics.h" -const F32 SKY_BOX_MULT = 16.0f; -const F32 HEAVENLY_BODY_DIST = HORIZON_DIST - 20.f; -const F32 HEAVENLY_BODY_FACTOR = 0.1f; -const F32 HEAVENLY_BODY_SCALE = HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR; +constexpr F32 SKY_BOX_MULT = 16.0f; +constexpr F32 HEAVENLY_BODY_DIST = HORIZON_DIST - 20.f; +constexpr F32 HEAVENLY_BODY_FACTOR = 0.1f; +constexpr F32 HEAVENLY_BODY_SCALE = HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR; -const F32 SKYTEX_COMPONENTS = 4; -const F32 SKYTEX_RESOLUTION = 64; +constexpr S32 SKYTEX_COMPONENTS = 4; +constexpr S32 SKYTEX_RESOLUTION = 64; class LLEnvironment; class LLFace; -- GitLab