28std::unique_ptr<CommandBuffer> MtlQueueManager::getNewCommandBuffer(
30 MtlResourceProvider* mtlResourceProvider =
static_cast<MtlResourceProvider*
>(resourceProvider);
32 this->mtlSharedContext(),
47 void onWaitUntilFinished(
const SharedContext*)
override {
55 if (!mtlCmdBuffer->commit()) {
60 std::unique_ptr<GpuWorkSubmission> submission(
65#if defined(GRAPHITE_TEST_UTILS)
66void MtlQueueManager::startCapture() {
67 if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, *)) {
69 MTLCaptureManager* captureManager = [MTLCaptureManager sharedCaptureManager];
70 if (captureManager.isCapturing) {
73 if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) {
74 MTLCaptureDescriptor* captureDescriptor = [[MTLCaptureDescriptor alloc]
init];
75 captureDescriptor.captureObject = fQueue.get();
78 if (![captureManager startCaptureWithDescriptor: captureDescriptor
error:&
error])
80 NSLog(
@"Failed to start capture, error %@",
error);
83 [captureManager startCaptureWithCommandQueue: fQueue.get()];
88void MtlQueueManager::stopCapture() {
89 if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, *)) {
90 MTLCaptureManager* captureManager = [MTLCaptureManager sharedCaptureManager];
91 if (captureManager.isCapturing) {
92 [captureManager stopCapture];
void waitUntilFinished(const SharedContext *sharedContext)
CommandBuffer * commandBuffer()
bool isFinished(const SharedContext *sharedContext)
static std::unique_ptr< MtlCommandBuffer > Make(id< MTLCommandQueue >, const MtlSharedContext *, MtlResourceProvider *)
MtlQueueManager(sk_cfp< id< MTLCommandQueue > > queue, const SharedContext *)
~MtlWorkSubmission() override
MtlWorkSubmission(std::unique_ptr< CommandBuffer > cmdBuffer, QueueManager *queueManager)
const SharedContext * fSharedContext
std::unique_ptr< GpuWorkSubmission > OutstandingSubmission
std::unique_ptr< CommandBuffer > fCurrentCommandBuffer
const uint8_t uint32_t uint32_t GError ** error