commit 631dca73fed459694fa1a942978147de58855502
parent b7e6b813f3a88bd8c1c13b4eaf8b4af5fc632e07
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 1 Oct 2019 15:41:42 +0200
Improve perfs by using s3d_scene_view_create2
Use s3d_scene_view_create2 to configure the quality and the properties
of the acceleration structure to build, actually a low quality
acceleration structure designed for dynamic geometries. The resulting
acceleration structures are comparable to the ones built by previous
Star-3D versions that rely on Embree2 rather than Embree3. Per
realisation performances are thus comparable while previously, Star-3D
with Embree3 was up to 5 times slower than Star-3D with Embree2 since
its build criteria were far more exigents.
Diffstat:
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -27,7 +27,7 @@ option(NO_TEST "Disable the test" OFF)
find_package(RCMake 0.4 REQUIRED)
find_package(RSys 0.8 REQUIRED)
find_package(StarSP 0.8 REQUIRED)
-find_package(Star3D 0.6 REQUIRED)
+find_package(Star3D 0.7 REQUIRED)
find_package(OpenMP 1.2 REQUIRED)
find_package(PkgConfig REQUIRED)
@@ -54,6 +54,7 @@ include_directories(
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR})
include(rcmake)
include(rcmake_runtime)
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer")
################################################################################
# Configure and define targets
diff --git a/src/sschiff_estimator.c b/src/sschiff_estimator.c
@@ -1124,7 +1124,7 @@ integrator_context_release(struct integrator_context* ctx)
if(ctx->rng) SSP(rng_ref_put(ctx->rng));
if(ctx->estimator) SSCHIFF(estimator_ref_put(ctx->estimator));
if(ctx->shape) S3D(shape_ref_put(ctx->shape));
- if(ctx->scene) S3D(scene_ref_put(ctx->scene));
+ if(ctx->scene) S3D(scene_ref_put(ctx->scene));
if(ctx->view) S3D(scene_view_ref_put(ctx->view));
#define RELEASE(Data) if(Data) sa_release(Data)
@@ -1249,6 +1249,7 @@ begin_realisation
struct sschiff_geometry_distribution* distrib,
struct integrator_context* ctx)
{
+ struct s3d_accel_struct_conf accel_struct_conf = S3D_ACCEL_STRUCT_CONF_DEFAULT;
res_T res = RES_OK;
ASSERT(dev && distrib && ctx && !ctx->view);
@@ -1260,8 +1261,13 @@ begin_realisation
goto error;
}
+ accel_struct_conf.quality = S3D_ACCEL_STRUCT_QUALITY_LOW;
+ accel_struct_conf.mask =
+ S3D_ACCEL_STRUCT_FLAG_ROBUST
+ | S3D_ACCEL_STRUCT_FLAG_DYNAMIC;
+
/* Build the Star-3D representation of the sampled shape */
- S3D(scene_view_create(ctx->scene, S3D_TRACE, &ctx->view));
+ S3D(scene_view_create2(ctx->scene, S3D_TRACE, &accel_struct_conf, &ctx->view));
exit:
return res;