Chromium Code Reviews
DescriptionMac h264: Plug GL program leak
The state for YUV to RGB conversion for GLImageIOSurface is stored
in the GLImageIOSurface object. This is objectionable because
- This means every GLImage object will re-create all shaders
- For hardware decode, we create a new GLImage for every decoded frame,
which means allocating a shader for every frame.
- It is not clear which CGLContextObj the GL objects are associated
with.
- For hardware decode, we do not specify that a GL context is current
when we free GLImages, so we end up leaking one GL program every
frame.
- This memory leak ends up causing GL context destroy to take more than
ten seconds, causing a GPU hang when the GL context is destroyed.
Move the program object into an RGBConverter class. Keep a global
registry of RGBConverter classes for each CGLContextObj, and share
RGBConverter objects across GLImages. Make the RGBConverter always
destroy its objects when it is destroyed. It can do this because it
retains the CGLContextObj that was used to allocate them.
This could be better in that a pathological user of GLImages could
still cause the RGBConverter to be created and destroyed every frame.
BUG=598388, 599314
Review URL: https://codereview.chromium.org/1870323002
Cr-Commit-Position: refs/heads/master@{#386757}
(cherry picked from commit c9295d4075c1e4a32977c446ab9734a88abf8391)
Committed: https://chromium.googlesource.com/chromium/src/+/c5d9e014c2adc935365cb443444c7b28e52f9ad0
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
||||||||||||||||||||||||||||