handles: indirect draw buckets for opaque and mask meshes
Opaque/mask draws sharing a pipeline and bind set become rows of one persistent `draws.<id>` indirect array (32-byte indexed commands, geometric capacity, inactive tail zeroed) drawn by a single graph pass, so the graph holds one pass per bucket instead of one per mesh. Transmission and blend draws stay direct and ordered after the buckets. Scene requires the indirect-first-instance feature. Compiles re-assert the bundle block when they start, since an earlier switch in the queue clears the one set at enqueue time. Amp-Thread-ID: https://ampcode.com/threads/T-01a0b2dd-db32-712d-99ce-12ce4a86d979 Co-authored-by: Heaust Azure <heaust.azure@gmail.com>
This commit is contained in:
@@ -7,8 +7,8 @@ import { PointLight } from "../src/lights/PointLight";
|
||||
import { PBRMaterial } from "../src/materials/PBRMaterial";
|
||||
import type { Texture } from "../src/materials/Texture";
|
||||
import {
|
||||
bucketDraws,
|
||||
createScene,
|
||||
forwardPasses,
|
||||
latestGraph,
|
||||
testCore,
|
||||
triangle,
|
||||
@@ -236,9 +236,9 @@ test("geometry spans validate before mutating, move intact, and inhibit renderin
|
||||
[1, -1, 0, 0, 0, 0, 1, 0, 1, 0, 0.9, 0.1, 1, 0, 0, 1, 0, 1, 0, 1],
|
||||
);
|
||||
close(scene.array("indices").row(moved.indexRow), [0, 1, 2, 2]);
|
||||
const draws = forwardPasses(latestGraph(scene)).map((pass: any) => pass.draw);
|
||||
const draws = bucketDraws(scene, latestGraph(scene));
|
||||
assert.deepEqual(
|
||||
draws.map((draw: any) => [draw.baseVertex, draw.firstIndex, draw.indices]),
|
||||
draws.map((draw) => [draw.baseVertex, draw.firstIndex, draw.indices]),
|
||||
[
|
||||
[moved.vertexRow, moved.indexRow * 4, 6],
|
||||
[before.second.vertexRow, before.second.indexRow * 4, 3],
|
||||
|
||||
Reference in New Issue
Block a user