mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
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:
committed by
Commit Bot service account
parent
27e67b5f97
commit
4b90c47ce0
@@ -19,8 +19,9 @@
|
||||
|
||||
namespace dawn_native {
|
||||
|
||||
CommandBufferBase::CommandBufferBase(DeviceBase* device, CommandEncoderBase* encoder)
|
||||
: ObjectBase(device), mResourceUsages(encoder->AcquireResourceUsages()) {
|
||||
CommandBufferBase::CommandBufferBase(CommandEncoderBase* encoder,
|
||||
const CommandBufferDescriptor*)
|
||||
: ObjectBase(encoder->GetDevice()), mResourceUsages(encoder->AcquireResourceUsages()) {
|
||||
}
|
||||
|
||||
CommandBufferBase::CommandBufferBase(DeviceBase* device, ObjectBase::ErrorTag tag)
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace dawn_native {
|
||||
|
||||
class CommandBufferBase : public ObjectBase {
|
||||
public:
|
||||
CommandBufferBase(DeviceBase* device, CommandEncoderBase* encoder);
|
||||
CommandBufferBase(CommandEncoderBase* encoder, const CommandBufferDescriptor* descriptor);
|
||||
static CommandBufferBase* MakeError(DeviceBase* device);
|
||||
|
||||
const CommandBufferResourceUsage& GetResourceUsages() const;
|
||||
|
||||
@@ -444,32 +444,37 @@ namespace dawn_native {
|
||||
}
|
||||
|
||||
MaybeError ValidateRenderPassDescriptor(const DeviceBase* device,
|
||||
const RenderPassDescriptor* renderPass,
|
||||
const RenderPassDescriptor* descriptor,
|
||||
uint32_t* width,
|
||||
uint32_t* height,
|
||||
uint32_t* sampleCount) {
|
||||
if (renderPass->colorAttachmentCount > kMaxColorAttachments) {
|
||||
if (descriptor->colorAttachmentCount > kMaxColorAttachments) {
|
||||
return DAWN_VALIDATION_ERROR("Setting color attachments out of bounds");
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < renderPass->colorAttachmentCount; ++i) {
|
||||
DAWN_TRY(ValidateRenderPassColorAttachment(device, renderPass->colorAttachments[i],
|
||||
for (uint32_t i = 0; i < descriptor->colorAttachmentCount; ++i) {
|
||||
DAWN_TRY(ValidateRenderPassColorAttachment(device, descriptor->colorAttachments[i],
|
||||
width, height, sampleCount));
|
||||
}
|
||||
|
||||
if (renderPass->depthStencilAttachment != nullptr) {
|
||||
if (descriptor->depthStencilAttachment != nullptr) {
|
||||
DAWN_TRY(ValidateRenderPassDepthStencilAttachment(
|
||||
device, renderPass->depthStencilAttachment, width, height, sampleCount));
|
||||
device, descriptor->depthStencilAttachment, width, height, sampleCount));
|
||||
}
|
||||
|
||||
if (renderPass->colorAttachmentCount == 0 &&
|
||||
renderPass->depthStencilAttachment == nullptr) {
|
||||
if (descriptor->colorAttachmentCount == 0 &&
|
||||
descriptor->depthStencilAttachment == nullptr) {
|
||||
return DAWN_VALIDATION_ERROR("Cannot use render pass with no attachments.");
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
MaybeError ValidateComputePassDescriptor(const DeviceBase* device,
|
||||
const ComputePassDescriptor* descriptor) {
|
||||
return {};
|
||||
}
|
||||
|
||||
enum class PassType {
|
||||
Render,
|
||||
Compute,
|
||||
@@ -618,7 +623,7 @@ namespace dawn_native {
|
||||
Finished
|
||||
};
|
||||
|
||||
CommandEncoderBase::CommandEncoderBase(DeviceBase* device)
|
||||
CommandEncoderBase::CommandEncoderBase(DeviceBase* device, const CommandEncoderDescriptor*)
|
||||
: ObjectBase(device), mEncodingState(EncodingState::TopLevel) {
|
||||
}
|
||||
|
||||
@@ -650,19 +655,25 @@ namespace dawn_native {
|
||||
|
||||
// Implementation of the API's command recording methods
|
||||
|
||||
ComputePassEncoderBase* CommandEncoderBase::BeginComputePass() {
|
||||
ComputePassEncoderBase* CommandEncoderBase::BeginComputePass(
|
||||
const ComputePassDescriptor* descriptor) {
|
||||
DeviceBase* device = GetDevice();
|
||||
if (ConsumedError(ValidateCanRecordTopLevelCommands())) {
|
||||
return ComputePassEncoderBase::MakeError(device, this);
|
||||
}
|
||||
|
||||
if (ConsumedError(ValidateComputePassDescriptor(device, descriptor))) {
|
||||
return ComputePassEncoderBase::MakeError(device, this);
|
||||
}
|
||||
|
||||
mAllocator.Allocate<BeginComputePassCmd>(Command::BeginComputePass);
|
||||
|
||||
mEncodingState = EncodingState::ComputePass;
|
||||
return new ComputePassEncoderBase(device, this, &mAllocator);
|
||||
}
|
||||
|
||||
RenderPassEncoderBase* CommandEncoderBase::BeginRenderPass(const RenderPassDescriptor* info) {
|
||||
RenderPassEncoderBase* CommandEncoderBase::BeginRenderPass(
|
||||
const RenderPassDescriptor* descriptor) {
|
||||
DeviceBase* device = GetDevice();
|
||||
|
||||
if (ConsumedError(ValidateCanRecordTopLevelCommands())) {
|
||||
@@ -673,7 +684,7 @@ namespace dawn_native {
|
||||
uint32_t height = 0;
|
||||
uint32_t sampleCount = 0;
|
||||
if (ConsumedError(
|
||||
ValidateRenderPassDescriptor(device, info, &width, &height, &sampleCount))) {
|
||||
ValidateRenderPassDescriptor(device, descriptor, &width, &height, &sampleCount))) {
|
||||
return RenderPassEncoderBase::MakeError(device, this);
|
||||
}
|
||||
|
||||
@@ -683,28 +694,33 @@ namespace dawn_native {
|
||||
|
||||
BeginRenderPassCmd* cmd = mAllocator.Allocate<BeginRenderPassCmd>(Command::BeginRenderPass);
|
||||
|
||||
for (uint32_t i = 0; i < info->colorAttachmentCount; ++i) {
|
||||
if (info->colorAttachments[i] != nullptr) {
|
||||
for (uint32_t i = 0; i < descriptor->colorAttachmentCount; ++i) {
|
||||
if (descriptor->colorAttachments[i] != nullptr) {
|
||||
cmd->colorAttachmentsSet.set(i);
|
||||
cmd->colorAttachments[i].view = info->colorAttachments[i]->attachment;
|
||||
cmd->colorAttachments[i].resolveTarget = info->colorAttachments[i]->resolveTarget;
|
||||
cmd->colorAttachments[i].loadOp = info->colorAttachments[i]->loadOp;
|
||||
cmd->colorAttachments[i].storeOp = info->colorAttachments[i]->storeOp;
|
||||
cmd->colorAttachments[i].clearColor = info->colorAttachments[i]->clearColor;
|
||||
cmd->colorAttachments[i].view = descriptor->colorAttachments[i]->attachment;
|
||||
cmd->colorAttachments[i].resolveTarget =
|
||||
descriptor->colorAttachments[i]->resolveTarget;
|
||||
cmd->colorAttachments[i].loadOp = descriptor->colorAttachments[i]->loadOp;
|
||||
cmd->colorAttachments[i].storeOp = descriptor->colorAttachments[i]->storeOp;
|
||||
cmd->colorAttachments[i].clearColor = descriptor->colorAttachments[i]->clearColor;
|
||||
}
|
||||
}
|
||||
|
||||
cmd->hasDepthStencilAttachment = info->depthStencilAttachment != nullptr;
|
||||
cmd->hasDepthStencilAttachment = descriptor->depthStencilAttachment != nullptr;
|
||||
if (cmd->hasDepthStencilAttachment) {
|
||||
cmd->hasDepthStencilAttachment = true;
|
||||
cmd->depthStencilAttachment.view = info->depthStencilAttachment->attachment;
|
||||
cmd->depthStencilAttachment.clearDepth = info->depthStencilAttachment->clearDepth;
|
||||
cmd->depthStencilAttachment.clearStencil = info->depthStencilAttachment->clearStencil;
|
||||
cmd->depthStencilAttachment.depthLoadOp = info->depthStencilAttachment->depthLoadOp;
|
||||
cmd->depthStencilAttachment.depthStoreOp = info->depthStencilAttachment->depthStoreOp;
|
||||
cmd->depthStencilAttachment.stencilLoadOp = info->depthStencilAttachment->stencilLoadOp;
|
||||
cmd->depthStencilAttachment.view = descriptor->depthStencilAttachment->attachment;
|
||||
cmd->depthStencilAttachment.clearDepth = descriptor->depthStencilAttachment->clearDepth;
|
||||
cmd->depthStencilAttachment.clearStencil =
|
||||
descriptor->depthStencilAttachment->clearStencil;
|
||||
cmd->depthStencilAttachment.depthLoadOp =
|
||||
descriptor->depthStencilAttachment->depthLoadOp;
|
||||
cmd->depthStencilAttachment.depthStoreOp =
|
||||
descriptor->depthStencilAttachment->depthStoreOp;
|
||||
cmd->depthStencilAttachment.stencilLoadOp =
|
||||
descriptor->depthStencilAttachment->stencilLoadOp;
|
||||
cmd->depthStencilAttachment.stencilStoreOp =
|
||||
info->depthStencilAttachment->stencilStoreOp;
|
||||
descriptor->depthStencilAttachment->stencilStoreOp;
|
||||
}
|
||||
|
||||
cmd->width = width;
|
||||
@@ -842,8 +858,8 @@ namespace dawn_native {
|
||||
copy->copySize = *copySize;
|
||||
}
|
||||
|
||||
CommandBufferBase* CommandEncoderBase::Finish() {
|
||||
if (GetDevice()->ConsumedError(ValidateFinish())) {
|
||||
CommandBufferBase* CommandEncoderBase::Finish(const CommandBufferDescriptor* descriptor) {
|
||||
if (GetDevice()->ConsumedError(ValidateFinish(descriptor))) {
|
||||
// Even if finish validation fails, it is now invalid to call any encoding commands on
|
||||
// this object, so we set its state to finished.
|
||||
mEncodingState = EncodingState::Finished;
|
||||
@@ -854,7 +870,7 @@ namespace dawn_native {
|
||||
mEncodingState = EncodingState::Finished;
|
||||
|
||||
MoveToIterator();
|
||||
return GetDevice()->CreateCommandBuffer(this);
|
||||
return GetDevice()->CreateCommandBuffer(this, descriptor);
|
||||
}
|
||||
|
||||
// Implementation of functions to interact with sub-encoders
|
||||
@@ -892,7 +908,7 @@ namespace dawn_native {
|
||||
|
||||
// Implementation of the command buffer validation that can be precomputed before submit
|
||||
|
||||
MaybeError CommandEncoderBase::ValidateFinish() {
|
||||
MaybeError CommandEncoderBase::ValidateFinish(const CommandBufferDescriptor*) {
|
||||
DAWN_TRY(GetDevice()->ValidateObject(this));
|
||||
|
||||
if (mGotError) {
|
||||
|
||||
@@ -30,15 +30,15 @@ namespace dawn_native {
|
||||
|
||||
class CommandEncoderBase : public ObjectBase {
|
||||
public:
|
||||
CommandEncoderBase(DeviceBase* device);
|
||||
CommandEncoderBase(DeviceBase* device, const CommandEncoderDescriptor* descriptor);
|
||||
~CommandEncoderBase();
|
||||
|
||||
CommandIterator AcquireCommands();
|
||||
CommandBufferResourceUsage AcquireResourceUsages();
|
||||
|
||||
// Dawn API
|
||||
ComputePassEncoderBase* BeginComputePass();
|
||||
RenderPassEncoderBase* BeginRenderPass(const RenderPassDescriptor* info);
|
||||
ComputePassEncoderBase* BeginComputePass(const ComputePassDescriptor* descriptor);
|
||||
RenderPassEncoderBase* BeginRenderPass(const RenderPassDescriptor* descriptor);
|
||||
void CopyBufferToBuffer(BufferBase* source,
|
||||
uint64_t sourceOffset,
|
||||
BufferBase* destination,
|
||||
@@ -53,7 +53,7 @@ namespace dawn_native {
|
||||
void CopyTextureToTexture(const TextureCopyView* source,
|
||||
const TextureCopyView* destination,
|
||||
const Extent3D* copySize);
|
||||
CommandBufferBase* Finish();
|
||||
CommandBufferBase* Finish(const CommandBufferDescriptor* descriptor);
|
||||
|
||||
// Functions to interact with the encoders
|
||||
void HandleError(const char* message);
|
||||
@@ -69,7 +69,7 @@ namespace dawn_native {
|
||||
void PassEnded();
|
||||
|
||||
private:
|
||||
MaybeError ValidateFinish();
|
||||
MaybeError ValidateFinish(const CommandBufferDescriptor* descriptor);
|
||||
MaybeError ValidateComputePass();
|
||||
MaybeError ValidateRenderPass(BeginRenderPassCmd* renderPass);
|
||||
MaybeError ValidateCanRecordTopLevelCommands() const;
|
||||
|
||||
@@ -307,8 +307,9 @@ namespace dawn_native {
|
||||
// The callback is deferred so it matches the async behavior of WebGPU.
|
||||
mDeferredCreateBufferMappedAsyncResults.push_back(deferred_info);
|
||||
}
|
||||
CommandEncoderBase* DeviceBase::CreateCommandEncoder() {
|
||||
return new CommandEncoderBase(this);
|
||||
CommandEncoderBase* DeviceBase::CreateCommandEncoder(
|
||||
const CommandEncoderDescriptor* descriptor) {
|
||||
return new CommandEncoderBase(this, descriptor);
|
||||
}
|
||||
ComputePipelineBase* DeviceBase::CreateComputePipeline(
|
||||
const ComputePipelineDescriptor* descriptor) {
|
||||
|
||||
@@ -56,7 +56,9 @@ namespace dawn_native {
|
||||
|
||||
FenceSignalTracker* GetFenceSignalTracker() const;
|
||||
|
||||
virtual CommandBufferBase* CreateCommandBuffer(CommandEncoderBase* encoder) = 0;
|
||||
virtual CommandBufferBase* CreateCommandBuffer(
|
||||
CommandEncoderBase* encoder,
|
||||
const CommandBufferDescriptor* descriptor) = 0;
|
||||
|
||||
virtual Serial GetCompletedCommandSerial() const = 0;
|
||||
virtual Serial GetLastSubmittedCommandSerial() const = 0;
|
||||
@@ -108,7 +110,7 @@ namespace dawn_native {
|
||||
void CreateBufferMappedAsync(const BufferDescriptor* descriptor,
|
||||
dawn::BufferCreateMappedCallback callback,
|
||||
void* userdata);
|
||||
CommandEncoderBase* CreateCommandEncoder();
|
||||
CommandEncoderBase* CreateCommandEncoder(const CommandEncoderDescriptor* descriptor);
|
||||
ComputePipelineBase* CreateComputePipeline(const ComputePipelineDescriptor* descriptor);
|
||||
PipelineLayoutBase* CreatePipelineLayout(const PipelineLayoutDescriptor* descriptor);
|
||||
QueueBase* CreateQueue();
|
||||
|
||||
@@ -401,8 +401,9 @@ namespace dawn_native { namespace d3d12 {
|
||||
|
||||
} // anonymous 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() {
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace dawn_native { namespace d3d12 {
|
||||
|
||||
class CommandBuffer : public CommandBufferBase {
|
||||
public:
|
||||
CommandBuffer(Device* device, CommandEncoderBase* encoder);
|
||||
CommandBuffer(CommandEncoderBase* encoder, const CommandBufferDescriptor* descriptor);
|
||||
~CommandBuffer();
|
||||
|
||||
void RecordCommands(ComPtr<ID3D12GraphicsCommandList> commandList, uint32_t indexInSubmit);
|
||||
|
||||
@@ -262,8 +262,9 @@ namespace dawn_native { namespace d3d12 {
|
||||
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) {
|
||||
|
||||
@@ -42,7 +42,8 @@ namespace dawn_native { namespace d3d12 {
|
||||
|
||||
MaybeError Initialize();
|
||||
|
||||
CommandBufferBase* CreateCommandBuffer(CommandEncoderBase* encoder) override;
|
||||
CommandBufferBase* CreateCommandBuffer(CommandEncoderBase* encoder,
|
||||
const CommandBufferDescriptor* descriptor) override;
|
||||
|
||||
Serial GetCompletedCommandSerial() const final override;
|
||||
Serial GetLastSubmittedCommandSerial() const final override;
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace dawn_native { namespace metal {
|
||||
|
||||
class CommandBuffer : public CommandBufferBase {
|
||||
public:
|
||||
CommandBuffer(Device* device, CommandEncoderBase* encoder);
|
||||
CommandBuffer(CommandEncoderBase* encoder, const CommandBufferDescriptor* descriptor);
|
||||
~CommandBuffer();
|
||||
|
||||
void FillCommands(id<MTLCommandBuffer> commandBuffer);
|
||||
|
||||
@@ -399,8 +399,9 @@ namespace dawn_native { namespace metal {
|
||||
}
|
||||
} // anonymous 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() {
|
||||
|
||||
@@ -37,7 +37,8 @@ namespace dawn_native { namespace metal {
|
||||
Device(AdapterBase* adapter, id<MTLDevice> mtlDevice, const DeviceDescriptor* descriptor);
|
||||
~Device();
|
||||
|
||||
CommandBufferBase* CreateCommandBuffer(CommandEncoderBase* encoder) override;
|
||||
CommandBufferBase* CreateCommandBuffer(CommandEncoderBase* encoder,
|
||||
const CommandBufferDescriptor* descriptor) override;
|
||||
|
||||
Serial GetCompletedCommandSerial() const final override;
|
||||
Serial GetLastSubmittedCommandSerial() const final override;
|
||||
|
||||
@@ -95,8 +95,9 @@ namespace dawn_native { namespace metal {
|
||||
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) {
|
||||
|
||||
@@ -97,8 +97,9 @@ namespace dawn_native { namespace null {
|
||||
DAWN_TRY(IncrementMemoryUsage(descriptor->size));
|
||||
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) {
|
||||
@@ -291,8 +292,9 @@ namespace dawn_native { namespace null {
|
||||
|
||||
// CommandBuffer
|
||||
|
||||
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() {
|
||||
|
||||
@@ -85,7 +85,8 @@ namespace dawn_native { namespace null {
|
||||
Device(Adapter* adapter, const DeviceDescriptor* descriptor);
|
||||
~Device();
|
||||
|
||||
CommandBufferBase* CreateCommandBuffer(CommandEncoderBase* encoder) override;
|
||||
CommandBufferBase* CreateCommandBuffer(CommandEncoderBase* encoder,
|
||||
const CommandBufferDescriptor* descriptor) override;
|
||||
|
||||
Serial GetCompletedCommandSerial() const final override;
|
||||
Serial GetLastSubmittedCommandSerial() const final override;
|
||||
@@ -164,7 +165,7 @@ namespace dawn_native { namespace null {
|
||||
|
||||
class CommandBuffer : public CommandBufferBase {
|
||||
public:
|
||||
CommandBuffer(Device* device, CommandEncoderBase* encoder);
|
||||
CommandBuffer(CommandEncoderBase* encoder, const CommandBufferDescriptor* descriptor);
|
||||
~CommandBuffer();
|
||||
|
||||
private:
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -327,8 +327,9 @@ namespace dawn_native { namespace vulkan {
|
||||
}
|
||||
} // anonymous 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() {
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace dawn_native { namespace vulkan {
|
||||
|
||||
class CommandBuffer : public CommandBufferBase {
|
||||
public:
|
||||
CommandBuffer(Device* device, CommandEncoderBase* encoder);
|
||||
CommandBuffer(CommandEncoderBase* encoder, const CommandBufferDescriptor* descriptor);
|
||||
~CommandBuffer();
|
||||
|
||||
void RecordCommands(VkCommandBuffer commands);
|
||||
|
||||
@@ -148,8 +148,9 @@ namespace dawn_native { namespace vulkan {
|
||||
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) {
|
||||
|
||||
@@ -64,7 +64,8 @@ namespace dawn_native { namespace vulkan {
|
||||
void AddWaitSemaphore(VkSemaphore semaphore);
|
||||
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user