rasterizer icon indicating copy to clipboard operation
rasterizer copied to clipboard

Crash with low-poly occluders

Open corporateshark opened this issue 4 years ago • 0 comments

Do:

Create a single occluder which consists of a tetrahedron mesh (4 vertices, 12 indices).

Observe:

A crash in Occluder::bake().

Hints:

The size of std::vector<__m128> orderedVertices can be less than 32 which means this code will crash:

__m128 v0 = _mm_mul_ps(_mm_sub_ps(orderedVertices[i + j +  0], refMin), invExtents);
__m128 v1 = _mm_mul_ps(_mm_sub_ps(orderedVertices[i + j +  4], refMin), invExtents);
__m128 v2 = _mm_mul_ps(_mm_sub_ps(orderedVertices[i + j +  8], refMin), invExtents);
__m128 v3 = _mm_mul_ps(_mm_sub_ps(orderedVertices[i + j + 12], refMin), invExtents);
__m128 v4 = _mm_mul_ps(_mm_sub_ps(orderedVertices[i + j + 16], refMin), invExtents);
__m128 v5 = _mm_mul_ps(_mm_sub_ps(orderedVertices[i + j + 20], refMin), invExtents);
__m128 v6 = _mm_mul_ps(_mm_sub_ps(orderedVertices[i + j + 24], refMin), invExtents);
__m128 v7 = _mm_mul_ps(_mm_sub_ps(orderedVertices[i + j + 28], refMin), invExtents);

corporateshark avatar Oct 24 '21 22:10 corporateshark