star-vx

Structuring voxels for ray-tracing
git clone git://git.meso-star.fr/star-vx.git
Log | Files | Refs | README | LICENSE

commit c1cd523ec98899f68a21b823981f5f2c3077b91c
parent 95cca20d5fdf5c62d6a021a99699ea1a046dbd0d
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 11 Jul 2018 11:25:53 +0200

Align the allocated svx_tree structure on 16 Bytes

This is actually necessary due to the "root_attr" attribute that is
aligned on 16 bytes into the svx_tree data structure.

Diffstat:
Msrc/svx_tree.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/svx_tree.c b/src/svx_tree.c @@ -130,11 +130,12 @@ tree_create goto error; } - tree = MEM_CALLOC(dev->allocator, 1, sizeof(*tree)); + tree = MEM_ALLOC_ALIGNED(dev->allocator, sizeof(*tree), 16); if(!tree) { res = RES_MEM_ERR; goto error; } + memset(tree, 0, sizeof(*tree)); ref_init(&tree->ref); SVX(device_ref_get(dev)); buffer_init(dev->allocator, vxsz, &tree->buffer);