Skip to content

Commit a5806a5

Browse files
committed
feat: update commanQueuMTL
Signed-off-by: Michael Pollind <mpollind@gmail.com>
1 parent 861ba3c commit a5806a5

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed

Source/Metal/CommandQueueMTL.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// © 2021 NVIDIA Corporation
2-
32
#pragma once
43

5-
64
namespace nri {
75

86
struct DeviceMTL;

Source/Metal/CommandQueueMTL.mm

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,17 @@
1515
m_Handle = handle;
1616
return Result::SUCCESS;
1717
}
18-
19-
void CommandQueueMTL::SetDebugName(const char* name) {
2018

19+
inline void CommandQueueMTL::SetDebugName(const char* name) {
20+
[m_Handle setLabel:[NSString stringWithUTF8String:name]];
2121
}
22+
23+
Result CommandQueueVK::WaitForIdle() {
24+
25+
id<MTLCommandBuffer> waitCmdBuf = [m_Handle commandBufferWithUnretainedReferences];
26+
27+
[waitCmdBuf commit];
28+
[waitCmdBuf waitUntilCompleted];
29+
30+
waitCmdBuf = nil;
31+
}

Source/VK/CommandQueueVK.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,12 @@ Result CommandQueueVK::Create(CommandQueueType type, uint32_t familyIndex, VkQue
1818
return Result::SUCCESS;
1919
}
2020

21-
inline void CommandQueueVK::SetDebugName(const char* name) {
22-
[m_Handle setLabel:[NSString stringWithUTF8String:name]];
23-
}
24-
25-
26-
Result CommandQueueVK::WaitForIdle() {
21+
//================================================================================================================
22+
// NRI
23+
//================================================================================================================
2724

28-
id<MTLCommandBuffer> waitCmdBuf = [m_Handle commandBufferWithUnretainedReferences];
29-
30-
[waitCmdBuf commit];
31-
[waitCmdBuf waitUntilCompleted];
32-
33-
waitCmdBuf = nil;
25+
inline void CommandQueueVK::SetDebugName(const char* name) {
26+
m_Device.SetDebugNameToTrivialObject(VK_OBJECT_TYPE_QUEUE, (uint64_t)m_Handle, name);
3427
}
3528

3629
inline void CommandQueueVK::Submit(const QueueSubmitDesc& queueSubmitDesc, const SwapChain* swapChain) {
@@ -94,4 +87,4 @@ inline Result CommandQueueVK::WaitForIdle() {
9487
return Result::SUCCESS;
9588
}
9689

97-
#include "CommandQueueVK.hpp"
90+
#include "CommandQueueVK.hpp"

Source/VK/CommandQueueVK.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct CommandQueueVK {
3939

4040
void SetDebugName(const char* name);
4141
void Submit(const QueueSubmitDesc& queueSubmitDesc, const SwapChain* swapChain);
42+
Result UploadData(const TextureUploadDesc* textureUploadDescs, uint32_t textureUploadDescNum, const BufferUploadDesc* bufferUploadDescs, uint32_t bufferUploadDescNum);
4243
Result WaitForIdle();
4344

4445
private:

Source/VK/DeviceVK.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "DescriptorSetVK.h"
1212
#include "DescriptorVK.h"
1313
#include "FenceVK.h"
14-
#include "HelperDeviceMemoryAllocator.h"Device
14+
#include "HelperDeviceMemoryAllocator.h"
1515
#include "MemoryVK.h"
1616
#include "PipelineLayoutVK.h"
1717
#include "PipelineVK.h"

Source/VK/DeviceVK.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#pragma once
44

5-
65
namespace nri {
76

87
struct CommandQueueVK;
@@ -12,7 +11,7 @@ struct DeviceVK final : public DeviceBase {
1211
return m_Device;
1312
}
1413

15-
inline operator VkPhysicalDevice() const {DeviceB
14+
inline operator VkPhysicalDevice() const {
1615
return m_PhysicalDevice;
1716
}
1817

0 commit comments

Comments
 (0)