forked from apple/SwiftUsd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenusd-patch.patch
More file actions
867 lines (808 loc) · 34.5 KB
/
openusd-patch.patch
File metadata and controls
867 lines (808 loc) · 34.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/build_scripts/apple_utils.py ./build_scripts/apple_utils.py
--- /Users/maddyadams/OpenUSD/build_scripts/apple_utils.py 2026-02-24 15:23:58
+++ ./build_scripts/apple_utils.py 2026-02-24 15:29:46
@@ -26,9 +26,12 @@
TARGET_ARM64 = "arm64"
TARGET_UNIVERSAL = "universal"
TARGET_IOS = "iOS"
+TARGET_IOS_SIMULATOR = "iOSSimulator"
TARGET_VISIONOS = "visionOS"
+TARGET_VISIONOS_SIMULATOR = "visionOSSimulator"
-EMBEDDED_PLATFORMS = [TARGET_IOS, TARGET_VISIONOS]
+EMBEDDED_PLATFORMS = [TARGET_IOS, TARGET_IOS_SIMULATOR,
+ TARGET_VISIONOS, TARGET_VISIONOS_SIMULATOR]
def GetBuildTargets():
return [TARGET_NATIVE,
@@ -36,7 +39,9 @@
TARGET_ARM64,
TARGET_UNIVERSAL,
TARGET_IOS,
- TARGET_VISIONOS]
+ TARGET_IOS_SIMULATOR,
+ TARGET_VISIONOS,
+ TARGET_VISIONOS_SIMULATOR]
def GetBuildTargetDefault():
return TARGET_NATIVE
@@ -123,8 +128,13 @@
sdk = "macosx"
if context.buildTarget == TARGET_IOS:
sdk = "iPhoneOS"
+ elif context.buildTarget == TARGET_IOS_SIMULATOR:
+ sdk = "iPhoneSimulator"
elif context.buildTarget == TARGET_VISIONOS:
sdk = "xrOS"
+ elif context.buildTarget == TARGET_VISIONOS_SIMULATOR:
+ sdk = "xrSimulator"
+
return sdk
def GetSDKRoot(context) -> Optional[str]:
@@ -144,8 +154,9 @@
context.targetX86 = (targetName == TARGET_X86)
context.targetARM64 = (targetName == GetTargetArmArch())
context.targetUniversal = (targetName == TARGET_UNIVERSAL)
- context.targetIOS = (targetName == TARGET_IOS)
- context.targetVisionOS = (targetName == TARGET_VISIONOS)
+ context.targetIOS = (targetName in (TARGET_IOS, TARGET_IOS_SIMULATOR))
+ context.targetVisionOS = (targetName in (TARGET_VISIONOS, TARGET_VISIONOS_SIMULATOR))
+ context.targetSimulator = (targetName in (TARGET_IOS_SIMULATOR, TARGET_VISIONOS_SIMULATOR))
if context.targetUniversal and not SupportsMacOSUniversalBinaries():
context.targetUniversal = False
raise ValueError(
@@ -158,6 +169,9 @@
TARGET_UNIVERSAL if context.targetUniversal else
context.buildTarget)
+def GetTargetPlatform(context):
+ return GetTargetName(context).replace("Simulator", "")
+
devout = open(os.devnull, 'w')
def ExtractFilesRecursive(path, cond):
@@ -402,7 +416,7 @@
def ConfigureCMakeExtraArgs(context, args:List[str]) -> List[str]:
system_name = None
if TargetEmbeddedOS(context):
- system_name = context.buildTarget
+ system_name = GetTargetPlatform(context)
if system_name:
args.append(f"-DCMAKE_SYSTEM_NAME={system_name}")
@@ -431,7 +445,7 @@
("iOS", context.buildTarget),
("IPHONEOS",sdk_name.upper())]
- if context.buildTarget == TARGET_VISIONOS:
+ if context.buildTarget in (TARGET_VISIONOS, TARGET_VISIONOS_SIMULATOR):
target_config_patches.extend([("iPhone", "XR"),
("?= 8.0", "?= 1.0")])
@@ -439,5 +453,13 @@
if context.buildTarget == TARGET_VISIONOS:
clang_config_patches.append(("-miphoneos-version-min=", "-target arm64-apple-xros"))
+ else:
+ sdk_root = GetSDKRoot(context)
+ version=os.path.basename(sdk_root).split("Simulator")[-1].replace(".sdk","")
+
+ if context.buildTarget == TARGET_VISIONOS_SIMULATOR:
+ clang_config_patches.append(("-miphoneos-version-min=", f"-target arm64-apple-xros{version}-simulator"))
+ elif context.buildTarget == TARGET_IOS_SIMULATOR:
+ clang_config_patches.append(("-miphoneos-version-min=", f"-target arm64-apple-ios{version}-simulator"))
return target_config_patches, clang_config_patches
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/build_scripts/build_usd.py ./build_scripts/build_usd.py
--- /Users/maddyadams/OpenUSD/build_scripts/build_usd.py 2026-02-24 15:23:58
+++ ./build_scripts/build_usd.py 2026-02-24 15:29:46
@@ -307,13 +307,20 @@
p.wait()
if p.returncode != 0:
+ with codecs.open("log.txt", "a", "utf-8") as logfile:
+ logfile.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M"))
+ logfile.write("\n")
+ logfile.write("{cmd} exited with returncode {returncode}"
+ .format(cmd=cmd, returncode=p.returncode))
+ logfile.write("\n")
+
# If verbosity >= 3, we'll have already been printing out command output
# so no reason to print the log file again.
if verbosity < 3:
with open("log.txt", "r") as logfile:
Print(logfile.read())
- raise RuntimeError("Failed to run '{cmd}' in {path}.\nSee {log} for more details."
- .format(cmd=cmd, path=os.getcwd(), log=os.path.abspath("log.txt")))
+ raise RuntimeError("Failed to run '{cmd}' in {path} (exited with returncode {returncode}).\nSee {log} for more details."
+ .format(cmd=cmd, path=os.getcwd(), returncode=p.returncode, log=os.path.abspath("log.txt")))
@contextlib.contextmanager
def CurrentWorkingDirectory(dir):
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/base/arch/fileSystem.h ./pxr/base/arch/fileSystem.h
--- /Users/maddyadams/OpenUSD/pxr/base/arch/fileSystem.h 2026-02-24 15:23:51
+++ ./pxr/base/arch/fileSystem.h 2026-02-24 15:29:46
@@ -36,8 +36,6 @@
#include <io.h>
#endif
-PXR_NAMESPACE_OPEN_SCOPE
-
/// \addtogroup group_arch_SystemFunctions
///@{
#if !defined(ARCH_OS_WINDOWS)
@@ -57,6 +55,8 @@
#define W_OK 2 // Test for write permission.
#define R_OK 4 // Test for read permission.
#endif
+
+PXR_NAMESPACE_OPEN_SCOPE
#if defined(ARCH_OS_WINDOWS)
#define ARCH_GLOB_NOCHECK 1
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/base/tf/CMakeLists.txt ./pxr/base/tf/CMakeLists.txt
--- /Users/maddyadams/OpenUSD/pxr/base/tf/CMakeLists.txt 2026-02-24 15:23:58
+++ ./pxr/base/tf/CMakeLists.txt 2026-02-24 15:29:46
@@ -230,6 +230,7 @@
pxrTslRobinMap/robin_map.h
pxrTslRobinMap/robin_set.h
preprocessorUtilsLite.h
+ retainReleaseHelper.h
safeTypeCompare.h
span.h
staticData.h
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/base/tf/iterator.h ./pxr/base/tf/iterator.h
--- /Users/maddyadams/OpenUSD/pxr/base/tf/iterator.h 2026-01-07 16:15:59
+++ ./pxr/base/tf/iterator.h 2026-02-24 15:29:46
@@ -418,6 +418,7 @@
using pointer = typename ReverseIterator::pointer;
using difference_type = typename ReverseIterator::difference_type;
+ #if !__swift__
static_assert(!std::is_reference<reference>::value,
"Tf_ProxyReferenceReverseIterator should only be used "
"when the underlying iterator's reference type is a "
@@ -427,6 +428,7 @@
std::random_access_iterator_tag>::value,
"Tf_ProxyReferenceReverseIterator must wrap a random "
"access iterator.");
+ #endif // #if !__swift__
Tf_ProxyReferenceReverseIterator() = default;
explicit Tf_ProxyReferenceReverseIterator(UnderlyingIterator it) :
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/base/tf/notice.h ./pxr/base/tf/notice.h
--- /Users/maddyadams/OpenUSD/pxr/base/tf/notice.h 2026-02-24 15:23:58
+++ ./pxr/base/tf/notice.h 2026-02-24 15:29:46
@@ -266,6 +266,7 @@
friend class Tf_NoticeRegistry;
friend class TfNotice;
+ friend class SwiftKey;
};
/// A \c TfNotice::Key container.
@@ -275,6 +276,16 @@
/// keys into a \c TfNotice::Keys then call \c Revoke() on it.
typedef std::vector<Key> Keys;
+ /// A key representing a listener registered from either Swift or C++
+ class SwiftKey;
+
+ /// A pxr::TfNotice::SwiftKey container.
+ ///
+ /// Many listeners listen for several notices and must revoke interest for
+ /// those several notices at once. These listeners can put all of the
+ /// keys into a `pxr::TfNotice::SwiftKeys` then call ``Revoke()`` on it.
+ typedef std::vector<SwiftKey> SwiftKeys;
+
/// Register a probe that will be invoked when notices are sent and
/// delivered.
/// \see TfNotice::Probe
@@ -369,7 +380,25 @@
///
/// This revokes interest by the listener for the particular notice type
/// and call-back method for which this key was created.
+ /// \c Revoke will return a bool value indicating whether or not the key
+ /// was successfully revoked. Subsequent calls to \c Revoke with the same
+ /// key will return false.
+ TF_API
+ static bool Revoke(TfNotice::SwiftKey key);
+
+ /// Revoke interest by listeners.
///
+ /// This revokes interest by the listeners for the particular
+ /// notice types and call-back methods for which the keys were
+ /// created. It then clears the keys container.
+ TF_API
+ static void Revoke(TfNotice::SwiftKeys* keys);
+
+ /// Revoke interest by a listener.
+ ///
+ /// This revokes interest by the listener for the particular notice type
+ /// and call-back method for which this key was created.
+ ///
/// \c Revoke will return a bool value indicating whether or not the key
/// was successfully revoked. Subsequent calls to \c Revoke with the same
/// key will return false.
@@ -404,7 +433,28 @@
/// while any threads are invoking any handlers.
TF_API
static void RevokeAndWait(TfNotice::Keys* keys);
+
+ /// Revoke interest by a listener.
+ ///
+ /// This revokes interest by the listener for the particular notice type
+ /// and call-back method for which this key was created.
+ ///
+ /// \c Revoke will return a bool value indicating whether or not the key
+ /// was successfully revoked. Subsequent calls to \c Revoke with the same
+ /// key will return false. This will not return while any threads are
+ /// invoking the handler.
+ TF_API
+ static bool RevokeAndWait(TfNotice::SwiftKey key);
+ /// Revoke interest by listeners.
+ ///
+ /// This revokes interest by the listeners for the particular
+ /// notice types and call-back methods for which the keys were
+ /// created. It then clears the keys container. This will not return
+ /// while any threads are invoking any handlers.
+ TF_API
+ static void RevokeAndWait(TfNotice::SwiftKeys* keys);
+
/// Deliver the notice to interested listeners, returning the number
/// of interested listeners.
///
@@ -623,8 +673,8 @@
typedef typename Derived::NoticeType NoticeType;
TfType ret = TfType::Find<NoticeType>();
if (ret.IsUnknown())
- TF_FATAL_ERROR("notice type " + ArchGetDemangled<NoticeType>() +
- " undefined in the TfType system");
+ TF_FATAL_ERROR(("notice type " + ArchGetDemangled<NoticeType>() +
+ " undefined in the TfType system").c_str());
return ret;
}
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/base/tf/refBase.h ./pxr/base/tf/refBase.h
--- /Users/maddyadams/OpenUSD/pxr/base/tf/refBase.h 2026-01-07 16:15:59
+++ ./pxr/base/tf/refBase.h 2026-02-24 15:29:46
@@ -125,6 +125,8 @@
template <typename T> friend TfRefPtr<T>
TfCreateRefPtrFromProtectedWeakPtr(TfWeakPtr<T> const &);
+
+ friend class Tf_RetainReleaseHelper;
};
/// \class TfSimpleRefBase
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/base/tf/refPtr.h ./pxr/base/tf/refPtr.h
--- /Users/maddyadams/OpenUSD/pxr/base/tf/refPtr.h 2026-01-07 16:15:59
+++ ./pxr/base/tf/refPtr.h 2026-02-24 15:29:46
@@ -423,6 +423,7 @@
#include <typeinfo>
#include <type_traits>
#include <cstddef>
+#include <swift/bridging>
PXR_NAMESPACE_OPEN_SCOPE
@@ -934,7 +935,7 @@
}
/// Dereferences the stored pointer.
- T& operator *() const {
+ T& operator *() const SWIFT_NAME(__operatorStar()) {
return *operator->();
}
@@ -1090,6 +1091,10 @@
_Counter::AddRef(_refBase);
}
+ static void _AddRefStatic(TfRefBase* _refBase) {
+ _Counter::AddRef(_refBase);
+ }
+
void _RemoveRef(const TfRefBase* ptr) const {
if (_Counter::RemoveRef(ptr)) {
Tf_RefPtrTracker_LastRef(this, ptr, _NullT);
@@ -1097,6 +1102,15 @@
}
}
+ static void _RemoveRefStatic(const TfRefBase* ptr) {
+ if (_Counter::RemoveRef(ptr)) {
+ Tf_RefPtrTracker_LastRef(nullptr,
+ reinterpret_cast<T*>(const_cast<TfRefBase*>(ptr)),
+ _NullT);
+ delete ptr;
+ }
+ }
+
#if ! defined(doxygen)
// doxygen is very confused by this. It declares all TfRefPtrs
// to be friends.
@@ -1108,6 +1122,7 @@
friend TfRefPtr<U> TfCreateRefPtrFromProtectedWeakPtr(TfWeakPtr<U> const &);
#endif
friend class TfWeakBase;
+ friend class Tf_RetainReleaseHelper;
};
#if !defined(doxygen)
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/base/tf/retainReleaseHelper.h ./pxr/base/tf/retainReleaseHelper.h
--- /Users/maddyadams/OpenUSD/pxr/base/tf/retainReleaseHelper.h 1969-12-31 16:00:00
+++ ./pxr/base/tf/retainReleaseHelper.h 2026-02-24 15:29:46
@@ -0,0 +1,47 @@
+#ifndef retainReleaseHelper_hpp
+#define retainReleaseHelper_hpp
+
+#include "pxr/pxr.h"
+#include "pxr/base/tf/refBase.h"
+#include "pxr/base/tf/refPtr.h"
+
+PXR_NAMESPACE_OPEN_SCOPE
+
+// This class exposes functions to manually manipulate the reference count of a TfRefBase.
+// Never call these functions directly; they are provided for the purposes of importing TfRefBase
+// with reference counting semantics into a language with automatic reference counting mechanisms.
+
+// TfRefPtr<TfRefBase> isn't supported, so we can't use the static member functions.
+// Instead, just use the no-unique-change-counter body
+class Tf_RetainReleaseHelper {
+public:
+ // Increments the reference count of the argument by 1.
+ template <class T>
+ inline static void retain(T* obj) {
+ if constexpr (std::is_same_v<pxr::TfRefBase, T>) {
+ pxr::Tf_RefPtr_Counter::AddRef(obj);
+ } else {
+ TfRefPtr<T>::_AddRefStatic(obj);
+ }
+ }
+
+ // Decrements the reference count of the argument by 1, deleting the argument
+ // if the reference count reaches 0.
+ template <class T>
+ inline static void release(T* obj) {
+ if constexpr (std::is_same_v<pxr::TfRefBase, T>) {
+ if (pxr::Tf_RefPtr_Counter::RemoveRef(obj)) {
+ pxr::Tf_RefPtrTracker_LastRef(nullptr,
+ reinterpret_cast<T*>(const_cast<TfRefBase*>(obj)),
+ nullptr);
+ delete obj;
+ }
+ } else{
+ TfRefPtr<T>::_RemoveRefStatic(obj);
+ }
+ }
+};
+
+PXR_NAMESPACE_CLOSE_SCOPE
+
+#endif /* retainReleaseHelper_h */
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/base/tf/weakPtrFacade.h ./pxr/base/tf/weakPtrFacade.h
--- /Users/maddyadams/OpenUSD/pxr/base/tf/weakPtrFacade.h 2026-01-07 16:15:59
+++ ./pxr/base/tf/weakPtrFacade.h 2026-02-24 15:29:46
@@ -17,6 +17,7 @@
#include "pxr/base/arch/demangle.h"
#include <type_traits>
+#include <swift/bridging>
PXR_NAMESPACE_OPEN_SCOPE
@@ -185,7 +186,7 @@
TF_CALL_CONTEXT, typeid(Derived).name());
}
- DataType &operator * () const {
+ DataType &operator * () const SWIFT_NAME(__operatorStar()) {
return * operator->();
}
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/base/trace/eventNode.h ./pxr/base/trace/eventNode.h
--- /Users/maddyadams/OpenUSD/pxr/base/trace/eventNode.h 2026-02-24 15:23:56
+++ ./pxr/base/trace/eventNode.h 2026-02-24 15:29:46
@@ -146,9 +146,8 @@
// Out-of-line to avoid inlining the multimap dtor code.
TRACE_API void _DeleteAttrMap(AttributeMap *attrMap);
- // _category (4 bytes) is first so it packs with TfRefBase's 4-byte count.
- const TraceCategoryId _category;
const TfToken _key;
+ const TraceCategoryId _category;
TimeStamp _beginTime;
TimeStamp _endTime;
// Empirical results show ~85% of nodes have < 2 children.
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/base/vt/dictionary.h ./pxr/base/vt/dictionary.h
--- /Users/maddyadams/OpenUSD/pxr/base/vt/dictionary.h 2026-02-24 15:23:58
+++ ./pxr/base/vt/dictionary.h 2026-02-24 15:29:46
@@ -448,8 +448,8 @@
{
VtDictionary::const_iterator i = dictionary.find(key);
if (ARCH_UNLIKELY(i == dictionary.end())) {
- TF_FATAL_ERROR("Attempted to get value for key '" + key +
- "', which is not in the dictionary.");
+ TF_FATAL_ERROR(("Attempted to get value for key '" + key +
+ "', which is not in the dictionary.").c_str());
}
return i->second.Get<T>();
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/exec/exec/CMakeLists.txt ./pxr/exec/exec/CMakeLists.txt
--- /Users/maddyadams/OpenUSD/pxr/exec/exec/CMakeLists.txt 2026-02-24 15:23:58
+++ ./pxr/exec/exec/CMakeLists.txt 2026-02-24 15:29:46
@@ -32,6 +32,7 @@
systemChangeProcessor
systemDiagnostics
typeRegistry
+ valueExtractor
validationError
valueKey
@@ -79,7 +80,6 @@
uncompilationTable
uncompilationTarget
uncompiler
- valueExtractor
RESOURCE_FILES
plugInfo.json
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/exec/vdf/parallelExecutorEngineBase.h ./pxr/exec/vdf/parallelExecutorEngineBase.h
--- /Users/maddyadams/OpenUSD/pxr/exec/vdf/parallelExecutorEngineBase.h 2026-02-24 15:23:51
+++ ./pxr/exec/vdf/parallelExecutorEngineBase.h 2026-02-24 15:29:46
@@ -1893,9 +1893,9 @@
if (!privateBuffer->GetExecutorCache()) {
// No output value: Spit out a warning.
TF_WARN(
- "No value set for output " + output.GetDebugName() +
- " of type " + output.GetSpec().GetType().GetTypeName() +
- " named " + output.GetName().GetString());
+ ("No value set for output " + output.GetDebugName() +
+ " of type " + output.GetSpec().GetType().GetTypeName() +
+ " named " + output.GetName().GetString()).c_str());
// Fill the output with a default value.
VdfExecutionTypeRegistry::FillVector(
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/exec/vdf/poolChainIndex.h ./pxr/exec/vdf/poolChainIndex.h
--- /Users/maddyadams/OpenUSD/pxr/exec/vdf/poolChainIndex.h 2026-01-22 09:56:22
+++ ./pxr/exec/vdf/poolChainIndex.h 2026-02-24 15:29:46
@@ -53,6 +53,9 @@
return !(*this == rhs);
}
+ // Swift default argument overspecialization fix
+ VdfPoolChainIndex() {}
+
private:
friend class VdfPoolChainIndexer;
VdfPoolChainIndex(int poolChainIndex, uint32_t outputIndex)
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/exec/vdf/pullBasedExecutorEngine.h ./pxr/exec/vdf/pullBasedExecutorEngine.h
--- /Users/maddyadams/OpenUSD/pxr/exec/vdf/pullBasedExecutorEngine.h 2026-02-24 15:23:53
+++ ./pxr/exec/vdf/pullBasedExecutorEngine.h 2026-02-24 15:29:46
@@ -1020,9 +1020,9 @@
// requested because otherwise, it wouldn't be in the schedule,
// because of VdfScheduler::_RemoveTrivialNodes.)
TF_WARN(
- "No value set for output " + output.GetDebugName() +
- " of type " + output.GetSpec().GetType().GetTypeName() +
- " named " + output.GetName().GetString());
+ ("No value set for output " + output.GetDebugName() +
+ " of type " + output.GetSpec().GetType().GetTypeName() +
+ " named " + output.GetName().GetString()).c_str());
//XXX: This is not 100% right when we use a single data flow
// element to hold multiple values (as we do for shaped
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/exec/vdf/sparseInputTraverser.cpp ./pxr/exec/vdf/sparseInputTraverser.cpp
--- /Users/maddyadams/OpenUSD/pxr/exec/vdf/sparseInputTraverser.cpp 2026-01-22 09:56:22
+++ ./pxr/exec/vdf/sparseInputTraverser.cpp 2026-02-24 15:29:46
@@ -28,70 +28,6 @@
////////////////////////////////////////////////////////////////////////////////
-class VdfSparseInputTraverser::_PrioritizedOutput
-{
-public:
- _PrioritizedOutput(
- const VdfOutput *output,
- const VdfMask &dependencyMask)
- : _output(output),
- _dependencyBits(dependencyMask.GetBits())
- { }
-
- _PrioritizedOutput(
- const VdfOutput *output,
- const VdfMask &dependencyMask,
- const VdfObjectPtrVector &basePath,
- const VdfConnection *pathElement)
- : _output(output),
- _dependencyBits(dependencyMask.GetBits()),
- _path(std::make_shared<VdfObjectPtrVector>(basePath))
- {
- if (pathElement) {
- _path->push_back(pathElement);
- }
- }
-
- /// Returns the output.
- ///
- const VdfOutput *GetOutput() const {
- return _output;
- }
-
- /// Returns the accumulated dependency bits.
- ///
- const VdfMask::Bits &GetDependencyBits() const {
- return _dependencyBits;
- }
-
- /// Extends this prioritized output with \p dependencyMask and
- /// \p parentCacheIndex.
- ///
- void Extend(const VdfMask &dependencyMask) {
- _dependencyBits |= dependencyMask.GetBits();
- }
-
- /// Returns the path, or a reference to NULL if we have no path.
- const VdfObjectPtrVector &GetPath() const
- {
- static VdfObjectPtrVector empty;
- return _path ? *_path : empty;
- }
-
-private:
-
- // The output.
- const VdfOutput *_output;
-
- // The (accumulated) dependency mask.
- VdfMask::Bits _dependencyBits;
-
- // The first path that leads to this pool output.
- // The _path is held via shared pointer because we use this call as
- // value type.
- std::shared_ptr<VdfObjectPtrVector> _path;
-};
-
class VdfSparseInputTraverser::_StackFrame
{
public:
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/exec/vdf/sparseInputTraverser.h ./pxr/exec/vdf/sparseInputTraverser.h
--- /Users/maddyadams/OpenUSD/pxr/exec/vdf/sparseInputTraverser.h 2026-01-22 09:56:22
+++ ./pxr/exec/vdf/sparseInputTraverser.h 2026-02-24 15:29:46
@@ -169,7 +169,69 @@
private:
// A type used to represent an input in a priority queue.
- class _PrioritizedOutput;
+ class _PrioritizedOutput
+ {
+ public:
+ _PrioritizedOutput(
+ const VdfOutput *output,
+ const VdfMask &dependencyMask)
+ : _output(output),
+ _dependencyBits(dependencyMask.GetBits())
+ { }
+
+ _PrioritizedOutput(
+ const VdfOutput *output,
+ const VdfMask &dependencyMask,
+ const VdfObjectPtrVector &basePath,
+ const VdfConnection *pathElement)
+ : _output(output),
+ _dependencyBits(dependencyMask.GetBits()),
+ _path(std::make_shared<VdfObjectPtrVector>(basePath))
+ {
+ if (pathElement) {
+ _path->push_back(pathElement);
+ }
+ }
+
+ /// Returns the output.
+ ///
+ const VdfOutput *GetOutput() const {
+ return _output;
+ }
+
+ /// Returns the accumulated dependency bits.
+ ///
+ const VdfMask::Bits &GetDependencyBits() const {
+ return _dependencyBits;
+ }
+
+ /// Extends this prioritized output with \p dependencyMask and
+ /// \p parentCacheIndex.
+ ///
+ void Extend(const VdfMask &dependencyMask) {
+ _dependencyBits |= dependencyMask.GetBits();
+ }
+
+ /// Returns the path, or a reference to NULL if we have no path.
+ const VdfObjectPtrVector &GetPath() const
+ {
+ static VdfObjectPtrVector empty;
+ return _path ? *_path : empty;
+ }
+
+ private:
+
+ // The output.
+ const VdfOutput *_output;
+
+ // The (accumulated) dependency mask.
+ VdfMask::Bits _dependencyBits;
+
+ // The first path that leads to this pool output.
+ // The _path is held via shared pointer because we use this call as
+ // value type.
+ std::shared_ptr<VdfObjectPtrVector> _path;
+ };
// A map from pool chain index to prioritized output, used to ensure that we
// process outputs in their order in the pool chain.
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/imaging/hd/dependencySchema.h ./pxr/imaging/hd/dependencySchema.h
--- /Users/maddyadams/OpenUSD/pxr/imaging/hd/dependencySchema.h 2026-02-24 15:23:51
+++ ./pxr/imaging/hd/dependencySchema.h 2026-02-24 15:29:46
@@ -54,6 +54,9 @@
HdDependencySchema(HdContainerDataSourceHandle container)
: HdSchema(container) {}
+ // Swift default argument overspecialization fix
+ HdDependencySchema() : HdSchema() {}
+
/// @}
// --(BEGIN CUSTOM CODE: Schema Methods)--
@@ -126,4 +129,4 @@
PXR_NAMESPACE_CLOSE_SCOPE
-#endif
\ No newline at end of file
+#endif
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/imaging/hd/mergingSceneIndex.h ./pxr/imaging/hd/mergingSceneIndex.h
--- /Users/maddyadams/OpenUSD/pxr/imaging/hd/mergingSceneIndex.h 2026-02-24 15:23:53
+++ ./pxr/imaging/hd/mergingSceneIndex.h 2026-02-24 15:29:46
@@ -163,6 +163,9 @@
, sceneRoot(sceneRoot)
{
}
+
+ // Swift default argument overspecialization fix
+ _InputEntry() {}
};
// We observe that most merging scene indexes have few inputs, such as 2.
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/imaging/hd/schema.h ./pxr/imaging/hd/schema.h
--- /Users/maddyadams/OpenUSD/pxr/imaging/hd/schema.h 2026-02-24 15:23:51
+++ ./pxr/imaging/hd/schema.h 2026-02-24 15:29:46
@@ -28,6 +28,8 @@
HdSchema(HdContainerDataSourceHandle container)
: _container(std::move(container)) {}
+ // Swift default argument overspecialization fix
+ HdSchema() {}
/// Returns the container data source that this schema is interpreting.
HD_API
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/imaging/hdsi/debuggingSceneIndex.cpp ./pxr/imaging/hdsi/debuggingSceneIndex.cpp
--- /Users/maddyadams/OpenUSD/pxr/imaging/hdsi/debuggingSceneIndex.cpp 2026-01-22 09:56:22
+++ ./pxr/imaging/hdsi/debuggingSceneIndex.cpp 2026-02-24 15:29:46
@@ -29,62 +29,6 @@
// It does produce a non-trivial data source for /foo.
const bool implicitlyAddedAncestorsHaveEmptyType = true;
-// Per prim-info.
-//
-// We always store a prim info for all ancestors as well.
-// In particular, we always store a prim info for the absolute root /.
-//
-struct _PrimInfo
-{
- // Does a prim exist?
- //
- // Note that the HdSceneIndexBase does not specify whether a prim "exists".
- //
- // There are two notions of existence:
- // - The strong form is that GetPrim("/foo") returns a non-empty prim type
- // or non-null data source handle.
- // - The weak form (existence in namespace) is that a prim exists at a path
- // if (without a subsequent PrimRemovedEntry):
- // * We have received a PrimAddedEntry for the path or a descendant path
- // * GetPrim for path or a descendant path returned a non-empty prim type
- // or non-null data source
- // * GetChildPrimPaths for path or a descendant path was non-empty
- // * path is in GetChildPrimPaths(parentPath)
- //
- // Here we assume the weaker form.
- //
- // If a prim exists (in namespace), there will be a prim-info for all its
- // ancestors which are also assumed to exist.
- //
- // Note that the debugging scene index (lazily) only queries GetPrim or
- // GetChildPrimPaths itself when the client calls that method.
- //
- // If we receive a PrimRemovedEntry, we set _PrimInfo::exists = false for
- // the corresponding prim info. Such a _PrimInfo has no descendants.
- //
- // Note that the implementation could be changed to just use a bool if
- // we were to use _PrimInfo::insert instead of _PrimInfo[].
- //
- std::optional<bool> existsInNamespace;
-
- // Do we know all children of this prim?
- //
- // True if GetChildPrimPaths(path) was called or we received
- // PrimRemovedEntry(path).
- //
- bool allChildrenKnown = false;
-
- // primType if known.
- std::optional<TfToken> primType;
-
- // Does this prim have a non-null ptr data source?
- //
- // Future work might store more information about the data source and wrap
- // it so that we can track which values were returned to a client.
- //
- std::optional<bool> hasDataSource;
-};
-
void _EmitMessage(const std::string &message)
{
// Future work might throw an error/show a stack trace/...
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/imaging/hdsi/debuggingSceneIndex.h ./pxr/imaging/hdsi/debuggingSceneIndex.h
--- /Users/maddyadams/OpenUSD/pxr/imaging/hdsi/debuggingSceneIndex.h 2026-01-22 09:56:22
+++ ./pxr/imaging/hdsi/debuggingSceneIndex.h 2026-02-24 15:29:46
@@ -22,7 +22,61 @@
namespace HdsiDebuggingSceneIndex_Impl
{
-struct _PrimInfo;
+// Per prim-info.
+//
+// We always store a prim info for all ancestors as well.
+// In particular, we always store a prim info for the absolute root /.
+//
+struct _PrimInfo
+{
+ // Does a prim exist?
+ //
+ // Note that the HdSceneIndexBase does not specify whether a prim "exists".
+ //
+ // There are two notions of existence:
+ // - The strong form is that GetPrim("/foo") returns a non-empty prim type
+ // or non-null data source handle.
+ // - The weak form (existence in namespace) is that a prim exists at a path
+ // if (without a subsequent PrimRemovedEntry):
+ // * We have received a PrimAddedEntry for the path or a descendant path
+ // * GetPrim for path or a descendant path returned a non-empty prim type
+ // or non-null data source
+ // * GetChildPrimPaths for path or a descendant path was non-empty
+ // * path is in GetChildPrimPaths(parentPath)
+ //
+ // Here we assume the weaker form.
+ //
+ // If a prim exists (in namespace), there will be a prim-info for all its
+ // ancestors which are also assumed to exist.
+ //
+ // Note that the debugging scene index (lazily) only queries GetPrim or
+ // GetChildPrimPaths itself when the client calls that method.
+ //
+ // If we receive a PrimRemovedEntry, we set _PrimInfo::exists = false for
+ // the corresponding prim info. Such a _PrimInfo has no descendants.
+ //
+ // Note that the implementation could be changed to just use a bool if
+ // we were to use _PrimInfo::insert instead of _PrimInfo[].
+ //
+ std::optional<bool> existsInNamespace;
+
+ // Do we know all children of this prim?
+ //
+ // True if GetChildPrimPaths(path) was called or we received
+ // PrimRemovedEntry(path).
+ //
+ bool allChildrenKnown = false;
+
+ // primType if known.
+ std::optional<TfToken> primType;
+
+ // Does this prim have a non-null ptr data source?
+ //
+ // Future work might store more information about the data source and wrap
+ // it so that we can track which values were returned to a client.
+ //
+ std::optional<bool> hasDataSource;
+};
using _PrimInfoSharedPtr = std::shared_ptr<_PrimInfo>;
using _PrimMap = std::map<SdfPath, _PrimInfo>;
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/usd/sdf/predicateProgram.h ./pxr/usd/sdf/predicateProgram.h
--- /Users/maddyadams/OpenUSD/pxr/usd/sdf/predicateProgram.h 2026-01-07 16:15:59
+++ ./pxr/usd/sdf/predicateProgram.h 2026-02-24 15:29:46
@@ -208,7 +208,7 @@
if (!errs.empty()) {
prog = {};
- TF_RUNTIME_ERROR(errs);
+ TF_RUNTIME_ERROR(errs.c_str());
}
return prog;
}
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/pxr/usd/usdMtlx/utils.cpp ./pxr/usd/usdMtlx/utils.cpp
--- /Users/maddyadams/OpenUSD/pxr/usd/usdMtlx/utils.cpp 2026-01-22 09:56:22
+++ ./pxr/usd/usdMtlx/utils.cpp 2026-02-24 15:29:46
@@ -16,6 +16,8 @@
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdr/shaderProperty.h"
#include "pxr/base/arch/fileSystem.h"
+#include "pxr/base/arch/symbols.h"
+#include "pxr/base/arch/systemInfo.h"
#include "pxr/base/gf/matrix3d.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/gf/vec2f.h"
@@ -183,6 +185,20 @@
stdlibSearchPaths =
_MergeSearchPaths(stdlibSearchPaths, { PXR_MATERIALX_STDLIB_DIR });
#endif
+
+ std::string binaryPath;
+ ArchGetAddressInfo(reinterpret_cast<void*>(&_ComputeStdlibSearchPaths), &binaryPath,
+ nullptr, nullptr, nullptr);
+ if (!binaryPath.empty()) {
+ // binaryPath: .../Usd_UsdMtlx.framework/Versions/A/Usd_UsdMtlx
+ // toAdd: .../Usd_UsdMtlx.framework/Versions/A/Resources/MaterialX_Libraries/libraries
+ // Make toAdd strongest, because app bundles with sandboxing pick up the build directory
+ // if it exists, then fail to load and don't continue to the next path
+ std::string toAdd = TfStringCatPaths(binaryPath, "../Resources/MaterialX_Libraries/libraries");
+ stdlibSearchPaths = _MergeSearchPaths({ toAdd }, stdlibSearchPaths);
+ toAdd = TfStringCatPaths(binaryPath, "../Resources_iOS/MaterialX_Libraries/libraries");
+ stdlibSearchPaths = _MergeSearchPaths({ toAdd }, stdlibSearchPaths);
+ }
// The MaterialX plugin contains the MaterialX standard
// library under the libraries location in its resource folder