From 75ffe90b0cf14559543e1719bf48fd0b397f3905 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 27 Apr 2015 18:21:39 +0300 Subject: MAINT-5042 FIXED SL Viewer Closes Unexpectedly in specific area with high RenderVolumeLODFactor - fix for review - fix in buffer overrun detector --- indra/llmath/llvolume.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llmath') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index c2198b91a7..41ee3941ac 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5584,7 +5584,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) { resizeVertices(num_vertices+1); - if (!partial_build) + //if (!partial_build) { resizeIndices(num_indices+3); } @@ -5592,7 +5592,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) else { resizeVertices(num_vertices); - if (!partial_build) + //if (!partial_build) { resizeIndices(num_indices); } @@ -5714,10 +5714,10 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) LL_CHECK_MEMORY - if (partial_build) - { - return TRUE; - } + //if (partial_build) + //{ + // return TRUE; + //} if (mTypeMask & HOLLOW_MASK) { -- cgit v1.2.3 From d43cef4ed5a012593ff31c4ef9c0356edbea5339 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 14 Jul 2015 16:29:36 +0300 Subject: MAINT-5364 FIXED Object with invalid sculpt topology type cannot be seen or selected --- indra/llmath/llvolume.cpp | 29 ++++++++++++++++++++++++++++- indra/llmath/llvolume.h | 13 ++++++++----- 2 files changed, 36 insertions(+), 6 deletions(-) (limited to 'indra/llmath') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 41ee3941ac..82081ca853 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -3178,6 +3178,16 @@ BOOL LLVolume::isFlat(S32 face) } +LLVolumeParams::LLVolumeParams( LLProfileParams &profile, + LLPathParams &path, + LLUUID sculpt_id, + U8 sculpt_type) : +mProfileParams(profile), +mPathParams(path) +{ + setSculptID(sculpt_id, sculpt_type); +} + bool LLVolumeParams::isSculpt() const { return mSculptID.notNull(); @@ -3494,7 +3504,24 @@ bool LLVolumeParams::setSkew(const F32 skew_value) bool LLVolumeParams::setSculptID(const LLUUID sculpt_id, U8 sculpt_type) { mSculptID = sculpt_id; - mSculptType = sculpt_type; + // Check sculpt type value, it consist of type and flags + U8 type = sculpt_type & LL_SCULPT_TYPE_MASK; + U8 flags = sculpt_type & LL_SCULPT_FLAG_MASK; + if (sculpt_type != (type | flags) || type > LL_SCULPT_TYPE_MAX) + { + if (sculpt_id != LLUUID::null) + { + mSculptType = LL_SCULPT_TYPE_MESH; + } + else + { + mSculptType = LL_SCULPT_TYPE_SPHERE; + } + } + else + { + mSculptType = sculpt_type; + } return true; } diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index c8476f6897..06688cacc9 100755 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -190,8 +190,12 @@ const U8 LL_SCULPT_TYPE_MESH = 5; const U8 LL_SCULPT_TYPE_MASK = LL_SCULPT_TYPE_SPHERE | LL_SCULPT_TYPE_TORUS | LL_SCULPT_TYPE_PLANE | LL_SCULPT_TYPE_CYLINDER | LL_SCULPT_TYPE_MESH; +// for value checks, assign new value after adding new types +const U8 LL_SCULPT_TYPE_MAX = LL_SCULPT_TYPE_MESH; + const U8 LL_SCULPT_FLAG_INVERT = 64; const U8 LL_SCULPT_FLAG_MIRROR = 128; +const U8 LL_SCULPT_FLAG_MASK = LL_SCULPT_FLAG_INVERT | LL_SCULPT_FLAG_MIRROR; const S32 LL_SCULPT_MESH_MAX_FACES = 8; @@ -556,11 +560,10 @@ public: { } - LLVolumeParams(LLProfileParams &profile, LLPathParams &path, - LLUUID sculpt_id = LLUUID::null, U8 sculpt_type = LL_SCULPT_TYPE_NONE) - : mProfileParams(profile), mPathParams(path), mSculptID(sculpt_id), mSculptType(sculpt_type) - { - } + LLVolumeParams( LLProfileParams &profile, + LLPathParams &path, + LLUUID sculpt_id = LLUUID::null, + U8 sculpt_type = LL_SCULPT_TYPE_NONE); bool operator==(const LLVolumeParams ¶ms) const; bool operator!=(const LLVolumeParams ¶ms) const; -- cgit v1.2.3 From d9341caf45fa888824c93d9c2b24fdb7659f181b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 17 Jul 2015 17:36:33 +0300 Subject: MAINT-5364 FIXED Object with invalid sculpt topology type cannot be seen or selected --- indra/llmath/llvolume.cpp | 29 +---------------------------- indra/llmath/llvolume.h | 9 +++++---- 2 files changed, 6 insertions(+), 32 deletions(-) (limited to 'indra/llmath') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 82081ca853..41ee3941ac 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -3178,16 +3178,6 @@ BOOL LLVolume::isFlat(S32 face) } -LLVolumeParams::LLVolumeParams( LLProfileParams &profile, - LLPathParams &path, - LLUUID sculpt_id, - U8 sculpt_type) : -mProfileParams(profile), -mPathParams(path) -{ - setSculptID(sculpt_id, sculpt_type); -} - bool LLVolumeParams::isSculpt() const { return mSculptID.notNull(); @@ -3504,24 +3494,7 @@ bool LLVolumeParams::setSkew(const F32 skew_value) bool LLVolumeParams::setSculptID(const LLUUID sculpt_id, U8 sculpt_type) { mSculptID = sculpt_id; - // Check sculpt type value, it consist of type and flags - U8 type = sculpt_type & LL_SCULPT_TYPE_MASK; - U8 flags = sculpt_type & LL_SCULPT_FLAG_MASK; - if (sculpt_type != (type | flags) || type > LL_SCULPT_TYPE_MAX) - { - if (sculpt_id != LLUUID::null) - { - mSculptType = LL_SCULPT_TYPE_MESH; - } - else - { - mSculptType = LL_SCULPT_TYPE_SPHERE; - } - } - else - { - mSculptType = sculpt_type; - } + mSculptType = sculpt_type; return true; } diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 06688cacc9..e1161682b5 100755 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -560,10 +560,11 @@ public: { } - LLVolumeParams( LLProfileParams &profile, - LLPathParams &path, - LLUUID sculpt_id = LLUUID::null, - U8 sculpt_type = LL_SCULPT_TYPE_NONE); + LLVolumeParams(LLProfileParams &profile, LLPathParams &path, + LLUUID sculpt_id = LLUUID::null, U8 sculpt_type = LL_SCULPT_TYPE_NONE) + : mProfileParams(profile), mPathParams(path), mSculptID(sculpt_id), mSculptType(sculpt_type) + { + } bool operator==(const LLVolumeParams ¶ms) const; bool operator!=(const LLVolumeParams ¶ms) const; -- cgit v1.2.3 From 6b2c1d5f104047af8aa71d01b7d8fbe9a0ad3493 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 14 Sep 2015 11:01:22 -0400 Subject: SL-133 WIP, SL-134 WIP - more extra joint handling --- indra/llmath/llvolume.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'indra/llmath') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index c2198b91a7..cd417c913d 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2536,6 +2536,8 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) U32 cur_influence = 0; LLVector4 wght(0,0,0,0); + U32 joints[4] = {0,0,0,0}; + LLVector4 joints_with_weights(0,0,0,0); while (joint != END_INFLUENCES && idx < weights.size()) { @@ -2543,7 +2545,9 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) influence |= ((U16) weights[idx++] << 8); F32 w = llclamp((F32) influence / 65535.f, 0.f, 0.99999f); - wght.mV[cur_influence++] = (F32) joint + w; + wght.mV[cur_influence] = w; + joints[cur_influence] = joint; + cur_influence++; if (cur_influence >= 4) { @@ -2554,8 +2558,16 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) joint = weights[idx++]; } } - - face.mWeights[cur_vertex].loadua(wght.mV); + F32 wsum = wght.mV[VX] + wght.mV[VY] + wght.mV[VZ] + wght.mV[VW]; + if (wsum <= 0.f) + { + wght = LLVector4(0.99999f,0.f,0.f,0.f); + } + for (U32 k=0; k<4; k++) + { + joints_with_weights[k] = (F32) joints[k] + wght[k]; + } + face.mWeights[cur_vertex].loadua(joints_with_weights.mV); cur_vertex++; } -- cgit v1.2.3