diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_shared_image.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_shared_image.txt index 8494f6ddd6d4ac..5190b1e6da82ba 100644 --- a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_shared_image.txt +++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_shared_image.txt @@ -52,24 +52,6 @@ New Procedures and Functions texture object. In this case the new texture name remains unbound. It is treated in the same way as a new texture name returned by GenTextures. - The command - - GLuint glCreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM ( - const GLbyte *mailbox, - GLenum internal_format) - - takes two arguments: - - internal_format - Must match the internal format of the SharedImage at - creation time, with the exception that a caller may pass GL_RGB or - GL_RGBA for a SharedImage created as RGBA_8888. - - mailbox - the mailbox referring to the SharedImage to assign to the - first level of the mailbox. - - This function works similar to glCreateAndTexStorage2DSharedImageCHROMIUM - in other respects. - The command void glBeginSharedImageAccessDirectCHROMIUM (GLuint texture, diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h index 9f9b8a7922e54f..b0d42e11d28ad5 100644 --- a/gpu/GLES2/gl2chromium_autogen.h +++ b/gpu/GLES2/gl2chromium_autogen.h @@ -367,8 +367,6 @@ #define glMaxShaderCompilerThreadsKHR GLES2_GET_FUN(MaxShaderCompilerThreadsKHR) #define glCreateAndTexStorage2DSharedImageCHROMIUM \ GLES2_GET_FUN(CreateAndTexStorage2DSharedImageCHROMIUM) -#define glCreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM \ - GLES2_GET_FUN(CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM) #define glBeginSharedImageAccessDirectCHROMIUM \ GLES2_GET_FUN(BeginSharedImageAccessDirectCHROMIUM) #define glEndSharedImageAccessDirectCHROMIUM \ diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 2c9977f943475b..fde26079112a03 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -4022,11 +4022,6 @@ 'extension': "CHROMIUM_shared_image", 'trace_level': 2, }, - 'CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM': { - 'type': 'NoCommand', - 'extension': "CHROMIUM_shared_image", - 'trace_level': 2, - }, 'CreateAndTexStorage2DSharedImageINTERNAL': { 'decoder_func': 'DoCreateAndTexStorage2DSharedImageINTERNAL', 'internal': True, diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h index 9e7c6885379bac..d9404946206dc0 100644 --- a/gpu/command_buffer/client/gles2_c_lib_autogen.h +++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h @@ -1650,14 +1650,6 @@ GLES2CreateAndTexStorage2DSharedImageCHROMIUM(const GLbyte* mailbox) { return gles2::GetGLContext()->CreateAndTexStorage2DSharedImageCHROMIUM( mailbox); } -GLuint GL_APIENTRY -GLES2CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - const GLbyte* mailbox, - GLenum internalformat) { - return gles2::GetGLContext() - ->CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - mailbox, internalformat); -} void GL_APIENTRY GLES2BeginSharedImageAccessDirectCHROMIUM(GLuint texture, GLenum mode) { gles2::GetGLContext()->BeginSharedImageAccessDirectCHROMIUM(texture, mode); @@ -3034,11 +3026,6 @@ extern const NameToFunc g_gles2_function_table[] = { reinterpret_cast( glCreateAndTexStorage2DSharedImageCHROMIUM), }, - { - "glCreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM", - reinterpret_cast( - glCreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM), - }, { "glBeginSharedImageAccessDirectCHROMIUM", reinterpret_cast( diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h index 8a5e165cd78475..519a7c7123b96e 100644 --- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h +++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h @@ -3145,7 +3145,6 @@ void MaxShaderCompilerThreadsKHR(GLuint count) { } void CreateAndTexStorage2DSharedImageINTERNALImmediate(GLuint texture, - GLenum internalformat, const GLbyte* mailbox) { const uint32_t size = gles2::cmds:: CreateAndTexStorage2DSharedImageINTERNALImmediate::ComputeSize(); @@ -3153,7 +3152,7 @@ void CreateAndTexStorage2DSharedImageINTERNALImmediate(GLuint texture, GetImmediateCmdSpaceTotalSize< gles2::cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(size); if (c) { - c->Init(texture, internalformat, mailbox); + c->Init(texture, mailbox); } } diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index e97c3bebd8b6d5..c8890a2ac06f6c 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -6682,7 +6682,7 @@ GLuint GLES2Implementation::CreateAndTexStorage2DSharedImageCHROMIUM( DCHECK(mailbox.IsSharedImage()); GLuint client_id; GetIdHandler(SharedIdNamespaces::kTextures)->MakeIds(this, 0, 1, &client_id); - helper_->CreateAndTexStorage2DSharedImageINTERNALImmediate(client_id, GL_NONE, + helper_->CreateAndTexStorage2DSharedImageINTERNALImmediate(client_id, mailbox_data); if (share_group_->bind_generates_resource()) helper_->CommandBufferHelper::OrderingBarrier(); @@ -6690,31 +6690,6 @@ GLuint GLES2Implementation::CreateAndTexStorage2DSharedImageCHROMIUM( return client_id; } -GLuint -GLES2Implementation::CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - const GLbyte* mailbox_data, - GLenum internalformat) { - GPU_CLIENT_SINGLE_THREAD_CHECK(); - GPU_CLIENT_LOG( - "[" << GetLogPrefix() - << "] CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM(" - << static_cast(mailbox_data) << ", " << internalformat - << ")"); - const Mailbox& mailbox = *reinterpret_cast(mailbox_data); - DCHECK(mailbox.Verify()) - << "CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM was " - "passed an invalid mailbox."; - DCHECK(mailbox.IsSharedImage()); - GLuint client_id; - GetIdHandler(SharedIdNamespaces::kTextures)->MakeIds(this, 0, 1, &client_id); - helper_->CreateAndTexStorage2DSharedImageINTERNALImmediate( - client_id, internalformat, mailbox_data); - if (share_group_->bind_generates_resource()) - helper_->CommandBufferHelper::OrderingBarrier(); - CheckGLError(); - return client_id; -} - void GLES2Implementation::PushGroupMarkerEXT(GLsizei length, const GLchar* marker) { GPU_CLIENT_SINGLE_THREAD_CHECK(); diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index a051a42e6d19d5..fb5bec9752154b 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h @@ -1159,10 +1159,6 @@ void MaxShaderCompilerThreadsKHR(GLuint count) override; GLuint CreateAndTexStorage2DSharedImageCHROMIUM(const GLbyte* mailbox) override; -GLuint CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - const GLbyte* mailbox, - GLenum internalformat) override; - void BeginSharedImageAccessDirectCHROMIUM(GLuint texture, GLenum mode) override; void EndSharedImageAccessDirectCHROMIUM(GLuint texture) override; diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc index 38b4539f9fd1c0..3bfb7aabd8b5dd 100644 --- a/gpu/command_buffer/client/gles2_implementation_unittest.cc +++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc @@ -3613,29 +3613,12 @@ TEST_F(GLES2ImplementationTest, CreateAndTexStorage2DSharedImageCHROMIUM) { Mailbox mailbox = Mailbox::GenerateForSharedImage(); Cmds expected; - expected.cmd.Init(kTexturesStartId, GL_NONE, mailbox.name); + expected.cmd.Init(kTexturesStartId, mailbox.name); GLuint id = gl_->CreateAndTexStorage2DSharedImageCHROMIUM(mailbox.name); EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); EXPECT_EQ(kTexturesStartId, id); } -TEST_F(GLES2ImplementationTest, - CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM) { - struct Cmds { - cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate cmd; - GLbyte data[GL_MAILBOX_SIZE_CHROMIUM]; - }; - - Mailbox mailbox = Mailbox::GenerateForSharedImage(); - const GLenum kFormat = GL_RGBA; - Cmds expected; - expected.cmd.Init(kTexturesStartId, kFormat, mailbox.name); - GLuint id = gl_->CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - mailbox.name, kFormat); - EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); - EXPECT_EQ(kTexturesStartId, id); -} - TEST_F(GLES2ImplementationTest, ProduceTextureDirectCHROMIUM) { struct Cmds { cmds::ProduceTextureDirectCHROMIUMImmediate cmd; diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h index 970f8d1214d903..cfba67344f4c79 100644 --- a/gpu/command_buffer/client/gles2_interface_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_autogen.h @@ -858,9 +858,6 @@ virtual void FramebufferTextureMultiviewOVR(GLenum target, virtual void MaxShaderCompilerThreadsKHR(GLuint count) = 0; virtual GLuint CreateAndTexStorage2DSharedImageCHROMIUM( const GLbyte* mailbox) = 0; -virtual GLuint CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - const GLbyte* mailbox, - GLenum internalformat) = 0; virtual void BeginSharedImageAccessDirectCHROMIUM(GLuint texture, GLenum mode) = 0; virtual void EndSharedImageAccessDirectCHROMIUM(GLuint texture) = 0; diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h index 6965ef039e1a72..b89764c9e58dea 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h @@ -831,9 +831,6 @@ void FramebufferTextureMultiviewOVR(GLenum target, GLsizei numViews) override; void MaxShaderCompilerThreadsKHR(GLuint count) override; GLuint CreateAndTexStorage2DSharedImageCHROMIUM(const GLbyte* mailbox) override; -GLuint CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - const GLbyte* mailbox, - GLenum internalformat) override; void BeginSharedImageAccessDirectCHROMIUM(GLuint texture, GLenum mode) override; void EndSharedImageAccessDirectCHROMIUM(GLuint texture) override; void EnableiOES(GLenum target, GLuint index) override; diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h index b6b8415963131a..9f7565e4b7e26e 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h @@ -1126,12 +1126,6 @@ GLuint GLES2InterfaceStub::CreateAndTexStorage2DSharedImageCHROMIUM( const GLbyte* /* mailbox */) { return 0; } -GLuint -GLES2InterfaceStub::CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - const GLbyte* /* mailbox */, - GLenum /* internalformat */) { - return 0; -} void GLES2InterfaceStub::BeginSharedImageAccessDirectCHROMIUM( GLuint /* texture */, GLenum /* mode */) {} diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h index e3d804486be301..5cf163eedd9ce1 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h @@ -831,9 +831,6 @@ void FramebufferTextureMultiviewOVR(GLenum target, GLsizei numViews) override; void MaxShaderCompilerThreadsKHR(GLuint count) override; GLuint CreateAndTexStorage2DSharedImageCHROMIUM(const GLbyte* mailbox) override; -GLuint CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - const GLbyte* mailbox, - GLenum internalformat) override; void BeginSharedImageAccessDirectCHROMIUM(GLuint texture, GLenum mode) override; void EndSharedImageAccessDirectCHROMIUM(GLuint texture) override; void EnableiOES(GLenum target, GLuint index) override; diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h index 8f4d5bf534e548..c0d5d6485ad002 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h @@ -2397,17 +2397,6 @@ GLuint GLES2TraceImplementation::CreateAndTexStorage2DSharedImageCHROMIUM( return gl_->CreateAndTexStorage2DSharedImageCHROMIUM(mailbox); } -GLuint GLES2TraceImplementation:: - CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - const GLbyte* mailbox, - GLenum internalformat) { - TRACE_EVENT_BINARY_EFFICIENT0( - "gpu", - "GLES2Trace::CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM"); - return gl_->CreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM( - mailbox, internalformat); -} - void GLES2TraceImplementation::BeginSharedImageAccessDirectCHROMIUM( GLuint texture, GLenum mode) { diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index 692b583b460598..0231e7dab7a0d4 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h @@ -15506,30 +15506,25 @@ struct CreateAndTexStorage2DSharedImageINTERNALImmediate { void SetHeader() { header.SetCmdByTotalSize(ComputeSize()); } - void Init(GLuint _texture, GLenum _internalformat, const GLbyte* _mailbox) { + void Init(GLuint _texture, const GLbyte* _mailbox) { SetHeader(); texture = _texture; - internalformat = _internalformat; memcpy(ImmediateDataAddress(this), _mailbox, ComputeDataSize()); } - void* Set(void* cmd, - GLuint _texture, - GLenum _internalformat, - const GLbyte* _mailbox) { - static_cast(cmd)->Init(_texture, _internalformat, _mailbox); + void* Set(void* cmd, GLuint _texture, const GLbyte* _mailbox) { + static_cast(cmd)->Init(_texture, _mailbox); const uint32_t size = ComputeSize(); return NextImmediateCmdAddressTotalSize(cmd, size); } gpu::CommandHeader header; uint32_t texture; - uint32_t internalformat; }; static_assert( - sizeof(CreateAndTexStorage2DSharedImageINTERNALImmediate) == 12, - "size of CreateAndTexStorage2DSharedImageINTERNALImmediate should be 12"); + sizeof(CreateAndTexStorage2DSharedImageINTERNALImmediate) == 8, + "size of CreateAndTexStorage2DSharedImageINTERNALImmediate should be 8"); static_assert(offsetof(CreateAndTexStorage2DSharedImageINTERNALImmediate, header) == 0, "offset of CreateAndTexStorage2DSharedImageINTERNALImmediate " @@ -15538,10 +15533,6 @@ static_assert(offsetof(CreateAndTexStorage2DSharedImageINTERNALImmediate, texture) == 4, "offset of CreateAndTexStorage2DSharedImageINTERNALImmediate " "texture should be 4"); -static_assert(offsetof(CreateAndTexStorage2DSharedImageINTERNALImmediate, - internalformat) == 8, - "offset of CreateAndTexStorage2DSharedImageINTERNALImmediate " - "internalformat should be 8"); struct BeginSharedImageAccessDirectCHROMIUM { typedef BeginSharedImageAccessDirectCHROMIUM ValueType; diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h index f0e35fa1eb7ee0..9541396ef938d8 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h @@ -5144,8 +5144,7 @@ TEST_F(GLES2FormatTest, CreateAndTexStorage2DSharedImageINTERNALImmediate) { }; cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate& cmd = *GetBufferAs(); - void* next_cmd = - cmd.Set(&cmd, static_cast(11), static_cast(12), data); + void* next_cmd = cmd.Set(&cmd, static_cast(11), data); EXPECT_EQ( static_cast( cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate::kCmdId), @@ -5153,7 +5152,6 @@ TEST_F(GLES2FormatTest, CreateAndTexStorage2DSharedImageINTERNALImmediate) { EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)), cmd.header.size * 4u); EXPECT_EQ(static_cast(11), cmd.texture); - EXPECT_EQ(static_cast(12), cmd.internalformat); CheckBytesWrittenMatchesExpectedSize( next_cmd, sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data))); } diff --git a/gpu/command_buffer/common/shared_image_usage.cc b/gpu/command_buffer/common/shared_image_usage.cc index d61741cd172112..4a1867a39c4895 100644 --- a/gpu/command_buffer/common/shared_image_usage.cc +++ b/gpu/command_buffer/common/shared_image_usage.cc @@ -40,9 +40,6 @@ std::string CreateLabelForSharedImageUsage(uint32_t usage) { if (usage & SHARED_IMAGE_USAGE_OOP_RASTERIZATION) { label += "|OopRasterization"; } - if (usage & SHARED_IMAGE_USAGE_RGB_EMULATION) { - label += "|RgbEmulation"; - } if (usage & SHARED_IMAGE_USAGE_WEBGPU) { label += "|Webgpu"; } diff --git a/gpu/command_buffer/common/shared_image_usage.h b/gpu/command_buffer/common/shared_image_usage.h index 8bcb97c961b6bd..27d995313d4482 100644 --- a/gpu/command_buffer/common/shared_image_usage.h +++ b/gpu/command_buffer/common/shared_image_usage.h @@ -30,37 +30,35 @@ enum SharedImageUsage : uint32_t { // RasterInterface for OOP rasterization. TODO(backer): Eliminate once we can // CPU raster to SkImage via RasterInterface. SHARED_IMAGE_USAGE_OOP_RASTERIZATION = 1 << 5, - // Image will be used for RGB emulation in WebGL on Mac. - SHARED_IMAGE_USAGE_RGB_EMULATION = 1 << 6, // Image will be used by Dawn (for WebGPU) - SHARED_IMAGE_USAGE_WEBGPU = 1 << 7, + SHARED_IMAGE_USAGE_WEBGPU = 1 << 6, // Image will be used in a protected Vulkan context on Fuchsia. - SHARED_IMAGE_USAGE_PROTECTED = 1 << 8, + SHARED_IMAGE_USAGE_PROTECTED = 1 << 7, // Image may use concurrent read/write access. Used by single buffered canvas. // TODO(crbug.com/969114): This usage is currently not supported in GL/Vulkan // interop cases. - SHARED_IMAGE_USAGE_CONCURRENT_READ_WRITE = 1 << 9, + SHARED_IMAGE_USAGE_CONCURRENT_READ_WRITE = 1 << 8, // Image will be used for video decode acceleration on Chrome OS. - SHARED_IMAGE_USAGE_VIDEO_DECODE = 1 << 10, + SHARED_IMAGE_USAGE_VIDEO_DECODE = 1 << 9, // Image will be used as a WebGPU swapbuffer - SHARED_IMAGE_USAGE_WEBGPU_SWAP_CHAIN_TEXTURE = 1 << 11, + SHARED_IMAGE_USAGE_WEBGPU_SWAP_CHAIN_TEXTURE = 1 << 10, // Image will be used by VideoToolbox on macOS. If this is set, then // GLImage::DisableInUseByWindowServer should be called on any GLImages that // use this SharedImage. - SHARED_IMAGE_USAGE_MACOS_VIDEO_TOOLBOX = 1 << 12, + SHARED_IMAGE_USAGE_MACOS_VIDEO_TOOLBOX = 1 << 11, // Image will be used with mipmap enabled - SHARED_IMAGE_USAGE_MIPMAP = 1 << 13, + SHARED_IMAGE_USAGE_MIPMAP = 1 << 12, // Image will be used for CPU Writes by client - SHARED_IMAGE_USAGE_CPU_WRITE = 1 << 14, + SHARED_IMAGE_USAGE_CPU_WRITE = 1 << 13, // Image will be used in RasterInterface with RawDraw. - SHARED_IMAGE_USAGE_RAW_DRAW = 1 << 15, + SHARED_IMAGE_USAGE_RAW_DRAW = 1 << 14, // Image will be used in RasterInterface for DelegatedCompositing. // TODO(crbug.com/1254033): this usage shall be removed after cc is able to // set a single (duplicated) fence for bunch of tiles instead of having the SI // framework creating fences for each single message when write access ends. - SHARED_IMAGE_USAGE_RASTER_DELEGATED_COMPOSITING = 1 << 16, + SHARED_IMAGE_USAGE_RASTER_DELEGATED_COMPOSITING = 1 << 15, // Image will be created on the high performance GPU if supported. - SHARED_IMAGE_USAGE_HIGH_PERFORMANCE_GPU = 1 << 17, + SHARED_IMAGE_USAGE_HIGH_PERFORMANCE_GPU = 1 << 16, // Start service side only usage flags after this entry. They must be larger // than `LAST_CLIENT_USAGE`. @@ -69,7 +67,7 @@ enum SharedImageUsage : uint32_t { // Image will have pixels uploaded from CPU. The backing must implement // `UploadFromMemory()` if it supports this usage. Clients should specify // SHARED_IMAGE_USAGE_CPU_WRITE if they need to write pixels to the image. - SHARED_IMAGE_USAGE_CPU_UPLOAD = 1 << 18, + SHARED_IMAGE_USAGE_CPU_UPLOAD = 1 << 17, }; // Returns true if usage is a valid client usage. diff --git a/gpu/command_buffer/gles2_cmd_buffer_functions.txt b/gpu/command_buffer/gles2_cmd_buffer_functions.txt index e1906ea569e68c..272bc00861b419 100644 --- a/gpu/command_buffer/gles2_cmd_buffer_functions.txt +++ b/gpu/command_buffer/gles2_cmd_buffer_functions.txt @@ -378,8 +378,7 @@ GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count) // Extension CHROMIUM_shared_image GL_APICALL GLuint GL_APIENTRY glCreateAndTexStorage2DSharedImageCHROMIUM (const GLbyte* mailbox); -GL_APICALL GLuint GL_APIENTRY glCreateAndTexStorage2DSharedImageWithInternalFormatCHROMIUM (const GLbyte* mailbox, GLenum internalformat); -GL_APICALL void GL_APIENTRY glCreateAndTexStorage2DSharedImageINTERNAL (GLuint texture, GLenum internalformat, const GLbyte* mailbox); +GL_APICALL void GL_APIENTRY glCreateAndTexStorage2DSharedImageINTERNAL (GLuint texture, const GLbyte* mailbox); GL_APICALL void GL_APIENTRY glBeginSharedImageAccessDirectCHROMIUM (GLuint texture, GLenumSharedImageAccessMode mode); GL_APICALL void GL_APIENTRY glEndSharedImageAccessDirectCHROMIUM (GLuint texture); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index db701f9260070a..20f54a2ac06bc5 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -1216,7 +1216,6 @@ class GLES2DecoderImpl : public GLES2Decoder, const volatile GLbyte* key); void DoCreateAndTexStorage2DSharedImageINTERNAL( GLuint client_id, - GLenum internal_format, const volatile GLbyte* mailbox); void DoBeginSharedImageAccessDirectCHROMIUM(GLuint client_id, GLenum mode); void DoEndSharedImageAccessDirectCHROMIUM(GLuint client_id); @@ -18458,7 +18457,6 @@ void GLES2DecoderImpl::DoCreateAndConsumeTextureINTERNAL( void GLES2DecoderImpl::DoCreateAndTexStorage2DSharedImageINTERNAL( GLuint client_id, - GLenum internal_format, const volatile GLbyte* mailbox_data) { TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoCreateAndTexStorage2DSharedImageCHROMIUM", @@ -18484,20 +18482,8 @@ void GLES2DecoderImpl::DoCreateAndTexStorage2DSharedImageINTERNAL( return; } - std::unique_ptr shared_image; - if (internal_format == GL_RGB) { - shared_image = group_->shared_image_representation_factory() - ->ProduceRGBEmulationGLTexture(mailbox); - } else if (internal_format == GL_NONE) { - shared_image = - group_->shared_image_representation_factory()->ProduceGLTexture( - mailbox); - } else { - LOCAL_SET_GL_ERROR(GL_INVALID_ENUM, - "DoCreateAndTexStorage2DSharedImageINTERNAL", - "invalid internal format"); - return; - } + std::unique_ptr shared_image = + group_->shared_image_representation_factory()->ProduceGLTexture(mailbox); if (!shared_image) { // Mailbox missing, generate a texture. diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index 48ffe2e477c78c..c551e5c0d26357 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h @@ -5275,7 +5275,6 @@ GLES2DecoderImpl::HandleCreateAndTexStorage2DSharedImageINTERNALImmediate( CreateAndTexStorage2DSharedImageINTERNALImmediate*>( cmd_data); GLuint texture = static_cast(c.texture); - GLenum internalformat = static_cast(c.internalformat); uint32_t mailbox_size; if (!GLES2Util::ComputeDataSize(1, &mailbox_size)) { return error::kOutOfBounds; @@ -5288,7 +5287,7 @@ GLES2DecoderImpl::HandleCreateAndTexStorage2DSharedImageINTERNALImmediate( if (mailbox == nullptr) { return error::kOutOfBounds; } - DoCreateAndTexStorage2DSharedImageINTERNAL(texture, internalformat, mailbox); + DoCreateAndTexStorage2DSharedImageINTERNAL(texture, mailbox); return error::kNoError; } diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h index a72a9125427745..f66706b51fcc16 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h @@ -1023,7 +1023,6 @@ error::Error DoUnlockDiscardableTextureCHROMIUM(GLuint texture_id); error::Error DoLockDiscardableTextureCHROMIUM(GLuint texture_id); error::Error DoCreateAndTexStorage2DSharedImageINTERNAL( GLuint client_id, - GLenum internalformat, const volatile GLbyte* mailbox); error::Error DoBeginSharedImageAccessDirectCHROMIUM(GLuint client_id, GLenum mode); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc index 3f404a8c82492b..838ee255017ba2 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc @@ -4849,14 +4849,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUnlockDiscardableTextureCHROMIUM( error::Error GLES2DecoderPassthroughImpl::DoCreateAndTexStorage2DSharedImageINTERNAL( GLuint texture_client_id, - GLenum internalformat, const volatile GLbyte* mailbox) { - // RGB emulation is not needed here. - if (internalformat != GL_NONE) { - InsertError(GL_INVALID_ENUM, "internal format not supported."); - return error::kNoError; - } - if (!texture_client_id || resources_->texture_id_map.HasClientID(texture_client_id)) { InsertError(GL_INVALID_OPERATION, "invalid client ID"); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc index 3ab4ba9cb688ae..9426b4783588f0 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc @@ -4548,7 +4548,6 @@ error::Error GLES2DecoderPassthroughImpl:: CreateAndTexStorage2DSharedImageINTERNALImmediate*>( cmd_data); GLuint texture = static_cast(c.texture); - GLenum internalformat = static_cast(c.internalformat); uint32_t mailbox_size; if (!GLES2Util::ComputeDataSize(1, &mailbox_size)) { return error::kOutOfBounds; @@ -4561,8 +4560,8 @@ error::Error GLES2DecoderPassthroughImpl:: if (mailbox == nullptr) { return error::kOutOfBounds; } - error::Error error = DoCreateAndTexStorage2DSharedImageINTERNAL( - texture, internalformat, mailbox); + error::Error error = + DoCreateAndTexStorage2DSharedImageINTERNAL(texture, mailbox); if (error != error::kNoError) { return error; } diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_textures.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_textures.cc index 3afa579858b69a..d5221767b35e1c 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_textures.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_textures.cc @@ -46,7 +46,7 @@ TEST_F(GLES2DecoderPassthroughTest, CreateAndTexStorage2DSharedImageCHROMIUM) { auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(kNewClientId, GL_NONE, mailbox.name); + cmd.Init(kNewClientId, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); EXPECT_EQ(GL_NO_ERROR, GetGLError()); @@ -81,7 +81,7 @@ TEST_F(GLES2DecoderPassthroughTest, Mailbox mailbox; auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(kNewClientId, GL_NONE, mailbox.name); + cmd.Init(kNewClientId, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); // CreateAndTexStorage2DSharedImage should fail if the mailbox is invalid. @@ -111,7 +111,7 @@ TEST_F(GLES2DecoderPassthroughTest, { auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(kNewClientId, GL_NONE, mailbox.name); + cmd.Init(kNewClientId, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } @@ -121,7 +121,7 @@ TEST_F(GLES2DecoderPassthroughTest, { auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(kNewClientId, GL_NONE, mailbox.name); + cmd.Init(kNewClientId, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); } @@ -148,7 +148,7 @@ TEST_F(GLES2DecoderPassthroughTest, BeginEndSharedImageAccessCRHOMIUM) { auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); auto client_id = kNewClientId + i; - cmd.Init(client_id, GL_NONE, mailbox.name); + cmd.Init(client_id, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); EXPECT_EQ(GL_NO_ERROR, GetGLError()); @@ -215,7 +215,7 @@ TEST_F(GLES2DecoderPassthroughTest, auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(kNewClientId, GL_NONE, mailbox.name); + cmd.Init(kNewClientId, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); EXPECT_EQ(GL_NO_ERROR, GetGLError()); @@ -274,7 +274,7 @@ TEST_F(GLES2DecoderPassthroughTest, // the backing. auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(kNewClientId, GL_NONE, mailbox.name); + cmd.Init(kNewClientId, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); EXPECT_EQ(GL_NO_ERROR, GetGLError()); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc index fbda9dd90d7d3b..3047a2d54d1a84 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc @@ -3085,7 +3085,7 @@ TEST_P(GLES2DecoderTest, CreateAndTexStorage2DSharedImageCHROMIUM) { auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(kNewClientId, GL_NONE, mailbox.name); + cmd.Init(kNewClientId, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); EXPECT_EQ(GL_NO_ERROR, GetGLError()); @@ -3115,7 +3115,7 @@ TEST_P(GLES2DecoderTest, auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(kNewClientId, GL_NONE, mailbox.name); + cmd.Init(kNewClientId, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); // CreateAndTexStorage2DSharedImage should fail if the mailbox is invalid. @@ -3147,7 +3147,7 @@ TEST_P(GLES2DecoderTest, auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(client_texture_id_, GL_NONE, mailbox.name); + cmd.Init(client_texture_id_, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); // CreateAndTexStorage2DSharedImage should fail. @@ -3171,7 +3171,7 @@ TEST_P(GLES2DecoderTest, BeginEndSharedImageAccessCRHOMIUM) { auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(kNewClientId, GL_NONE, mailbox.name); + cmd.Init(kNewClientId, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); EXPECT_EQ(GL_NO_ERROR, GetGLError()); @@ -3234,7 +3234,7 @@ TEST_P(GLES2DecoderTest, BeginSharedImageAccessDirectCHROMIUMCantBeginAccess) { auto& cmd = *GetImmediateAs< cmds::CreateAndTexStorage2DSharedImageINTERNALImmediate>(); - cmd.Init(kNewClientId, GL_NONE, mailbox.name); + cmd.Init(kNewClientId, mailbox.name); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(mailbox.name))); EXPECT_EQ(GL_NO_ERROR, GetGLError()); diff --git a/gpu/command_buffer/service/shared_image/gl_image_backing.cc b/gpu/command_buffer/service/shared_image/gl_image_backing.cc index 043dae16ca8d25..ea0c7abf19c121 100644 --- a/gpu/command_buffer/service/shared_image/gl_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/gl_image_backing.cc @@ -413,10 +413,6 @@ void GLImageBacking::ReleaseGLTexture(bool have_context) { } } - if (rgb_emulation_texture_) { - rgb_emulation_texture_->RemoveLightweightRef(have_context); - rgb_emulation_texture_ = nullptr; - } if (IsPassthrough()) { if (passthrough_texture_) { if (have_context) { @@ -612,56 +608,6 @@ std::unique_ptr GLImageBacking::ProduceMemory( manager, this, tracker, base::WrapRefCounted(image_memory)); } -std::unique_ptr -GLImageBacking::ProduceRGBEmulationGLTexture(SharedImageManager* manager, - MemoryTypeTracker* tracker) { - if (IsPassthrough()) - return nullptr; - - RetainGLTexture(); - if (!rgb_emulation_texture_) { - const GLenum target = GetGLTarget(); - gl::GLApi* api = gl::g_current_gl_context; - ScopedRestoreTexture scoped_restore(api, target); - - // Set to false as this code path is only used on Mac. - const bool framebuffer_attachment_angle = false; - GLTextureImageBackingHelper::MakeTextureAndSetParameters( - target, 0 /* service_id */, framebuffer_attachment_angle, nullptr, - &rgb_emulation_texture_); - api->glBindTextureFn(target, rgb_emulation_texture_->service_id()); - - gles2::Texture::ImageState image_state = gles2::Texture::BOUND; - gl::GLImage* image = texture_->GetLevelImage(target, 0, &image_state); - DCHECK_EQ(image, image_.get()); - - DCHECK(image->ShouldBindOrCopy() == gl::GLImage::BIND); - const GLenum internal_format = GL_RGB; - if (!image->BindTexImageWithInternalformat(target, internal_format)) { - LOG(ERROR) << "Failed to bind image to rgb texture."; - rgb_emulation_texture_->RemoveLightweightRef(true /* have_context */); - rgb_emulation_texture_ = nullptr; - ReleaseGLTexture(true /* has_context */); - return nullptr; - } - GLenum format = - gles2::TextureManager::ExtractFormatFromStorageFormat(internal_format); - GLenum type = - gles2::TextureManager::ExtractTypeFromStorageFormat(internal_format); - - const gles2::Texture::LevelInfo* info = texture_->GetLevelInfo(target, 0); - rgb_emulation_texture_->SetLevelInfo(target, 0, internal_format, - info->width, info->height, 1, 0, - format, type, info->cleared_rect); - - rgb_emulation_texture_->SetLevelImage(target, 0, image, image_state); - rgb_emulation_texture_->SetImmutable(true, false); - } - - return std::make_unique( - manager, this, this, tracker, rgb_emulation_texture_); -} - void GLImageBacking::Update(std::unique_ptr in_fence) { if (in_fence) { // TODO(dcastagna): Don't wait for the fence if the SharedImage is going @@ -776,16 +722,9 @@ bool GLImageBacking::BindOrCopyImageIfNeeded() { // Bind or copy the GLImage to the texture. gles2::Texture::ImageState new_state = gles2::Texture::UNBOUND; if (image_->ShouldBindOrCopy() == gl::GLImage::BIND) { - if (gl_params_.is_rgb_emulation) { - if (!image_->BindTexImageWithInternalformat(target, GL_RGB)) { - LOG(ERROR) << "Failed to bind GLImage to RGB target"; - return false; - } - } else { - if (!image_->BindTexImage(target)) { - LOG(ERROR) << "Failed to bind GLImage to target"; - return false; - } + if (!image_->BindTexImage(target)) { + LOG(ERROR) << "Failed to bind GLImage to target"; + return false; } new_state = gles2::Texture::BOUND; } else { diff --git a/gpu/command_buffer/service/shared_image/gl_image_backing.h b/gpu/command_buffer/service/shared_image/gl_image_backing.h index d93699d006b33d..2577ccc699666a 100644 --- a/gpu/command_buffer/service/shared_image/gl_image_backing.h +++ b/gpu/command_buffer/service/shared_image/gl_image_backing.h @@ -232,9 +232,6 @@ class GPU_GLES2_EXPORT GLImageBacking std::unique_ptr ProduceMemory( SharedImageManager* manager, MemoryTypeTracker* tracker) override; - std::unique_ptr ProduceRGBEmulationGLTexture( - SharedImageManager* manager, - MemoryTypeTracker* tracker) override; void Update(std::unique_ptr in_fence) override; // GLTextureImageRepresentationClient: @@ -263,7 +260,6 @@ class GPU_GLES2_EXPORT GLImageBacking // |texture_| is nullptr. gfx::Rect cleared_rect_; - gles2::Texture* rgb_emulation_texture_ = nullptr; gles2::Texture* texture_ = nullptr; scoped_refptr passthrough_texture_; diff --git a/gpu/command_buffer/service/shared_image/gl_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/gl_image_backing_factory.cc index cd45ca832ea86e..4c6704d4c18563 100644 --- a/gpu/command_buffer/service/shared_image/gl_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/gl_image_backing_factory.cc @@ -196,16 +196,13 @@ std::unique_ptr GLImageBackingFactory::CreateSharedImage( const bool for_framebuffer_attachment = (usage & (SHARED_IMAGE_USAGE_RASTER | SHARED_IMAGE_USAGE_GLES2_FRAMEBUFFER_HINT)) != 0; - const bool is_rgb_emulation = (usage & SHARED_IMAGE_USAGE_RGB_EMULATION) != 0; InitializeGLTextureParams params; params.target = target; - params.internal_format = - is_rgb_emulation ? GL_RGB : image->GetInternalFormat(); - params.format = is_rgb_emulation ? GL_RGB : image->GetDataFormat(); + params.internal_format = image->GetInternalFormat(); + params.format = image->GetDataFormat(); params.type = image->GetDataType(); params.is_cleared = true; - params.is_rgb_emulation = is_rgb_emulation; params.framebuffer_attachment_angle = for_framebuffer_attachment && texture_usage_angle_; return std::make_unique( diff --git a/gpu/command_buffer/service/shared_image/gl_image_backing_factory_unittest.cc b/gpu/command_buffer/service/shared_image/gl_image_backing_factory_unittest.cc index b88e6155a7514c..8aa4ea75eba09f 100644 --- a/gpu/command_buffer/service/shared_image/gl_image_backing_factory_unittest.cc +++ b/gpu/command_buffer/service/shared_image/gl_image_backing_factory_unittest.cc @@ -216,17 +216,6 @@ TEST_P(GLImageBackingFactoryTest, Basic) { EXPECT_EQ(color_space, gl_representation->color_space()); EXPECT_EQ(usage, gl_representation->usage()); gl_representation.reset(); - - auto gl_representation_rgb = - shared_image_representation_factory_->ProduceRGBEmulationGLTexture( - mailbox); - EXPECT_TRUE(gl_representation_rgb); - EXPECT_TRUE(gl_representation_rgb->GetTexture()->service_id()); - EXPECT_EQ(size, gl_representation_rgb->size()); - EXPECT_EQ(format, gl_representation_rgb->format()); - EXPECT_EQ(color_space, gl_representation_rgb->color_space()); - EXPECT_EQ(usage, gl_representation_rgb->usage()); - gl_representation_rgb.reset(); } // Next, validate a GLTexturePassthroughImageRepresentation. @@ -585,21 +574,10 @@ class StubImage : public gl::GLImageStub { return true; } - bool BindTexImageWithInternalformat(unsigned target, - unsigned internal_format) override { - internal_format_ = internal_format; - if (!bound_) { - bound_ = true; - ++update_counter_; - } - return true; - } - void ReleaseTexImage(unsigned target) override { bound_ = false; } bool bound() const { return bound_; } int update_counter() const { return update_counter_; } - unsigned internal_format() const { return internal_format_; } private: ~StubImage() override = default; @@ -608,7 +586,6 @@ class StubImage : public gl::GLImageStub { gfx::BufferFormat format_; bool bound_ = false; int update_counter_ = 0; - unsigned internal_format_ = GL_RGBA; }; class GLImageBackingFactoryWithGMBTest : public GLImageBackingFactoryTestBase, @@ -766,52 +743,6 @@ TEST_P(GLImageBackingFactoryWithGMBTest, GpuMemoryBufferImportSharedMemory) { EXPECT_EQ(format, shm_image->format()); } -TEST_P(GLImageBackingFactoryWithGMBTest, - GpuMemoryBufferImportNative_WithRGBEmulation) { - if (use_passthrough()) - return; - auto mailbox = Mailbox::GenerateForSharedImage(); - gfx::Size size(256, 256); - gfx::BufferFormat format = viz::BufferFormat(get_format()); - auto color_space = gfx::ColorSpace::CreateSRGB(); - GrSurfaceOrigin surface_origin = kTopLeft_GrSurfaceOrigin; - SkAlphaType alpha_type = kPremul_SkAlphaType; - uint32_t usage = SHARED_IMAGE_USAGE_GLES2; - - gfx::GpuMemoryBufferHandle handle; - handle.type = gfx::NATIVE_PIXMAP; - auto backing = backing_factory_->CreateSharedImage( - mailbox, kClientId, std::move(handle), format, gfx::BufferPlane::DEFAULT, - kNullSurfaceHandle, size, color_space, surface_origin, alpha_type, usage); - if (!can_create_scanout_or_gmb_shared_image(get_format())) { - EXPECT_FALSE(backing); - return; - } - ASSERT_TRUE(backing); - - std::unique_ptr ref = - shared_image_manager_->Register(std::move(backing), - memory_type_tracker_.get()); - - auto representation = - shared_image_representation_factory_->ProduceRGBEmulationGLTexture( - mailbox); - EXPECT_TRUE(representation); - EXPECT_TRUE(representation->GetTexture()->service_id()); - EXPECT_EQ(size, representation->size()); - EXPECT_EQ(get_format(), representation->format()); - EXPECT_EQ(color_space, representation->color_space()); - EXPECT_EQ(usage, representation->usage()); - - scoped_refptr image = - representation->GetTexture()->GetLevelImage(GL_TEXTURE_2D, 0); - ASSERT_EQ(image->GetType(), gl::GLImage::Type::NONE); - auto* stub_image = static_cast(image.get()); - EXPECT_EQ(stub_image->internal_format(), (unsigned)GL_RGB); - EXPECT_TRUE(stub_image->bound()); - EXPECT_EQ(stub_image->update_counter(), 1); -} - #if !BUILDFLAG(IS_ANDROID) const auto kResourceFormats = ::testing::Values(viz::ResourceFormat::RGBA_8888, diff --git a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.h b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.h index 36e08ae211a5ab..6b7775c60e6708 100644 --- a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.h +++ b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.h @@ -22,7 +22,6 @@ class GPU_GLES2_EXPORT GLTextureImageBackingHelper { GLenum format = 0; GLenum type = 0; bool is_cleared = false; - bool is_rgb_emulation = false; bool framebuffer_attachment_angle = false; bool has_immutable_storage = false; }; diff --git a/gpu/command_buffer/service/shared_image/shared_image_backing.cc b/gpu/command_buffer/service/shared_image/shared_image_backing.cc index b3577fbf5295ee..b4886150f79ce6 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/shared_image_backing.cc @@ -134,12 +134,6 @@ SharedImageBacking::ProduceGLTexture(SharedImageManager* manager, return nullptr; } -std::unique_ptr -SharedImageBacking::ProduceRGBEmulationGLTexture(SharedImageManager* manager, - MemoryTypeTracker* tracker) { - return nullptr; -} - std::unique_ptr SharedImageBacking::ProduceGLTexturePassthrough(SharedImageManager* manager, MemoryTypeTracker* tracker) { diff --git a/gpu/command_buffer/service/shared_image/shared_image_backing.h b/gpu/command_buffer/service/shared_image/shared_image_backing.h index e1800e20537d89..8912eb9be9c2e4 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_backing.h +++ b/gpu/command_buffer/service/shared_image/shared_image_backing.h @@ -193,9 +193,6 @@ class GPU_GLES2_EXPORT SharedImageBacking { virtual std::unique_ptr ProduceGLTexture( SharedImageManager* manager, MemoryTypeTracker* tracker); - virtual std::unique_ptr - ProduceRGBEmulationGLTexture(SharedImageManager* manager, - MemoryTypeTracker* tracker); virtual std::unique_ptr ProduceGLTexturePassthrough(SharedImageManager* manager, MemoryTypeTracker* tracker); diff --git a/gpu/command_buffer/service/shared_image/shared_image_factory.cc b/gpu/command_buffer/service/shared_image/shared_image_factory.cc index 2f2ac80453fc52..1b67b798a510f6 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_factory.cc +++ b/gpu/command_buffer/service/shared_image/shared_image_factory.cc @@ -801,12 +801,6 @@ SharedImageRepresentationFactory::ProduceGLTexture(const Mailbox& mailbox) { return manager_->ProduceGLTexture(mailbox, tracker_.get()); } -std::unique_ptr -SharedImageRepresentationFactory::ProduceRGBEmulationGLTexture( - const Mailbox& mailbox) { - return manager_->ProduceRGBEmulationGLTexture(mailbox, tracker_.get()); -} - std::unique_ptr SharedImageRepresentationFactory::ProduceGLTexturePassthrough( const Mailbox& mailbox) { diff --git a/gpu/command_buffer/service/shared_image/shared_image_factory.h b/gpu/command_buffer/service/shared_image/shared_image_factory.h index 6efcdbb9ee30e5..07899a0ba6a66a 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_factory.h +++ b/gpu/command_buffer/service/shared_image/shared_image_factory.h @@ -201,8 +201,6 @@ class GPU_GLES2_EXPORT SharedImageRepresentationFactory { // their destruction process. std::unique_ptr ProduceGLTexture( const Mailbox& mailbox); - std::unique_ptr ProduceRGBEmulationGLTexture( - const Mailbox& mailbox); std::unique_ptr ProduceGLTexturePassthrough(const Mailbox& mailbox); std::unique_ptr ProduceSkia( diff --git a/gpu/command_buffer/service/shared_image/shared_image_manager.cc b/gpu/command_buffer/service/shared_image/shared_image_manager.cc index ec95bc36ad0bc2..0bcefc741391ed 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_manager.cc +++ b/gpu/command_buffer/service/shared_image/shared_image_manager.cc @@ -154,29 +154,6 @@ SharedImageManager::ProduceGLTexture(const Mailbox& mailbox, return representation; } -std::unique_ptr -SharedImageManager::ProduceRGBEmulationGLTexture(const Mailbox& mailbox, - MemoryTypeTracker* tracker) { - CALLED_ON_VALID_THREAD(); - - AutoLock autolock(this); - auto found = images_.find(mailbox); - if (found == images_.end()) { - LOG(ERROR) << "SharedImageManager::ProduceRGBEmulationGLTexture: Trying to " - "produce a representation from a non-existent mailbox."; - return nullptr; - } - - auto representation = (*found)->ProduceRGBEmulationGLTexture(this, tracker); - if (!representation) { - LOG(ERROR) << "SharedImageManager::ProduceRGBEmulationGLTexture: Trying to " - "produce a representation from an incompatible mailbox."; - return nullptr; - } - - return representation; -} - std::unique_ptr SharedImageManager::ProduceGLTexturePassthrough(const Mailbox& mailbox, MemoryTypeTracker* tracker) { diff --git a/gpu/command_buffer/service/shared_image/shared_image_manager.h b/gpu/command_buffer/service/shared_image/shared_image_manager.h index bc523f0fa059c2..eb988cba7f8fd4 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_manager.h +++ b/gpu/command_buffer/service/shared_image/shared_image_manager.h @@ -53,9 +53,6 @@ class GPU_GLES2_EXPORT SharedImageManager { std::unique_ptr ProduceGLTexture( const Mailbox& mailbox, MemoryTypeTracker* ref); - std::unique_ptr ProduceRGBEmulationGLTexture( - const Mailbox& mailbox, - MemoryTypeTracker* ref); std::unique_ptr ProduceGLTexturePassthrough(const Mailbox& mailbox, MemoryTypeTracker* ref); std::unique_ptr ProduceSkia( diff --git a/gpu/command_buffer/tests/fuzzer_main.cc b/gpu/command_buffer/tests/fuzzer_main.cc index 4e335475b3364d..51b686460f9367 100644 --- a/gpu/command_buffer/tests/fuzzer_main.cc +++ b/gpu/command_buffer/tests/fuzzer_main.cc @@ -419,7 +419,7 @@ class CommandBufferSetup { /*image_factory=*/nullptr, /*memory_tracker=*/nullptr, /*is_for_display_compositor=*/false); for (uint32_t usage = SHARED_IMAGE_USAGE_GLES2; - usage <= SHARED_IMAGE_USAGE_RGB_EMULATION; usage <<= 1) { + usage <= SHARED_IMAGE_USAGE_OOP_RASTERIZATION; usage <<= 1) { Mailbox::Name name; memset(name, 0, sizeof(name)); name[0] = usage; diff --git a/gpu/command_buffer/tests/texture_image_factory.cc b/gpu/command_buffer/tests/texture_image_factory.cc index 92a68cceeb824f..6dc5fdea917d4d 100644 --- a/gpu/command_buffer/tests/texture_image_factory.cc +++ b/gpu/command_buffer/tests/texture_image_factory.cc @@ -26,15 +26,6 @@ class TextureImage : public gl::GLImage { GetDataFormat(), GetDataType(), nullptr); return true; } - bool BindTexImageWithInternalformat(unsigned target, - unsigned internal_format) override { - glTexImage2D(target, - 0, // mip level - GetInternalFormat(), size_.width(), size_.height(), - 0, // border - GetDataFormat(), GetDataType(), nullptr); - return true; - } void ReleaseTexImage(unsigned target) override {} bool CopyTexImage(unsigned target) override { NOTREACHED(); diff --git a/gpu/ipc/service/dcomp_texture_win.cc b/gpu/ipc/service/dcomp_texture_win.cc index aec3660dd46499..48beb07425dc34 100644 --- a/gpu/ipc/service/dcomp_texture_win.cc +++ b/gpu/ipc/service/dcomp_texture_win.cc @@ -167,7 +167,6 @@ gpu::Mailbox DCOMPTexture::CreateSharedImage() { params.internal_format = GL_RGBA; params.format = GL_RGBA; params.is_cleared = true; - params.is_rgb_emulation = false; params.framebuffer_attachment_angle = false; auto shared_image = std::make_unique( this, mailbox, viz::BGRA_8888, GetSize(), gfx::ColorSpace::CreateSRGB(),