Memory manager: buffer uploads (Metal+refactor) - Part 3

Manages a single persistently mapped GPU heap which is sub-allocated
inside of ring-buffer for uploads. To handle larger buffers without additional
unused heaps, ring buffers are created on-demand.

BUG=dawn:28
TEST=dawn_unittests

Change-Id: If4d3e717186895b1409502c1dea5ab751a4776b2
Reviewed-on: https://dawn-review.googlesource.com/c/4440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
This commit is contained in:
Bryan Bernhart
2019-02-15 21:18:40 +00:00
committed by Commit Bot service account
parent 695b68d100
commit 67a73bd9fa
31 changed files with 147 additions and 190 deletions

View File

@@ -180,10 +180,6 @@ TEST_P(BufferSetSubDataTests, SmallDataAtOffset) {
// Stress test for many calls to SetSubData
TEST_P(BufferSetSubDataTests, ManySetSubData) {
// TODO(cwallez@chromium.org): Use ringbuffers for SetSubData on explicit APIs.
// otherwise this creates too many resources and can take freeze the driver(?)
DAWN_SKIP_TEST_IF(IsMetal());
// Note: Increasing the size of the buffer will likely cause timeout issues.
// In D3D12, timeout detection occurs when the GPU scheduler tries but cannot preempt the task
// executing these commands in-flight. If this takes longer than ~2s, a device reset occurs and

View File

@@ -396,7 +396,7 @@ TEST_P(CopyTests_T2B, Texture2DArrayRegion) {
// Test that copying texture 2D array mips with 256-byte aligned sizes works
TEST_P(CopyTests_T2B, Texture2DArrayMip) {
// TODO(b-brber): Figure out why this test fails on Intel Linux.
// TODO(bryan.bernhart@intel.com): Figure out why this test fails on Intel Linux.
// See https://bugs.chromium.org/p/dawn/issues/detail?id=101
DAWN_SKIP_TEST_IF(IsLinux() && IsVulkan() && IsIntel());
constexpr uint32_t kWidth = 256;

View File

@@ -33,7 +33,7 @@ namespace {
class RingBufferTests : public testing::Test {
protected:
void SetUp() override {
// TODO(b-brber): Create this device through the adapter.
// TODO(bryan.bernhart@intel.com): Create this device through the adapter.
mDevice = std::make_unique<null::Device>(/*adapter*/ nullptr);
}
@@ -165,7 +165,7 @@ TEST_F(RingBufferTests, RingBufferSubAlloc) {
// In this example, Tick(8) could not reclaim the wasted bytes. The wasted bytes
// were add to F9's sub-allocation.
// TODO(b-brber): Decide if Tick(8) should free these wasted bytes.
// TODO(bryan.bernhart@intel.com): Decide if Tick(8) should free these wasted bytes.
ASSERT_EQ(offset, 0u);
ASSERT_EQ(buffer->GetUsedSize(), frameSizeInBytes * maxNumOfFrames);