diff --git a/dawn.json b/dawn.json index 64fca2adb7..72074db8eb 100644 --- a/dawn.json +++ b/dawn.json @@ -175,14 +175,6 @@ "buffer": { "category": "object", "methods": [ - { - "name": "set sub data", - "args": [ - {"name": "start", "type": "uint64_t"}, - {"name": "count", "type": "uint64_t"}, - {"name": "data", "type": "void", "annotation": "const*", "length": "count"} - ] - }, { "name": "map read async", "args": [ diff --git a/dawn_wire.json b/dawn_wire.json index 51ab477805..b2256a5a52 100644 --- a/dawn_wire.json +++ b/dawn_wire.json @@ -27,12 +27,6 @@ { "name": "handle create info length", "type": "uint64_t" }, { "name": "handle create info", "type": "uint8_t", "annotation": "const*", "length": "handle create info length", "skip_serialize": true} ], - "buffer set sub data internal": [ - {"name": "buffer id", "type": "ObjectId" }, - {"name": "start", "type": "uint64_t"}, - {"name": "count", "type": "uint64_t"}, - {"name": "data", "type": "uint8_t", "annotation": "const*", "length": "count"} - ], "buffer update mapped data": [ { "name": "buffer id", "type": "ObjectId" }, { "name": "write flush info length", "type": "uint64_t" }, @@ -105,7 +99,6 @@ "BufferMapAsync", "BufferMapReadAsync", "BufferMapWriteAsync", - "BufferSetSubData", "BufferGetConstMappedRange", "BufferGetMappedRange", "DeviceCreateBuffer", diff --git a/src/dawn_native/Buffer.cpp b/src/dawn_native/Buffer.cpp index 1fcc3be91b..4dd1f3a086 100644 --- a/src/dawn_native/Buffer.cpp +++ b/src/dawn_native/Buffer.cpp @@ -271,17 +271,6 @@ namespace dawn_native { } } - void BufferBase::SetSubData(uint64_t start, uint64_t count, const void* data) { - if (count > uint64_t(std::numeric_limits::max())) { - GetDevice()->HandleError(InternalErrorType::Validation, "count too big"); - } - - Ref queue = AcquireRef(GetDevice()->GetDefaultQueue()); - GetDevice()->EmitDeprecationWarning( - "Buffer::SetSubData is deprecate. Use Queue::WriteBuffer instead"); - queue->WriteBuffer(this, start, data, static_cast(count)); - } - void BufferBase::MapReadAsync(WGPUBufferMapReadCallback callback, void* userdata) { GetDevice()->EmitDeprecationWarning( "Buffer::MapReadAsync is deprecated. Use Buffer::MapAsync instead"); diff --git a/src/dawn_native/Buffer.h b/src/dawn_native/Buffer.h index 12aaadeff4..1dd5278ce7 100644 --- a/src/dawn_native/Buffer.h +++ b/src/dawn_native/Buffer.h @@ -61,7 +61,6 @@ namespace dawn_native { void SetIsDataInitialized(); // Dawn API - void SetSubData(uint64_t start, uint64_t count, const void* data); void MapReadAsync(WGPUBufferMapReadCallback callback, void* userdata); void MapWriteAsync(WGPUBufferMapWriteCallback callback, void* userdata); void MapAsync(wgpu::MapMode mode, diff --git a/src/dawn_wire/client/Buffer.cpp b/src/dawn_wire/client/Buffer.cpp index f744ee6755..86f5944cc4 100644 --- a/src/dawn_wire/client/Buffer.cpp +++ b/src/dawn_wire/client/Buffer.cpp @@ -417,16 +417,6 @@ namespace dawn_wire { namespace client { device->GetClient()->SerializeCommand(cmd); } - void Buffer::SetSubData(uint64_t start, uint64_t count, const void* data) { - BufferSetSubDataInternalCmd cmd; - cmd.bufferId = id; - cmd.start = start; - cmd.count = count; - cmd.data = static_cast(data); - - device->GetClient()->SerializeCommand(cmd); - } - bool Buffer::IsMappedForReading() const { return mReadHandle != nullptr; } diff --git a/src/dawn_wire/client/Buffer.h b/src/dawn_wire/client/Buffer.h index 1143779f99..5c32c751fc 100644 --- a/src/dawn_wire/client/Buffer.h +++ b/src/dawn_wire/client/Buffer.h @@ -51,8 +51,6 @@ namespace dawn_wire { namespace client { void Destroy(); - void SetSubData(uint64_t start, uint64_t count, const void* data); - private: bool IsMappedForReading() const; bool IsMappedForWriting() const; diff --git a/src/dawn_wire/server/ServerBuffer.cpp b/src/dawn_wire/server/ServerBuffer.cpp index dd71638de9..f85ff15414 100644 --- a/src/dawn_wire/server/ServerBuffer.cpp +++ b/src/dawn_wire/server/ServerBuffer.cpp @@ -168,24 +168,6 @@ namespace dawn_wire { namespace server { return true; } - bool Server::DoBufferSetSubDataInternal(ObjectId bufferId, - uint64_t start, - uint64_t offset, - const uint8_t* data) { - // The null object isn't valid as `self` - if (bufferId == 0) { - return false; - } - - auto* buffer = BufferObjects().Get(bufferId); - if (buffer == nullptr) { - return false; - } - - mProcs.bufferSetSubData(buffer->handle, start, offset, data); - return true; - } - bool Server::DoBufferUpdateMappedData(ObjectId bufferId, uint64_t writeFlushInfoLength, const uint8_t* writeFlushInfo) { diff --git a/src/tests/end2end/DeprecatedAPITests.cpp b/src/tests/end2end/DeprecatedAPITests.cpp index bc0bca9bf4..66fc4c4c06 100644 --- a/src/tests/end2end/DeprecatedAPITests.cpp +++ b/src/tests/end2end/DeprecatedAPITests.cpp @@ -58,30 +58,6 @@ class DeprecationTests : public DawnTest { } \ } while (0) -// Test that using SetSubData emits a deprecation warning. -TEST_P(DeprecationTests, SetSubDataDeprecated) { - wgpu::BufferDescriptor descriptor; - descriptor.usage = wgpu::BufferUsage::CopyDst; - descriptor.size = 4; - wgpu::Buffer buffer = device.CreateBuffer(&descriptor); - - EXPECT_DEPRECATION_WARNING(buffer.SetSubData(0, 0, nullptr)); -} - -// Test that using SetSubData works -TEST_P(DeprecationTests, SetSubDataStillWorks) { - DAWN_SKIP_TEST_IF(IsNull()); - - wgpu::BufferDescriptor descriptor; - descriptor.usage = wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::CopySrc; - descriptor.size = 4; - wgpu::Buffer buffer = device.CreateBuffer(&descriptor); - - uint32_t data = 2020; - EXPECT_DEPRECATION_WARNING(buffer.SetSubData(0, 4, &data)); - EXPECT_BUFFER_U32_EQ(data, buffer, 0); -} - DAWN_INSTANTIATE_TEST(DeprecationTests, D3D12Backend(), MetalBackend(),