Enable Queue, Device labels to be set. (Take 2)

Queue labels can be set by the defaultQueue.label member of the device
descriptor or the setQueue method.

Device labels can be set label member of the device
descriptor or the setQueue method.

D3D12 and VK backend label support included.

Bug: dawn:1323
Change-Id: Ic44f1fac268c20d5338220eaf959d949a5f66536
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85843
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This commit is contained in:
Brandon Jones
2022-04-12 03:28:40 +00:00
committed by Dawn LUCI CQ
parent 1ed28fbdfd
commit 8085367233
24 changed files with 168 additions and 68 deletions

View File

@@ -39,7 +39,7 @@ namespace dawn::native::opengl {
const DeviceDescriptor* descriptor,
const OpenGLFunctions& functions) {
Ref<Device> device = AcquireRef(new Device(adapter, descriptor, functions));
DAWN_TRY(device->Initialize());
DAWN_TRY(device->Initialize(descriptor));
return device;
}
@@ -53,11 +53,11 @@ namespace dawn::native::opengl {
Destroy();
}
MaybeError Device::Initialize() {
MaybeError Device::Initialize(const DeviceDescriptor* descriptor) {
InitTogglesFromDriver();
mFormatTable = BuildGLFormatTable();
return DeviceBase::Initialize(new Queue(this));
return DeviceBase::Initialize(AcquireRef(new Queue(this, &descriptor->defaultQueue)));
}
void Device::InitTogglesFromDriver() {

View File

@@ -42,7 +42,7 @@ namespace dawn::native::opengl {
const OpenGLFunctions& functions);
~Device() override;
MaybeError Initialize();
MaybeError Initialize(const DeviceDescriptor* descriptor);
// Contains all the OpenGL entry points, glDoFoo is called via device->gl.DoFoo.
const OpenGLFunctions gl;

View File

@@ -23,7 +23,8 @@
namespace dawn::native::opengl {
Queue::Queue(Device* device) : QueueBase(device) {
Queue::Queue(Device* device, const QueueDescriptor* descriptor)
: QueueBase(device, descriptor) {
}
MaybeError Queue::SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) {

View File

@@ -23,7 +23,7 @@ namespace dawn::native::opengl {
class Queue final : public QueueBase {
public:
Queue(Device* device);
Queue(Device* device, const QueueDescriptor* descriptor);
private:
MaybeError SubmitImpl(uint32_t commandCount, CommandBufferBase* const* commands) override;