Path: blob/master/thirdparty/metal-cpp/Metal/MTL4CompilerTask.hpp
21066 views
//-------------------------------------------------------------------------------------------------------------------------------------------------------------1//2// Metal/MTL4CompilerTask.hpp3//4// Copyright 2020-2025 Apple Inc.5//6// Licensed under the Apache License, Version 2.0 (the "License");7// you may not use this file except in compliance with the License.8// You may obtain a copy of the License at9//10// http://www.apache.org/licenses/LICENSE-2.011//12// Unless required by applicable law or agreed to in writing, software13// distributed under the License is distributed on an "AS IS" BASIS,14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15// See the License for the specific language governing permissions and16// limitations under the License.17//18//-------------------------------------------------------------------------------------------------------------------------------------------------------------1920#pragma once2122#include "../Foundation/Foundation.hpp"23#include "MTLDefines.hpp"24#include "MTLHeaderBridge.hpp"25#include "MTLPrivate.hpp"2627namespace MTL428{29class Compiler;30_MTL_ENUM(NS::Integer, CompilerTaskStatus) {31CompilerTaskStatusNone = 0,32CompilerTaskStatusScheduled = 1,33CompilerTaskStatusCompiling = 2,34CompilerTaskStatusFinished = 3,35};3637class CompilerTask : public NS::Referencing<CompilerTask>38{39public:40Compiler* compiler() const;4142CompilerTaskStatus status() const;4344void waitUntilCompleted();45};4647}4849_MTL_INLINE MTL4::Compiler* MTL4::CompilerTask::compiler() const50{51return Object::sendMessage<MTL4::Compiler*>(this, _MTL_PRIVATE_SEL(compiler));52}5354_MTL_INLINE MTL4::CompilerTaskStatus MTL4::CompilerTask::status() const55{56return Object::sendMessage<MTL4::CompilerTaskStatus>(this, _MTL_PRIVATE_SEL(status));57}5859_MTL_INLINE void MTL4::CompilerTask::waitUntilCompleted()60{61Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(waitUntilCompleted));62}636465