summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-06-14 21:38:00 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-06-14 21:38:00 +0300
commitba6ac70596d9f866e15983a4e2fc1d4f3d82b2ec (patch)
treebe9eb80e356af346c17852c116ed481a7d911277 /indra/llrender
parentf5e2708a0fc4e08d3d0a5dc393bbd4bac09e1c55 (diff)
parentc4fc76efefd12c7cb1224dc8a748da2958f4a7f0 (diff)
Merge branch 'release/maint-b' into marchcat/b-merge
# Conflicts: # .github/workflows/build.yaml # indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl # indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl # indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl # indra/newview/llfilepicker.cpp
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llfontfreetype.cpp10
-rw-r--r--indra/llrender/llfontfreetypesvg.cpp4
-rw-r--r--indra/llrender/llfontfreetypesvg.h6
-rw-r--r--indra/llrender/llgl.cpp15
-rw-r--r--indra/llrender/llglheaders.h35
-rw-r--r--indra/llrender/llglslshader.cpp2
6 files changed, 56 insertions, 16 deletions
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 92b373c835..554e70d6a7 100644
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -52,7 +52,9 @@
#include "llfontbitmapcache.h"
#include "llgl.h"
-#define ENABLE_OT_SVG_SUPPORT
+#if !defined(LL_NO_OTSVG)
+ #define ENABLE_OT_SVG_SUPPORT
+#endif
FT_Render_Mode gFontRenderMode = FT_RENDER_MODE_NORMAL;
@@ -87,7 +89,7 @@ LLFontManager::LLFontManager()
FT_Done_FreeType(gFTLibrary);
}
-#ifdef ENABLE_OT_SVG_SUPPORT
+#if defined(ENABLE_OT_SVG_SUPPORT)
SVG_RendererHooks hooks = {
LLFontFreeTypeSvgRenderer::OnInit,
LLFontFreeTypeSvgRenderer::OnFree,
@@ -483,8 +485,8 @@ LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch, EFontGlyphType glyph_type
continue;
}
glyph_index = FT_Get_Char_Index(pair.first->mFTFace, wch);
- if (glyph_index)
- {
+ if (glyph_index)
+ {
return addGlyphFromFont(pair.first, wch, glyph_index,
glyph_type);
}
diff --git a/indra/llrender/llfontfreetypesvg.cpp b/indra/llrender/llfontfreetypesvg.cpp
index 355e8432aa..e33da7cf86 100644
--- a/indra/llrender/llfontfreetypesvg.cpp
+++ b/indra/llrender/llfontfreetypesvg.cpp
@@ -80,6 +80,7 @@ void LLFontFreeTypeSvgRenderer::OnDataFinalizer(void* objectp)
//static
FT_Error LLFontFreeTypeSvgRenderer::OnPresetGlypthSlot(FT_GlyphSlot glyph_slot, FT_Bool cache, FT_Pointer*)
{
+#ifndef LL_NO_OTSVG
FT_SVG_Document document = static_cast<FT_SVG_Document>(glyph_slot->other);
llassert(!glyph_slot->generic.data || !cache || glyph_slot->glyph_index == ((LLSvgRenderData*)glyph_slot->generic.data)->GlyphIndex);
@@ -166,6 +167,9 @@ FT_Error LLFontFreeTypeSvgRenderer::OnPresetGlypthSlot(FT_GlyphSlot glyph_slot,
}
return FT_Err_Ok;
+#else
+ return FT_Err_Unimplemented_Feature;
+#endif
}
// static
diff --git a/indra/llrender/llfontfreetypesvg.h b/indra/llrender/llfontfreetypesvg.h
index 72ac5293ce..62aefd10b5 100644
--- a/indra/llrender/llfontfreetypesvg.h
+++ b/indra/llrender/llfontfreetypesvg.h
@@ -29,7 +29,11 @@
#include <ft2build.h>
#include FT_TYPES_H
#include FT_MODULE_H
-#include FT_OTSVG_H
+#ifdef FT_OTSVG_H
+ #include FT_OTSVG_H
+#else
+ #define LL_NO_OTSVG
+#endif
// See https://freetype.org/freetype2/docs/reference/ft2-svg_fonts.html
class LLFontFreeTypeSvgRenderer
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 1b5566a3f7..a34efe24d3 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -211,8 +211,6 @@ LLMatrix4 gGLObliqueProjectionInverse;
std::list<LLGLUpdate*> LLGLUpdate::sGLQ;
-#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS
-
#if LL_WINDOWS
// WGL_ARB_create_context
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = nullptr;
@@ -232,8 +230,6 @@ PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC wglBlitContextFramebufferAMD = n
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = nullptr;
PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = nullptr;
-#endif
-
// GL_VERSION_1_2
//PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = nullptr;
//PFNGLTEXIMAGE3DPROC glTexImage3D = nullptr;
@@ -1381,6 +1377,9 @@ void LLGLManager::shutdownGL()
void LLGLManager::initExtensions()
{
+#if LL_LINUX
+ glh_init_extensions("");
+#endif
#if LL_DARWIN
GLint num_extensions = 0;
std::string all_extensions{""};
@@ -1411,10 +1410,9 @@ void LLGLManager::initExtensions()
mInited = TRUE;
-#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS
+#if LL_WINDOWS
LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL;
-#if LL_WINDOWS
// WGL_AMD_gpu_association
wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUIDsAMD");
wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUInfoAMD");
@@ -1432,8 +1430,6 @@ void LLGLManager::initExtensions()
// WGL_ARB_create_context
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateContextAttribsARB");
-#endif
-
// Load entire OpenGL API through GetProcAddress, leaving sections beyond mGLVersion unloaded
@@ -2561,6 +2557,7 @@ void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor
{
return;
}
+ LL_INFOS() << "GL: " << version << LL_ENDL;
version_string->assign(version);
@@ -2940,5 +2937,3 @@ extern "C"
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
#endif
-
-
diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index c5e1ff3e23..df23a9da1d 100644
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -41,6 +41,22 @@
# include "GL/glh_extensions.h"
# undef __APPLE__
+#elif LL_LINUX
+#define GL_GLEXT_PROTOTYPES
+#define GLX_GLEXT_PROTOTYPES
+
+#include "GL/gl.h"
+#include "GL/glext.h"
+#include "GL/glu.h"
+
+// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
+# define __APPLE__
+# include "GL/glh_extensions.h"
+# undef __APPLE__
+
+# include "GL/glx.h"
+# include "GL/glxext.h"
+
#elif LL_WINDOWS
//----------------------------------------------------------------------------
// LL_WINDOWS
@@ -1029,6 +1045,25 @@ extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
#include <OpenGL/gl.h>
+#elif LL_LINUX
+
+#define GL_GLEXT_PROTOTYPES
+#define GLX_GLEXT_PROTOTYPES
+
+#include "GL/gl.h"
+#include "GL/glu.h"
+#include "GL/glext.h"
+#include "GL/glx.h"
+
+// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly
+# define __APPLE__
+# include "GL/glh_extensions.h"
+# undef __APPLE__
+
+// #include <X11/Xlib.h>
+// #include <X11/Xutil.h>
+#include "GL/glh_extensions.h"
+
#endif // LL_MESA / LL_WINDOWS / LL_DARWIN
// Even when GL_ARB_depth_clamp is available in the driver, the (correct)
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 28b5bc7495..3cc26b14bd 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -279,7 +279,7 @@ bool LLGLSLShader::readProfileQuery(bool for_runtime, bool force_read)
GLuint64 samples_passed = 0;
glGetQueryObjectui64v(mSamplesQuery, GL_QUERY_RESULT, &samples_passed);
- U64 primitives_generated = 0;
+ GLuint64 primitives_generated = 0;
glGetQueryObjectui64v(mPrimitivesQuery, GL_QUERY_RESULT, &primitives_generated);
sTotalTimeElapsed += time_elapsed;