Skip to content

Commit

Permalink
[Impeller] Patch up sundry issues in the Vulkan backend. (flutter#39905)
Browse files Browse the repository at this point in the history
Kaushik already did most of the great work. This patch gets us to a point where
all the playgrounds tests pass and the common performance optimizations are in
place. All known non-compute Impeller features should be implemented. There are
iOS only performance optimizations that haven’t been opted into because these
are behind define guards. These need to be generalized. Without that, the
performance of this backend will lag behind that of the Metal backend but only
because it is not an apples to apples comparison.

The general rubric was to keep the code and concepts as similar to the Metal
backend as possible.

The list of updates, all to the Vulkan Impeller backend:

* MSAA is wired up.
* Depth and stencil attachments and pipeline states are wired up.
* Got rid of Vulkan specific hacks in the inline pass context that were
  preventing clips from working.
* Storage modes for both device buffer and texture allocation are respected.
  This includes optimal usage of tile memory for device transient attachments.
* Host coherent memory for textures is no longer a requirement with explicit
  mapping management and write flushes.
* Texture uploads should be optimized for the UMA case without needing a staging
  buffer. That entire pipeline has been reworked.
* Textures track their current layout and ensure they get to the right layout
  based on usage without redundant transitions.
* Cube textures are now supported.
* Mipmapping has been reworked to correct image layout errors. With the new
  texture layout transition management, blit passes should be a whole lot easier
  to read and reason about.
* Allocator allocations are named using Vulkan debug utilities and the allocator
  (VMA). Comes in handy when chasing leaks. All of which are chased down.
* Left some handy utilities in there to debug resource leaks after context
  shutdown.  These are validation errors.
* Debug groups are pushed around render pass command encoding as well as the
  entire pass contents. This mimics the behavior of the Metal backend and it
  should be easy to map traces using both backends in Xcode and RenderDoc.
* Command buffer submission allows for tracking the life cycles of all resources
  referenced in the command stream and ensuring that the objects stay alive till
  past the submission of the command buffer. All use-after-free issues due to
  this class of issue have been chased down.
* Command pools are now context global instead of being created per pass.
* Descriptor pool are now context global instead of being created per pass.
  Individual descriptor types are now reference counted and returned to the pool
  when not needed. The pool is still fixed size though (and hence relatively
  large).
* All instances of global waitIdle on the device are removed during normal
  operation. The only times a waitIdle may happen is during swapchain recreation
  and context destruction.
* Swapchain adapt to them going out of date with the underlying surface and
  seamlessly resize as necessary on the next drawable acquisition.
* Playgrounds are resizable.
* Pipeline front face and cull modes are respected.
* Clears for all attachments are respected.
* Maximum textures sizes supported on the device are respected instead of
  hardcoding the minimum Vulkan requirement.

Fixes flutter/flutter#112388
Fixes flutter/flutter#112648
Fixes flutter/flutter#112647 and a few other issues...
  • Loading branch information
chinmaygarde authored Feb 28, 2023
1 parent d37ba0d commit 365f348
Show file tree
Hide file tree
Showing 71 changed files with 2,869 additions and 2,430 deletions.
48 changes: 20 additions & 28 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1406,20 +1406,12 @@ ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/capabilities_vk.cc + .
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/capabilities_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/command_buffer_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/command_buffer_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/command_pool_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/command_pool_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/commands_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/commands_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/command_encoder_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/command_encoder_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/context_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/context_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/deletion_queue_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/deletion_queue_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/descriptor_pool_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/descriptor_pool_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/device_buffer_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/device_buffer_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/fenced_command_buffer_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/fenced_command_buffer_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/formats_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/formats_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/pipeline_library_vk.cc + ../../../flutter/LICENSE
Expand All @@ -1436,14 +1428,18 @@ ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/shader_function_vk.cc
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/shader_function_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/shader_library_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/shader_library_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/surface_producer_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/surface_producer_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/shared_object_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/shared_object_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/surface_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/surface_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_details_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_details_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_image_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_image_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_impl_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_impl_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/texture_source_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/texture_source_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/texture_vk.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/texture_vk.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/renderer/backend/vulkan/vertex_descriptor_vk.cc + ../../../flutter/LICENSE
Expand Down Expand Up @@ -3906,20 +3902,12 @@ FILE: ../../../flutter/impeller/renderer/backend/vulkan/capabilities_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/capabilities_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/command_buffer_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/command_buffer_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/command_pool_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/command_pool_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/commands_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/commands_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/command_encoder_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/command_encoder_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/context_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/context_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/deletion_queue_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/deletion_queue_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/descriptor_pool_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/descriptor_pool_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/device_buffer_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/device_buffer_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/fenced_command_buffer_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/fenced_command_buffer_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/formats_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/formats_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/pipeline_library_vk.cc
Expand All @@ -3936,14 +3924,18 @@ FILE: ../../../flutter/impeller/renderer/backend/vulkan/shader_function_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/shader_function_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/shader_library_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/shader_library_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/surface_producer_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/surface_producer_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/shared_object_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/shared_object_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/surface_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/surface_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_details_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_details_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_image_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_image_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_impl_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_impl_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/swapchain_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/texture_source_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/texture_source_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/texture_vk.cc
FILE: ../../../flutter/impeller/renderer/backend/vulkan/texture_vk.h
FILE: ../../../flutter/impeller/renderer/backend/vulkan/vertex_descriptor_vk.cc
Expand Down
15 changes: 15 additions & 0 deletions flutter_vma/flutter_vma.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,19 @@

#define VMA_IMPLEMENTATION

// Enable this to dump a list of all pending allocations to the log. This comes
// in handy if you are tracking a leak of a resource after context shutdown.
#if 0
#include "flutter/fml/logging.h" // nogncheck
#define VMA_DEBUG_LOG VMADebugPrint
void VMADebugPrint(const char* message, ...) {
va_list args;
va_start(args, message);
char buffer[256];
vsnprintf(buffer, sizeof(buffer) - 1, message, args);
va_end(args);
FML_DLOG(INFO) << buffer;
}
#endif

#include "flutter/flutter_vma/flutter_vma.h"
6 changes: 0 additions & 6 deletions impeller/entity/inline_pass_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ InlinePassContext::RenderPassResult InlinePassContext::GetRenderPass(
color0.store_action = StoreAction::kStore;
}

#ifndef IMPELLER_ENABLE_VULKAN
auto stencil = render_target_.GetStencilAttachment();
if (!stencil.has_value()) {
VALIDATION_LOG << "Stencil attachment unexpectedly missing from the "
Expand All @@ -122,11 +121,6 @@ InlinePassContext::RenderPassResult InlinePassContext::GetRenderPass(
? StoreAction::kDontCare
: StoreAction::kStore;
render_target_.SetStencilAttachment(stencil.value());
#else
// Touch this variable to avoid a compiler warnings.
// This will go away once stencil support is added for vulkan.
total_pass_reads_ = 1;
#endif

render_target_.SetColorAttachment(color0, 0);

Expand Down
36 changes: 17 additions & 19 deletions impeller/playground/backend/vulkan/playground_impl_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ ShaderLibraryMappingsForPlayground() {
impeller_imgui_shaders_vk_length),
std::make_shared<fml::NonOwnedMapping>(impeller_scene_shaders_vk_data,
impeller_scene_shaders_vk_length),

};
}

Expand All @@ -59,11 +58,9 @@ PlaygroundImplVK::PlaygroundImplVK()

::glfwDefaultWindowHints();
::glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
::glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
::glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);

auto window =
::glfwCreateWindow(800, 600, "Test Vulkan Window", nullptr, nullptr);
auto window = ::glfwCreateWindow(1, 1, "Test", nullptr, nullptr);
if (!window) {
VALIDATION_LOG << "Unable to create glfw window";
return;
Expand All @@ -84,25 +81,26 @@ PlaygroundImplVK::PlaygroundImplVK()
return;
}

context_ = std::move(context);

SetupSwapchain();
}

void PlaygroundImplVK::SetupSwapchain() {
ContextVK* context_vk = reinterpret_cast<ContextVK*>(context_.get());
auto window = reinterpret_cast<GLFWwindow*>(handle_.get());
vk::Instance instance = context_vk->GetInstance();
VkSurfaceKHR surface_tmp;
auto res = vk::Result{
::glfwCreateWindowSurface(instance, window, nullptr, &surface_tmp)};
VkSurfaceKHR vk_surface;
auto res =
vk::Result{::glfwCreateWindowSurface(context->GetInstance(), // instance
window, // window
nullptr, // allocator
&vk_surface // surface
)};
if (res != vk::Result::eSuccess) {
VALIDATION_LOG << "Could not create surface for GLFW window: "
<< vk::to_string(res);
return;
}
vk::UniqueSurfaceKHR surface{surface_tmp, instance};
context_vk->SetupSwapchain(std::move(surface));

vk::UniqueSurfaceKHR surface{vk_surface, context->GetInstance()};
if (!context->SetWindowSurface(std::move(surface))) {
VALIDATION_LOG << "Could not setup surface for context.";
return;
}

context_ = std::move(context);
}

PlaygroundImplVK::~PlaygroundImplVK() = default;
Expand All @@ -121,7 +119,7 @@ PlaygroundImpl::WindowHandle PlaygroundImplVK::GetWindowHandle() const {
std::unique_ptr<Surface> PlaygroundImplVK::AcquireSurfaceFrame(
std::shared_ptr<Context> context) {
ContextVK* context_vk = reinterpret_cast<ContextVK*>(context_.get());
return context_vk->AcquireSurface(current_frame_++);
return context_vk->AcquireNextSurface();
}

} // namespace impeller
6 changes: 1 addition & 5 deletions impeller/playground/backend/vulkan/playground_impl_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "flutter/fml/concurrent_message_loop.h"
#include "flutter/fml/macros.h"
#include "impeller/playground/playground_impl.h"
#include "impeller/renderer/backend/vulkan/swapchain_vk.h"
#include "impeller/renderer/backend/vulkan/vk.h"

namespace impeller {
Expand All @@ -21,9 +20,8 @@ class PlaygroundImplVK final : public PlaygroundImpl {
private:
std::shared_ptr<fml::ConcurrentMessageLoop> concurrent_loop_;
std::shared_ptr<Context> context_;
size_t current_frame_ = 0;

// windows
// Windows management.
static void DestroyWindowHandle(WindowHandle handle);
using UniqueHandle = std::unique_ptr<void, decltype(&DestroyWindowHandle)>;
UniqueHandle handle_;
Expand All @@ -38,8 +36,6 @@ class PlaygroundImplVK final : public PlaygroundImpl {
std::unique_ptr<Surface> AcquireSurfaceFrame(
std::shared_ptr<Context> context) override;

void SetupSwapchain();

FML_DISALLOW_COPY_AND_ASSIGN(PlaygroundImplVK);
};

Expand Down
68 changes: 36 additions & 32 deletions impeller/renderer/backend/metal/surface_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -43,60 +43,64 @@
return nullptr;
}

TextureDescriptor color0_tex_desc;
color0_tex_desc.storage_mode = StorageMode::kDeviceTransient;
color0_tex_desc.type = TextureType::kTexture2DMultisample;
color0_tex_desc.sample_count = SampleCount::kCount4;
color0_tex_desc.format = color_format;
color0_tex_desc.size = {
TextureDescriptor msaa_tex_desc;
msaa_tex_desc.storage_mode = StorageMode::kDeviceTransient;
msaa_tex_desc.type = TextureType::kTexture2DMultisample;
msaa_tex_desc.sample_count = SampleCount::kCount4;
msaa_tex_desc.format = color_format;
msaa_tex_desc.size = {
static_cast<ISize::Type>(current_drawable.texture.width),
static_cast<ISize::Type>(current_drawable.texture.height)};
color0_tex_desc.usage = static_cast<uint64_t>(TextureUsage::kRenderTarget);
msaa_tex_desc.usage = static_cast<uint64_t>(TextureUsage::kRenderTarget);

auto msaa_tex =
context->GetResourceAllocator()->CreateTexture(color0_tex_desc);
auto msaa_tex = context->GetResourceAllocator()->CreateTexture(msaa_tex_desc);
if (!msaa_tex) {
VALIDATION_LOG << "Could not allocate MSAA resolve texture.";
VALIDATION_LOG << "Could not allocate MSAA color texture.";
return nullptr;
}

msaa_tex->SetLabel("ImpellerOnscreenColorMSAA");

TextureDescriptor color0_resolve_tex_desc;
color0_resolve_tex_desc.format = color_format;
color0_resolve_tex_desc.size = color0_tex_desc.size;
color0_resolve_tex_desc.usage =
static_cast<uint64_t>(TextureUsage::kRenderTarget);
color0_resolve_tex_desc.storage_mode = StorageMode::kDevicePrivate;
TextureDescriptor resolve_tex_desc;
resolve_tex_desc.format = color_format;
resolve_tex_desc.size = msaa_tex_desc.size;
resolve_tex_desc.usage = static_cast<uint64_t>(TextureUsage::kRenderTarget);
resolve_tex_desc.storage_mode = StorageMode::kDevicePrivate;

std::shared_ptr<Texture> resolve_tex =
std::make_shared<TextureMTL>(resolve_tex_desc, current_drawable.texture);
if (!resolve_tex) {
VALIDATION_LOG << "Could not wrap resolve texture.";
return nullptr;
}
resolve_tex->SetLabel("ImpellerOnscreenResolve");

ColorAttachment color0;
color0.texture = msaa_tex;
color0.clear_color = Color::DarkSlateGray();
color0.load_action = LoadAction::kClear;
color0.store_action = StoreAction::kMultisampleResolve;
color0.resolve_texture = std::make_shared<TextureMTL>(
color0_resolve_tex_desc, current_drawable.texture);

TextureDescriptor stencil0_tex;
stencil0_tex.storage_mode = StorageMode::kDeviceTransient;
stencil0_tex.type = TextureType::kTexture2DMultisample;
stencil0_tex.sample_count = SampleCount::kCount4;
stencil0_tex.format =
color0.resolve_texture = resolve_tex;

TextureDescriptor stencil_tex_desc;
stencil_tex_desc.storage_mode = StorageMode::kDeviceTransient;
stencil_tex_desc.type = TextureType::kTexture2DMultisample;
stencil_tex_desc.sample_count = SampleCount::kCount4;
stencil_tex_desc.format =
context->GetDeviceCapabilities().GetDefaultStencilFormat();
stencil0_tex.size = color0_tex_desc.size;
stencil0_tex.usage =
stencil_tex_desc.size = msaa_tex_desc.size;
stencil_tex_desc.usage =
static_cast<TextureUsageMask>(TextureUsage::kRenderTarget);
auto stencil_texture =
context->GetResourceAllocator()->CreateTexture(stencil0_tex);
auto stencil_tex =
context->GetResourceAllocator()->CreateTexture(stencil_tex_desc);

if (!stencil_texture) {
if (!stencil_tex) {
VALIDATION_LOG << "Could not create stencil texture.";
return nullptr;
}
stencil_texture->SetLabel("ImpellerOnscreenStencil");
stencil_tex->SetLabel("ImpellerOnscreenStencil");

StencilAttachment stencil0;
stencil0.texture = stencil_texture;
stencil0.texture = stencil_tex;
stencil0.clear_stencil = 0;
stencil0.load_action = LoadAction::kClear;
stencil0.store_action = StoreAction::kDontCare;
Expand Down
4 changes: 0 additions & 4 deletions impeller/renderer/backend/metal/texture_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@
return false;
}

// TODO(csg): Perhaps the storage mode should be added to the texture
// descriptor so that invalid region replacements on potentially non-host
// visible textures are disallowed. The annoying bit about the API below is
// that there seems to be no error handling guidance.
const auto region =
MTLRegionMake2D(0u, 0u, desc.size.width, desc.size.height);
[texture_ replaceRegion:region //
Expand Down
24 changes: 10 additions & 14 deletions impeller/renderer/backend/vulkan/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,12 @@ impeller_component("vulkan") {
"capabilities_vk.h",
"command_buffer_vk.cc",
"command_buffer_vk.h",
"command_pool_vk.cc",
"command_pool_vk.h",
"commands_vk.cc",
"commands_vk.h",
"command_encoder_vk.cc",
"command_encoder_vk.h",
"context_vk.cc",
"context_vk.h",
"deletion_queue_vk.cc",
"deletion_queue_vk.h",
"descriptor_pool_vk.cc",
"descriptor_pool_vk.h",
"device_buffer_vk.cc",
"device_buffer_vk.h",
"fenced_command_buffer_vk.cc",
"fenced_command_buffer_vk.h",
"formats_vk.cc",
"formats_vk.h",
"pipeline_library_vk.cc",
Expand All @@ -46,14 +38,18 @@ impeller_component("vulkan") {
"shader_function_vk.h",
"shader_library_vk.cc",
"shader_library_vk.h",
"surface_producer_vk.cc",
"surface_producer_vk.h",
"shared_object_vk.cc",
"shared_object_vk.h",
"surface_vk.cc",
"surface_vk.h",
"swapchain_details_vk.cc",
"swapchain_details_vk.h",
"swapchain_image_vk.cc",
"swapchain_image_vk.h",
"swapchain_impl_vk.cc",
"swapchain_impl_vk.h",
"swapchain_vk.cc",
"swapchain_vk.h",
"texture_source_vk.cc",
"texture_source_vk.h",
"texture_vk.cc",
"texture_vk.h",
"vertex_descriptor_vk.cc",
Expand Down
Loading

0 comments on commit 365f348

Please sign in to comment.