UltraHDR Ovelays: remove texture unit clash

Do not use the same texture unit for two different textures.
This was causing tests to fail on multiple devices.

PiperOrigin-RevId: 690610094
This commit is contained in:
dancho 2024-10-28 07:56:46 -07:00 committed by Copybara-Service
parent 9653fa64fe
commit 5bb9e1a932
4 changed files with 5 additions and 13 deletions

View File

@ -142,7 +142,7 @@ import java.io.IOException;
glProgram.setSamplerTexIdUniform(
"uGainmapTexSampler" + texUnitIndex,
gainmapTexIds.get(texUnitIndex),
texUnitIndex);
/* texUnitIndex= */ overlays.size() + texUnitIndex);
GainmapUtil.setGainmapUniforms(
glProgram, lastGainmaps.get(texUnitIndex), texUnitIndex);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 MiB

After

Width:  |  Height:  |  Size: 7.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@ -359,12 +359,7 @@ public final class DefaultVideoFrameProcessorTextureOutputPixelTest {
videoFrameProcessorTestRunner.processFirstFrameAndEnd();
Bitmap actualBitmap = videoFrameProcessorTestRunner.getOutputBitmap();
// TODO(b/207848601): Switch to using proper tooling for testing against golden data.
float averagePixelAbsoluteDifference =
BitmapPixelTestUtil.getBitmapAveragePixelAbsoluteDifferenceFp16(
expectedBitmap, actualBitmap);
assertThat(averagePixelAbsoluteDifference)
.isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE_DIFFERENT_DEVICE_FP16);
assertBitmapsAreSimilar(expectedBitmap, actualBitmap, HDR_PSNR_THRESHOLD);
}
@Test
@ -394,12 +389,9 @@ public final class DefaultVideoFrameProcessorTextureOutputPixelTest {
videoFrameProcessorTestRunner.processFirstFrameAndEnd();
Bitmap actualBitmap = videoFrameProcessorTestRunner.getOutputBitmap();
// TODO(b/207848601): Switch to using proper tooling for testing against golden data.
float averagePixelAbsoluteDifference =
BitmapPixelTestUtil.getBitmapAveragePixelAbsoluteDifferenceFp16(
expectedBitmap, actualBitmap);
assertThat(averagePixelAbsoluteDifference)
.isAtMost(MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE_DIFFERENT_DEVICE_FP16);
// TODO: b/376016540 - use HDR_PSNR_THRESHOLD when HDR videos are processed with high floating
// point precision.
assertBitmapsAreSimilar(expectedBitmap, actualBitmap, /* psnrThresholdDb= */ 42.5);
}
@Test