Skip to content

fix: preserve blend state in drawQuadWithShader / RenderPassQuad#8535

Merged
mvaligursky merged 1 commit intomainfrom
mv-fix-quad-blend-state
Mar 19, 2026
Merged

fix: preserve blend state in drawQuadWithShader / RenderPassQuad#8535
mvaligursky merged 1 commit intomainfrom
mv-fix-quad-blend-state

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Mar 19, 2026

Fixes a regression introduced in #8503 where RenderPassQuad.execute() calls device.setDrawStates() with no arguments, which defaults blendState to BlendState.NOBLEND. This overwrites any blend state the caller set before drawQuadWithShader(), breaking custom blending in post effects.

Changes:

Fixes https://forum.playcanvas.com/t/drawquadwithshader-does-not-work-with-blendstate/42066

RenderPassQuad.execute() was calling device.setDrawStates() with no
arguments, which defaults blendState to BlendState.NOBLEND. This
overwrites any blend state the caller set before drawQuadWithShader(),
breaking custom blending in post effects.

Pass device.blendState through to preserve the caller's blend state
while still resetting depth, cull, frontFace, and stencil to safe
defaults. This restores the pre-setDrawStates behavior where blend
state was not touched by RenderPassQuad.

Fixes https://forum.playcanvas.com/t/drawquadwithshader-does-not-work-with-blendstate/42066

Made-with: Cursor
@mvaligursky mvaligursky self-assigned this Mar 19, 2026
@mvaligursky mvaligursky added the area: graphics Graphics related issue label Mar 19, 2026
@mvaligursky mvaligursky merged commit 86c9b22 into main Mar 19, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-fix-quad-blend-state branch March 19, 2026 10:31
mvaligursky added a commit that referenced this pull request Mar 19, 2026
RenderPassQuad.execute() was calling device.setDrawStates() with no
arguments, which defaults blendState to BlendState.NOBLEND. This
overwrites any blend state the caller set before drawQuadWithShader(),
breaking custom blending in post effects.

Pass device.blendState through to preserve the caller's blend state
while still resetting depth, cull, frontFace, and stencil to safe
defaults. This restores the pre-setDrawStates behavior where blend
state was not touched by RenderPassQuad.

Fixes https://forum.playcanvas.com/t/drawquadwithshader-does-not-work-with-blendstate/42066

Made-with: Cursor

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant