Clean up code and enable strict TS
This commit is contained in:
parent
f350b1ff37
commit
0735dd764f
21 changed files with 124 additions and 119 deletions
|
|
@ -41,6 +41,6 @@ export class DeltaTimeCalculator {
|
|||
}
|
||||
|
||||
public get fps() {
|
||||
return 1 / this.deltaTimeAccumulator;
|
||||
return this.deltaTimeAccumulator ? 1 / this.deltaTimeAccumulator : 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export class ErrorHandler {
|
|||
}
|
||||
|
||||
public static addMetadata(key: string, value: any) {
|
||||
const serialized = {};
|
||||
const serialized: Record<string, any> = {};
|
||||
for (const k in value) {
|
||||
serialized[k] = value[k];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,5 +83,5 @@ export const generateNoise = ({
|
|||
textureCache.set(cacheKey, colorTexture);
|
||||
}
|
||||
|
||||
return textureCache.get(cacheKey).createView();
|
||||
return textureCache.get(cacheKey)!.createView();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import { vec2 } from 'gl-matrix';
|
|||
import { CopyPipeline } from '../../pipelines/copy/copy-pipeline';
|
||||
|
||||
export class ResizableTexture {
|
||||
private texture: GPUTexture;
|
||||
private textureView: GPUTextureView;
|
||||
private texture!: GPUTexture;
|
||||
private textureView!: GPUTextureView;
|
||||
private readonly copyPipeline: CopyPipeline;
|
||||
private size: vec2 | null = null;
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ export class ResizableTexture {
|
|||
|
||||
const newTextureView = newTexture.createView();
|
||||
|
||||
if (this.textureView) {
|
||||
if (this.size) {
|
||||
const commandEncoder = this.device.createCommandEncoder();
|
||||
this.copyPipeline.execute(
|
||||
commandEncoder,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue