Update max overlays in one OverlayTextureProcessor

Tested adding 3, 15,16 different overlays in a single OverlayTextureProcessor. The program errored out when 16 overlays were added.

PiperOrigin-RevId: 504810157
This commit is contained in:
tofunmi 2023-01-26 12:52:16 +00:00 committed by christosts
parent a5d43b2194
commit 1a416b17b5

View file

@ -56,11 +56,11 @@ import com.google.common.collect.ImmutableList;
throws FrameProcessingException { throws FrameProcessingException {
super(useHdr); super(useHdr);
checkArgument(!useHdr, "OverlayTextureProcessor does not support HDR colors yet."); checkArgument(!useHdr, "OverlayTextureProcessor does not support HDR colors yet.");
// TODO: If the limit on the number of overlays ever becomes and issue, investigate expanding it // The maximum number of samplers allowed in a single GL program is 16.
// in relation to common device limits. // We use one for every overlay and one for the video.
checkArgument( checkArgument(
overlays.size() <= 8, overlays.size() <= 15,
"OverlayTextureProcessor does not more than 8 overlays in the same processor yet."); "OverlayTextureProcessor does not support more than 15 overlays in the same processor.");
this.overlays = overlays; this.overlays = overlays;
aspectRatioMatrix = GlUtil.create4x4IdentityMatrix(); aspectRatioMatrix = GlUtil.create4x4IdentityMatrix();
overlayMatrix = GlUtil.create4x4IdentityMatrix(); overlayMatrix = GlUtil.create4x4IdentityMatrix();