Add missing descriptors that are present in WebGPU.

These are the CommandEncoder, ComputePass and CommandBuffer descriptors
that contains nothing but a debug name for now but are important for
later extensibility. Defaults are added so the C++ API doesn't require
the descriptors to be passed as arguments.

Also renames variables named "info" for RenderPassDescriptor to
"descriptor" as is now the standard in the codebase.

BUG=dawn:22

Change-Id: I9de4cfbbce952d01fb79ed1d9f34825a6fa174f9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8686
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Corentin Wallez
2019-07-10 20:43:13 +00:00
committed by Commit Bot service account
parent 27e67b5f97
commit 4b90c47ce0
28 changed files with 164 additions and 105 deletions

View File

@@ -326,8 +326,9 @@ namespace dawn_native { namespace opengl {
}
} // namespace
CommandBuffer::CommandBuffer(Device* device, CommandEncoderBase* encoder)
: CommandBufferBase(device, encoder), mCommands(encoder->AcquireCommands()) {
CommandBuffer::CommandBuffer(CommandEncoderBase* encoder,
const CommandBufferDescriptor* descriptor)
: CommandBufferBase(encoder, descriptor), mCommands(encoder->AcquireCommands()) {
}
CommandBuffer::~CommandBuffer() {

View File

@@ -28,7 +28,7 @@ namespace dawn_native { namespace opengl {
class CommandBuffer : public CommandBufferBase {
public:
CommandBuffer(Device* device, CommandEncoderBase* encoder);
CommandBuffer(CommandEncoderBase* encoder, const CommandBufferDescriptor* descriptor);
~CommandBuffer();
void Execute();

View File

@@ -65,8 +65,9 @@ namespace dawn_native { namespace opengl {
ResultOrError<BufferBase*> Device::CreateBufferImpl(const BufferDescriptor* descriptor) {
return new Buffer(this, descriptor);
}
CommandBufferBase* Device::CreateCommandBuffer(CommandEncoderBase* encoder) {
return new CommandBuffer(this, encoder);
CommandBufferBase* Device::CreateCommandBuffer(CommandEncoderBase* encoder,
const CommandBufferDescriptor* descriptor) {
return new CommandBuffer(encoder, descriptor);
}
ResultOrError<ComputePipelineBase*> Device::CreateComputePipelineImpl(
const ComputePipelineDescriptor* descriptor) {

View File

@@ -44,7 +44,8 @@ namespace dawn_native { namespace opengl {
void SubmitFenceSync();
// Dawn API
CommandBufferBase* CreateCommandBuffer(CommandEncoderBase* encoder) override;
CommandBufferBase* CreateCommandBuffer(CommandEncoderBase* encoder,
const CommandBufferDescriptor* descriptor) override;
Serial GetCompletedCommandSerial() const final override;
Serial GetLastSubmittedCommandSerial() const final override;