Actually reverse indices for early Z!

2x performance improvement. I feel silly.
This commit is contained in:
Patrick Walton 2017-09-14 17:20:54 -07:00
parent 42151cc334
commit b48b256ab3
3 changed files with 4 additions and 4 deletions

View File

@ -333,7 +333,7 @@ class ThreeDView extends PathfinderDemoView {
return transform;
}
protected clearForResolve(): void {
protected clearForDirectRendering(): void {
this.gl.clearColor(1.0, 1.0, 1.0, 1.0);
this.gl.clearDepth(1.0);
this.gl.depthMask(true);

View File

@ -269,7 +269,7 @@ export abstract class PathfinderDemoView extends PathfinderView {
antialiasingStrategy.prepare(this);
// Clear.
this.clearForResolve();
this.clearForDirectRendering();
// Draw "scenery" (used in the 3D view).
this.drawSceneryIfNecessary();
@ -514,7 +514,7 @@ export abstract class PathfinderDemoView extends PathfinderView {
protected drawSceneryIfNecessary(): void {}
protected clearForResolve(): void {
protected clearForDirectRendering(): void {
this.gl.clearColor(1.0, 1.0, 1.0, 1.0);
this.gl.clearDepth(0.0);
this.gl.depthMask(true);

View File

@ -330,7 +330,7 @@ fn partition_paths(partitioner: &mut Partitioner, subpath_indices: &[SubpathRang
// Reverse interior indices for early Z optimizations.
let mut new_cover_interior_indices = Vec::with_capacity(cover_interior_indices.len());
for path_indices in &mut path_indices {
for path_indices in path_indices.iter_mut().rev() {
let old_byte_start = path_indices.cover_interior_indices.start * mem::size_of::<u32>();
let old_byte_end = path_indices.cover_interior_indices.end * mem::size_of::<u32>();
let new_start_index = new_cover_interior_indices.len() / mem::size_of::<u32>();