From efbf1407e4d9487eff8ea6c808e40d98e46190a4 Mon Sep 17 00:00:00 2001 From: Kaido Kert Date: Sun, 24 Mar 2024 13:51:06 -0700 Subject: [PATCH] Remove NV12 texture support config The config is still only used for configuring tests, and can be resolved at runtime. b/150410605 --- cobalt/renderer/rasterizer/pixel_test.cc | 26 ------------------- .../starboard/configuration-public.md | 1 - starboard/CHANGELOG.md | 3 +++ .../android/shared/configuration_public.h | 6 ----- starboard/configuration.h | 4 --- .../arm/hardfp/configuration_public.h | 6 ----- .../arm/softfp/configuration_public.h | 6 ----- .../evergreen/arm64/configuration_public.h | 6 ----- .../evergreen/x64/configuration_public.h | 6 ----- .../evergreen/x86/configuration_public.h | 6 ----- starboard/linux/x64x11/configuration_public.h | 6 ----- starboard/raspi/shared/configuration_public.h | 6 ----- starboard/stub/configuration_public.h | 4 --- starboard/win/shared/configuration_public.h | 4 --- starboard/xb1/shared/configuration_public.h | 4 --- 15 files changed, 3 insertions(+), 91 deletions(-) diff --git a/cobalt/renderer/rasterizer/pixel_test.cc b/cobalt/renderer/rasterizer/pixel_test.cc index 225dd3439c25..75f9be679d72 100644 --- a/cobalt/renderer/rasterizer/pixel_test.cc +++ b/cobalt/renderer/rasterizer/pixel_test.cc @@ -57,15 +57,6 @@ #include "third_party/glm/glm/gtc/matrix_transform.hpp" #include "third_party/glm/glm/gtx/transform.hpp" -#define NV12_TEXTURE_SUPPORTED 1 - -#if defined(STARBOARD) -#if !SB_HAS(NV12_TEXTURE_SUPPORT) -#undef NV12_TEXTURE_SUPPORTED -#define NV12_TEXTURE_SUPPORTED 0 -#endif -#endif - using cobalt::loader::image::AnimatedWebPImage; using cobalt::loader::image::MockImageDecoder; using cobalt::loader::image::MockImageDecoderCallback; @@ -1338,9 +1329,6 @@ scoped_refptr MakeI420Image(ResourceProvider* resource_provider, std::move(image_memory), image_data_descriptor); } -// The software rasterizer does not support NV12 images. -#if NV12_TEXTURE_SUPPORTED - // Creates a two plane YUV image where the Y channel is stored as a // single-channel image plane and the U and V channels are interleaved in a // second image plane. The NV12 format dictates that the UV plane has the same @@ -1404,7 +1392,6 @@ scoped_refptr MakeNV12Image(ResourceProvider* resource_provider, return resource_provider->CreateMultiPlaneImageFromRawMemory( std::move(image_memory), image_data_descriptor); } -#endif // #if NV12_TEXTURE_SUPPORTED } // namespace scoped_refptr MakeUYVYImage(ResourceProvider* resource_provider, @@ -1568,9 +1555,6 @@ TEST_F(PixelTest, YUV422UYVYImageScaledAndTranslated) { -1.0f, 0.0f, 0.0f, 1.0f))); } -// The software rasterizer does not support NV12 images. -#if NV12_TEXTURE_SUPPORTED - TEST_F(PixelTest, TwoPlaneYUVImageSupport) { // Tests that an ImageNode hooked up to a 3-plane YUV image works fine. scoped_refptr image = @@ -1597,7 +1581,6 @@ TEST_F(PixelTest, TwoPlaneYUVImageWithTransform) { TranslateMatrix(-half_output_size.width(), -half_output_size.height()))); } -#endif // #if NV12_TEXTURE_SUPPORTED TEST_F(PixelTest, ImageNodeLocalTransformRotationAndScale) { scoped_refptr image = @@ -2094,9 +2077,6 @@ TEST_F(PixelTest, YUV3PlaneImagesAreLinearlyInterpolated) { TestTree(new ImageNode(image, RectF(output_surface_size()))); } -// The software rasterizer does not support NV12 images. -#if NV12_TEXTURE_SUPPORTED - TEST_F(PixelTest, YUV2PlaneImagesAreLinearlyInterpolated) { // Tests that two plane YUV images are bilinearly interpolated. scoped_refptr image = MakeNV12Image(GetResourceProvider(), Size(8, 8)); @@ -2104,8 +2084,6 @@ TEST_F(PixelTest, YUV2PlaneImagesAreLinearlyInterpolated) { TestTree(new ImageNode(image, RectF(output_surface_size()))); } -#endif // #if NV12_TEXTURE_SUPPORTED - TEST_F(PixelTest, VeryLargeOpacityFilterDoesNotOccupyVeryMuchMemory) { // This test ensures that an opacity filter being applied to an extremely // large surface works just fine. This test is interesting because opacity @@ -4059,8 +4037,6 @@ TEST_F(PixelTest, MapToMeshRGBTest) { TestTree(CreateMapToMeshTestRenderTree(GetResourceProvider(), image)); } -#if NV12_TEXTURE_SUPPORTED - TEST_F(PixelTest, MapToMeshNV12Test) { // Tests that MapToMesh filter works as expected with a NV12 YUV texture. scoped_refptr image = @@ -4068,8 +4044,6 @@ TEST_F(PixelTest, MapToMeshNV12Test) { TestTree(CreateMapToMeshTestRenderTree(GetResourceProvider(), image)); } -#endif // #if NV12_TEXTURE_SUPPORTED - TEST_F(PixelTest, MapToMeshI420Test) { // Tests that MapToMesh filter works as expected with a I420 YUV texture. scoped_refptr image = diff --git a/cobalt/site/docs/reference/starboard/configuration-public.md b/cobalt/site/docs/reference/starboard/configuration-public.md index a66fa29dd03d..259b3e77c02d 100644 --- a/cobalt/site/docs/reference/starboard/configuration-public.md +++ b/cobalt/site/docs/reference/starboard/configuration-public.md @@ -34,7 +34,6 @@ Book: /youtube/cobalt/_book.yaml | Properties | | :--- | -| **`SB_HAS_NV12_TEXTURE_SUPPORT`**

Indicates whether or not the given platform supports rendering of NV12 textures. These textures typically originate from video decoders.

The default value in the Stub implementation is `0` | | **`SB_HAS_VIRTUAL_REALITY`**

The default value in the Stub implementation is `1` | diff --git a/starboard/CHANGELOG.md b/starboard/CHANGELOG.md index 18db56c5d396..216a39f3d7d7 100644 --- a/starboard/CHANGELOG.md +++ b/starboard/CHANGELOG.md @@ -9,6 +9,9 @@ since the version previous to it. ## Version 16 +### Removed SB_HAS_NV12_TEXTURE_SUPPORT +This flag is resolved at run-time. + ### GLES2 configuration mandatory SB_HAS_GLES2 configuration has been removed, and `gl_type` GN config no longer accepts `none` as an option. diff --git a/starboard/android/shared/configuration_public.h b/starboard/android/shared/configuration_public.h index d6a9a60921f7..1422eaa004a3 100644 --- a/starboard/android/shared/configuration_public.h +++ b/starboard/android/shared/configuration_public.h @@ -72,12 +72,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- Graphics Configuration ------------------------------------------------ - -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 1 - // --- I/O Configuration ----------------------------------------------------- // Whether the current platform has speech synthesis. #define SB_HAS_SPEECH_SYNTHESIS 1 diff --git a/starboard/configuration.h b/starboard/configuration.h index e3ee3bc10b6c..d561db44a7ef 100644 --- a/starboard/configuration.h +++ b/starboard/configuration.h @@ -536,10 +536,6 @@ struct CompileAssert {}; "starboard//configuration_constants.cc." #endif -#if !defined(SB_HAS_NV12_TEXTURE_SUPPORT) -#error "Your platform must define SB_HAS_NV12_TEXTURE_SUPPORT." -#endif - #if defined(SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT) #error \ "SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT should not be defined for " \ diff --git a/starboard/evergreen/arm/hardfp/configuration_public.h b/starboard/evergreen/arm/hardfp/configuration_public.h index f99e60de7e2a..349fb5c26543 100644 --- a/starboard/evergreen/arm/hardfp/configuration_public.h +++ b/starboard/evergreen/arm/hardfp/configuration_public.h @@ -70,12 +70,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- Graphics Configuration ------------------------------------------------ - -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 1 - // --- I/O Configuration ----------------------------------------------------- // Whether the current platform implements the on screen keyboard interface. diff --git a/starboard/evergreen/arm/softfp/configuration_public.h b/starboard/evergreen/arm/softfp/configuration_public.h index e479fb625261..bf89b81fd99a 100644 --- a/starboard/evergreen/arm/softfp/configuration_public.h +++ b/starboard/evergreen/arm/softfp/configuration_public.h @@ -70,12 +70,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- Graphics Configuration ------------------------------------------------ - -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 1 - // --- I/O Configuration ----------------------------------------------------- // Whether the current platform has microphone supported. diff --git a/starboard/evergreen/arm64/configuration_public.h b/starboard/evergreen/arm64/configuration_public.h index e21c1a554138..d0c3a6ac012a 100644 --- a/starboard/evergreen/arm64/configuration_public.h +++ b/starboard/evergreen/arm64/configuration_public.h @@ -70,12 +70,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- Graphics Configuration ------------------------------------------------ - -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 1 - // --- I/O Configuration ----------------------------------------------------- // Whether the current platform has microphone supported. diff --git a/starboard/evergreen/x64/configuration_public.h b/starboard/evergreen/x64/configuration_public.h index df4cc3a65284..dbea1449d67e 100644 --- a/starboard/evergreen/x64/configuration_public.h +++ b/starboard/evergreen/x64/configuration_public.h @@ -70,12 +70,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- Graphics Configuration ------------------------------------------------ - -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 0 - // --- I/O Configuration ----------------------------------------------------- // Whether the current platform implements the on screen keyboard interface. diff --git a/starboard/evergreen/x86/configuration_public.h b/starboard/evergreen/x86/configuration_public.h index 6e68b26a11ab..fc760a75a32e 100644 --- a/starboard/evergreen/x86/configuration_public.h +++ b/starboard/evergreen/x86/configuration_public.h @@ -70,12 +70,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- Graphics Configuration ------------------------------------------------ - -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 1 - // --- Decoder-only Params --- // --- Memory Configuration -------------------------------------------------- diff --git a/starboard/linux/x64x11/configuration_public.h b/starboard/linux/x64x11/configuration_public.h index 58fccece705e..b7a301c0fc8b 100644 --- a/starboard/linux/x64x11/configuration_public.h +++ b/starboard/linux/x64x11/configuration_public.h @@ -29,12 +29,6 @@ // available on this platform. For a definitive measure, the application should // still call SbSystemGetNumberOfProcessors at runtime. -// --- Graphics Configuration ------------------------------------------------ - -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 1 - // --- Shared Configuration and Overrides ------------------------------------ // Include the Linux configuration that's common between all Desktop Linuxes. diff --git a/starboard/raspi/shared/configuration_public.h b/starboard/raspi/shared/configuration_public.h index 5fcdbf462864..5aff38c2adb3 100644 --- a/starboard/raspi/shared/configuration_public.h +++ b/starboard/raspi/shared/configuration_public.h @@ -66,12 +66,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- Graphics Configuration ------------------------------------------------ - -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 1 - // --- I/O Configuration ----------------------------------------------------- // Whether the current platform implements the on screen keyboard interface. diff --git a/starboard/stub/configuration_public.h b/starboard/stub/configuration_public.h index 876014f04818..1e9d1ef33fab 100644 --- a/starboard/stub/configuration_public.h +++ b/starboard/stub/configuration_public.h @@ -104,10 +104,6 @@ // --- Graphics Configuration ------------------------------------------------ -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 0 - #define SB_HAS_VIRTUAL_REALITY 1 // --- I/O Configuration ----------------------------------------------------- diff --git a/starboard/win/shared/configuration_public.h b/starboard/win/shared/configuration_public.h index b039bd14a8fc..6b986ecd5434 100644 --- a/starboard/win/shared/configuration_public.h +++ b/starboard/win/shared/configuration_public.h @@ -75,10 +75,6 @@ // --- Graphics Configuration ------------------------------------------------ -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 0 - #define SB_HAS_VIRTUAL_REALITY 0 // --- I/O Configuration ----------------------------------------------------- diff --git a/starboard/xb1/shared/configuration_public.h b/starboard/xb1/shared/configuration_public.h index 8f4001aef896..37ba6f123aac 100644 --- a/starboard/xb1/shared/configuration_public.h +++ b/starboard/xb1/shared/configuration_public.h @@ -74,10 +74,6 @@ // --- Graphics Configuration ------------------------------------------------ -// Indicates whether or not the given platform supports rendering of NV12 -// textures. These textures typically originate from video decoders. -#define SB_HAS_NV12_TEXTURE_SUPPORT 0 - #define SB_HAS_VIRTUAL_REALITY 0 // --- I/O Configuration -----------------------------------------------------