-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michael Pollind <[email protected]>
- Loading branch information
Showing
9 changed files
with
168 additions
and
75 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// © 2021 NVIDIA Corporation | ||
|
||
#pragma once | ||
|
||
|
||
namespace nri { | ||
|
||
struct DeviceMTL; | ||
|
||
struct CommandQueueMTL { | ||
|
||
inline CommandQueueMTL(DeviceMTL& device) | ||
: m_Device(device) { | ||
} | ||
|
||
~CommandQueueMTL(); | ||
|
||
inline operator id<MTLCommandQueue>() const { | ||
return m_Handle; | ||
} | ||
|
||
inline DeviceMTL& GetDevice() const { | ||
return m_Device; | ||
} | ||
|
||
inline uint32_t GetFamilyIndex() const { | ||
return m_FamilyIndex; | ||
} | ||
|
||
inline CommandQueueType GetType() const { | ||
return m_Type; | ||
} | ||
|
||
inline Lock& GetLock() { | ||
return m_Lock; | ||
} | ||
|
||
void SetDebugName(const char* name); | ||
Result Create(CommandQueueType type, uint32_t familyIndex, id<MTLCommandQueue> handle); | ||
private: | ||
DeviceMTL& m_Device; | ||
uint32_t m_FamilyIndex = INVALID_FAMILY_INDEX; | ||
CommandQueueType m_Type = CommandQueueType(-1); | ||
id<MTLCommandQueue> m_Handle; | ||
Lock m_Lock; | ||
}; | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// © 2021 NVIDIA Corporation | ||
|
||
#include "CommandQueueMTL.h" | ||
|
||
using namespace nri; | ||
|
||
|
||
CommandQueueMTL::~CommandQueueMTL() { | ||
m_CommandQueue = nil; | ||
} | ||
|
||
Result CommandQueueMTL::Create(CommandQueueType type, uint32_t familyIndex, id<MTLCommandQueue> handle) { | ||
m_Type = type; | ||
m_FamilyIndex = familyIndex; | ||
m_Handle = handle; | ||
return Result::SUCCESS; | ||
} | ||
|
||
void CommandQueueMTL::SetDebugName(const char* name) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
#pragma once | ||
|
||
|
||
namespace nri { | ||
|
||
struct DeviceMTL; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters