Skip to content

Commit

Permalink
revert: use cache for createInputLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed May 17, 2024
1 parent c4c6004 commit f68e1be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/renderer/src/device/DeviceModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default class DeviceModel implements IModel {
this.indexBuffer = (elements as DeviceElements).get();
}

const inputLayout = device.createInputLayout({
const inputLayout = service.renderCache.createInputLayout({
vertexBufferDescriptors,
indexBufferFormat: elements ? Format.U32_R : null,
program: this.program,
Expand Down Expand Up @@ -363,7 +363,8 @@ export default class DeviceModel implements IModel {
this.vertexBuffers?.forEach((buffer) => buffer.destroy());
this.indexBuffer?.destroy();
this.bindings?.destroy();
this.inputLayout.destroy();
// 不能进行销毁,删除 deleteVertexArray
// this.inputLayout.destroy();
this.pipeline.destroy();
this.destroyed = true;
}
Expand Down

0 comments on commit f68e1be

Please sign in to comment.