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

Force texImage2D upload for videos #6088

Merged
merged 2 commits into from Sep 13, 2019
Merged

Force texImage2D upload for videos #6088

merged 2 commits into from Sep 13, 2019

Conversation

bigtimebuddy
Copy link
Member

@bigtimebuddy bigtimebuddy commented Sep 12, 2019

Addresses #4089

This defaults texImage2D uploading instead of texSubImage2D for VideoResource objects.

See for more information and performance measurements: http://codeflow.org/issues/slow_video_to_texture/

Build:
http://pixijs.download/fix-video-performance/pixi.min.js

Example:
https://pixiplayground.com/#/edit/jpeAPzXpQFY336WzsTKqn (PR)
https://pixiplayground.com/#/edit/9vDVREwmsMLTMNoCgW2VI (5.1.3)

Measurements (Chrome 76)
I did a small benchmark in Chrome to see the performance. At least in Chrome, texImage2D is faster (although on my laptop I didn't perceive much of a different, would probably show up more on mobile/slower devices).

Branch Duration Render Time (lower is better)
5.1.3 5000ms 387ms texSubImage2D
fix-video-performance 5000ms 55ms texImage2D

@codecov-io
Copy link

codecov-io commented Sep 12, 2019

Codecov Report

Merging #6088 into dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #6088      +/-   ##
==========================================
+ Coverage   71.04%   71.05%   +<.01%     
==========================================
  Files         208      208              
  Lines       10624    10626       +2     
==========================================
+ Hits         7548     7550       +2     
  Misses       3076     3076
Impacted Files Coverage Δ
...kages/core/src/textures/resources/VideoResource.js 75% <100%> (+0.21%) ⬆️
...s/core/src/textures/resources/BaseImageResource.js 93.93% <100%> (+0.18%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update add2870...076b8d9. Read the comment docs.

@bigtimebuddy bigtimebuddy marked this pull request as ready for review September 12, 2019 00:50
@bigtimebuddy bigtimebuddy added this to the v5.2.0 milestone Sep 12, 2019
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.

nice! I have noticed this issue too, was hoping the browsers would step up and fix it b y now, but this will do the trick until they do 👍

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.

None yet

5 participants