Files
reims-vgpu/guest/bundle/src/RgfxFeatureProfile.hpp
T
Anees Iqbal a5988ff35e ✨ Answer the x86 Macs' feature profile, 10002, from macOS 13 on
What changes for the guest: the device's featureProfile is 10002 where it was
the host's, 10 on every host so far, wherever the guest's Metal has the
MTLArchitecture class (macOS 13 and later), on every host. Where it lacks the
class (macOS 11 and 12) the device still answers 10001. Both x86 Macs of the
oracle answer 10002 under macOS 26.7.1 (the Radeon Pro 5300M and the UHD 630),
and the guest's Metal keys its limits, families and feature queries on the
profile. 10 was the M3 Max's, kept only because macOS 26's WindowServer, under
10002, asks for tiled textures of 6 and 7 levels over a buffer, which the
device answered nil; the host makes those now (the two commits before), and
26.7.2 composes its desktop under 10002 with them.

The answer is made in one place, RgfxFeatureProfile.hpp, which no longer takes
the host's profile: the bundle stops reading it from the device info, whose
field the host still fills with its Metal device's or the M3 Max's.

The profile's unit test, which held the host's answer from macOS 13 on, holds
10002 there and 10001 below; the guest's kext set is built again with it.
2026-11-08 03:29:59 -08:00

43 lines
2.0 KiB
C++

// The feature profile the device answers (`featureProfile`, SPI). At device creation Metal reads
// it before anything else and keys three things on it: the device's limits, its GPU families and
// its feature queries. A guest's Metal that has no limits for the profile it reads leaves every
// limit 0 and ends the process at its first check of one. WindowServer is that process, so the
// guest has no desktop.
//
// The device answers the x86 Macs' profile, which the guest's Metal knows, on every host. Under
// macOS 26.7.1 both of the oracle's GPUs answer 10002 (the Radeon Pro 5300M and the UHD 630;
// measured, docs/graphics-kext/dgpu-oracle.md, Q11), and under macOS 12 both of their drivers
// answer 10001 (AMDRadeonX6000's and AppleIntelKBLGraphics'; read from 12.7.6's drivers), which
// 12's Metal has limits for (it has none for the M3 Max's 10: 12.7.6's WindowServer ends at
// device creation under it). macOS 11's Metal is taken to be 12's here: its boots stop in the
// kernel before WindowServer (Graft's to fix).
//
// Which of the two the guest's Metal knows is told by what it has, not by its version: Metal that
// has the MTLArchitecture class (macOS 13 and later) gets 10002, under which 26.7.2 boots to its
// desktop, and Metal without it (macOS 11 and 12) gets 10001. Under 10002, macOS 26's WindowServer
// asks for tiled textures of 6 and 7 levels over a buffer, which the host makes (RgfxBuffer.mm).
#ifndef RGFX_FEATURE_PROFILE_HPP
#define RGFX_FEATURE_PROFILE_HPP
#include <cstdint>
namespace rgfx_profile {
// The profile macOS 11 and 12's x86 GPU drivers answer.
constexpr uint64_t kX86Mac12 = 10001;
// The profile macOS 26's x86 GPU drivers answer.
constexpr uint64_t kX86Mac = 10002;
// The profile the device answers: the x86 Macs' that the guest's Metal knows, 10002 where it has
// the MTLArchitecture class, else 10001.
constexpr uint64_t forGuest(bool metalHasArchitecture)
{
return metalHasArchitecture ? kX86Mac : kX86Mac12;
}
} // namespace rgfx_profile
#endif