@adobe/ecs - v0.2.1
    Preparing search index...

    Function render

    • Declares a render system: it runs once per run on gpuDevice's thread, in schedule order, and records GPU work over the GPU copy of the components its accessors name, which the world uploads first as needed. It runs only while the world has a gpuDevice. Its body's tables hold one table per matching archetype, each in row order; with order, exactly one table of every matching row, across archetypes, in the index's order, so instance i is the i-th: a shader's accessors take that position as their row, with the same names and signatures. Throws as create does, for an order that isn't a sorted index, and for an accessor its shader can't read on the GPU. A system with order fails its run when a matching archetype holds more rows than 32 bits name beside its slot: 2^31 with up to two matching archetypes, 2^30 with up to four, and so on.

      Type Parameters

      • const D extends RenderDeclaration
      • B extends (
            gpu: RenderContext,
            context: {
                resources: {
                    "[always]": boolean;
                    "[cadence]": Cadence;
                    "[clock]": { delta: number; now: number; tick: number };
                    "[gpuDevice]": null | GPUDevice;
                    "[wake]": number;
                    "[workers]": null | number;
                } & {} & {
                    "[always]": true;
                    "[gpuDevice]": GPUDevice;
                    "[workers]": number;
                };
            },
        ) => void

      Parameters

      • declaration: D & Inferred & OneThread<"world" | ThreadsOf<D>, ThreadedBy<D>>
      • body: B & ReturnsNoPromise<B>

      Returns System