Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Set framebuffer to null only when canvas source matches main canvas #10966

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

ShukantPal
Copy link
Member

Description of change

In my work on @pixi-essentials/svg, I was seeing that copying from a canvas to a render texture was not working using renderer.renderTarget.copyToTexture, even though the signature accepts canvas sources. I traced it to PixiJS assigning the canvas texture a null framebuffer on binding to WebGL. This is because it incorrectly assumes that a canvas input must be the main canvas.

https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindFramebuffer

A WebGLFramebuffer object to bind, or null for binding the HTMLCanvasElement or OffscreenCanvas object associated with the rendering context.

Pre-Merge Checklist
  • Tests and/or benchmarks are included
  • Documentation is changed or added
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your PR title doesn't match the required format. The title should be in this format:

chore: update Text docs
fix: text not rendering
feat: add new feature to Text
breaking: remove Text#resolution 

@ShukantPal ShukantPal changed the title Fix: Set framebuffer to null only when canvas source matches main canvas fix: Set framebuffer to null only when canvas source matches main canvas Oct 4, 2024
Copy link

codesandbox-ci bot commented Oct 4, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ed56504:

Sandbox Source
pixi.js-sandbox Configuration

Copy link
Member

@GoodBoyDigital GoodBoyDigital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @ShukantPal 👍

@Zyie Zyie added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label Oct 4, 2024
@Zyie Zyie added this pull request to the merge queue Oct 4, 2024
Merged via the queue into dev with commit 2025fc7 Oct 4, 2024
5 of 6 checks passed
@Zyie Zyie deleted the shukant/fix-framebuffer branch October 4, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants