From 78007d2592290582e3b3fbff002376ad0561779f Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 27 Sep 2021 22:35:50 +0000 Subject: SL-16088 Fix for stall from many calls to glGenBuffers. --- indra/llrender/llvertexbuffer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/llrender/llvertexbuffer.h') diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index dbe1a3687f..1d60970df4 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -89,6 +89,9 @@ public: std::vector mFreeList; std::vector mMissCount; + //used to avoid calling glGenBuffers for every VBO creation + static U32 sNamePool[1024]; + static U32 sNameIdx; }; @@ -127,7 +130,7 @@ public: static LLVBOPool sDynamicCopyVBOPool; static LLVBOPool sStreamIBOPool; static LLVBOPool sDynamicIBOPool; - + static std::list sAvailableVAOName; static U32 sCurVAOName; -- cgit v1.2.3 From 52e1a45659341df68eca01822f189e0883afe66d Mon Sep 17 00:00:00 2001 From: Runitai Linden Date: Tue, 12 Oct 2021 14:46:19 -0500 Subject: SL-16166 Optimization pass on LLRenderPass::pushBatch --- indra/llrender/llvertexbuffer.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/llrender/llvertexbuffer.h') diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 1d60970df4..51ed85510e 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -210,13 +210,17 @@ protected: virtual ~LLVertexBuffer(); // use unref() - virtual void setupVertexBuffer(U32 data_mask); // pure virtual, called from mapBuffer() + virtual void setupVertexBuffer(U32 data_mask); + void setupVertexBufferFast(U32 data_mask); + void setupVertexArray(); void genBuffer(U32 size); void genIndices(U32 size); bool bindGLBuffer(bool force_bind = false); + bool bindGLBufferFast(); bool bindGLIndices(bool force_bind = false); + bool bindGLIndicesFast(); bool bindGLArray(); void releaseBuffer(); void releaseIndices(); @@ -239,6 +243,8 @@ public: // set for rendering virtual void setBuffer(U32 data_mask); // calls setupVertexBuffer() if data_mask is not 0 + void setBufferFast(U32 data_mask); // calls setupVertexBufferFast(), assumes data_mask is not 0 among other assumptions + void flush(); //flush pending data to GL memory // allocate buffer bool allocateBuffer(S32 nverts, S32 nindices, bool create); @@ -290,6 +296,9 @@ public: void drawArrays(U32 mode, U32 offset, U32 count) const; void drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const; + //implementation for inner loops that does no safety checking + void drawRangeFast(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const; + //for debugging, validate data in given range is valid void validateRange(U32 start, U32 end, U32 count, U32 offset) const; -- cgit v1.2.3 From 4e8cd9437bed90b3468b1bf12f545de16faefb67 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 26 Oct 2021 14:07:00 +0000 Subject: SL-16193 Fix for mesh selection outline not rendering correctly (and broken physics shapes display). --- indra/llrender/llvertexbuffer.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/llrender/llvertexbuffer.h') diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 51ed85510e..fad474a143 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -146,8 +146,7 @@ public: static void initClass(bool use_vbo, bool no_vbo_mapping); static void cleanupClass(); static void setupClientArrays(U32 data_mask); - static void pushPositions(U32 mode, const LLVector4a* pos, U32 count); - static void drawArrays(U32 mode, const std::vector& pos, const std::vector& norm); + static void drawArrays(U32 mode, const std::vector& pos); static void drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp); static void unbind(); //unbind any bound vertex buffer -- cgit v1.2.3 From 8d20480c5f77fe1fab8149d3cda79bdd61e77656 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 28 Oct 2021 18:06:21 +0000 Subject: SL-16148 SL-16244 SL-16270 SL-16253 Remove most BlockTimers, remove LLMemTracked, introduce alignas, hook most/all reamining allocs, disable synchronous occlusion, and convert frequently accessed LLSingletons to LLSimpleton --- indra/llrender/llvertexbuffer.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/llrender/llvertexbuffer.h') diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index fad474a143..1b400b3aad 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -98,7 +98,7 @@ public: //============================================================================ // base class class LLPrivateMemoryPool; -class LLVertexBuffer : public LLRefCount, public LLTrace::MemTrackable +class LLVertexBuffer : public LLRefCount { public: class MappedRegion @@ -113,8 +113,7 @@ public: }; LLVertexBuffer(const LLVertexBuffer& rhs) - : LLTrace::MemTrackable("LLVertexBuffer"), - mUsage(rhs.mUsage) + : mUsage(rhs.mUsage) { *this = rhs; } -- cgit v1.2.3 From 724193e5b01e5c1ae879a6364f54601cdb22c2c1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 23 Nov 2021 20:46:27 +0000 Subject: SL-16239 Fix for slowdown on AMD GPUs (disable core profile and remove volatile members from LLVertexBuffer) --- indra/llrender/llvertexbuffer.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'indra/llrender/llvertexbuffer.h') diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 1b400b3aad..baf8407fc6 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -64,10 +64,10 @@ public: const U32 mType; //size MUST be a power of 2 - volatile U8* allocate(U32& name, U32 size, bool for_seed = false); + U8* allocate(U32& name, U32 size, bool for_seed = false); //size MUST be the size provided to allocate that returned the given name - void release(U32 name, volatile U8* buffer, U32 size); + void release(U32 name, U8* buffer, U32 size); //batch allocate buffers to be provided to the application on demand void seedPool(); @@ -82,7 +82,7 @@ public: { public: U32 mGLName; - volatile U8* mClientData; + U8* mClientData; }; typedef std::list record_list_t; @@ -234,8 +234,8 @@ public: LLVertexBuffer(U32 typemask, S32 usage); // map for data access - volatile U8* mapVertexBuffer(S32 type, S32 index, S32 count, bool map_range); - volatile U8* mapIndexBuffer(S32 index, S32 count, bool map_range); + U8* mapVertexBuffer(S32 type, S32 index, S32 count, bool map_range); + U8* mapIndexBuffer(S32 index, S32 count, bool map_range); void bindForFeedback(U32 channel, U32 type, U32 index, U32 count); @@ -278,14 +278,14 @@ public: S32 getNumVerts() const { return mNumVerts; } S32 getNumIndices() const { return mNumIndices; } - volatile U8* getIndicesPointer() const { return useVBOs() ? (U8*) mAlignedIndexOffset : mMappedIndexData; } - volatile U8* getVerticesPointer() const { return useVBOs() ? (U8*) mAlignedOffset : mMappedData; } + U8* getIndicesPointer() const { return useVBOs() ? (U8*) mAlignedIndexOffset : mMappedIndexData; } + U8* getVerticesPointer() const { return useVBOs() ? (U8*) mAlignedOffset : mMappedData; } U32 getTypeMask() const { return mTypeMask; } bool hasDataType(S32 type) const { return ((1 << type) & getTypeMask()); } S32 getSize() const; S32 getIndicesSize() const { return mIndicesSize; } - volatile U8* getMappedData() const { return mMappedData; } - volatile U8* getMappedIndices() const { return mMappedIndexData; } + U8* getMappedData() const { return mMappedData; } + U8* getMappedIndices() const { return mMappedIndexData; } S32 getOffset(S32 type) const { return mOffsets[type]; } S32 getUsage() const { return mUsage; } bool isWriteable() const { return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? true : false; } @@ -318,8 +318,8 @@ protected: U32 mGLIndices; // GL IBO handle U32 mGLArray; // GL VAO handle - volatile U8* mMappedData; // pointer to currently mapped data (NULL if unmapped) - volatile U8* mMappedIndexData; // pointer to currently mapped indices (NULL if unmapped) + U8* mMappedData; // pointer to currently mapped data (NULL if unmapped) + U8* mMappedIndexData; // pointer to currently mapped indices (NULL if unmapped) U32 mMappedDataUsingVBOs : 1; U32 mMappedIndexDataUsingVBOs : 1; -- cgit v1.2.3