Remove deprecated WireClient/Server handlers functions
Remove deprecated functions and change new functions to pure virtual since they are implemented both on dawn and chromium side. Bug: dawn:773 Change-Id: I5adfe42ad1155276f533660b938b869c775025bf Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58100 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
This commit is contained in:
parent
427a5eb9c5
commit
813a855b54
|
@ -303,9 +303,6 @@ namespace dawn_wire { namespace client {
|
||||||
// - Unmap locally on the client
|
// - Unmap locally on the client
|
||||||
// - Server -> Client: Result of MapRequest2
|
// - Server -> Client: Result of MapRequest2
|
||||||
|
|
||||||
// TODO(dawn:608): mDevice->InjectError(WGPUErrorType_Validation) for map oom failure
|
|
||||||
// and separate from buffer destroyed before unmap case
|
|
||||||
|
|
||||||
// mWriteHandle can still be nullptr if buffer has been destroyed before unmap
|
// mWriteHandle can still be nullptr if buffer has been destroyed before unmap
|
||||||
if ((mMapState == MapState::MappedForWrite || mMapState == MapState::MappedAtCreation) &&
|
if ((mMapState == MapState::MappedForWrite || mMapState == MapState::MappedAtCreation) &&
|
||||||
mWriteHandle != nullptr) {
|
mWriteHandle != nullptr) {
|
||||||
|
@ -364,8 +361,6 @@ namespace dawn_wire { namespace client {
|
||||||
BufferUnmapCmd cmd;
|
BufferUnmapCmd cmd;
|
||||||
cmd.self = ToAPI(this);
|
cmd.self = ToAPI(this);
|
||||||
client->SerializeCommand(cmd);
|
client->SerializeCommand(cmd);
|
||||||
// TODO(dawn:608): add tracking mapped status and change to return bool for returning unmap
|
|
||||||
// success/failure
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buffer::Destroy() {
|
void Buffer::Destroy() {
|
||||||
|
|
|
@ -112,31 +112,17 @@ namespace dawn_wire {
|
||||||
// Simply return the base address of the allocation (without applying any offset)
|
// Simply return the base address of the allocation (without applying any offset)
|
||||||
// Returns nullptr if the allocation failed.
|
// Returns nullptr if the allocation failed.
|
||||||
// The data must live at least until the ReadHandle is destructued
|
// The data must live at least until the ReadHandle is destructued
|
||||||
// TODO(dawn:773): change to pure virtual after update on chromium side.
|
virtual const void* GetData() = 0;
|
||||||
virtual const void* GetData() {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gets called when a MapReadCallback resolves.
|
// Gets called when a MapReadCallback resolves.
|
||||||
// deserialize the data update and apply
|
// deserialize the data update and apply
|
||||||
// it to the range (offset, offset + size) of allocation
|
// it to the range (offset, offset + size) of allocation
|
||||||
// There could be nothing to be deserialized (if using shared memory)
|
// There could be nothing to be deserialized (if using shared memory)
|
||||||
// Needs to check potential offset/size OOB and overflow
|
// Needs to check potential offset/size OOB and overflow
|
||||||
// TODO(dawn:773): change to pure virtual after update on chromium side.
|
|
||||||
virtual bool DeserializeDataUpdate(const void* deserializePointer,
|
virtual bool DeserializeDataUpdate(const void* deserializePointer,
|
||||||
size_t deserializeSize,
|
size_t deserializeSize,
|
||||||
size_t offset,
|
size_t offset,
|
||||||
size_t size) {
|
size_t size) = 0;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(dawn:773): remove after update on chromium side.
|
|
||||||
virtual bool DeserializeInitialData(const void* deserializePointer,
|
|
||||||
size_t deserializeSize,
|
|
||||||
const void** data,
|
|
||||||
size_t* dataLength) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ReadHandle(const ReadHandle&) = delete;
|
ReadHandle(const ReadHandle&) = delete;
|
||||||
|
@ -158,40 +144,18 @@ namespace dawn_wire {
|
||||||
// The data returned should be zero-initialized.
|
// The data returned should be zero-initialized.
|
||||||
// The data returned must live at least until the WriteHandle is destructed.
|
// The data returned must live at least until the WriteHandle is destructed.
|
||||||
// On failure, the pointer returned should be null.
|
// On failure, the pointer returned should be null.
|
||||||
// TODO(dawn:773): change to pure virtual after update on chromium side.
|
virtual void* GetData() = 0;
|
||||||
virtual void* GetData() {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the required serialization size for SerializeDataUpdate
|
// Get the required serialization size for SerializeDataUpdate
|
||||||
// TODO(dawn:773): change to pure virtual after update on chromium side.
|
virtual size_t SizeOfSerializeDataUpdate(size_t offset, size_t size) = 0;
|
||||||
virtual size_t SizeOfSerializeDataUpdate(size_t offset, size_t size) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Serialize a command to send the modified contents of
|
// Serialize a command to send the modified contents of
|
||||||
// the subrange (offset, offset + size) of the allocation at buffer unmap
|
// the subrange (offset, offset + size) of the allocation at buffer unmap
|
||||||
// This subrange is always the whole mapped region for now
|
// This subrange is always the whole mapped region for now
|
||||||
// There could be nothing to be serialized (if using shared memory)
|
// There could be nothing to be serialized (if using shared memory)
|
||||||
// TODO(dawn:773): change to pure virtual after update on chromium side.
|
|
||||||
virtual void SerializeDataUpdate(void* serializePointer,
|
virtual void SerializeDataUpdate(void* serializePointer,
|
||||||
size_t offset,
|
size_t offset,
|
||||||
size_t size) {
|
size_t size) = 0;
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(dawn:773): remove after update on chromium side.
|
|
||||||
virtual std::pair<void*, size_t> Open() {
|
|
||||||
return std::make_pair(nullptr, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(dawn:773): remove after update on chromium side.
|
|
||||||
virtual size_t SerializeFlushSize() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(dawn:773): remove after update on chromium side.
|
|
||||||
virtual void SerializeFlush(void* serializePointer) {
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WriteHandle(const WriteHandle&) = delete;
|
WriteHandle(const WriteHandle&) = delete;
|
||||||
|
|
|
@ -93,32 +93,16 @@ namespace dawn_wire {
|
||||||
|
|
||||||
// Return the size of the command serialized if
|
// Return the size of the command serialized if
|
||||||
// SerializeDataUpdate is called with the same offset/size args
|
// SerializeDataUpdate is called with the same offset/size args
|
||||||
// TODO(dawn:773): change to pure virtual after update on chromium side.
|
virtual size_t SizeOfSerializeDataUpdate(size_t offset, size_t size) = 0;
|
||||||
virtual size_t SizeOfSerializeDataUpdate(size_t offset, size_t size) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gets called when a MapReadCallback resolves.
|
// Gets called when a MapReadCallback resolves.
|
||||||
// Serialize the data update for the range (offset, offset + size) into
|
// Serialize the data update for the range (offset, offset + size) into
|
||||||
// |serializePointer| to the client There could be nothing to be serialized (if
|
// |serializePointer| to the client There could be nothing to be serialized (if
|
||||||
// using shared memory)
|
// using shared memory)
|
||||||
// TODO(dawn:773): change to pure virtual after update on chromium side.
|
|
||||||
virtual void SerializeDataUpdate(const void* data,
|
virtual void SerializeDataUpdate(const void* data,
|
||||||
size_t offset,
|
size_t offset,
|
||||||
size_t size,
|
size_t size,
|
||||||
void* serializePointer) {
|
void* serializePointer) = 0;
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(dawn:773): remove after update on chromium side.
|
|
||||||
virtual size_t SerializeInitialDataSize(const void* data, size_t dataLength) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(dawn:773): remove after update on chromium side.
|
|
||||||
virtual void SerializeInitialData(const void* data,
|
|
||||||
size_t dataLength,
|
|
||||||
void* serializePointer) {
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ReadHandle(const ReadHandle&) = delete;
|
ReadHandle(const ReadHandle&) = delete;
|
||||||
|
|
Loading…
Reference in New Issue