WebGPURenderer: Rebind textureNode value post RenderTarget resize#28372
Closed
RenaudRohlinger wants to merge 1 commit into
Closed
WebGPURenderer: Rebind textureNode value post RenderTarget resize#28372RenaudRohlinger wants to merge 1 commit into
RenaudRohlinger wants to merge 1 commit into
Conversation
Collaborator
|
How I can reproduce this warning in some PP example? I tried resize the windows but not happened... |
Collaborator
Author
|
Seems like it came from one of my custom postprocessing node that was constantly re-creating a texture node in the updateBefore(frame) {
//this was generating the error
this._textureNode = texture(this._fbo.texture);
}So I simply moved it to the constructor. And it seems to solve the issue. That's why my PR did fix my issue, because it was making sure the textureNode was always properly up to date even if the textureNode was getting re-created every frame in the updateBefore loop. Sorry about that, this one was pretty tricky to debug! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: #28289
Description
Additional fix to #28289, when resizing a
RenderTarget, for example using a PostProcess pipeline with aPassNode, the resize will triggerthis.renderTarget.setSize(), which will dispatch dispose, destroying the associated textures in the backend and then losing the proper binding on the GPU side.This PR ensures the

textureNode.valuegets updated right after the resize event of the associatedRenderTarget. Otherwise, if a resize event gets triggered after the updateBefore call and beforebinding.update(), the following error would be triggered because the condition inbinding.update()(this.texture !== textureNode.value) would not be satisfied.This happens because the rebinding of
textureNode.value = rtt.textureisn't triggered yet byupdateBefore, which will occur in the next frame.This contribution is funded by Utsubo