From 7e5364a4dc360f4e1254824aaa013fa447d12e97 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 31 Jan 2022 13:05:38 -0800 Subject: [PATCH] Minor: Account for macro namespacing. --- impeller/entity/BUILD.gn | 3 +-- impeller/renderer/allocator.cc | 2 +- impeller/renderer/backend/metal/allocator_mtl.mm | 8 ++++---- impeller/renderer/backend/metal/formats_mtl.h | 4 ++-- impeller/renderer/backend/metal/surface_mtl.mm | 4 ++-- impeller/renderer/command_buffer.h | 9 ++++++++- impeller/renderer/formats.h | 8 ++++---- impeller/renderer/platform.h | 4 ++-- impeller/renderer/texture_descriptor.h | 2 +- 9 files changed, 25 insertions(+), 19 deletions(-) diff --git a/impeller/entity/BUILD.gn b/impeller/entity/BUILD.gn index e6c109e06e99e..7badc02495d46 100644 --- a/impeller/entity/BUILD.gn +++ b/impeller/entity/BUILD.gn @@ -33,9 +33,8 @@ impeller_component("entity") { "entity_pass_delegate.h", ] - deps = [ ":entity_shaders" ] - public_deps = [ + ":entity_shaders", "../archivist", "../image", "../renderer", diff --git a/impeller/renderer/allocator.cc b/impeller/renderer/allocator.cc index 5969d220c21a7..fa4147141cf9b 100644 --- a/impeller/renderer/allocator.cc +++ b/impeller/renderer/allocator.cc @@ -15,7 +15,7 @@ bool Allocator::RequiresExplicitHostSynchronization(StorageMode mode) { return false; } -#if OS_IOS +#if FML_OS_IOS // StorageMode::kHostVisible is MTLStorageModeShared already. return false; #else // OS_IOS diff --git a/impeller/renderer/backend/metal/allocator_mtl.mm b/impeller/renderer/backend/metal/allocator_mtl.mm index 4cbe7ac143646..20ceb1e2c7910 100644 --- a/impeller/renderer/backend/metal/allocator_mtl.mm +++ b/impeller/renderer/backend/metal/allocator_mtl.mm @@ -32,7 +32,7 @@ static MTLResourceOptions ToMTLResourceOptions(StorageMode type) { switch (type) { case StorageMode::kHostVisible: -#if OS_IOS +#if FML_OS_IOS return MTLResourceStorageModeShared; #else return MTLResourceStorageModeManaged; @@ -40,7 +40,7 @@ static MTLResourceOptions ToMTLResourceOptions(StorageMode type) { case StorageMode::kDevicePrivate: return MTLResourceStorageModePrivate; case StorageMode::kDeviceTransient: -#if OS_IOS +#if FML_OS_IOS if (@available(iOS 10.0, *)) { return MTLResourceStorageModeMemoryless; } else { @@ -57,7 +57,7 @@ static MTLResourceOptions ToMTLResourceOptions(StorageMode type) { static MTLStorageMode ToMTLStorageMode(StorageMode mode) { switch (mode) { case StorageMode::kHostVisible: -#if OS_IOS +#if FML_OS_IOS return MTLStorageModeShared; #else return MTLStorageModeManaged; @@ -65,7 +65,7 @@ static MTLStorageMode ToMTLStorageMode(StorageMode mode) { case StorageMode::kDevicePrivate: return MTLStorageModePrivate; case StorageMode::kDeviceTransient: -#if OS_IOS +#if FML_OS_IOS if (@available(iOS 10.0, *)) { return MTLStorageModeMemoryless; } else { diff --git a/impeller/renderer/backend/metal/formats_mtl.h b/impeller/renderer/backend/metal/formats_mtl.h index 370284bb62f0c..47e17843132a4 100644 --- a/impeller/renderer/backend/metal/formats_mtl.h +++ b/impeller/renderer/backend/metal/formats_mtl.h @@ -275,9 +275,9 @@ constexpr MTLClearColor ToMTLClearColor(const Color& color) { constexpr MTLTextureType ToMTLTextureType(TextureType type) { switch (type) { - case TextureType::k2D: + case TextureType::kTexture2D: return MTLTextureType2D; - case TextureType::k2DMultisample: + case TextureType::kTexture2DMultisample: return MTLTextureType2DMultisample; } return MTLTextureType2D; diff --git a/impeller/renderer/backend/metal/surface_mtl.mm b/impeller/renderer/backend/metal/surface_mtl.mm index 9a8ed8185ccf7..4c57ee21f6579 100644 --- a/impeller/renderer/backend/metal/surface_mtl.mm +++ b/impeller/renderer/backend/metal/surface_mtl.mm @@ -37,7 +37,7 @@ } TextureDescriptor color0_tex_desc; - color0_tex_desc.type = TextureType::k2DMultisample; + color0_tex_desc.type = TextureType::kTexture2DMultisample; color0_tex_desc.sample_count = SampleCount::kCount4; color0_tex_desc.format = color_format; color0_tex_desc.size = { @@ -69,7 +69,7 @@ color0_resolve_tex_desc, current_drawable.texture); TextureDescriptor stencil0_tex; - stencil0_tex.type = TextureType::k2DMultisample; + stencil0_tex.type = TextureType::kTexture2DMultisample; stencil0_tex.sample_count = SampleCount::kCount4; stencil0_tex.format = PixelFormat::kDefaultStencil; stencil0_tex.size = color0_tex_desc.size; diff --git a/impeller/renderer/command_buffer.h b/impeller/renderer/command_buffer.h index 10ac6a65a4247..2056b048cb891 100644 --- a/impeller/renderer/command_buffer.h +++ b/impeller/renderer/command_buffer.h @@ -25,7 +25,14 @@ class RenderTarget; /// `RenderPass` describes the configuration of the various /// attachments when the command is submitted. /// -/// A command buffer is only meant to be used on a single thread. +/// A command buffer is only meant to be used on a single thread. If +/// a frame workload needs to be encoded from multiple threads, +/// setup and record into multiple command buffers. The order of +/// submission of commands encoded in multiple command buffers can +/// be controlled via either the order in which the command buffers +/// were created, or, using the `ReserveSpotInQueue` command which +/// allows for encoding commands for submission in an order that is +/// different from the encoding order. /// class CommandBuffer { public: diff --git a/impeller/renderer/formats.h b/impeller/renderer/formats.h index 3b4b0c19688b9..796c6258387c7 100644 --- a/impeller/renderer/formats.h +++ b/impeller/renderer/formats.h @@ -100,15 +100,15 @@ enum class StoreAction { }; enum class TextureType { - k2D, - k2DMultisample, + kTexture2D, + kTexture2DMultisample, }; constexpr bool IsMultisampleCapable(TextureType type) { switch (type) { - case TextureType::k2D: + case TextureType::kTexture2D: return false; - case TextureType::k2DMultisample: + case TextureType::kTexture2DMultisample: return true; } return false; diff --git a/impeller/renderer/platform.h b/impeller/renderer/platform.h index 9044c8b78bc8b..1ca8133c328c5 100644 --- a/impeller/renderer/platform.h +++ b/impeller/renderer/platform.h @@ -12,9 +12,9 @@ namespace impeller { constexpr size_t DefaultUniformAlignment() { -#if OS_IOS +#if FML_OS_IOS return 16u; -#elif OS_MACOSX +#elif FML_OS_MACOSX return 256u; #else #error "Unsupported platform". diff --git a/impeller/renderer/texture_descriptor.h b/impeller/renderer/texture_descriptor.h index d453ae28508bd..da51479b0e4a5 100644 --- a/impeller/renderer/texture_descriptor.h +++ b/impeller/renderer/texture_descriptor.h @@ -13,7 +13,7 @@ namespace impeller { struct TextureDescriptor { - TextureType type = TextureType::k2D; + TextureType type = TextureType::kTexture2D; PixelFormat format = PixelFormat::kUnknown; ISize size; size_t mip_count = 1u; // Size::MipCount is usually appropriate.