secondlife / viewer

🖥️ Second Life's official client
GNU Lesser General Public License v2.1
209 stars 54 forks source link

Fix crash rendering rigged PBR prims #2448

Open cosmic-linden opened 1 month ago

cosmic-linden commented 1 month ago

Description

Fatal assert in LLVertexBuffer::setBuffer for PBR material batch

Bug found in develop at 5c16ae13758bdfe8fe1f13d5f67eabbb6eaa30a1

Bug occurred near Rumpus Room on Aditi Fatal assert is as follows:

ERROR  llrender/llvertexbuffer.cpp(1516) LLVertexBuffer::setBuffer : ASSERT (Attribute mask mismatch! mTypeMask should be a superset of data_mask.  data_mask: 0x1547 mTypeMask: 0x25c7 Missing: 0x1000)

Currently bound shader: "GLTF PBR Metallic Roughness Shader"

Call stack:

secondlife-bin.exe!LLVertexBuffer::setBuffer::__l46::<lambda_4>::operator()(int * ptr) Line 1514    C++
secondlife-bin.exe!`LLVertexBuffer::setBuffer'::`46'::<lambda_4>::<lambda_invoker_cdecl>(int * ptr) Line 1514   C++
secondlife-bin.exe!LLVertexBuffer::setBuffer() Line 1514    C++
secondlife-bin.exe!LLRenderPass::pushGLTFBatch(LLDrawInfo & params) Line 829    C++
secondlife-bin.exe!LLRenderPass::pushRiggedGLTFBatches(unsigned int type) Line 874  C++
secondlife-bin.exe!LLPipeline::renderGeomDeferred(LLCamera & camera, bool do_occlusion) Line 3899   C++
secondlife-bin.exe!display(bool rebuild, float zoom_factor, int subfield, bool for_snapshot) Line 969   C++
secondlife-bin.exe!LLAppViewer::doFrame() Line 1519 C++
secondlife-bin.exe!LLAppViewer::frame() Line 1352   C++
secondlife-bin.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * pCmdLine, int nCmdShow) Line 499    C++
[External Code] 

Test plan

The viewer should no longer crash after logging in to the "Rumpus Room" region on Aditi, and waiting for everything to fully load.

vladyslavasproductengine commented 3 days ago

Passed QA.

Verified on Second Life Release 7.1.11.10947335521 (64bit) on Win10/OSX in the scope of https://github.com/secondlife/iqa/issues/348.