mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-25 07:53:32 +00:00
This is to get the new version of d3dcompiler_47.dll present in the updated Windows toolchain. Also rolls tools/clang and libc++abi to match the version used by Chromium for this //build and //buildtools revision. Also fixes -Wdeprecated-copy-with-dtor warnings in Dawn. Roll build/ ea192b29d..0ff4b3d4e (529 commits; 1 trivial rolls)ea192b29d2..0ff4b3d4ee
$ git log ea192b29d..0ff4b3d4e --date=short --no-merges --format='%ad %ae %s' 2021-06-22 chromium-autoroll Roll Fuchsia SDK from 5.20210621.3.1 to 5.20210622.0.1 2021-06-22 joelhockey Revert "Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)" 2021-06-22 chromium-autoroll Roll Fuchsia SDK from 5.20210621.1.1 to 5.20210621.3.1 2021-06-21 robliao Add LASTCHANGE_YEAR Support to //build/util/version.py 2021-06-21 chromium-autoroll Roll Fuchsia SDK from 5.20210621.0.1 to 5.20210621.1.1 2021-06-21 stha09 unbundle: add libavcodec/packet.h to shim headers 2021-06-21 thakis Revert "Reland^4 "mac: Temporarily use lld as linker in non-pgo builds"" 2021-06-21 chromium-autoroll Roll Fuchsia SDK from 5.20210620.3.1 to 5.20210621.0.1 2021-06-21 chromium-autoroll Roll Fuchsia SDK from 5.20210620.2.1 to 5.20210620.3.1 2021-06-20 chromium-autoroll Roll Fuchsia SDK from 5.20210620.0.1 to 5.20210620.2.1 2021-06-20 chromium-autoroll Roll Fuchsia SDK from 5.20210619.3.1 to 5.20210620.0.1 2021-06-20 thakis Reland^4 "mac: Temporarily use lld as linker in non-pgo builds" 2021-06-20 chromium-autoroll Roll Fuchsia SDK from 5.20210619.1.1 to 5.20210619.3.1 2021-06-19 chromium-autoroll Roll Fuchsia SDK from 5.20210619.0.1 to 5.20210619.1.1 2021-06-19 chromium-autoroll Roll Fuchsia SDK from 5.20210616.3.1 to 5.20210619.0.1 2021-06-19 brucedawson Updated toolchain with new d3dcompiler_47.dll 2021-06-18 thakis mac: Stop using thin archives in lld builds for now 2021-06-18 robliao Add LASTCHANGE_YEAR to lastchange.py for Automatic Year Substitution 2021-06-18 asully Revert "Reland^3 "mac: Temporarily use lld as linker in non-pgo builds"""" 2021-06-18 thakis Reland^3 "mac: Temporarily use lld as linker in non-pgo builds""" 2021-06-18 bpastene chromeos: Isolate the test image rather than qemu image for VM tests. 2021-06-18 thakis posix: Remove sysroot_ld_path.sh 2021-06-18 gbeaty Add OWNERS files for controlling CQ usage. 2021-06-17 bialpio WebXR: roll ARCore APK version, revert workaround 2021-06-17 thakis Add a comment to install-sysroot.py saying where the output goes 2021-06-17 tikuta build: remove unused run_under_python2 references 2021-06-17 yyanagisawa ignore rewrapper related configs in build/args/chromeos. 2021-06-17 chromium-autoroll Roll Fuchsia SDK from 5.20210616.2.1 to 5.20210616.3.1 2021-06-17 pkotwicz [Build Android] Add tests for incremental javac 2021-06-17 yyanagisawa rewrapper: use linux config for chromeos host compiles. 2021-06-16 bpastene Revert "chromeos: Don't run lacros-related Tast tests on ash-chrome bots." 2021-06-16 miketaylr Revert back to generating chromium_git_revision.h via version.py 2021-06-16 chromium-autoroll Roll Fuchsia SDK from 5.20210615.2.1 to 5.20210616.2.1 2021-06-16 asully Indexeddb: Enable TSAN on CorruptDBRequestHandler 2021-06-16 rnk Give all Clang maintainers OWNERS in //build for cflag changes 2021-06-16 wnwen Android: Increase dex max heap size 2021-06-16 djean [ios] Move ios deployment target to 13.0 2021-06-16 hidehiko Remove dependency to linux/dri from Lacros. 2021-06-15 svenzheng Lacros tests run in parallel 2021-06-15 rnk Revert "Reland "Reland "mac: Temporarily use lld as linker in non-official non-component builds""" 2021-06-15 chromium-autoroll Roll Fuchsia SDK from 5.20210614.3.1 to 5.20210615.2.1 2021-06-15 hferreiro Merge ash/public/cpp/ash_switches.* into ash/constants/ 2021-06-15 thakis Reland "Reland "mac: Temporarily use lld as linker in non-official non-component builds"" 2021-06-15 pkotwicz [Build] Change 'cannot find symbol' compile message. 2021-06-15 chromium-autoroll Roll Fuchsia SDK from 5.20210614.2.1 to 5.20210614.3.1 2021-06-14 antoinedesbois Add config for unresolved symbols 2021-06-14 agrieve Update android resources doc: R.java are from androd_library() 2021-06-14 chromium-autoroll Roll Fuchsia SDK from 5.20210613.3.1 to 5.20210614.2.1 2021-06-14 pkotwicz [Build] Pass accurate GN target name to compile_java.py 2021-06-14 mheikal [Android] Enable unused resources removal on bundle targets (relandx2) (...) 2021-03-30 chonggu [Fuchsia] Rename additional_manifests to additional_manifest_fragments 2021-03-30 chromium-autoroll Roll Fuchsia SDK from 3.20210329.3.1 to 3.20210330.0.1 2021-03-30 weizhong Manual roll of catapult 2021-03-30 chromium-autoroll Roll Fuchsia SDK from 3.20210329.1.1 to 3.20210329.3.1 2021-03-30 rmcelrath Check getActivity method owner in FragmentActivityReplacer 2021-03-30 svenzheng Lacros: ash_clang_x64 uses x11 ozone_platform 2021-03-29 bjoyce Mark UNKNOWN test results as ABORT for result_db. 2021-03-29 chromium-autoroll Roll Fuchsia SDK from 3.20210329.0.1 to 3.20210329.1.1 2021-03-29 pkotwicz Move BuildConfig.template to //build 2021-03-29 thakis Reformat a comment in the win toolchain gn file. 2021-03-29 chromium-autoroll Roll Fuchsia SDK from 3.20210328.3.1 to 3.20210329.0.1 2021-03-29 hidehiko Pass all available FDs from ash-chrome. 2021-03-28 chromium-autoroll Roll Fuchsia SDK from 3.20210328.1.1 to 3.20210328.3.1 2021-03-28 thakis symlink.py: Remove an "unused variable f" lint warning 2021-03-28 chromium-autoroll Roll Fuchsia SDK from 3.20210328.0.1 to 3.20210328.1.1 2021-03-28 chromium-autoroll Roll Fuchsia SDK from 3.20210327.3.1 to 3.20210328.0.1 2021-03-27 chromium-autoroll Roll Fuchsia SDK from 3.20210327.1.1 to 3.20210327.3.1 2021-03-27 chromium-autoroll Roll Fuchsia SDK from 3.20210327.0.1 to 3.20210327.1.1 2021-03-27 chromium-autoroll Roll Fuchsia SDK from 3.20210326.3.1 to 3.20210327.0.1 2021-03-26 chromium-autoroll Roll Fuchsia SDK from 3.20210326.1.1 to 3.20210326.3.1 2021-03-26 chromium-autoroll Roll Fuchsia SDK from 3.20210325.4.1 to 3.20210326.1.1 2021-03-26 chonggu [Fuchsia] Switch web engine and runner tests to use test-cmx fragments 2021-03-26 chromium-autoroll Roll Fuchsia SDK from 3.20210325.2.1 to 3.20210325.4.1 2021-03-25 gangwu Call ClipDescription#isStyledText() in Android S 2021-03-25 hnakashima [Android] Create lookup_dep.py 2021-03-25 bjoyce Change UNKNOWN default status of gtests to CRASH. 2021-03-25 thakis In is_ubsan_security builds, add fsanitize=vptr at gn level, not flag level 2021-03-25 thakis mac: Use llvm-nm when building on a non-mac host 2021-03-25 bjoyce Add additional regex check for crashes. 2021-03-25 chromium-autoroll Roll Fuchsia SDK from 3.20210325.0.1 to 3.20210325.2.1 2021-03-25 rubensf [reclient][nacl] Change nacl executable paths to use '\' on windows. 2021-03-25 hans Add script for analyzing the include graph 2021-03-25 sdefresne Use build/branding_buildflags.h instead of GOOGLE_CHROME_BUILD 2021-03-25 chromium-autoroll Roll Fuchsia SDK from 3.20210324.3.1 to 3.20210325.0.1 2021-03-25 aeubanks Unbreak Linux libFuzzer MSan bot 2021-03-25 chromium-autoroll Roll Fuchsia SDK from 3.20210324.1.1 to 3.20210324.3.1 2021-03-24 dpranke Attempt #4 of "Add test directory -> monorail component metadata to test" 2021-03-24 steveroe [fuchsia] Add test json to warn if Chrome-Fuchsia packages exceed 38.6M 2021-03-24 bsheedy Mark Android emulator as supported config 2021-03-24 akhuang Re-enable precompiled headers on Windows, since it's been fixed in Clang. 2021-03-24 chromium-autoroll Roll Fuchsia SDK from 3.20210324.0.1 to 3.20210324.1.1 2021-03-24 chromium-autoroll Roll Fuchsia SDK from 3.20210323.3.1 to 3.20210324.0.1 2021-03-24 dpranke Update '#!/usr/bin/python' shebangs to '#!/usr/bin/env python'. 2021-03-24 wez [android] Migrate Android toolchain rules to use llvm-{nm|strip}. 2021-03-24 chromium-autoroll Roll Fuchsia SDK from 3.20210323.1.1 to 3.20210323.3.1 2021-03-23 horo Revert "Attempt #3 of "Add test directory -> monorail component metadata.""" 2021-03-23 dpranke Attempt #3 of "Add test directory -> monorail component metadata."" 2021-03-23 chonggu [Fuchsia] Remove unnecessary package vars from yaml files 2021-03-23 wez [clang] Use llvm-nm and llvm-strip when using Clang toolchain. 2021-03-23 chromium-autoroll Roll Fuchsia SDK from 3.20210323.0.1 to 3.20210323.1.1 Roll buildtools/ 69cc9b8a3..9c143ace7 (26 commits; 1 trivial rolls)69cc9b8a3a..9c143ace75
$ git log 69cc9b8a3..9c143ace7 --date=short --no-merges --format='%ad %ae %s' 2021-06-22 joelhockey Revert "Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)" 2021-06-17 ukai Update for roll clang llvmorg-13-init-12576-g643b6407-1 : llvmorg-13-init-12881-g4017d033-1 2021-06-14 ukai Update for roll clang llvmorg-13-init-12491-g055770d5-1 : llvmorg-13-init-12576-g643b6407-1 2021-06-11 ukai Update for roll clang llvmorg-13-init-11649-g4d788fb8-1 : llvmorg-13-init-12491-g055770d5-1 2021-06-09 ukai Revert "update for clang_version=llvmorg-13-init-11999-g50c0aaed-1" 2021-06-07 ukai update for clang_version=llvmorg-13-init-11999-g50c0aaed-1 2021-06-07 ukai fix reclient_cfgs/OWNERS 2021-06-04 ukai update for clang_version=llvmorg-13-init-11649-g4d788fb8-1 2021-06-04 ukai Add OWNERS for buildtools/reclient_cfgs 2021-06-01 ukai Add reclient_cfgs/win-cross-experiments 2021-05-21 rubensf [reclient] Add option for remote links. 2021-05-20 wnwen Android: Fix java_checker ignored directories 2021-05-19 wnwen Android: Fix py3 presubmit compat for java files 2021-05-19 jopalmer [COIL] Change chromium code search type links to use main rather than master for buildtools 2021-05-14 sky cct: calls setClientDataHeaderForNewTab for hidden tabs 2021-05-14 dpranke Reland "Make //buildtools/checkdeps Python3-compatible." 2021-05-12 thakis Revert "Make //buildtools/checkdeps Python3-compatible." 2021-05-12 dpranke Make //buildtools/checkdeps Python3-compatible. 2021-05-03 msavigny [reclient] Fix up reclient nacl wrapper config. 2021-04-30 msavigny [reclient] Fix up reclient c/c++ wrapper config. 2021-03-29 thakis linux: Don't link clang-format against zlib 2021-03-29 thakis linux: Build clang-format in a sysroot 2021-03-29 thakis mac: Don't link clang-format against libz.1.dylib either 2021-03-28 thakis mac: Don't link clang-format against /usr/lib/libncurses.5.4.dylib 2021-03-26 thakis mac: Add clang-format binary that can run on arm. Created with: roll-dep build buildtools Change-Id: I48668fb6b45df25ba3cd2bc04665a78a9c4399ed Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55620 Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
130 lines
5.8 KiB
C++
130 lines
5.8 KiB
C++
// Copyright 2018 The Dawn Authors
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#include "dawn_native/DynamicUploader.h"
|
|
#include "common/Math.h"
|
|
#include "dawn_native/Device.h"
|
|
|
|
namespace dawn_native {
|
|
|
|
DynamicUploader::DynamicUploader(DeviceBase* device) : mDevice(device) {
|
|
mRingBuffers.emplace_back(
|
|
std::unique_ptr<RingBuffer>(new RingBuffer{nullptr, {kRingBufferSize}}));
|
|
}
|
|
|
|
void DynamicUploader::ReleaseStagingBuffer(std::unique_ptr<StagingBufferBase> stagingBuffer) {
|
|
mReleasedStagingBuffers.Enqueue(std::move(stagingBuffer),
|
|
mDevice->GetPendingCommandSerial());
|
|
}
|
|
|
|
ResultOrError<UploadHandle> DynamicUploader::AllocateInternal(uint64_t allocationSize,
|
|
ExecutionSerial serial) {
|
|
// Disable further sub-allocation should the request be too large.
|
|
if (allocationSize > kRingBufferSize) {
|
|
std::unique_ptr<StagingBufferBase> stagingBuffer;
|
|
DAWN_TRY_ASSIGN(stagingBuffer, mDevice->CreateStagingBuffer(allocationSize));
|
|
|
|
UploadHandle uploadHandle;
|
|
uploadHandle.mappedBuffer = static_cast<uint8_t*>(stagingBuffer->GetMappedPointer());
|
|
uploadHandle.stagingBuffer = stagingBuffer.get();
|
|
|
|
ReleaseStagingBuffer(std::move(stagingBuffer));
|
|
return uploadHandle;
|
|
}
|
|
|
|
// Note: Validation ensures size is already aligned.
|
|
// First-fit: find next smallest buffer large enough to satisfy the allocation request.
|
|
RingBuffer* targetRingBuffer = mRingBuffers.back().get();
|
|
for (auto& ringBuffer : mRingBuffers) {
|
|
const RingBufferAllocator& ringBufferAllocator = ringBuffer->mAllocator;
|
|
// Prevent overflow.
|
|
ASSERT(ringBufferAllocator.GetSize() >= ringBufferAllocator.GetUsedSize());
|
|
const uint64_t remainingSize =
|
|
ringBufferAllocator.GetSize() - ringBufferAllocator.GetUsedSize();
|
|
if (allocationSize <= remainingSize) {
|
|
targetRingBuffer = ringBuffer.get();
|
|
break;
|
|
}
|
|
}
|
|
|
|
uint64_t startOffset = RingBufferAllocator::kInvalidOffset;
|
|
if (targetRingBuffer != nullptr) {
|
|
startOffset = targetRingBuffer->mAllocator.Allocate(allocationSize, serial);
|
|
}
|
|
|
|
// Upon failure, append a newly created ring buffer to fulfill the
|
|
// request.
|
|
if (startOffset == RingBufferAllocator::kInvalidOffset) {
|
|
mRingBuffers.emplace_back(
|
|
std::unique_ptr<RingBuffer>(new RingBuffer{nullptr, {kRingBufferSize}}));
|
|
|
|
targetRingBuffer = mRingBuffers.back().get();
|
|
startOffset = targetRingBuffer->mAllocator.Allocate(allocationSize, serial);
|
|
}
|
|
|
|
ASSERT(startOffset != RingBufferAllocator::kInvalidOffset);
|
|
|
|
// Allocate the staging buffer backing the ringbuffer.
|
|
// Note: the first ringbuffer will be lazily created.
|
|
if (targetRingBuffer->mStagingBuffer == nullptr) {
|
|
std::unique_ptr<StagingBufferBase> stagingBuffer;
|
|
DAWN_TRY_ASSIGN(stagingBuffer,
|
|
mDevice->CreateStagingBuffer(targetRingBuffer->mAllocator.GetSize()));
|
|
targetRingBuffer->mStagingBuffer = std::move(stagingBuffer);
|
|
}
|
|
|
|
ASSERT(targetRingBuffer->mStagingBuffer != nullptr);
|
|
|
|
UploadHandle uploadHandle;
|
|
uploadHandle.stagingBuffer = targetRingBuffer->mStagingBuffer.get();
|
|
uploadHandle.mappedBuffer =
|
|
static_cast<uint8_t*>(uploadHandle.stagingBuffer->GetMappedPointer()) + startOffset;
|
|
uploadHandle.startOffset = startOffset;
|
|
|
|
return uploadHandle;
|
|
}
|
|
|
|
void DynamicUploader::Deallocate(ExecutionSerial lastCompletedSerial) {
|
|
// Reclaim memory within the ring buffers by ticking (or removing requests no longer
|
|
// in-flight).
|
|
for (size_t i = 0; i < mRingBuffers.size(); ++i) {
|
|
mRingBuffers[i]->mAllocator.Deallocate(lastCompletedSerial);
|
|
|
|
// Never erase the last buffer as to prevent re-creating smaller buffers
|
|
// again. The last buffer is the largest.
|
|
if (mRingBuffers[i]->mAllocator.Empty() && i < mRingBuffers.size() - 1) {
|
|
mRingBuffers.erase(mRingBuffers.begin() + i);
|
|
}
|
|
}
|
|
mReleasedStagingBuffers.ClearUpTo(lastCompletedSerial);
|
|
}
|
|
|
|
// TODO(dawn:512): Optimize this function so that it doesn't allocate additional memory
|
|
// when it's not necessary.
|
|
ResultOrError<UploadHandle> DynamicUploader::Allocate(uint64_t allocationSize,
|
|
ExecutionSerial serial,
|
|
uint64_t offsetAlignment) {
|
|
ASSERT(offsetAlignment > 0);
|
|
UploadHandle uploadHandle;
|
|
DAWN_TRY_ASSIGN(uploadHandle,
|
|
AllocateInternal(allocationSize + offsetAlignment - 1, serial));
|
|
uint64_t additionalOffset =
|
|
Align(uploadHandle.startOffset, offsetAlignment) - uploadHandle.startOffset;
|
|
uploadHandle.mappedBuffer =
|
|
static_cast<uint8_t*>(uploadHandle.mappedBuffer) + additionalOffset;
|
|
uploadHandle.startOffset += additionalOffset;
|
|
return uploadHandle;
|
|
}
|
|
} // namespace dawn_native
|