Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c125c7c
[visionOS] Implement visionOS XR module
rsanchezsaez Nov 6, 2025
6316729
Merge branch 'master' into apple/visionos-xr-i
rsanchezsaez Nov 10, 2025
92babf2
Modify COPYRIGHT.txt
rsanchezsaez Dec 5, 2025
3483a75
[Sky] Remove SKY_VERSION_BACKGROUND_MULTIVIEW_WRITE_DEPTH variant
rsanchezsaez Dec 6, 2025
a03371e
Remove xr_node warnings
rsanchezsaez Dec 6, 2025
dd287b9
Merge branch 'master' of ssh://stash.sd.apple.com/tdgnui/godot into a…
rsanchezsaez Dec 6, 2025
e493cb3
Merge branch 'master' of github.com:godotengine/godot into apple/visi…
rsanchezsaez Dec 6, 2025
7852c18
Fix visionOS compilation
rsanchezsaez Dec 6, 2025
c5302de
Merge branch 'master' of ssh://stash.sd.apple.com/tdgnui/godot into a…
rsanchezsaez Dec 8, 2025
01635a0
Undo whitespace change
rsanchezsaez Dec 8, 2025
c00a953
[visionOS XR Module] Remove platform-specific prepare_screen_for_dra…
rsanchezsaez Dec 9, 2025
7183d15
Update COPYRIGHT.txt
rsanchezsaez Dec 9, 2025
a9db433
Update COPYRIGHT.txt
rsanchezsaez Dec 9, 2025
d56f9d8
Merge branch 'master' of github.com:rsanchezsaez/godot into apple/vis…
rsanchezsaez Jan 11, 2026
12b0111
Revert COPYRIGHT.txt update
rsanchezsaez Jan 12, 2026
caf9cf4
Revert renderer_compositor_rd.h override updates
rsanchezsaez Jan 12, 2026
c106a67
Undo unnecessary changes in `servers`
rsanchezsaez Jan 12, 2026
f8eee5a
Bin XR_VRS_TEXTURE_FORMAT_RASTERIZATION_RATE_MAP to GDScript
rsanchezsaez Jan 12, 2026
9576ec9
Add XR_VRS_TEXTURE_FORMAT_RASTERIZATION_RATE_MAP documentation
rsanchezsaez Jan 12, 2026
9a8694e
Update XR_VRS_TEXTURE_FORMAT_RASTERIZATION_RATE_MAP documentation
rsanchezsaez Jan 16, 2026
3371942
Merge branch 'master' into apple/visionos-xr
rsanchezsaez Jan 16, 2026
40048a8
[VisionOSXRInterface] Fix reprojection when altering wold scale
rsanchezsaez Jan 16, 2026
9f2fcdf
[VisionOSXRInterface] Address thread safety issues when using "separa…
rsanchezsaez Jan 20, 2026
0a08d39
[visionOS] Support immersive app backgrounding/foregrounding
rsanchezsaez Jan 20, 2026
0acc7a7
Fix thread safety issue where ar_device_anchor_t objects shouldn't be…
rsanchezsaez Jan 22, 2026
98027d6
[VisionOSXRIterface] Move driver 'is_rasterization_rate_map_supported…
rsanchezsaez Jan 22, 2026
5ed3ec6
Merge branch 'master' into apple/visionos-xr
rsanchezsaez Jan 22, 2026
3fb3a2c
[VisionOSXRInterface] Improve documentation
rsanchezsaez Jan 23, 2026
da0610f
Merge branch 'master' into apple/visionos-xr
rsanchezsaez Feb 7, 2026
c5e9f50
[visionOS] Update CompositorServices depthFormat to support stencil
rsanchezsaez Feb 8, 2026
fc89944
Make linter happy
rsanchezsaez Feb 8, 2026
3f4642d
[rendering_device_driver_metal] Fix protocol comformance check issue
rsanchezsaez Feb 11, 2026
66026d4
Merge branch 'master' of github.com:godotengine/godot into apple/visi…
rsanchezsaez Mar 3, 2026
b66bdd4
Fix merge issues
rsanchezsaez Mar 3, 2026
586d9d9
[visionOS XR Interface] Fix get_render_target_size() being called fro…
rsanchezsaez Mar 3, 2026
90bd3e3
Merge branch 'master' of github.com:godotengine/godot into apple/visi…
rsanchezsaez Mar 3, 2026
566a771
Fix documentation for SUPPORTS_RASTERIZATION_RATE_MAP
rsanchezsaez Mar 3, 2026
f3e94a9
Bind SUPPORTS_RASTERIZATION_RATE_MAP
rsanchezsaez Mar 3, 2026
c28c903
Fix documentation indentation
rsanchezsaez Mar 3, 2026
b0204f9
Remove claude file
rsanchezsaez Mar 4, 2026
b48fd1d
Merge branch 'master' of github.com:godotengine/godot into apple/visi…
rsanchezsaez Mar 4, 2026
2776069
Fix build
rsanchezsaez Mar 4, 2026
b990e62
[visionOS] Better UIApplicationSceneManifest handling
rsanchezsaez Mar 4, 2026
b5989b6
Merge branch 'master' into apple/visionos-xr
stuartcarnie Mar 21, 2026
43c54f6
chore: PR feedback; merge conflicts
stuartcarnie Mar 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/classes/RenderingDevice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2743,6 +2743,9 @@
<constant name="SUPPORTS_HDR_OUTPUT" value="13" enum="Features">
Support for high dynamic range (HDR) output.
</constant>
<constant name="SUPPORTS_RASTERIZATION_RATE_MAP" value="14" enum="Features">
Support for rasterization rate maps on Apple platforms. This allows for foveated rendering, which is used by the visionOS XR module.
</constant>
<constant name="LIMIT_MAX_BOUND_UNIFORM_SETS" value="0" enum="Limit">
Maximum number of uniform sets that can be bound at a given time.
</constant>
Expand Down
3 changes: 3 additions & 0 deletions doc/classes/XRInterface.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,5 +284,8 @@
<constant name="XR_VRS_TEXTURE_FORMAT_FRAGMENT_DENSITY_MAP" value="2" enum="VRSTextureFormat">
The texture format is the same as expected by the Vulkan [code]VK_EXT_fragment_density_map[/code] extension.
</constant>
<constant name="XR_VRS_TEXTURE_FORMAT_RASTERIZATION_RATE_MAP" value="3" enum="VRSTextureFormat">
The texture contains a Metal [code]rasterizationRateMap[/code], used for foveated rendering on Apple platforms. It's not a real texture, but instead an opaque wrapper for an [code]MTLRasterizationRateMap[/code] object.
</constant>
</constants>
</class>
2 changes: 1 addition & 1 deletion drivers/apple_embedded/apple_embedded.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#import "apple_embedded.h"

#include "core/object/class_db.h"
#import "drivers/apple_embedded/app_delegate_service.h"
#import "drivers/apple_embedded/godot_app_delegate_service_apple_embedded.h"
#import "drivers/apple_embedded/godot_view_controller.h"

#import <CoreHaptics/CoreHaptics.h>
Expand Down
3 changes: 1 addition & 2 deletions drivers/apple_embedded/bridging_header_apple_embedded.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
#pragma once

// IWYU pragma: begin_exports.
#import "drivers/apple_embedded/app_delegate_service.h"
#import "drivers/apple_embedded/godot_app_delegate.h"
#import "drivers/apple_embedded/godot_app_delegate_service_apple_embedded.h"
#import "drivers/apple_embedded/godot_view_apple_embedded.h"
#import "drivers/apple_embedded/godot_view_controller.h"
// IWYU pragma: end_exports.
2 changes: 1 addition & 1 deletion drivers/apple_embedded/display_server_apple_embedded.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "core/input/input.h"
#include "core/io/file_access_pack.h"
#include "core/os/os.h"
#import "drivers/apple_embedded/app_delegate_service.h"
#import "drivers/apple_embedded/apple_embedded.h"
#import "drivers/apple_embedded/godot_app_delegate_service_apple_embedded.h"
#import "drivers/apple_embedded/godot_keyboard_input_view.h"
#import "drivers/apple_embedded/godot_view_apple_embedded.h"
#import "drivers/apple_embedded/godot_view_controller.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**************************************************************************/
/* godot_app_delegate.h */
/* godot_app_delegate_apple_embedded.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand Down Expand Up @@ -34,7 +34,7 @@

typedef NSObject<UIApplicationDelegate, UIWindowSceneDelegate> GDTAppDelegateServiceProtocol;

@interface GDTApplicationDelegate : NSObject <UIApplicationDelegate, UIWindowSceneDelegate>
@interface GDTAppDelegate : NSObject <UIApplicationDelegate, UIWindowSceneDelegate>

@property(class, readonly, strong) NSArray<GDTAppDelegateServiceProtocol *> *services;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**************************************************************************/
/* godot_app_delegate.mm */
/* godot_app_delegate_apple_embedded.mm */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand Down Expand Up @@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/

#import "godot_app_delegate.h"
#import "godot_app_delegate_apple_embedded.h"

#include "core/typedefs.h"
#import "drivers/apple_embedded/app_delegate_service.h"
#import "drivers/apple_embedded/godot_app_delegate_service_apple_embedded.h"

@implementation GDTApplicationDelegate
@implementation GDTAppDelegate

static NSMutableArray<GDTAppDelegateServiceProtocol *> *services = nil;

Expand All @@ -43,7 +43,7 @@ @implementation GDTApplicationDelegate

+ (void)load {
services = [NSMutableArray new];
[services addObject:[GDTAppDelegateService new]];
// Add the specific GDTAppDelegateService subclass in each inheriting platform
}

+ (void)addService:(GDTAppDelegateServiceProtocol *)service {
Expand Down Expand Up @@ -113,7 +113,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options API_AVAILABLE(ios(13.0), tvos(13.0), visionos(1.0)) {
UISceneConfiguration *config = [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
config.delegateClass = [GDTApplicationDelegate class];
config.delegateClass = [GDTAppDelegate class];
return config;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**************************************************************************/
/* app_delegate_service.h */
/* godot_app_delegate_service_apple_embedded.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand Down Expand Up @@ -36,6 +36,6 @@

@interface GDTAppDelegateService : NSObject <UIApplicationDelegate, UIWindowSceneDelegate>

@property(strong, class, nonatomic) GDTViewController *viewController;
@property(weak, class, nonatomic, nullable) GDTViewController *viewController;

@end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**************************************************************************/
/* app_delegate_service.mm */
/* godot_app_delegate_service_apple_embedded.mm */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand Down Expand Up @@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/

#import "app_delegate_service.h"
#import "godot_app_delegate_service_apple_embedded.h"

#include "core/config/project_settings.h"
#include "core/os/main_loop.h"
Expand Down Expand Up @@ -59,14 +59,14 @@ @implementation GDTAppDelegateService
SESSION_CATEGORY_SOLO_AMBIENT
};

static GDTViewController *mainViewController = nil;
static __weak GDTViewController *_viewController = nil;

+ (GDTViewController *)viewController {
return mainViewController;
return _viewController;
}

+ (void)setViewController:(GDTViewController *)viewController {
mainViewController = viewController;
_viewController = viewController;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
Expand Down
49 changes: 49 additions & 0 deletions drivers/apple_embedded/godot_renderer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**************************************************************************/
/* godot_renderer.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/

#pragma once

#import <Foundation/Foundation.h>

inline void safeDispatchSyncToMain(void (^block)(void)) {
if ([NSThread isMainThread]) {
block();
} else {
dispatch_sync(dispatch_get_main_queue(), block);
}
}

@interface GDTRenderer : NSObject

@property(assign, readonly, nonatomic) BOOL hasFinishedSetup;

- (BOOL)setUp;

@end
108 changes: 108 additions & 0 deletions drivers/apple_embedded/godot_renderer.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/**************************************************************************/
/* godot_renderer.mm */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/

#import "godot_renderer.h"

#import "display_server_apple_embedded.h"
#import "os_apple_embedded.h"

#include "core/config/project_settings.h"
#include "main/main.h"

@interface GDTRenderer ()

@property(assign, nonatomic) BOOL hasCalledProjectDataSetUp;
@property(assign, nonatomic) BOOL hasStartedMain;
@property(assign, nonatomic) BOOL hasFinishedSetUp;

@end

@implementation GDTRenderer

- (BOOL)setUp {
if (self.hasFinishedSetUp) {
return NO;
}

if (!OS::get_singleton()) {
exit(0);
}

if (!self.hasCalledProjectDataSetUp) {
[self setUpProjectData];
}

if (!self.hasStartedMain) {
[self startMain];
}

self.hasFinishedSetUp = YES;

return NO;
}

- (void)setUpProjectData {
self.hasCalledProjectDataSetUp = YES;
safeDispatchSyncToMain(^{
Main::setup2();

// this might be necessary before here
NSDictionary *dict = [[NSBundle mainBundle] infoDictionary];
for (NSString *key in dict) {
NSObject *value = [dict objectForKey:key];
String ukey = String::utf8([key UTF8String]);

// we need a NSObject to Variant conversor

if ([value isKindOfClass:[NSString class]]) {
NSString *str = (NSString *)value;
String uval = String::utf8([str UTF8String]);

ProjectSettings::get_singleton()->set("Info.plist/" + ukey, uval);

} else if ([value isKindOfClass:[NSNumber class]]) {
NSNumber *n = (NSNumber *)value;
double dval = [n doubleValue];

ProjectSettings::get_singleton()->set("Info.plist/" + ukey, dval);
}
// do stuff
}
});
}

- (void)startMain {
self.hasStartedMain = YES;
safeDispatchSyncToMain(^{
OS_AppleEmbedded::get_singleton()->start();
});
}

@end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**************************************************************************/
/* app.swift */
/* godot_swiftui_view_controller.swift */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand Down Expand Up @@ -45,10 +45,7 @@ struct GodotSwiftUIViewController: UIViewControllerRepresentable {

}

@main
struct SwiftUIApp: App {
@UIApplicationDelegateAdaptor(GDTApplicationDelegate.self) var appDelegate

struct GodotWindowScene: Scene {
var body: some Scene {
WindowGroup {
GodotSwiftUIViewController()
Expand Down
6 changes: 3 additions & 3 deletions drivers/apple_embedded/godot_view_apple_embedded.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
class String;

@class GDTView;
@class GDTViewRenderer;
@protocol GDTDisplayLayer;
@protocol GDTViewRendererProtocol;

@protocol GDTViewDelegate

Expand All @@ -46,8 +46,8 @@ class String;

@interface GDTView : UIView

@property(assign, nonatomic) id<GDTViewRendererProtocol> renderer;
@property(assign, nonatomic) id<GDTViewDelegate> delegate;
@property(weak, nonatomic) GDTViewRenderer *renderer;
@property(weak, nonatomic) id<GDTViewDelegate> delegate;

@property(assign, readonly, nonatomic) BOOL isActive;

Expand Down
6 changes: 3 additions & 3 deletions drivers/apple_embedded/godot_view_apple_embedded.mm
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ - (void)stopRendering {

self.isActive = NO;

print_verbose("Stop animation!");
print_verbose("Stop rendering");

if (self.useCADisplayLink) {
[self.displayLink invalidate];
Expand All @@ -199,7 +199,7 @@ - (void)startRendering {

self.isActive = YES;

print_verbose("Start animation!");
print_verbose("Start rendering");

if (self.useCADisplayLink) {
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(drawView)];
Expand Down Expand Up @@ -237,7 +237,7 @@ - (void)drawView {
return;
}

if ([self.renderer setupView:self]) {
if ([self.renderer setUp]) {
return;
}

Expand Down
10 changes: 2 additions & 8 deletions drivers/apple_embedded/godot_view_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,11 @@

#pragma once

#import "godot_renderer.h"
#import <UIKit/UIKit.h>

@protocol GDTViewRendererProtocol <NSObject>
@interface GDTViewRenderer : GDTRenderer

@property(assign, readonly, nonatomic) BOOL hasFinishedSetup;

- (BOOL)setupView:(UIView *)view;
- (void)renderOnView:(UIView *)view;

@end

@interface GDTViewRenderer : NSObject <GDTViewRendererProtocol>

@end
Loading