Skip to content

Commit 3d62dc6

Browse files
committed
fix(texture): unable to force destory texture(#457)
1 parent e8257bc commit 3d62dc6

File tree

6 files changed

+8
-19
lines changed

6 files changed

+8
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@orillusion/core",
3-
"version": "0.8.4",
3+
"version": "0.8.5-dev.1",
44
"author": "Orillusion",
55
"description": "Orillusion WebGPU Engine",
66
"type": "module",

src/core/geometry/GeometryVertexBuffer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,15 @@ export class GeometryVertexBuffer {
262262

263263
}
264264

265-
public destroy(force?: boolean) {
265+
public destroy() {
266266
this.vertexCount = null;
267267
this.geometryType = null;
268268
this._vertexBufferLayouts = null;
269269
this._attributeSlotLayouts = null;
270270
this._attributeLocation = null;
271271

272272
if (this.vertexGPUBuffer)
273-
this.vertexGPUBuffer.destroy(force);
273+
this.vertexGPUBuffer.destroy();
274274
this.vertexGPUBuffer = null;
275275
}
276276
}

src/gfx/graphics/webGpu/core/buffer/GPUBufferBase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ export class GPUBufferBase {
463463
}
464464
}
465465

466-
public destroy(force?: boolean) {
466+
public destroy() {
467467
if (this.memoryNodes) {
468468
this.memoryNodes.forEach((v) => {
469469
v.destroy();

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -955,17 +955,6 @@ export class RenderShaderPass extends ShaderPassBase {
955955
texture.destroy(force);
956956
} else {
957957
texture.destroy(false);
958-
let table = Reference.getInstance().getReference(texture);
959-
if (table) {
960-
let list = [];
961-
table.forEach((v, k) => {
962-
if (`name` in v) {
963-
list.push(v[`name`]);
964-
} else {
965-
list.push(`NaN`);
966-
}
967-
});
968-
}
969958
}
970959
}
971960
}
@@ -981,7 +970,7 @@ export class RenderShaderPass extends ShaderPassBase {
981970
this._destFS = null;
982971
this._vsShaderModule = null;
983972
this._fsShaderModule = null;
984-
this.materialDataUniformBuffer.destroy(force);;
973+
this.materialDataUniformBuffer.destroy();;
985974
this.materialDataUniformBuffer = null;
986975
}
987976

src/gfx/graphics/webGpu/shader/Shader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ export class Shader {
233233
}
234234
}
235235

236-
public destroy() {
237-
this.getDefaultColorShader().destroy();
236+
public destroy(force?: boolean) {
237+
this.getDefaultColorShader().destroy(force);
238238
}
239239

240240
public clone() {

src/materials/Material.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class Material {
191191
destroy(force: boolean) {
192192
this.name = null;
193193
this.instanceID = null;
194-
this._shader.destroy();
194+
this._shader.destroy(force);
195195
this._shader = null;
196196
}
197197

0 commit comments

Comments
 (0)