diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-10-19 18:00:10 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-10-19 18:00:10 +0800 |
commit | c0e3be5df88ed316a247d8f7fae19a327a5a8a6f (patch) | |
tree | 48b553e5e3dea0263d9e5c34dad44239411df76b /indra/llrender | |
parent | 551950b4d38187a1724517b8b2995faa57a87205 (diff) |
Further revert llrender to LL's
This might fix the black screen problem on Apple GPU.
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llgl.cpp | 17 | ||||
-rw-r--r-- | indra/llrender/llrender.cpp | 22 | ||||
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 1 | ||||
-rw-r--r-- | indra/llrender/llvertexbuffer.h | 2 |
4 files changed, 11 insertions, 31 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index bd05645b46..6988e55034 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -50,10 +50,6 @@ #include "llglheaders.h" #include "llglslshader.h" -#include "llvertexbuffer.h" -#include "llcontrol.h" -extern LLControlGroup gSavedSettings; - #include "glm/glm.hpp" #include <glm/gtc/matrix_access.hpp> #include "glm/gtc/type_ptr.hpp" @@ -1283,18 +1279,6 @@ bool LLGLManager::initGL() initGLStates(); - U32 MPVBufferOptiMode = gSavedSettings.getU32("MPVBufferOptiMode"); - if (MPVBufferOptiMode == 0) - { - if(mIsApple) MPVBufferOptiMode = 2; - else MPVBufferOptiMode = 1; - gSavedSettings.setU32("MPVBufferOptiMode",MPVBufferOptiMode); - } - LLVertexBuffer::sMappingMode = MPVBufferOptiMode; - //LLRender::sMappingMode = MPVBufferOptiMode; - - LL_INFOS() << "milo init sMappingMode " << MPVBufferOptiMode << LL_ENDL; - return true; } @@ -1411,7 +1395,6 @@ void LLGLManager::asLLSD(LLSD& info) info["is_ati"] = mIsAMD; // note, do not rename is_ati to is_amd without coordinating with DW info["is_nvidia"] = mIsNVIDIA; info["is_intel"] = mIsIntel; - info["is_apple"] = mIsApple; info["gl_renderer"] = mGLRenderer; } diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index db3a04c581..9178fc16b9 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -51,8 +51,6 @@ extern void APIENTRY gl_debug_callback(GLenum source, thread_local LLRender gGL; -const U32 BATCH_SIZE = 16334; - // Handy copies of last good GL matrices F32 gGLModelView[16]; F32 gGLLastModelView[16]; @@ -69,7 +67,7 @@ S32 gGLViewport[4]; U32 LLRender::sUICalls = 0; U32 LLRender::sUIVerts = 0; U32 LLTexUnit::sWhiteTexture = 0; -bool LLRender::sGLCoreProfile = true; +bool LLRender::sGLCoreProfile = false; bool LLRender::sNsightDebugSupport = false; LLVector2 LLRender::sUIGLScaleFactor = LLVector2(1.f, 1.f); @@ -912,7 +910,7 @@ void LLRender::initVertexBuffer() llassert_always(mBuffer.isNull()); stop_glerror(); mBuffer = new LLVertexBuffer(immediate_mask); - mBuffer->allocateBuffer(BATCH_SIZE, 0); + mBuffer->allocateBuffer(4096, 0); mBuffer->getVertexStrider(mVerticesp); mBuffer->getTexCoord0Strider(mTexcoordsp); mBuffer->getColorStrider(mColorsp); @@ -1575,7 +1573,7 @@ void LLRender::end() if ((mMode != LLRender::LINES && mMode != LLRender::TRIANGLES && mMode != LLRender::POINTS) || - mCount > (BATCH_SIZE / 2)) + mCount > 2048) { flush(); } @@ -1748,7 +1746,9 @@ LLVertexBuffer* LLRender::genBuffer(U32 attribute_mask, S32 count) vb->setColorData(mColorsp.get()); } - if (LLVertexBuffer::sMappingMode == 3) vb->unmapBuffer(); +#if LL_DARWIN + vb->unmapBuffer(); +#endif vb->unbind(); return vb; @@ -1772,7 +1772,7 @@ void LLRender::resetStriders(S32 count) void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) { //the range of mVerticesp, mColorsp and mTexcoordsp is [0, 4095] - if (mCount > BATCH_SIZE / 2) + if (mCount > 2048) { //break when buffer gets reasonably full to keep GL command buffers happy and avoid overflow below switch (mMode) { @@ -1782,7 +1782,7 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) } } - if (mCount > BATCH_SIZE - 2) + if (mCount > 4094) { // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL; return; @@ -1806,7 +1806,7 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) void LLRender::vertexBatchPreTransformed(LLVector4a* verts, S32 vert_count) { - if (mCount + vert_count > BATCH_SIZE - 2) + if (mCount + vert_count > 4094) { // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL; return; @@ -1827,7 +1827,7 @@ void LLRender::vertexBatchPreTransformed(LLVector4a* verts, S32 vert_count) void LLRender::vertexBatchPreTransformed(LLVector4a* verts, LLVector2* uvs, S32 vert_count) { - if (mCount + vert_count > BATCH_SIZE - 2) + if (mCount + vert_count > 4094) { // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL; return; @@ -1851,7 +1851,7 @@ void LLRender::vertexBatchPreTransformed(LLVector4a* verts, LLVector2* uvs, S32 void LLRender::vertexBatchPreTransformed(LLVector4a* verts, LLVector2* uvs, LLColor4U* colors, S32 vert_count) { - if (mCount + vert_count > BATCH_SIZE - 2) + if (mCount + vert_count > 4094) { // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL; return; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 52ee998dcb..6f4828397a 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -658,7 +658,6 @@ U32 LLVertexBuffer::sGLRenderIndices = 0; U32 LLVertexBuffer::sLastMask = 0; U32 LLVertexBuffer::sVertexCount = 0; -U32 LLVertexBuffer::sMappingMode = 0; //NOTE: each component must be AT LEAST 4 bytes in size to avoid a performance penalty on AMD hardware const U32 LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_MAX] = diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 487b510d2e..d4c6fbaf18 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -337,8 +337,6 @@ public: static U32 sGLRenderIndices; static U32 sLastMask; static U32 sVertexCount; - - static U32 sMappingMode; }; #ifdef LL_PROFILER_ENABLE_RENDER_DOC |