Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-05-12 00:56:06 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-05-12 19:38:51 +0300
commit018acc5688934a0867e07105fe4c44d88f780cec (patch)
tree4b7cca7ad34b6707af4b9cab98dcf8c470990860 /build_files
parent2c784f44cf2c1b72b9e08fac6dd8f6861dfd0d83 (diff)
Build: patch USD to avoid using rdtscp instruction not available on older CPUs
Disable the new more accurate timing code, this is not needed for Blender. In USD itself this code is disabled on macOS anyway, so it should operate fine without it. Ref T97950, T95206 Differential Revision: https://developer.blender.org/D14928
Diffstat (limited to 'build_files')
-rw-r--r--build_files/build_environment/patches/usd.diff49
1 files changed, 49 insertions, 0 deletions
diff --git a/build_files/build_environment/patches/usd.diff b/build_files/build_environment/patches/usd.diff
index eb5905109a7..3d0aa4498b7 100644
--- a/build_files/build_environment/patches/usd.diff
+++ b/build_files/build_environment/patches/usd.diff
@@ -51,3 +51,52 @@ diff --git a/pxr/usd/sdr/shaderMetadataHelpers.h b/pxr/usd/sdr/shaderMetadataHel
/// \namespace ShaderMetadataHelpers
+diff --git a/pxr/base/arch/timing.h b/pxr/base/arch/timing.h
+index 517561f..fda5a1f 100644
+--- a/pxr/base/arch/timing.h
++++ b/pxr/base/arch/timing.h
+@@ -91,6 +91,10 @@ ArchGetTickTime()
+ inline uint64_t
+ ArchGetStartTickTime()
+ {
++ // BLENDER: avoid using rdtsc instruction that is not supported on older CPUs.
++ return ArchGetTickTime();
++
++#if 0
+ uint64_t t;
+ #if defined (ARCH_OS_DARWIN)
+ return ArchGetTickTime();
+@@ -123,6 +127,7 @@ ArchGetStartTickTime()
+ #error "Unsupported architecture."
+ #endif
+ return t;
++#endif
+ }
+
+ /// Get a "stop" tick time for measuring an interval of time. See
+@@ -132,6 +137,10 @@ ArchGetStartTickTime()
+ inline uint64_t
+ ArchGetStopTickTime()
+ {
++ // BLENDER: avoid using rdtsc instruction that is not supported on older CPUs.
++ return ArchGetTickTime();
++
++#if 0
+ uint64_t t;
+ #if defined (ARCH_OS_DARWIN)
+ return ArchGetTickTime();
+@@ -162,11 +171,11 @@ ArchGetStopTickTime()
+ #error "Unsupported architecture."
+ #endif
+ return t;
++#endif
+ }
+
+-#if defined (doxygen) || \
+- (!defined(ARCH_OS_DARWIN) && defined(ARCH_CPU_INTEL) && \
+- (defined(ARCH_COMPILER_CLANG) || defined(ARCH_COMPILER_GCC)))
++// BLENDER: avoid using rdtsc instruction that is not supported on older CPUs.
++#if 0
+
+ /// A simple timer class for measuring an interval of time using the
+ /// ArchTickTimer facilities.