commit a4748184a1401b9b7979b65b8b220889228fcadc
parent ef7c533c3e1a994e70046d8cd4a67447dfe3a9e3
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 10 Jan 2019 14:32:37 +0100
Fix the setup of the index buffer against Embree3
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/s3d_scene_view.c b/src/s3d_scene_view.c
@@ -323,14 +323,14 @@ embree_geometry_setup_indices
ntris = mesh_get_ntris(geom->data.mesh);
buf = rtcNewSharedBuffer
- (scnview->scn->dev->rtc, ids, sizeof(uint32_t[3])*ntris*3);
+ (scnview->scn->dev->rtc, ids, sizeof(uint32_t[3])*ntris);
if(!buf) {
res = rtc_error_to_res_T(rtcGetDeviceError(scnview->scn->dev->rtc));
goto error;
}
rtcSetGeometryBuffer(geom->rtc, RTC_BUFFER_TYPE_INDEX, 0/*slot*/,
- RTC_FORMAT_UINT3, buf, 0/*offset*/, sizeof(uint32_t[3])/*stride*/, ntris*3);
+ RTC_FORMAT_UINT3, buf, 0/*offset*/, sizeof(uint32_t[3])/*stride*/, ntris);
rtcUpdateGeometryBuffer(geom->rtc, RTC_BUFFER_TYPE_INDEX, 0);
exit: