Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions impeller/renderer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,15 @@ impeller_component("renderer_dart_unittests") {

sources = [ "renderer_dart_unittests.cc" ]

public_configs = [ "//flutter:export_dynamic_symbols" ]

deps = [
":renderer",
"../fixtures:flutter_gpu_fixtures",
"../fixtures:flutter_gpu_shaders",
"../playground:playground_test",
"//flutter/lib/gpu",
"//flutter/lib/snapshot",
"//flutter/runtime:runtime",
"//flutter/testing:fixture_test",
"//flutter/testing:testing",
Expand Down
3 changes: 2 additions & 1 deletion lib/gpu/host_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ size_t HostBuffer::EmplaceBytes(const tonic::DartByteData& byte_data) {
host_buffer_->Emplace(byte_data.data(), byte_data.length_in_bytes(),
impeller::DefaultUniformAlignment());
emplacements_[current_offset_] = view;
size_t previous_offset = current_offset_;
current_offset_ += view.range.length;
return view.range.offset;
return previous_offset;
}

std::optional<impeller::BufferView> HostBuffer::GetBufferViewForOffset(
Expand Down
4 changes: 3 additions & 1 deletion lib/gpu/host_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class HostBuffer : public RefCountedDartWrappable<HostBuffer> {
extern "C" {

FLUTTER_GPU_EXPORT
extern void InternalFlutterGpu_HostBuffer_Initialize(Dart_Handle wrapper);
extern void InternalFlutterGpu_HostBuffer_Initialize(
Dart_Handle wrapper,
flutter::gpu::Context* context);

FLUTTER_GPU_EXPORT
extern size_t InternalFlutterGpu_HostBuffer_EmplaceBytes(
Expand Down
2 changes: 1 addition & 1 deletion lib/gpu/lib/src/buffer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ base class HostBuffer extends NativeFieldWrapperClass1 with Buffer {
}

/// Wrap with native counterpart.
@Native<Void Function(Handle, Handle)>(
@Native<Void Function(Handle, Pointer<Void>)>(
symbol: 'InternalFlutterGpu_HostBuffer_Initialize')
external void _initialize(GpuContext gpuContext);

Expand Down
10 changes: 10 additions & 0 deletions testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,16 @@ def make_test(name, flags=None, extra_env=None):
extra_env=extra_env,
)

# Run the Flutter GPU test suite.
run_engine_executable(
build_dir,
'impeller_dart_unittests',
executable_filter,
shuffle_flags + ['--enable_vulkan_validation'],
coverage=coverage,
extra_env=extra_env,
)


def run_engine_benchmarks(build_dir, executable_filter):
logger.info('Running Engine Benchmarks.')
Expand Down