8000 `PipelineUtil.recreateRenderTargetIfNeeded` 在 `needDepthTexture` 为 true 时,可能会触发不重建 renderTarget 的问题 · Issue #2674 · galacean/engine · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
PipelineUtil.recreateRenderTargetIfNeededneedDepthTexture 为 true 时,可能会触发不重建 renderTarget 的问题 #2674
Open
@cptbtptpbcptdtptp

Description

@cptbtptpbcptdtptp
 if (needDepthTexture) {
      const currentDepthTexture = <Texture2D>currentRenderTarget?.depthTexture;
      const needDepthTexture = depthFormat
        ? PipelineUtils.recreateTextureIfNeeded(
          engine,
          currentDepthTexture,
          width,
          height,
          depthFormat,
          mipmap,
          isSRGBColorSpace,
          textureWrapMode,
          textureFilterMode
        )
        : null;

      // 此处应判断 currentRenderTarget?.antiAliasing !== antiAliasing
      if (currentColorTexture !== colorTexture || currentDepthTexture !== needDepthTexture) {
        currentRenderTarget?.destroy(true);
        currentRenderTarget = new RenderTarget(engine, width, height, colorTexture, needDepthTexture, antiAliasing);
        currentRenderTarget.isGCIgnored = true;
      }
    } else {
      if (
        currentColorTexture !== colorTexture ||
        currentRenderTarget?._depthFormat !== depthFormat ||
        currentRenderTarget.antiAliasing !== antiAliasing
      ) {
        currentRenderTarget?.destroy(true);
        currentRenderTarget = new RenderTarget(engine, width, height, colorTexture, depthFormat, antiAliasing);
        currentRenderTarget.isGCIgnored = true;
      }
    }

Metadata

Metadata

Labels

bugSomething isn't workingmedium priorityMedium priority issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0