React to changes in either width or height in iOS Metal renderer.
Bug: webrtc:10024 Change-Id: Ia17ab43887fc1dfdf4058bed097c05b396a6d895 Reviewed-on: https://webrtc-review.googlesource.com/c/112281 Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org> Commit-Queue: Anders Carlsson <andersc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25824}
This commit is contained in:

committed by
Commit Bot

parent
071edf317e
commit
48fcf943fd
@ -118,7 +118,7 @@ static NSString *const shaderSource = MTL_STRINGIFY(
|
|||||||
id<RTCI420Buffer> buffer = [frame.buffer toI420];
|
id<RTCI420Buffer> buffer = [frame.buffer toI420];
|
||||||
|
|
||||||
// Luma (y) texture.
|
// Luma (y) texture.
|
||||||
if (!_descriptor || (_width != frame.width && _height != frame.height)) {
|
if (!_descriptor || _width != frame.width || _height != frame.height) {
|
||||||
_width = frame.width;
|
_width = frame.width;
|
||||||
_height = frame.height;
|
_height = frame.height;
|
||||||
_descriptor = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatR8Unorm
|
_descriptor = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatR8Unorm
|
||||||
@ -135,8 +135,7 @@ static NSString *const shaderSource = MTL_STRINGIFY(
|
|||||||
withBytes:buffer.dataY
|
withBytes:buffer.dataY
|
||||||
bytesPerRow:buffer.strideY];
|
bytesPerRow:buffer.strideY];
|
||||||
|
|
||||||
if (!_chromaDescriptor ||
|
if (!_chromaDescriptor || _chromaWidth != frame.width / 2 || _chromaHeight != frame.height / 2) {
|
||||||
(_chromaWidth != frame.width / 2 && _chromaHeight != frame.height / 2)) {
|
|
||||||
_chromaWidth = frame.width / 2;
|
_chromaWidth = frame.width / 2;
|
||||||
_chromaHeight = frame.height / 2;
|
_chromaHeight = frame.height / 2;
|
||||||
_chromaDescriptor =
|
_chromaDescriptor =
|
||||||
|
Reference in New Issue
Block a user