summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-03-27 00:45:06 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-03-27 00:45:06 +0200
commit71ed19839eb95d918329b2c776c8af3b8724f1da (patch)
tree4639de2c088a688bb5c4a77a2763261397d904fd /indra/llrender
parent5ac0b9debc100a5a4d14e9eaad1a6542c927a275 (diff)
parent9567393f803dfb0c786b8e917e41c8f4b8b22af7 (diff)
Merge branch 'main' into DRTVWR-600-maint-A
# Conflicts: # indra/newview/llappviewer.cpp # indra/newview/llfloaterchangeitemthumbnail.cpp # indra/newview/llpanelprofile.cpp # indra/newview/llselectmgr.cpp # indra/newview/lltexturectrl.cpp # indra/newview/lltexturectrl.h # indra/newview/lltooldraganddrop.cpp # indra/newview/llviewerdisplay.cpp # indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llimagegl.cpp3
-rw-r--r--indra/llrender/llrender.cpp10
-rw-r--r--indra/llrender/llrender.h2
-rw-r--r--indra/llrender/llrendernavprim.cpp10
4 files changed, 18 insertions, 7 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 7e09713054..ed729f64e3 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1353,6 +1353,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
scratch = new(std::nothrow) U32[width * height];
if (!scratch)
{
+ LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS() << "Failed to allocate " << (U32)(width * height * sizeof(U32))
<< " bytes for a manual image W" << width << " H" << height << LL_ENDL;
}
@@ -1378,6 +1379,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
scratch = new(std::nothrow) U32[width * height];
if (!scratch)
{
+ LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS() << "Failed to allocate " << (U32)(width * height * sizeof(U32))
<< " bytes for a manual image W" << width << " H" << height << LL_ENDL;
}
@@ -1406,6 +1408,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
scratch = new(std::nothrow) U32[width * height];
if (!scratch)
{
+ LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS() << "Failed to allocate " << (U32)(width * height * sizeof(U32))
<< " bytes for a manual image W" << width << " H" << height << LL_ENDL;
}
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 66252facc4..fb3a8af779 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -857,7 +857,7 @@ LLRender::~LLRender()
shutdown();
}
-void LLRender::init(bool needs_vertex_buffer)
+bool LLRender::init(bool needs_vertex_buffer)
{
#if LL_WINDOWS
if (gGLManager.mHasDebugOutput && gDebugGL)
@@ -879,6 +879,13 @@ void LLRender::init(bool needs_vertex_buffer)
// necessary for reflection maps
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
+#if LL_WINDOWS
+ if (glGenVertexArrays == nullptr)
+ {
+ return false;
+ }
+#endif
+
{ //bind a dummy vertex array object so we're core profile compliant
U32 ret;
glGenVertexArrays(1, &ret);
@@ -889,6 +896,7 @@ void LLRender::init(bool needs_vertex_buffer)
{
initVertexBuffer();
}
+ return true;
}
void LLRender::initVertexBuffer()
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index fd922affba..716b52354d 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -375,7 +375,7 @@ public:
LLRender();
~LLRender();
- void init(bool needs_vertex_buffer);
+ bool init(bool needs_vertex_buffer);
void initVertexBuffer();
void resetVertexBuffer();
void shutdown();
diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp
index d610a44bc6..eea3077632 100644
--- a/indra/llrender/llrendernavprim.cpp
+++ b/indra/llrender/llrendernavprim.cpp
@@ -40,20 +40,20 @@ LLRenderNavPrim gRenderNav;
//=============================================================================
void LLRenderNavPrim::renderLLTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, const LLColor4U& color ) const
{
- LLColor4 cV(color);
- gGL.color4fv( cV.mV );
- gGL.begin(LLRender::TRIANGLES);
+ gGL.color4ubv(color.mV);
+
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.vertex3fv( a.mV );
gGL.vertex3fv( b.mV );
gGL.vertex3fv( c.mV );
}
- gGL.end();
+ gGL.end();
}
//=============================================================================
void LLRenderNavPrim::renderNavMeshVB( U32 mode, LLVertexBuffer* pVBO, int vertCnt )
{
pVBO->setBuffer();
- pVBO->drawArrays( mode, 0, vertCnt );
+ pVBO->drawArrays( mode, 0, vertCnt );
}
//=============================================================================