From c97b6034eec9ce27a9d8f22db9a77b60e7e28779 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 22 Mar 2023 13:49:33 -0500 Subject: SL-19297 Hacky fix for MY EYES! --- indra/newview/llvovolume.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index d1f4fa1c7a..e1335acc17 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -6655,12 +6655,19 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace LLRenderPass::PASS_NORMSPEC_EMISSIVE, }; - U32 mask = mat->getShaderMask(); + U32 alpha_mode = mat->getDiffuseAlphaMode(); + if (!distance_sort && alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) + { // HACK - this should never happen, but sometimes we get a material that thinks it has alpha blending when it ought not + alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + } + U32 mask = mat->getShaderMask(alpha_mode); llassert(mask < sizeof(pass)/sizeof(U32)); mask = llmin(mask, (U32)(sizeof(pass)/sizeof(U32)-1)); + // if this is going into alpha pool, distance sort MUST be true + llassert(pass[mask] == LLRenderPass::PASS_ALPHA ? distance_sort : true); registerFace(group, facep, pass[mask]); } } -- cgit v1.2.3 From e23b3972a00370aff25d582ce33dc0db6d795213 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 22 Mar 2023 18:25:47 -0500 Subject: DRTVWR-559 Fix for bad hashing of materials breaking render batches and who knows what else. --- indra/newview/llvovolume.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e1335acc17..237f9e34a0 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5416,7 +5416,8 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, if (gltf_mat) { - // nothing to do, render pools will reference the GLTF material + // just remember the material ID, render pools will reference the GLTF material + draw_info->mMaterialID = mat_id; } else if (mat) { -- cgit v1.2.3 From af57bbf0ca70f0a6209a7e39261a806040f6ea92 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 23 Mar 2023 11:39:45 -0500 Subject: SL-18458 Fix for one failure mode of overrides getting applied before base material is set. --- indra/newview/llvovolume.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 237f9e34a0..7be9394364 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5670,6 +5670,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) continue; } + // HACK -- brute force this check every time a drawable gets rebuilt + for (S32 i = 0; i < drawablep->getNumFaces(); ++i) + { + vobj->updateTEMaterialTextures(i); + } + // apply any pending material overrides gGLTFMaterialList.applyQueuedOverrides(vobj); @@ -5754,9 +5760,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { continue; } - - // HACK -- brute force this check every time a drawable gets rebuilt - vobj->updateTEMaterialTextures(i); #if 0 #if LL_RELEASE_WITH_DEBUG_INFO const LLUUID pbr_id( "49c88210-7238-2a6b-70ac-92d4f35963cf" ); -- cgit v1.2.3 From 9b96bf168e15d49bfb6857b3370b9c843b150390 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 23 Mar 2023 16:31:49 -0500 Subject: SL-19478 Fix for assert when applying specular map. --- indra/newview/llvovolume.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7be9394364..77849c668a 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5473,6 +5473,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, llassert(type != LLRenderPass::PASS_BUMP || (info->mVertexBuffer->getTypeMask() & LLVertexBuffer::MAP_TANGENT) != 0); llassert(type != LLRenderPass::PASS_NORMSPEC || info->mNormalMap.notNull()); + llassert(type != LLRenderPass::PASS_SPECMAP || (info->mVertexBuffer->getTypeMask() & LLVertexBuffer::MAP_TEXCOORD2) != 0); } void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) @@ -6666,6 +6667,15 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace } U32 mask = mat->getShaderMask(alpha_mode); + U32 vb_mask = facep->getVertexBuffer()->getTypeMask(); + + // HACK - this should also never happen, but sometimes we get here and the material thinks it has a specmap now + // even though it didn't appear to have a specmap when the face was added to the list of faces + if ((mask & 0x4) && !(vb_mask & LLVertexBuffer::MAP_TEXCOORD2)) + { + mask &= ~0x4; + } + llassert(mask < sizeof(pass)/sizeof(U32)); mask = llmin(mask, (U32)(sizeof(pass)/sizeof(U32)-1)); -- cgit v1.2.3