Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e87f8ea

Browse files
authored
Merge branch 'main' into bdero/gaussian-blur-alphamask
2 parents 7e417dc + 415e624 commit e87f8ea

File tree

10 files changed

+28
-71
lines changed

10 files changed

+28
-71
lines changed

DEPS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ vars = {
4848
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS
4949
# You can use //tools/dart/create_updated_flutter_deps.py to produce
5050
# updated revision list of existing dependencies.
51-
'dart_revision': '2bb9c265fa24f1ba98239b23b15ecf5bfb2dbb22',
51+
'dart_revision': '8481b8f08044eeb94d60d4d5dfc3c26801d43f2c',
5252

5353
# WARNING: DO NOT EDIT MANUALLY
5454
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
@@ -386,7 +386,7 @@ deps = {
386386
Var('dart_git') + '/json_rpc_2.git@0280ac6cb4f3905d81c47ba927123ba2b95f7940',
387387

388388
'src/third_party/dart/third_party/pkg/linter':
389-
Var('dart_git') + '/linter.git@7c7db85d29b46af51e3f4a5e0a33440c4e3791fc',
389+
Var('dart_git') + '/linter.git@d116555dc05bd29a17842e36e684cb9b4a608e1e',
390390

391391
'src/third_party/dart/third_party/pkg/logging':
392392
Var('dart_git') + '/logging.git@abef3717d958158eb8b0ddb2871f4b15a9804cd4',
@@ -455,7 +455,7 @@ deps = {
455455
Var('dart_git') + '/test_reflective_loader.git@c4c2d5c3f94a96f3fc79e9e28944fba391bc544c',
456456

457457
'src/third_party/dart/third_party/pkg/tools':
458-
Var('dart_git') + '/tools.git@8d18d01192077e85839539de9afdf679622445c8',
458+
Var('dart_git') + '/tools.git@9ce9f67c3ff2ac835ed0045e71d22188e2a19562',
459459

460460
'src/third_party/dart/third_party/pkg/typed_data':
461461
Var('dart_git') + '/typed_data.git@f858046fb420cf644e7d8cb86b7893f2830d8a6c',

impeller/aiks/aiks_unittests.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,10 +1823,6 @@ TEST_P(AiksTest, SiblingSaveLayerBoundsAreRespected) {
18231823
}
18241824

18251825
TEST_P(AiksTest, CanRenderClippedLayers) {
1826-
if (GetBackend() == PlaygroundBackend::kVulkan) {
1827-
GTEST_SKIP_("Temporarily disabled.");
1828-
}
1829-
18301826
Canvas canvas;
18311827

18321828
canvas.DrawPaint({.color = Color::White()});
@@ -1877,9 +1873,6 @@ TEST_P(AiksTest, SaveLayerFiltersScaleWithTransform) {
18771873
}
18781874

18791875
TEST_P(AiksTest, SceneColorSource) {
1880-
if (GetBackend() == PlaygroundBackend::kVulkan) {
1881-
GTEST_SKIP_("Temporarily disabled.");
1882-
}
18831876
// Load up the scene.
18841877
auto mapping =
18851878
flutter::testing::OpenFixtureAsMapping("flutter_logo_baked.glb.ipscene");

impeller/display_list/display_list_unittests.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,10 +679,6 @@ TEST_P(DisplayListTest, SaveLayerWithBlendFiltersAndAlphaDrawCorrectly) {
679679
}
680680

681681
TEST_P(DisplayListTest, CanDrawBackdropFilter) {
682-
if (GetBackend() == PlaygroundBackend::kVulkan) {
683-
GTEST_SKIP_("Temporarily disabled.");
684-
}
685-
686682
auto texture = CreateTextureForFixture("embarcadero.jpg");
687683

688684
auto callback = [&]() {

impeller/entity/entity_pass_target.cc

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "impeller/entity/entity_pass_target.h"
66

7+
#include "impeller/base/validation.h"
8+
#include "impeller/renderer/formats.h"
79
#include "impeller/renderer/texture.h"
810

911
namespace impeller {
@@ -15,8 +17,16 @@ EntityPassTarget::EntityPassTarget(const RenderTarget& render_target,
1517

1618
std::shared_ptr<Texture> EntityPassTarget::Flip(Allocator& allocator) {
1719
auto color0 = target_.GetColorAttachments().find(0)->second;
20+
if (!color0.resolve_texture) {
21+
VALIDATION_LOG << "EntityPassTarget Flip should never be called for a "
22+
"non-MSAA target.";
23+
// ...because there is never a circumstance where doing so would be
24+
// necessary. Unlike MSAA passes, non-MSAA passes can be trivially loaded
25+
// with `LoadAction::kLoad`.
26+
return color0.texture;
27+
}
1828

19-
if (supports_read_from_resolve_ && color0.resolve_texture) {
29+
if (supports_read_from_resolve_) {
2030
// Just return the current resolve texture, which is safe to read in the
2131
// next render pass that'll resolve to `target_`.
2232
//
@@ -26,16 +36,16 @@ std::shared_ptr<Texture> EntityPassTarget::Flip(Allocator& allocator) {
2636

2737
if (!secondary_color_texture_) {
2838
// The second texture is allocated lazily to avoid unused allocations.
29-
TextureDescriptor new_descriptor = color0.texture->GetTextureDescriptor();
39+
TextureDescriptor new_descriptor =
40+
color0.resolve_texture->GetTextureDescriptor();
3041
secondary_color_texture_ = allocator.CreateTexture(new_descriptor);
3142

3243
if (!secondary_color_texture_) {
3344
return nullptr;
3445
}
3546
}
3647

37-
std::swap(color0.resolve_texture ? color0.resolve_texture : color0.texture,
38-
secondary_color_texture_);
48+
std::swap(color0.resolve_texture, secondary_color_texture_);
3949

4050
target_.SetColorAttachment(color0, 0);
4151

impeller/renderer/backend/vulkan/allocator_vk.cc

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -311,37 +311,6 @@ class AllocatedTextureSourceVK final : public TextureSourceVK {
311311
}
312312
}
313313

314-
bool SetContents(const TextureDescriptor& desc,
315-
const uint8_t* contents,
316-
size_t length,
317-
size_t slice) override {
318-
void* data = nullptr;
319-
if (::vmaMapMemory(allocator_, allocation_, &data) != VK_SUCCESS) {
320-
VALIDATION_LOG << "Could not map texture memory to write to.";
321-
return false;
322-
}
323-
324-
std::memcpy(static_cast<uint8_t*>(data) + (length * slice), //
325-
contents, //
326-
length //
327-
);
328-
329-
const auto flushed = ::vmaFlushAllocation(allocator_, // allocator
330-
allocation_, // allocation
331-
length * slice, // offset
332-
length // size
333-
) == VK_SUCCESS;
334-
335-
::vmaUnmapMemory(allocator_, allocation_);
336-
337-
if (!flushed) {
338-
VALIDATION_LOG << "Could not flush written mapped memory.";
339-
return false;
340-
}
341-
342-
return true;
343-
}
344-
345314
bool IsValid() const { return is_valid_; }
346315

347316
vk::Image GetImage() const override { return image_; }

impeller/renderer/backend/vulkan/context_vk.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ vk::Device ContextVK::GetDevice() const {
397397
}
398398

399399
std::unique_ptr<Surface> ContextVK::AcquireNextSurface() {
400+
TRACE_EVENT0("impeller", __FUNCTION__);
400401
auto surface = swapchain_ ? swapchain_->AcquireNextDrawable() : nullptr;
401402
if (surface && pipeline_library_) {
402403
pipeline_library_->DidAcquireSurfaceFrame();

impeller/renderer/backend/vulkan/swapchain_impl_vk.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct FrameSynchronizer {
2929
if (acquire_res.result != vk::Result::eSuccess ||
3030
render_res.result != vk::Result::eSuccess ||
3131
present_res.result != vk::Result::eSuccess) {
32-
VALIDATION_LOG << "Could not create synchornizer.";
32+
VALIDATION_LOG << "Could not create synchronizer.";
3333
return;
3434
}
3535
acquire = std::move(acquire_res.value);
@@ -41,14 +41,18 @@ struct FrameSynchronizer {
4141
~FrameSynchronizer() = default;
4242

4343
bool WaitForFence(const vk::Device& device) {
44-
if (device.waitForFences(
44+
if (auto result = device.waitForFences(
4545
*acquire, // fence
4646
true, // wait all
4747
std::numeric_limits<uint64_t>::max() // timeout (ns)
48-
) != vk::Result::eSuccess) {
48+
);
49+
result != vk::Result::eSuccess) {
50+
VALIDATION_LOG << "Fence wait failed: " << vk::to_string(result);
4951
return false;
5052
}
51-
if (device.resetFences(*acquire) != vk::Result::eSuccess) {
53+
if (auto result = device.resetFences(*acquire);
54+
result != vk::Result::eSuccess) {
55+
VALIDATION_LOG << "Could not reset fence: " << vk::to_string(result);
5256
return false;
5357
}
5458
return true;

impeller/renderer/backend/vulkan/texture_source_vk.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,4 @@ bool TextureSourceVK::SetLayout(const LayoutTransition& transition) const {
5858
return true;
5959
}
6060

61-
bool TextureSourceVK::SetContents(const TextureDescriptor& desc,
62-
const uint8_t* contents,
63-
size_t length,
64-
size_t slice) {
65-
return false;
66-
}
67-
6861
} // namespace impeller

impeller/renderer/backend/vulkan/texture_source_vk.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ class TextureSourceVK {
1818

1919
const TextureDescriptor& GetTextureDescriptor() const;
2020

21-
virtual bool SetContents(const TextureDescriptor& desc,
22-
const uint8_t* contents,
23-
size_t length,
24-
size_t slice);
25-
2621
virtual vk::Image GetImage() const = 0;
2722

2823
virtual vk::ImageView GetImageView() const = 0;

impeller/renderer/renderer_unittests.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,6 @@ TEST_P(RendererTest, CanRenderMultiplePrimitives) {
278278
}
279279

280280
TEST_P(RendererTest, CanRenderToTexture) {
281-
if (GetBackend() == PlaygroundBackend::kVulkan) {
282-
GTEST_SKIP_("Temporarily disabled.");
283-
}
284281
using VS = BoxFadeVertexShader;
285282
using FS = BoxFadeFragmentShader;
286283
auto context = GetContext();
@@ -312,9 +309,9 @@ TEST_P(RendererTest, CanRenderToTexture) {
312309
ASSERT_TRUE(bridge && boston);
313310
auto sampler = context->GetSamplerLibrary()->GetSampler({});
314311
ASSERT_TRUE(sampler);
315-
316312
std::shared_ptr<RenderPass> r2t_pass;
317-
313+
auto cmd_buffer = context->CreateCommandBuffer();
314+
ASSERT_TRUE(cmd_buffer);
318315
{
319316
ColorAttachment color0;
320317
color0.load_action = LoadAction::kClear;
@@ -352,7 +349,6 @@ TEST_P(RendererTest, CanRenderToTexture) {
352349
RenderTarget r2t_desc;
353350
r2t_desc.SetColorAttachment(color0, 0u);
354351
r2t_desc.SetStencilAttachment(stencil0);
355-
auto cmd_buffer = context->CreateCommandBuffer();
356352
r2t_pass = cmd_buffer->CreateRenderPass(r2t_desc);
357353
ASSERT_TRUE(r2t_pass && r2t_pass->IsValid());
358354
}

0 commit comments

Comments
 (0)