Skip to content

Commit

Permalink
Minor: Account for macro namespacing.
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmaygarde authored and dnfield committed Apr 27, 2022
1 parent f282f41 commit 7e5364a
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 19 deletions.
3 changes: 1 addition & 2 deletions impeller/entity/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ impeller_component("entity") {
"entity_pass_delegate.h",
]

deps = [ ":entity_shaders" ]

public_deps = [
":entity_shaders",
"../archivist",
"../image",
"../renderer",
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions impeller/renderer/backend/metal/allocator_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
static MTLResourceOptions ToMTLResourceOptions(StorageMode type) {
switch (type) {
case StorageMode::kHostVisible:
#if OS_IOS
#if FML_OS_IOS
return MTLResourceStorageModeShared;
#else
return MTLResourceStorageModeManaged;
#endif
case StorageMode::kDevicePrivate:
return MTLResourceStorageModePrivate;
case StorageMode::kDeviceTransient:
#if OS_IOS
#if FML_OS_IOS
if (@available(iOS 10.0, *)) {
return MTLResourceStorageModeMemoryless;
} else {
Expand All @@ -57,15 +57,15 @@ 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;
#endif
case StorageMode::kDevicePrivate:
return MTLStorageModePrivate;
case StorageMode::kDeviceTransient:
#if OS_IOS
#if FML_OS_IOS
if (@available(iOS 10.0, *)) {
return MTLStorageModeMemoryless;
} else {
Expand Down
4 changes: 2 additions & 2 deletions impeller/renderer/backend/metal/formats_mtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions impeller/renderer/backend/metal/surface_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 8 additions & 1 deletion impeller/renderer/command_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions impeller/renderer/formats.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions impeller/renderer/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/texture_descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7e5364a

Please sign in to comment.