Blender V5.3
GHOST_XrGraphicsBindingMetal.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#ifndef __APPLE__
12# error "GHOST_XrGraphicsBindingMetal can be only compiled on macOS."
13#endif
14
16
17#include <list>
18#include <vector>
19
21#include "GHOST_Types.hh"
22
24 PFN_xrGetMetalGraphicsRequirementsKHR xrGetMetalGraphicsRequirementsKHR_ = nullptr;
25
26 public:
28
29 bool loadExtensionFunctions(XrInstance instance) override;
31 XrInstance instance,
32 XrSystemId system_id,
33 std::string *r_requirement_info) const override;
34
35 void initFromGhostContext(GHOST_Context &ghost_ctx,
36 XrInstance instance,
37 XrSystemId system_id) override;
38 std::optional<int64_t> chooseSwapchainFormat(const std::vector<int64_t> &runtime_formats,
39 GHOST_TXrSwapchainFormat &r_format,
40 bool &r_is_srgb_format) const override;
41 std::vector<XrSwapchainImageBaseHeader *> createSwapchainImages(uint32_t image_count) override;
42
43 void submitToSwapchainBegin() override;
44 void submitToSwapchainImage(XrSwapchainImageBaseHeader &swapchain_image,
45 const GHOST_XrDrawViewInfo &draw_info) override;
46 void submitToSwapchainEnd() override;
47
48 bool needsUpsideDownDrawing(GHOST_Context &ghost_ctx) const override;
49
50 protected:
52 std::list<std::vector<XrSwapchainImageMetalKHR>> image_cache_;
53};
GHOST_IXrGraphicsBinding()=default
std::optional< int64_t > chooseSwapchainFormat(const std::vector< int64_t > &runtime_formats, GHOST_TXrSwapchainFormat &r_format, bool &r_is_srgb_format) const override
bool checkVersionRequirements(GHOST_Context &ghost_ctx, XrInstance instance, XrSystemId system_id, std::string *r_requirement_info) const override
std::vector< XrSwapchainImageBaseHeader * > createSwapchainImages(uint32_t image_count) override
void submitToSwapchainImage(XrSwapchainImageBaseHeader &swapchain_image, const GHOST_XrDrawViewInfo &draw_info) override
bool needsUpsideDownDrawing(GHOST_Context &ghost_ctx) const override
std::list< std::vector< XrSwapchainImageMetalKHR > > image_cache_
bool loadExtensionFunctions(XrInstance instance) override
load the functions for the graphics binding.
void initFromGhostContext(GHOST_Context &ghost_ctx, XrInstance instance, XrSystemId system_id) override
GHOST_XrGraphicsBindingMetal(GHOST_Context &ghost_ctx)