Skip to content

Commit

Permalink
fix: 修复 bindings 缓存在 WebGPU 的问题 (#2526)
Browse files Browse the repository at this point in the history
* fix: 修复 bindings 缓存在 WebGPU 的问题

* chore: add changset
  • Loading branch information
lvisei committed Jun 7, 2024
1 parent 1797625 commit 3aa0f32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-geese-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-renderer': patch
---

fix: 修复 bindings 缓存在 WebGPU 的问题
6 changes: 2 additions & 4 deletions packages/renderer/src/device/DeviceModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export default class DeviceModel implements IModel {
const stencilEnabled = !!(stencilParams && stencilParams.enable);

const pipeline = this.device.createRenderPipeline({
// return this.service.renderCache.createRenderPipeline({
inputLayout: this.inputLayout,
program: this.program,
topology: primitiveMap[primitive],
Expand Down Expand Up @@ -270,7 +269,7 @@ export default class DeviceModel implements IModel {
...this.extractUniforms(uniforms),
};

const { renderPass, currentFramebuffer, width, height, renderCache } = this.service;
const { renderPass, currentFramebuffer, width, height } = this.service;

// TODO: Recreate pipeline only when blend / cull changed.
this.pipeline = this.createPipeline(mergedOptions, pick);
Expand Down Expand Up @@ -311,8 +310,7 @@ export default class DeviceModel implements IModel {
: null,
);
if (uniformBuffers) {
// this.bindings = device.createBindings({
this.bindings = renderCache.createBindings({
this.bindings = device.createBindings({
pipeline: this.pipeline,
uniformBufferBindings: uniformBuffers.map((uniformBuffer, i) => {
const buffer = uniformBuffer as DeviceBuffer;
Expand Down

0 comments on commit 3aa0f32

Please sign in to comment.