More clean up
This commit is contained in:
parent
c94ffcc506
commit
f03da42b5e
43 changed files with 818 additions and 1076 deletions
|
|
@ -25,7 +25,7 @@ export const getSafePixelRatio = (pixelRatio: number | undefined): number =>
|
|||
? pixelRatio
|
||||
: 1;
|
||||
|
||||
export const setBrushUniformValues = (
|
||||
const setBrushUniformValues = (
|
||||
target: Float32Array,
|
||||
{
|
||||
brushSize,
|
||||
|
|
@ -105,7 +105,7 @@ export class BrushPipeline {
|
|||
});
|
||||
|
||||
const shaderModule = smartCompile(device, CommonState.shaderCode, shader);
|
||||
this.multiTargetPipeline = this.createPipeline(shaderModule, 'fragmentMrt', 2);
|
||||
this.multiTargetPipeline = this.createPipeline(shaderModule, 'fragmentMrt', 1);
|
||||
|
||||
this.uniforms = this.device.createBuffer({
|
||||
size: BrushPipeline.UNIFORM_COUNT * Float32Array.BYTES_PER_ELEMENT,
|
||||
|
|
@ -209,12 +209,10 @@ export class BrushPipeline {
|
|||
|
||||
public executeMultiTarget(
|
||||
commandEncoder: GPUCommandEncoder,
|
||||
sourceMapOut: GPUTextureView,
|
||||
influenceMapOut: GPUTextureView
|
||||
): void {
|
||||
this.executeWithPipeline(commandEncoder, this.multiTargetPipeline, [
|
||||
sourceMapOut: GPUTextureView
|
||||
): boolean {
|
||||
return this.executeWithPipeline(commandEncoder, this.multiTargetPipeline, [
|
||||
sourceMapOut,
|
||||
influenceMapOut,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -222,9 +220,9 @@ export class BrushPipeline {
|
|||
commandEncoder: GPUCommandEncoder,
|
||||
pipeline: GPURenderPipeline,
|
||||
textureViews: Array<GPUTextureView>
|
||||
): void {
|
||||
): boolean {
|
||||
if (this.lineCount === 0) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
const renderPassDescriptor: GPURenderPassDescriptor = {
|
||||
|
|
@ -242,6 +240,7 @@ export class BrushPipeline {
|
|||
passEncoder.setVertexBuffer(0, this.vertexBuffer);
|
||||
passEncoder.draw(BrushPipeline.VERTICES_PER_LINE_SEGMENT, this.lineCount);
|
||||
passEncoder.end();
|
||||
return true;
|
||||
}
|
||||
|
||||
public destroy() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue