Add QueueBase::MakeError
Bug: dawn:68, chromium:1042598 Change-Id: I1cf97e29ecadb520e2641ea01ac6dcf7e908bbd3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15221 Commit-Queue: Natasha Lee <natlee@microsoft.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
352a589fe0
commit
d8f8c29bb2
|
@ -517,10 +517,7 @@ namespace dawn_native {
|
||||||
QueueBase* result = nullptr;
|
QueueBase* result = nullptr;
|
||||||
|
|
||||||
if (ConsumedError(CreateQueueInternal(&result))) {
|
if (ConsumedError(CreateQueueInternal(&result))) {
|
||||||
// If queue creation failure ever becomes possible, we should implement MakeError and
|
return QueueBase::MakeError(this);
|
||||||
// friends for them.
|
|
||||||
UNREACHABLE();
|
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -32,6 +32,19 @@ namespace dawn_native {
|
||||||
QueueBase::QueueBase(DeviceBase* device) : ObjectBase(device) {
|
QueueBase::QueueBase(DeviceBase* device) : ObjectBase(device) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueueBase::QueueBase(DeviceBase* device, ObjectBase::ErrorTag tag) : ObjectBase(device, tag) {
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
QueueBase* QueueBase::MakeError(DeviceBase* device) {
|
||||||
|
return new QueueBase(device, ObjectBase::kError);
|
||||||
|
}
|
||||||
|
|
||||||
|
MaybeError QueueBase::SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) {
|
||||||
|
UNREACHABLE();
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
void QueueBase::Submit(uint32_t commandCount, CommandBufferBase* const* commands) {
|
void QueueBase::Submit(uint32_t commandCount, CommandBufferBase* const* commands) {
|
||||||
DeviceBase* device = GetDevice();
|
DeviceBase* device = GetDevice();
|
||||||
if (device->ConsumedError(device->ValidateIsAlive())) {
|
if (device->ConsumedError(device->ValidateIsAlive())) {
|
||||||
|
|
|
@ -27,14 +27,17 @@ namespace dawn_native {
|
||||||
public:
|
public:
|
||||||
QueueBase(DeviceBase* device);
|
QueueBase(DeviceBase* device);
|
||||||
|
|
||||||
|
static QueueBase* MakeError(DeviceBase* device);
|
||||||
|
|
||||||
// Dawn API
|
// Dawn API
|
||||||
void Submit(uint32_t commandCount, CommandBufferBase* const* commands);
|
void Submit(uint32_t commandCount, CommandBufferBase* const* commands);
|
||||||
void Signal(Fence* fence, uint64_t signalValue);
|
void Signal(Fence* fence, uint64_t signalValue);
|
||||||
Fence* CreateFence(const FenceDescriptor* descriptor);
|
Fence* CreateFence(const FenceDescriptor* descriptor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual MaybeError SubmitImpl(uint32_t commandCount,
|
QueueBase(DeviceBase* device, ObjectBase::ErrorTag tag);
|
||||||
CommandBufferBase* const* commands) = 0;
|
|
||||||
|
virtual MaybeError SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands);
|
||||||
|
|
||||||
MaybeError ValidateSubmit(uint32_t commandCount, CommandBufferBase* const* commands);
|
MaybeError ValidateSubmit(uint32_t commandCount, CommandBufferBase* const* commands);
|
||||||
MaybeError ValidateSignal(const Fence* fence, uint64_t signalValue);
|
MaybeError ValidateSignal(const Fence* fence, uint64_t signalValue);
|
||||||
|
|
Loading…
Reference in New Issue