Some minor code formatting cleanup and debug printing.
This commit is contained in:
parent
ef31093dcb
commit
848d0afd40
|
@ -122,8 +122,6 @@ impl AssemblyBuilder {
|
||||||
|
|
||||||
pub fn build(mut self) -> Assembly {
|
pub fn build(mut self) -> Assembly {
|
||||||
// Shrink storage to minimum.
|
// Shrink storage to minimum.
|
||||||
// However, don't shrink shader storage, because there are pointers to
|
|
||||||
// that data that could get invalidated.
|
|
||||||
self.instances.shrink_to_fit();
|
self.instances.shrink_to_fit();
|
||||||
self.xforms.shrink_to_fit();
|
self.xforms.shrink_to_fit();
|
||||||
self.objects.shrink_to_fit();
|
self.objects.shrink_to_fit();
|
||||||
|
@ -135,6 +133,8 @@ impl AssemblyBuilder {
|
||||||
1,
|
1,
|
||||||
|inst| &bbs[bis[inst.id]..bis[inst.id + 1]]);
|
|inst| &bbs[bis[inst.id]..bis[inst.id + 1]]);
|
||||||
|
|
||||||
|
println!("Assembly BVH Depth: {}", object_accel.tree_depth());
|
||||||
|
|
||||||
Assembly {
|
Assembly {
|
||||||
instances: self.instances,
|
instances: self.instances,
|
||||||
xforms: self.xforms,
|
xforms: self.xforms,
|
||||||
|
|
|
@ -47,11 +47,13 @@ impl BVH {
|
||||||
bvh.bounds_cache.clear();
|
bvh.bounds_cache.clear();
|
||||||
bvh.bounds_cache.shrink_to_fit();
|
bvh.bounds_cache.shrink_to_fit();
|
||||||
|
|
||||||
println!("BVH Depth: {}", bvh.depth);
|
|
||||||
|
|
||||||
bvh
|
bvh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn tree_depth(&self) -> usize {
|
||||||
|
self.depth
|
||||||
|
}
|
||||||
|
|
||||||
fn acc_bounds<'a, T, F>(&mut self, objects1: &mut [T], bounder: &F)
|
fn acc_bounds<'a, T, F>(&mut self, objects1: &mut [T], bounder: &F)
|
||||||
where F: 'a + Fn(&T) -> &'a [BBox]
|
where F: 'a + Fn(&T) -> &'a [BBox]
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,10 @@ pub fn parse_assembly(tree: &DataTree) -> Result<Assembly, PsyParseError> {
|
||||||
// MeshSurface
|
// MeshSurface
|
||||||
"MeshSurface" => {
|
"MeshSurface" => {
|
||||||
if let &DataTree::Internal {ident: Some(ident), ..} = child {
|
if let &DataTree::Internal {ident: Some(ident), ..} = child {
|
||||||
builder.add_object(ident, Object::Surface(Box::new(try!(parse_mesh_surface(&child)))));
|
builder.add_object(
|
||||||
|
ident,
|
||||||
|
Object::Surface(Box::new(try!(parse_mesh_surface(&child))))
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// TODO: error condition of some kind, because no ident
|
// TODO: error condition of some kind, because no ident
|
||||||
panic!();
|
panic!();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user