commit aa50add43ae7972d00b1024f171869e783481c5b
parent a54873753feb8314fef967e0de8f8e8bd94ffe2c
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 9 Sep 2015 19:19:01 +0200
Test the s3d_primitive API
Diffstat:
7 files changed, 157 insertions(+), 47 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -129,6 +129,7 @@ if(NOT NO_TEST)
endfunction(new_test)
new_test(test_s3d_device)
+ new_test(test_s3d_primitive)
new_test(test_s3d_sampler)
new_test(test_s3d_scene)
new_test(test_s3d_shape)
diff --git a/src/s3d.h b/src/s3d.h
@@ -156,9 +156,8 @@ static const struct s3d_hit S3D_HIT_NULL =
};
enum s3d_session_flag {
- S3D_SESSION_NONE = 0,
- S3D_SESSION_TRACE = BIT(0),
- S3D_SESSION_SAMPLE = BIT(1)
+ S3D_TRACE = BIT(0),
+ S3D_SAMPLE = BIT(1)
};
/* Helper macro that defines whether or not the hit is valid, i.e. the ray
@@ -251,8 +250,7 @@ s3d_scene_clear
* a s3d_scene_begin_session is already active on `scn' or one of its attached
* instance a RES_BAD_OP error is returned. On success neither another begin
* session nor a clear or shape_detach can be invoked on `scn' and its attached
- * instances until s3d_scene_end_session is called. A s3d_scene_trace_ray
- * operation can be invoked on if a S3D_SESSION_TRACE session is active on scn*/
+ * instances until s3d_scene_end_session is called. */
S3D_API res_T
s3d_scene_begin_session
(struct s3d_scene* scn,
@@ -271,8 +269,8 @@ s3d_scene_get_session_mask
/* Trace a ray into the `scn' and return the closest intersection. The ray is
* defined by `origin' + t*`direction' = 0 with t in [`range[0]', `range[1]').
* Note that if range is degenerated (i.e. `range[0]' >= `range[1]') then the
- * ray is not traced and `hit' is set to S3D_HIT_NULL. This function can be
- * called only if a s3d_scene_begin_trace operation is active on `scn' */
+ * ray is not traced and `hit' is set to S3D_HIT_NULL. Can be called only if an
+ * S3D_TRACE session is active on `scn' */
S3D_API res_T
s3d_scene_trace_ray
(struct s3d_scene* scn,
@@ -285,8 +283,8 @@ s3d_scene_trace_ray
* them. The rays are defined by `origin' + t*`direction' = 0 with t in
* [`range[0]', `range[1]'). Note that if a range is degenerated (i.e.
* `range[0]' >= `range[1]') then its associated ray is not traced and `hit' is
- * set to S3D_HIT_NULL. This function can be called only if a
- * s3d_scene_begin_trace operation is active on `scn' */
+ * set to S3D_HIT_NULL. Can be called only if an S3D_TRACE session is active on
+ * `scn' */
S3D_API res_T
s3d_scene_trace_rays
(struct s3d_scene* scn,
@@ -297,10 +295,11 @@ s3d_scene_trace_rays
const float* ranges, /* List of 2D ray ranges. in [0, INF)^2 */
struct s3d_hit* hits);
-/* TODO comment */
+/* Uniformly sample the scene and returned the sampled primitive and its sample
+ * uv position. Can be called only if an S3D_SAMPLE session is active on `scn'*/
S3D_API res_T
s3d_scene_sample
- (struct s3d_scene* scene,
+ (struct s3d_scene* scn,
const float u, const float v, const float w,
struct s3d_primitive* primitive, /* sampled primitive */
float uv[2]);
diff --git a/src/s3d_scene.c b/src/s3d_scene.c
@@ -43,7 +43,7 @@
#include <algorithm>
/* Flag used to define session of enabled on instantiated scene */
-#define S3D_SESSION_INSTANCE (BIT(sizeof(int)*8 - 1))
+#define S3D_INSTANCE (BIT(sizeof(int)*8 - 1))
/*******************************************************************************
* Helper functions
@@ -51,7 +51,7 @@
static res_T
scene_sync
(struct s3d_scene* scn,
- const int mask);/* combination of s3d_session_flag & S3D_SESSION_INSTANCE */
+ const int mask);/* combination of s3d_session_flag & S3D_INSTANCE */
static INLINE void
scene_geometry_flush_enable_state
@@ -128,7 +128,7 @@ scene_session_clear(struct s3d_scene* scn)
geometry_ref_put(geoms[i]);
}
darray_geom_clear(&scn->embree2geoms);
- scn->session_mask = S3D_SESSION_NONE;
+ scn->session_mask = 0;
}
static res_T
@@ -255,7 +255,7 @@ scene_register_instance
/* Recursuvely update the scene */
res = scene_sync(shape->data.instance->scene,
- session_mask|S3D_SESSION_INSTANCE);
+ session_mask|S3D_INSTANCE);
if(res != RES_OK) goto error;
pgeom = htable_geom_find(&scn->cached_geoms, &shape);
@@ -314,7 +314,7 @@ scene_detach_shape(struct s3d_scene* scn, struct s3d_shape* shape)
struct geometry** pgeom;
ASSERT(scn && shape && !is_list_empty(&shape->scene_attachment));
ASSERT(shape->type == GEOM_MESH || shape->type == GEOM_INSTANCE);
- ASSERT(scn->session_mask == S3D_SESSION_NONE);
+ ASSERT(scn->session_mask == 0);
pgeom = htable_geom_find(&scn->cached_geoms, &shape);
if(pgeom) { /* Remove the cached shape mesh */
@@ -408,7 +408,7 @@ scene_sync(struct s3d_scene* scn, const int session_mask)
res_T res = RES_OK;
ASSERT(scn);
- if(scn->session_mask != S3D_SESSION_NONE) {
+ if(scn->session_mask != 0) {
res = RES_BAD_OP;
goto error;
}
@@ -428,12 +428,12 @@ scene_sync(struct s3d_scene* scn, const int session_mask)
goto error;
}
- if((session_mask & S3D_SESSION_SAMPLE) != 0) {
+ if((session_mask & S3D_SAMPLE) != 0) {
res = scene_compute_cdf(scn);
if(res != RES_OK) goto error;
}
- if((session_mask & S3D_SESSION_TRACE) != 0 && scn->is_rtc_scn_outdated) {
+ if((session_mask & S3D_TRACE) != 0 && scn->is_rtc_scn_outdated) {
rtcCommit(scn->rtc_scn);
scn->is_rtc_scn_outdated = 0;
}
@@ -490,7 +490,7 @@ s3d_scene_create(struct s3d_device* dev, struct s3d_scene** out_scn)
ref_init(&scn->ref);
S3D(device_ref_get(dev));
scn->dev = dev;
- scn->session_mask = S3D_SESSION_NONE;
+ scn->session_mask = 0;
scn->rtc_scn = rtcNewScene
(RTC_SCENE_DYNAMIC | RTC_SCENE_INCOHERENT | RTC_SCENE_ROBUST,
RTC_INTERSECT1 | RTC_INTERSECT4);
@@ -579,7 +579,7 @@ s3d_scene_detach_shape(struct s3d_scene* scn, struct s3d_shape* shape)
{
char is_attached;
if(!scn || !shape) return RES_BAD_ARG;
- if(scn->session_mask != S3D_SESSION_NONE) return RES_BAD_OP;
+ if(scn->session_mask != 0) return RES_BAD_OP;
if(!(S3D(shape_is_attached(shape, &is_attached)), is_attached))
return RES_BAD_ARG;
#ifndef NDEBUG
@@ -602,7 +602,7 @@ s3d_scene_clear(struct s3d_scene* scn)
{
struct list_node* node, *tmp;
if(!scn) return RES_BAD_ARG;
- if(scn->session_mask != S3D_SESSION_NONE) return RES_BAD_OP;
+ if(scn->session_mask != 0) return RES_BAD_OP;
LIST_FOR_EACH_SAFE(node, tmp, &scn->shapes) {
struct s3d_shape* shape = CONTAINER_OF
(node, struct s3d_shape, scene_attachment);
@@ -616,7 +616,7 @@ s3d_scene_begin_session(struct s3d_scene* scn, const int session_mask)
{
if(!scn)
return RES_BAD_ARG;
- if(!(session_mask&S3D_SESSION_TRACE) && !(session_mask&S3D_SESSION_SAMPLE))
+ if(!(session_mask&S3D_TRACE) && !(session_mask&S3D_SAMPLE))
return RES_BAD_ARG;
return scene_sync(scn, session_mask);
}
@@ -626,7 +626,7 @@ s3d_scene_end_session(struct s3d_scene* scn)
{
if(!scn)
return RES_BAD_ARG;
- if(scn->session_mask & S3D_SESSION_INSTANCE || !scn->session_mask)
+ if(scn->session_mask & S3D_INSTANCE || !scn->session_mask)
return RES_BAD_OP;
scene_session_clear(scn);
return RES_OK;
@@ -637,7 +637,7 @@ s3d_scene_get_session_mask(struct s3d_scene* scn, int* session_mask)
{
if(!scn || !session_mask)
return RES_BAD_ARG;
- *session_mask = scn->session_mask & (~S3D_SESSION_INSTANCE);
+ *session_mask = scn->session_mask & (~S3D_INSTANCE);
return RES_OK;
}
@@ -654,7 +654,7 @@ s3d_scene_trace_ray
return RES_BAD_ARG;
if(!f3_is_normalized(dir))
return RES_BAD_ARG;
- if((scn->session_mask & S3D_SESSION_TRACE) == 0)
+ if((scn->session_mask & S3D_TRACE) == 0)
return RES_BAD_OP;
if(range[0] > range[1]) {
*hit = S3D_HIT_NULL;
@@ -789,7 +789,7 @@ s3d_scene_sample
res = RES_BAD_ARG;
goto error;
}
- if((scn->session_mask & S3D_SESSION_SAMPLE) == 0) {
+ if((scn->session_mask & S3D_SAMPLE) == 0) {
res = RES_BAD_OP;
goto error;
}
diff --git a/src/test_s3d_primitive.c b/src/test_s3d_primitive.c
@@ -0,0 +1,110 @@
+/* Copyright (C) |Meso|Star> 2015 (contact@meso-star.com)
+ *
+ * This software is a computer program whose purpose is to describe a
+ * virtual 3D environment that can be ray-traced and sampled both robustly
+ * and efficiently.
+ *
+ * This software is governed by the CeCILL license under French law and
+ * abiding by the rules of distribution of free software. You can use,
+ * modify and/or redistribute the software under the terms of the CeCILL
+ * license as circulated by CEA, CNRS and INRIA at the following URL
+ * "http://www.cecill.info".
+ *
+ * As a counterpart to the access to the source code and rights to copy,
+ * modify and redistribute granted by the license, users are provided only
+ * with a limited warranty and the software's author, the holder of the
+ * economic rights, and the successive licensors have only limited
+ * liability.
+ *
+ * In this respect, the user's attention is drawn to the risks associated
+ * with loading, using, modifying and/or developing or reproducing the
+ * software by the user in light of its specific status of free software,
+ * that may mean that it is complicated to manipulate, and that also
+ * therefore means that it is reserved for developers and experienced
+ * professionals having in-depth computer knowledge. Users are therefore
+ * encouraged to load and test the software's suitability as regards their
+ * requirements in conditions enabling the security of their systems and/or
+ * data to be ensured and, more generally, to use and operate it in the
+ * same conditions as regards security.
+ *
+ * The fact that you are presently reading this means that you have had
+ * knowledge of the CeCILL license and that you accept its terms. */
+
+#include "s3d.h"
+#include "test_s3d_cbox.h"
+#include "test_s3d_utils.h"
+
+int
+main(int argc, char** argv)
+{
+ struct mem_allocator allocator;
+ struct s3d_device* dev;
+ struct s3d_scene* scn;
+ struct s3d_shape* walls;
+ struct s3d_attrib attr;
+ struct s3d_primitive prim = S3D_PRIMITIVE_NULL;
+ struct s3d_vertex_data attribs[2];
+ struct cbox_desc desc;
+ unsigned ntris, nverts;
+ float uv[2];
+ unsigned walls_id;
+ (void)argc, (void)argv;
+
+ mem_init_proxy_allocator(&allocator, &mem_default_allocator);
+
+ CHECK(s3d_device_create(NULL, &allocator, 1, &dev), RES_OK);
+ CHECK(s3d_scene_create(dev, &scn), RES_OK);
+ CHECK(s3d_shape_create_mesh(dev, &walls), RES_OK);
+ CHECK(s3d_shape_get_id(walls, &walls_id), RES_OK);
+ CHECK(s3d_scene_attach_shape(scn, walls), RES_OK);
+
+ attribs[0].usage = S3D_POSITION;
+ attribs[0].type = S3D_FLOAT3;
+ attribs[0].get = cbox_get_position;
+ attribs[1] = S3D_VERTEX_DATA_NULL;
+
+ ntris = sizeof(cbox_walls_ids)/sizeof(unsigned[3]);
+ nverts = sizeof(cbox_walls)/sizeof(float[3]);
+ desc.vertices = cbox_walls;
+ desc.indices = cbox_walls_ids;
+ CHECK(s3d_mesh_setup_indexed_vertices
+ (walls, ntris, cbox_get_ids, nverts, attribs, &desc), RES_OK);
+
+ CHECK(s3d_scene_begin_session(scn, S3D_SAMPLE), RES_OK);
+ CHECK(s3d_scene_sample(scn, 0, 0, 0, &prim, uv), RES_OK);
+ CHECK(s3d_scene_end_session(scn), RES_OK);
+
+ CHECK(s3d_primitive_get_attrib(NULL, S3D_ATTRIBS_COUNT__, NULL, NULL), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(&prim, S3D_ATTRIBS_COUNT__, NULL, NULL), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(NULL, S3D_ATTRIBS_COUNT__, uv, NULL), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(&prim, S3D_ATTRIBS_COUNT__, uv, NULL), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(NULL, S3D_ATTRIBS_COUNT__, NULL, &attr), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(&prim, S3D_ATTRIBS_COUNT__, NULL, &attr), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(NULL, S3D_ATTRIBS_COUNT__, uv, &attr), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(&prim, S3D_ATTRIBS_COUNT__, uv, &attr), RES_BAD_ARG);
+
+ CHECK(s3d_primitive_get_attrib(NULL, S3D_POSITION, NULL, NULL), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(&prim, S3D_POSITION, NULL, NULL), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(NULL, S3D_POSITION, uv, NULL), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(&prim, S3D_POSITION, uv, NULL), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(NULL, S3D_POSITION, NULL, &attr), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(&prim, S3D_POSITION, NULL, &attr), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(NULL, S3D_POSITION, uv, &attr), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(&prim, S3D_POSITION, uv, &attr), RES_OK);
+ CHECK(attr.type, S3D_FLOAT3);
+ CHECK(attr.usage, S3D_POSITION);
+ CHECK(s3d_primitive_get_attrib(&prim, S3D_GEOMETRY_NORMAL, uv, &attr), RES_OK);
+ CHECK(attr.type, S3D_FLOAT3);
+ CHECK(attr.usage, S3D_GEOMETRY_NORMAL);
+ CHECK(s3d_primitive_get_attrib(&prim, S3D_ATTRIB_0, uv, &attr), RES_BAD_ARG);
+ CHECK(s3d_primitive_get_attrib(&S3D_PRIMITIVE_NULL, S3D_POSITION, uv, &attr), RES_BAD_ARG);
+
+ CHECK(s3d_device_ref_put(dev), RES_OK);
+ CHECK(s3d_scene_ref_put(scn), RES_OK);
+ CHECK(s3d_shape_ref_put(walls), RES_OK);
+
+ check_memory_allocator(&allocator);
+ mem_shutdown_proxy_allocator(&allocator);
+ CHECK(mem_allocated_size(), 0);
+ return 0;
+}
diff --git a/src/test_s3d_sampler.c b/src/test_s3d_sampler.c
@@ -87,7 +87,7 @@ main(int argc, char** argv)
CHECK(s3d_shape_get_id(short_block, &short_block_id), RES_OK);
CHECK(s3d_shape_get_id(tall_block, &tall_block_id), RES_OK);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_SAMPLE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn, S3D_SAMPLE), RES_OK);
CHECK(s3d_scene_sample(NULL, 0, 0, 0, NULL, NULL), RES_BAD_ARG);
CHECK(s3d_scene_sample(scn, 0, 0, 0, NULL, NULL), RES_BAD_ARG);
CHECK(s3d_scene_sample(NULL, 0, 0, 0, &prim, NULL), RES_BAD_ARG);
@@ -120,8 +120,8 @@ main(int argc, char** argv)
CHECK(s3d_scene_attach_shape(scn, walls), RES_OK);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_SAMPLE), RES_OK);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_SAMPLE), RES_BAD_OP);
+ CHECK(s3d_scene_begin_session(scn, S3D_SAMPLE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn, S3D_SAMPLE), RES_BAD_OP);
CHECK(s3d_scene_sample(scn, 0.5f, 0.5f, 0.5f, &prim, uv), RES_OK);
CHECK(s3d_primitive_get_attrib(&prim, S3D_POSITION, uv, &attr0), RES_OK);
@@ -151,7 +151,7 @@ main(int argc, char** argv)
CHECK(s3d_scene_end_session(scn), RES_OK);
CHECK(s3d_shape_enable(walls, 0), RES_OK);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_SAMPLE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn, S3D_SAMPLE), RES_OK);
CHECK(s3d_scene_sample(scn, 0.5f, 0.5f, 0.5f, &prim, uv), RES_OK);
CHECK(S3D_PRIMITIVE_EQ(&prim, &S3D_PRIMITIVE_NULL), 1);
CHECK(s3d_scene_end_session(scn), RES_OK);
@@ -169,7 +169,7 @@ main(int argc, char** argv)
CHECK(s3d_scene_attach_shape(scn, short_block), RES_OK);
CHECK(s3d_scene_attach_shape(scn, tall_block), RES_OK);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_SAMPLE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn, S3D_SAMPLE), RES_OK);
CHECK(s3d_scene_sample(scn, 0.5f, 0.5f, 0.5f, &prim, uv), RES_OK);
CHECK(s3d_primitive_get_attrib(&prim, S3D_POSITION, uv, &attr0), RES_OK);
desc.vertices = cbox_tall_block;
@@ -180,19 +180,19 @@ main(int argc, char** argv)
CHECK(f3_eq_eps(attr0.value, attr1.value, 1.e-6f), 1);
CHECK(s3d_scene_end_session(scn), RES_OK);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_SAMPLE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn, S3D_SAMPLE), RES_OK);
CHECK(s3d_scene_sample(scn, 0.5f, 0.5f, 0.5f, &prim, uv), RES_OK);
CHECK(s3d_primitive_get_attrib(&prim, S3D_POSITION, uv, &attr1), RES_OK);
NCHECK(f3_eq_eps(attr0.value, attr1.value, 1.e-6f), 1);
CHECK(s3d_scene_end_session(scn), RES_OK);
CHECK(s3d_shape_enable(cbox, 0), RES_OK);
- CHECK(s3d_scene_begin_session(scn2, S3D_SESSION_SAMPLE|S3D_SESSION_TRACE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn2, S3D_SAMPLE|S3D_TRACE), RES_OK);
CHECK(s3d_scene_sample(scn2, 0.5f, 0.5f, 0.5f, &prim, uv), RES_OK);
CHECK(S3D_PRIMITIVE_EQ(&prim, &S3D_PRIMITIVE_NULL), 1);
CHECK(s3d_scene_end_session(scn2), RES_OK);
CHECK(s3d_shape_enable(cbox, 1), RES_OK);
- CHECK(s3d_scene_begin_session(scn2, S3D_SESSION_SAMPLE|S3D_SESSION_TRACE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn2, S3D_SAMPLE|S3D_TRACE), RES_OK);
FOR_EACH(i, 0, NSAMPS) {
const float u = rand_canonic();
const float v = rand_canonic();
diff --git a/src/test_s3d_scene.c b/src/test_s3d_scene.c
@@ -94,17 +94,17 @@ main(int argc, char** argv)
CHECK(s3d_scene_get_session_mask(scn, NULL), RES_BAD_ARG);
CHECK(s3d_scene_get_session_mask(NULL, &mask), RES_BAD_ARG);
CHECK(s3d_scene_get_session_mask(scn, &mask), RES_OK);
- CHECK(mask, S3D_SESSION_NONE);
+ CHECK(mask, 0);
CHECK(s3d_scene_attach_shape(scn, shapes[0]), RES_OK);
CHECK(s3d_scene_begin_session(NULL, 0), RES_BAD_ARG);
CHECK(s3d_scene_begin_session(scn, 0), RES_BAD_ARG);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_TRACE), RES_OK);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_TRACE), RES_BAD_OP);
+ CHECK(s3d_scene_begin_session(scn, S3D_TRACE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn, S3D_TRACE), RES_BAD_OP);
CHECK(s3d_scene_get_session_mask(scn, &mask), RES_OK);
- CHECK(mask & S3D_SESSION_TRACE, S3D_SESSION_TRACE);
- CHECK(mask & S3D_SESSION_SAMPLE, 0);
+ CHECK(mask & S3D_TRACE, S3D_TRACE);
+ CHECK(mask & S3D_SAMPLE, 0);
CHECK(s3d_scene_clear(scn), RES_BAD_OP);
CHECK(s3d_scene_detach_shape(scn, shapes[0]), RES_BAD_OP);
diff --git a/src/test_s3d_trace_ray.c b/src/test_s3d_trace_ray.c
@@ -133,7 +133,7 @@ main(int argc, char** argv)
CHECK(s3d_scene_attach_shape(scn, walls), RES_OK);
CHECK(s3d_shape_ref_put(walls), RES_OK);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_TRACE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn, S3D_TRACE), RES_OK);
CHECK(s3d_scene_trace_ray(NULL, NULL, NULL, NULL, NULL), RES_BAD_ARG);
CHECK(s3d_scene_trace_ray(scn, NULL, NULL, NULL, NULL), RES_BAD_ARG);
CHECK(s3d_scene_trace_ray(NULL, org, NULL, NULL, NULL), RES_BAD_ARG);
@@ -237,11 +237,11 @@ main(int argc, char** argv)
CHECK(s3d_shape_enable(inst, 0), RES_OK);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_TRACE), RES_OK);
- CHECK(s3d_scene_begin_session(scn2, S3D_SESSION_TRACE), RES_BAD_OP);
+ CHECK(s3d_scene_begin_session(scn, S3D_TRACE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn2, S3D_TRACE), RES_BAD_OP);
CHECK(s3d_scene_end_session(scn), RES_OK);
- CHECK(s3d_scene_begin_session(scn2, S3D_SESSION_TRACE), RES_OK);
- CHECK(s3d_scene_begin_session(scn, S3D_SESSION_TRACE), RES_BAD_OP);
+ CHECK(s3d_scene_begin_session(scn2, S3D_TRACE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn, S3D_TRACE), RES_BAD_OP);
CHECK(s3d_scene_end_session(scn), RES_BAD_OP);
CHECK(s3d_scene_clear(scn2), RES_BAD_OP);
@@ -249,7 +249,7 @@ main(int argc, char** argv)
CHECK(s3d_scene_end_session(scn2), RES_OK);
CHECK(s3d_shape_enable(inst, 1), RES_OK);
- CHECK(s3d_scene_begin_session(scn2, S3D_SESSION_TRACE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn2, S3D_TRACE), RES_OK);
CHECK(s3d_scene_end_session(scn2), RES_OK);
CHECK(s3d_scene_clear(scn), RES_OK);
@@ -257,7 +257,7 @@ main(int argc, char** argv)
CHECK(s3d_scene_attach_shape(scn, short_block), RES_OK);
CHECK(s3d_scene_attach_shape(scn, tall_block), RES_OK);
- CHECK(s3d_scene_begin_session(scn2, S3D_SESSION_TRACE), RES_OK);
+ CHECK(s3d_scene_begin_session(scn2, S3D_TRACE), RES_OK);
camera_init(&cam);
FOR_EACH(iy, 0, IMG_HEIGHT) {