diff --git a/intern/cycles/bvh/embree.cpp b/intern/cycles/bvh/embree.cpp index c70813d6d488ee76f25d66ef6c54ecc4922ed1af..8994ae3da9ac35f5e7b5ca9b2e878cfe120caca2 100644 --- a/intern/cycles/bvh/embree.cpp +++ b/intern/cycles/bvh/embree.cpp @@ -342,11 +342,9 @@ void BVHEmbree::set_tri_vertex_buffer(RTCGeometry geom_id, const Mesh *mesh, con } else { if (!rtc_device_is_sycl) { - /* NOTE(sirgienko) Embree requires padding for VERTEX layout as last buffer element - * must be readable using 16-byte SSE load instructions. Because of this, we are - * artificially increasing shared buffer size by 1 - it shouldn't cause any memory - * access violation as this last element is not accessed directly since no triangle - * can reference it. */ + static_assert(sizeof(float3) == 16, + "Embree requires that each buffer element be readable with 16-byte SSE load " + "instructions"); rtcSetSharedGeometryBuffer(geom_id, RTC_BUFFER_TYPE_VERTEX, t, @@ -354,7 +352,7 @@ void BVHEmbree::set_tri_vertex_buffer(RTCGeometry geom_id, const Mesh *mesh, con verts, 0, sizeof(float3), - num_verts + 1); + num_verts); } else { /* NOTE(sirgienko): If the Embree device is a SYCL device, then Embree execution will