From 2becb70686e9363c28bb465d897cc3b1b7a235e3 Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Mon, 5 Aug 2024 22:14:17 +1000 Subject: [PATCH 1/2] Fixed unwanted implicit cast of U32 to U16 causing a crash --- indra/newview/llvosurfacepatch.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index 12de4ca76b..0bb401449b 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -987,7 +987,7 @@ LLTerrainPartition::LLTerrainPartition(LLViewerRegion* regionp) } // Do not add vertices; honor strict vertex count specified by strider_vertex_count -void gen_terrain_tangents(U16 strider_vertex_count, +void gen_terrain_tangents(U32 strider_vertex_count, U32 strider_index_count, LLStrider &verticesp, LLStrider &normalsp, @@ -1003,7 +1003,7 @@ void gen_terrain_tangents(U16 strider_vertex_count, std::vector texcoords(strider_vertex_count); std::vector indices(strider_index_count); - for (U16 v = 0; v < strider_vertex_count; ++v) + for (U32 v = 0; v < strider_vertex_count; ++v) { F32 *vert = verticesp[v].mV; vertices[v] = LLVector4a(vert[0], vert[1], vert[2], 1.f); @@ -1019,7 +1019,7 @@ void gen_terrain_tangents(U16 strider_vertex_count, LLCalculateTangentArray(strider_vertex_count, vertices, normals, texcoords.data(), strider_index_count / 3, indices.data(), tangents); - for (U16 v = 0; v < strider_vertex_count; ++v) + for (U32 v = 0; v < strider_vertex_count; ++v) { tangentsp[v] = tangents[v]; } From b65be38ae0b2cd03d0f8b1591998e671fe212557 Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Mon, 5 Aug 2024 23:14:41 +1000 Subject: [PATCH 2/2] Added missing FS tags --- indra/newview/llvosurfacepatch.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index 0bb401449b..999a027d56 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -987,7 +987,7 @@ LLTerrainPartition::LLTerrainPartition(LLViewerRegion* regionp) } // Do not add vertices; honor strict vertex count specified by strider_vertex_count -void gen_terrain_tangents(U32 strider_vertex_count, +void gen_terrain_tangents(U32 strider_vertex_count, // [FIRE-34363] Fix implicit cast from U32->U16 that can cause a crash U32 strider_index_count, LLStrider &verticesp, LLStrider &normalsp, @@ -1003,7 +1003,7 @@ void gen_terrain_tangents(U32 strider_vertex_count, std::vector texcoords(strider_vertex_count); std::vector indices(strider_index_count); - for (U32 v = 0; v < strider_vertex_count; ++v) + for (U32 v = 0; v < strider_vertex_count; ++v) // [FIRE-34363] Fix implicit cast from U32->U16 that can cause a crash { F32 *vert = verticesp[v].mV; vertices[v] = LLVector4a(vert[0], vert[1], vert[2], 1.f); @@ -1019,7 +1019,7 @@ void gen_terrain_tangents(U32 strider_vertex_count, LLCalculateTangentArray(strider_vertex_count, vertices, normals, texcoords.data(), strider_index_count / 3, indices.data(), tangents); - for (U32 v = 0; v < strider_vertex_count; ++v) + for (U32 v = 0; v < strider_vertex_count; ++v) // [FIRE-34363] Fix implicit cast from U32->U16 that can cause a crash { tangentsp[v] = tangents[v]; }