Minor: Account for macro namespacing.

This commit is contained in:
Chinmay Garde
2022-01-31 13:05:38 -08:00
committed by Dan Field
parent 5e9aeeb11b
commit ddb2c14ec1
9 changed files with 25 additions and 19 deletions

View File

@@ -33,9 +33,8 @@ impeller_component("entity") {
"entity_pass_delegate.h",
]
deps = [ ":entity_shaders" ]
public_deps = [
":entity_shaders",
"../archivist",
"../image",
"../renderer",

View File

@@ -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

View File

@@ -32,7 +32,7 @@ bool AllocatorMTL::IsValid() const {
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 {

View File

@@ -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;

View File

@@ -37,7 +37,7 @@ std::unique_ptr<Surface> SurfaceMTL::WrapCurrentMetalLayerDrawable(
}
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 @@ std::unique_ptr<Surface> SurfaceMTL::WrapCurrentMetalLayerDrawable(
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;

View File

@@ -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:

View File

@@ -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;

View File

@@ -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".

View File

@@ -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.