mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-07 07:03:42 +00:00
Vulkan: Split off QueueVk
This commit is contained in:
parent
b703def640
commit
a4cb35cdbc
@ -293,6 +293,8 @@ if (NXT_ENABLE_VULKAN)
|
|||||||
${VULKAN_DIR}/NativeSwapChainImplVk.h
|
${VULKAN_DIR}/NativeSwapChainImplVk.h
|
||||||
${VULKAN_DIR}/PipelineLayoutVk.cpp
|
${VULKAN_DIR}/PipelineLayoutVk.cpp
|
||||||
${VULKAN_DIR}/PipelineLayoutVk.h
|
${VULKAN_DIR}/PipelineLayoutVk.h
|
||||||
|
${VULKAN_DIR}/QueueVk.cpp
|
||||||
|
${VULKAN_DIR}/QueueVk.h
|
||||||
${VULKAN_DIR}/RenderPassCache.cpp
|
${VULKAN_DIR}/RenderPassCache.cpp
|
||||||
${VULKAN_DIR}/RenderPassCache.h
|
${VULKAN_DIR}/RenderPassCache.h
|
||||||
${VULKAN_DIR}/RenderPassDescriptorVk.cpp
|
${VULKAN_DIR}/RenderPassDescriptorVk.cpp
|
||||||
|
@ -51,6 +51,8 @@ namespace backend { namespace vulkan {
|
|||||||
DeviceMemoryAllocation mMemoryAllocation;
|
DeviceMemoryAllocation mMemoryAllocation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
using BufferView = BufferViewBase;
|
||||||
|
|
||||||
class MapRequestTracker {
|
class MapRequestTracker {
|
||||||
public:
|
public:
|
||||||
MapRequestTracker(Device* device);
|
MapRequestTracker(Device* device);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "backend/vulkan/DepthStencilStateVk.h"
|
#include "backend/vulkan/DepthStencilStateVk.h"
|
||||||
#include "backend/vulkan/InputStateVk.h"
|
#include "backend/vulkan/InputStateVk.h"
|
||||||
#include "backend/vulkan/PipelineLayoutVk.h"
|
#include "backend/vulkan/PipelineLayoutVk.h"
|
||||||
|
#include "backend/vulkan/QueueVk.h"
|
||||||
#include "backend/vulkan/RenderPassDescriptorVk.h"
|
#include "backend/vulkan/RenderPassDescriptorVk.h"
|
||||||
#include "backend/vulkan/RenderPipelineVk.h"
|
#include "backend/vulkan/RenderPipelineVk.h"
|
||||||
#include "backend/vulkan/SamplerVk.h"
|
#include "backend/vulkan/SamplerVk.h"
|
||||||
|
39
src/backend/vulkan/QueueVk.cpp
Normal file
39
src/backend/vulkan/QueueVk.cpp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
// Copyright 2018 The NXT Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "backend/vulkan/QueueVk.h"
|
||||||
|
|
||||||
|
#include "backend/vulkan/CommandBufferVk.h"
|
||||||
|
#include "backend/vulkan/VulkanBackend.h"
|
||||||
|
|
||||||
|
namespace backend { namespace vulkan {
|
||||||
|
|
||||||
|
Queue::Queue(Device* device) : QueueBase(device) {
|
||||||
|
}
|
||||||
|
|
||||||
|
Queue::~Queue() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void Queue::Submit(uint32_t numCommands, CommandBuffer* const* commands) {
|
||||||
|
Device* device = ToBackend(GetDevice());
|
||||||
|
|
||||||
|
VkCommandBuffer commandBuffer = device->GetPendingCommandBuffer();
|
||||||
|
for (uint32_t i = 0; i < numCommands; ++i) {
|
||||||
|
commands[i]->RecordCommands(commandBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
device->SubmitPendingCommands();
|
||||||
|
}
|
||||||
|
|
||||||
|
}} // namespace backend::vulkan
|
36
src/backend/vulkan/QueueVk.h
Normal file
36
src/backend/vulkan/QueueVk.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// Copyright 2018 The NXT Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#ifndef BACKEND_VULKAN_QUEUEVK_H_
|
||||||
|
#define BACKEND_VULKAN_QUEUEVK_H_
|
||||||
|
|
||||||
|
#include "backend/Queue.h"
|
||||||
|
|
||||||
|
namespace backend { namespace vulkan {
|
||||||
|
|
||||||
|
class CommandBuffer;
|
||||||
|
class Device;
|
||||||
|
|
||||||
|
class Queue : public QueueBase {
|
||||||
|
public:
|
||||||
|
Queue(Device* device);
|
||||||
|
~Queue();
|
||||||
|
|
||||||
|
// NXT API
|
||||||
|
void Submit(uint32_t numCommands, CommandBuffer* const* commands);
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace backend::vulkan
|
||||||
|
|
||||||
|
#endif // BACKEND_VULKAN_QUEUEVK_H_
|
@ -27,6 +27,7 @@
|
|||||||
#include "backend/vulkan/InputStateVk.h"
|
#include "backend/vulkan/InputStateVk.h"
|
||||||
#include "backend/vulkan/NativeSwapChainImplVk.h"
|
#include "backend/vulkan/NativeSwapChainImplVk.h"
|
||||||
#include "backend/vulkan/PipelineLayoutVk.h"
|
#include "backend/vulkan/PipelineLayoutVk.h"
|
||||||
|
#include "backend/vulkan/QueueVk.h"
|
||||||
#include "backend/vulkan/RenderPassCache.h"
|
#include "backend/vulkan/RenderPassCache.h"
|
||||||
#include "backend/vulkan/RenderPassDescriptorVk.h"
|
#include "backend/vulkan/RenderPassDescriptorVk.h"
|
||||||
#include "backend/vulkan/RenderPipelineVk.h"
|
#include "backend/vulkan/RenderPipelineVk.h"
|
||||||
@ -675,23 +676,4 @@ namespace backend { namespace vulkan {
|
|||||||
commands->commandBuffer = VK_NULL_HANDLE;
|
commands->commandBuffer = VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Queue
|
|
||||||
|
|
||||||
Queue::Queue(Device* device) : QueueBase(device) {
|
|
||||||
}
|
|
||||||
|
|
||||||
Queue::~Queue() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void Queue::Submit(uint32_t numCommands, CommandBuffer* const* commands) {
|
|
||||||
Device* device = ToBackend(GetDevice());
|
|
||||||
|
|
||||||
VkCommandBuffer commandBuffer = device->GetPendingCommandBuffer();
|
|
||||||
for (uint32_t i = 0; i < numCommands; ++i) {
|
|
||||||
commands[i]->RecordCommands(commandBuffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
device->SubmitPendingCommands();
|
|
||||||
}
|
|
||||||
|
|
||||||
}} // namespace backend::vulkan
|
}} // namespace backend::vulkan
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include "nxt/nxtcpp.h"
|
#include "nxt/nxtcpp.h"
|
||||||
|
|
||||||
#include "backend/Device.h"
|
#include "backend/Device.h"
|
||||||
#include "backend/Queue.h"
|
|
||||||
#include "backend/ToBackend.h"
|
#include "backend/ToBackend.h"
|
||||||
#include "backend/vulkan/VulkanFunctions.h"
|
#include "backend/vulkan/VulkanFunctions.h"
|
||||||
#include "backend/vulkan/VulkanInfo.h"
|
#include "backend/vulkan/VulkanInfo.h"
|
||||||
@ -28,6 +27,10 @@
|
|||||||
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
|
namespace backend {
|
||||||
|
class BufferViewBase;
|
||||||
|
}
|
||||||
|
|
||||||
namespace backend { namespace vulkan {
|
namespace backend { namespace vulkan {
|
||||||
|
|
||||||
class BindGroup;
|
class BindGroup;
|
||||||
@ -201,15 +204,6 @@ namespace backend { namespace vulkan {
|
|||||||
std::vector<VkSemaphore> mWaitSemaphores;
|
std::vector<VkSemaphore> mWaitSemaphores;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Queue : public QueueBase {
|
|
||||||
public:
|
|
||||||
Queue(Device* device);
|
|
||||||
~Queue();
|
|
||||||
|
|
||||||
// NXT API
|
|
||||||
void Submit(uint32_t numCommands, CommandBuffer* const* commands);
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace backend::vulkan
|
}} // namespace backend::vulkan
|
||||||
|
|
||||||
#endif // BACKEND_VULKAN_VULKANBACKEND_H_
|
#endif // BACKEND_VULKAN_VULKANBACKEND_H_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user