we
    Preparing search index...

    计算命令 参数

    interface IV_ComputeCommand {
        baseInfo?: { parent?: { getBindGroups(): GPUBindGroup[] } };
        computeInfo: {
            afterUpdate?: (scope: any) => Promise<any>;
            bindGroups?: GPUBindGroup[] | T_uniformEntries[][];
            dispatchCount: [number, number, number];
            map?: (scope: any, encode: GPUCommandEncoder) => Promise<any>;
            pipeline: I_ComputePipelineInitValues | GPUComputePipeline;
        };
        device: GPUDevice;
        label: string;
    }
    Index

    Properties

    baseInfo?: { parent?: { getBindGroups(): GPUBindGroup[] } }

    基础信息

    Type Declaration

    • Optionalparent?: { getBindGroups(): GPUBindGroup[] }

      drawInfo的dynamicLoadBindGroup为true时,需要绑定的父对象

    computeInfo: {
        afterUpdate?: (scope: any) => Promise<any>;
        bindGroups?: GPUBindGroup[] | T_uniformEntries[][];
        dispatchCount: [number, number, number];
        map?: (scope: any, encode: GPUCommandEncoder) => Promise<any>;
        pipeline: I_ComputePipelineInitValues | GPUComputePipeline;
    }

    Type Declaration

    • OptionalafterUpdate?: (scope: any) => Promise<any>

      callback function :测试使用,生成勿用(影响性能)

      进行map操作,由上级程序保障正确性

      examp: encoder.copyBufferToBuffer(workgroupBuffer, 0, workgroupReadBuffer, 0, size);

      workgroupBuffer=this.unifromBuffer[0][0],对应:@group(0)@binding(0)

    • OptionalbindGroups?: GPUBindGroup[] | T_uniformEntries[][]
    • dispatchCount: [number, number, number]
    • Optionalmap?: (scope: any, encode: GPUCommandEncoder) => Promise<any>

      callback function

      正确性由上级程序保障

      一、 如果是map操作,需要copy和unmap两步:

      1、 await Promise.all([ workgroupReadBuffer.mapAsync(GPUMapMode.READ), localReadBuffer.mapAsync(GPUMapMode.READ), globalReadBuffer.mapAsync(GPUMapMode.READ), ]);

      2、 workgroupReadBuffer.unmap();

    • pipeline: I_ComputePipelineInitValues | GPUComputePipeline
    device: GPUDevice
    label: string

    label