From d0324be669ac4ec7f63241bbc135d562b600095a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 8 May 2025 17:26:39 +0800 Subject: Fix "Too many fragment shader texture samplers" Linux on M1 crash, caused by PBR Terrain. M1 only supports 16 image samplers in the fragment shader (GL_MAX_TEXTURE_IMAGE_UNITS). That's why we need to be able to mask RenderTerrainPBRDetail on Linux too by adding it to an also added TexUnit16orLess list to its feature table, and to the graphic settings lists above it in the file. --- indra/newview/featuretable_linux.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index d8d4f08429..f97ff28062 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -48,6 +48,7 @@ RenderLocalLights 1 1 RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 +RenderTerrainPBRDetail 1 0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderVBOEnable 1 1 @@ -88,6 +89,7 @@ RenderObjectBump 1 0 RenderReflectionDetail 1 0 RenderTerrainDetail 1 0 RenderTerrainLODFactor 1 1 +RenderTerrainPBRDetail 1 -1 RenderTransparentWater 1 0 RenderTreeLODFactor 1 0 RenderVolumeLODFactor 1 1.125 @@ -128,6 +130,7 @@ RenderTerrainDetail 1 0 RenderTerrainLODFactor 1 1 RenderTransparentWater 1 0 RenderTreeLODFactor 1 0 +RenderTerrainPBRDetail 1 -1 RenderVolumeLODFactor 1 1.125 WindLightUseAtmosShaders 1 0 RenderDeferred 1 0 @@ -166,6 +169,7 @@ RenderTerrainLODFactor 1 1.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.125 +RenderTerrainPBRDetail 1 -1 WindLightUseAtmosShaders 1 0 RenderDeferred 1 0 RenderDeferredSSAO 1 0 @@ -200,6 +204,7 @@ RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 +RenderTerrainPBRDetail 1 0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.125 @@ -237,6 +242,7 @@ RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 +RenderTerrainPBRDetail 1 0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.125 @@ -274,6 +280,7 @@ RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 +RenderTerrainPBRDetail 1 0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.125 @@ -311,6 +318,7 @@ RenderLocalLights 1 1 RenderReflectionDetail 1 0 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 +RenderTerrainPBRDetail 1 0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.125 @@ -347,6 +355,7 @@ RenderObjectBump 1 1 RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 +RenderTerrainPBRDetail 1 0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderVolumeLODFactor 1 2.0 @@ -755,3 +764,5 @@ RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_Go_7900 RenderShaderLightingMaxLevel 1 2 +list TexUnit16orLess +RenderTerrainPBRDetail 1 -1 -- cgit v1.2.3 From 390ba2f4fdc8520192182f97d934c9f20367c6a1 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 8 May 2025 17:42:54 +0800 Subject: Build Dullahan in Linux aarch64 config stage GCC needs cstdint header inclusion for it to compile. include/cef needs to exist first otherwise configuration would fail. INSTALL_RPATH is needed in try_compile-ing. PROJECT_ARCH needs to be set on aarch64 to avoid -m64 and -march(=x86-64) settings which aren't recognised (and wouldn't be correct) on aarch64. ENABLE_CXX11_ABI needs to be set ON, otherwise it would use C++ 03's ABI and cause a linking failure. Dullahan headers don't seem to be included in the installation upstream, and dullahan_version.h gets generated only at least after Dullahan configuration, hence the 2 files copying. dullahan_host rpath removal is taken out of scope because the Fedora we support isn't only x86-64 now. The reindentations are just to make the uniform with the rest in the file. --- indra/cmake/CEFPlugin.cmake | 68 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 119a41f570..70e6c366a4 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -35,16 +35,66 @@ elseif (CMAKE_OSX_ARCHITECTURES MATCHES x86_64) ) file(WRITE ${PREBUILD_TRACKING_DIR}/dullahan_installed "0") endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/dullahan_installed OR NOT ${dullahan_installed} EQUAL 0) +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES aarch64) + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/dullahan_installed OR NOT ${dullahan_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/v1.14.0-r3.tar.gz) + file(DOWNLOAD + https://github.com/secondlife/dullahan/archive/refs/tags/v1.14.0-r3.tar.gz + ${CMAKE_BINARY_DIR}/v1.14.0-r3.tar.gz + ) + endif () + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/v1.14.0-r3.tar.gz + DESTINATION ${CMAKE_BINARY_DIR} + ) + execute_process( + COMMAND sed -i "/#include /a #include " dullahan.h + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/dullahan-1.14.0-r3/src + ) + file(MAKE_DIRECTORY ${LIBS_PREBUILT_DIR}/include/cef) + try_compile(DULLAHAN_RESULT + PROJECT dullahan + SOURCE_DIR ${CMAKE_BINARY_DIR}/dullahan-1.14.0-r3 + BINARY_DIR ${CMAKE_BINARY_DIR}/dullahan-1.14.0-r3 + CMAKE_FLAGS + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} + -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET} + -DCMAKE_INSTALL_PREFIX:PATH=${LIBS_PREBUILT_DIR} + -DCMAKE_INSTALL_LIBDIR:PATH=${ARCH_PREBUILT_DIRS_RELEASE} + -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DUSE_SPOTIFY_CEF:BOOL=ON + -DSPOTIFY_CEF_URL:STRING=https://cef-builds.spotifycdn.com/cef_binary_118.4.1%2Bg3dd6078%2Bchromium-118.0.5993.54_linuxarm64_beta_minimal.tar.bz2 + -DPROJECT_ARCH:STRING=${CMAKE_SYSTEM_PROCESSOR} + -DENABLE_CXX11_ABI:BOOL=ON + ) + if (${DULLAHAN_RESULT}) + execute_process( + COMMAND ${CMAKE_MAKE_PROGRAM} install + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/dullahan-1.14.0-r3 + OUTPUT_VARIABLE dullahan_installed + ) + file( + COPY + ${CMAKE_BINARY_DIR}/dullahan-1.14.0-r3/src/dullahan.h + ${CMAKE_BINARY_DIR}/dullahan-1.14.0-r3/src/dullahan_version.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/cef + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/dullahan_installed "${dullahan_installed}") + endif (${DULLAHAN_RESULT}) + endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/dullahan_installed OR NOT ${dullahan_installed} EQUAL 0) else (CMAKE_OSX_ARCHITECTURES MATCHES arm64) use_prebuilt_binary(dullahan) - if (${LINUX_DISTRO} MATCHES fedora) - execute_process( - COMMAND patchelf --remove-rpath bin/release/dullahan_host - WORKING_DIRECTORY ${LIBS_PREBUILT_DIR} - ) - endif (${LINUX_DISTRO} MATCHES fedora) endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) +if (${LINUX_DISTRO} MATCHES fedora) + execute_process( + COMMAND patchelf --remove-rpath bin/release/dullahan_host + WORKING_DIRECTORY ${LIBS_PREBUILT_DIR} + ) +endif (${LINUX_DISTRO} MATCHES fedora) + target_include_directories( ll::cef SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/cef) if (WINDOWS) @@ -73,8 +123,8 @@ elseif (DARWIN) elseif (LINUX) target_link_libraries( ll::cef INTERFACE - libdullahan.a - cef - cef_dll_wrapper.a + libdullahan.a + cef + cef_dll_wrapper.a ) endif (WINDOWS) -- cgit v1.2.3