Skip to content

fix(rendering): compute render pass merge info in render graph order - #314

Merged
star-e merged 1 commit into
cocos:v4.0.0from
VanityNie:fix/rendering/draw-outside-render-pass
Aug 29, 2026
Merged

fix(rendering): compute render pass merge info in render graph order#314
star-e merged 1 commit into
cocos:v4.0.0from
VanityNie:fix/rendering/draw-outside-render-pass

Conversation

@VanityNie

Copy link
Copy Markdown
Contributor

In debug mode, pass hashes are generated while traversing the resource graph during compilation, so the render-pass merge bookkeeping (needBeginRP/needEndRP) can be computed in a different order from the actual execution order. When passes are reused, this can cause draw commands to be recorded outside a render pass and rejected by the validator.

Compute hashes after compilation by iterating the render graph vertices in execution order, and only include valid raster passes in debug mode.

Refs #156

Re: #

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

In debug mode, pass hashes are generated while traversing the resource graph during compilation, so the render-pass merge bookkeeping (needBeginRP/needEndRP) can be computed in a different order from the actual execution order. When passes are reused, this can cause draw commands to be recorded outside a render pass and rejected by the validator.

Compute hashes after compilation by iterating the render graph vertices in execution order, and only include valid raster passes in debug mode.

Refs cocos#156
@github-actions

Copy link
Copy Markdown

Code Size Check Report

Wechat (WASM) Before After Diff
2D Empty (legacy pipeline) 1015436 bytes 1015436 bytes ✅ 0 bytes
2D All (legacy pipeline) 2683579 bytes 2683579 bytes ✅ 0 bytes
2D All (new pipeline) 2775838 bytes 2775832 bytes 👍 -6 bytes
(2D + 3D) All 10033280 bytes 10033274 bytes 👍 -6 bytes
Web (WASM + ASMJS) Before After Diff
(2D + 3D) All 16869698 bytes 16869692 bytes 👍 -6 bytes

Interface Check Report

This pull request does not change any public interfaces !

@VanityNie

Copy link
Copy Markdown
Contributor Author

@cocos-robot

@star-e

star-e commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

@cocos-robot run-test-cases-custom

@github-actions

Copy link
Copy Markdown

@VanityNie, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile PASS PASS FAIL tween-repeat-forever,scroll-view-scroll-to-offset
ios PASS PASS PASS
mac PASS PASS PASS

@github-actions

Copy link
Copy Markdown

@VanityNie, Please check the result of run test cases:

Task Details

@star-e
star-e merged commit c438c2d into cocos:v4.0.0 Aug 29, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants