Skip to content

Commit

Permalink
fix: 修复 bindings 缓存在 WebGPU 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Jun 7, 2024
1 parent 7c78b4a commit 08ef509
Showing 1 changed file with 2 additions and 4 deletions.
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 08ef509

Please sign in to comment.