-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathblender-4.0.2-e2k.patch
495 lines (467 loc) · 20.5 KB
/
blender-4.0.2-e2k.patch
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
From eca78a48be42bfaa20f07f0d2c74a8ad54301eb4 Mon Sep 17 00:00:00 2001
From: Ilya Kurdyukov <[email protected]>
Date: Thu, 22 Feb 2024 12:39:56 +0700
Subject: [PATCH] blender-4.0.2 e2k support
Using LCC 1.27.14
---
.../btSequentialImpulseConstraintSolver.cpp | 4 ++++
extern/cuew/include/cuew.h | 2 +-
extern/fast_float/fast_float.h | 2 +-
extern/hipew/include/hipew.h | 2 +-
intern/cycles/kernel/osl/osl.h | 4 ++++
intern/cycles/util/defines.h | 2 +-
intern/cycles/util/math_float3.h | 6 +++---
intern/cycles/util/math_float4.h | 2 +-
intern/cycles/util/optimization.h | 8 ++++++++
intern/cycles/util/simd.h | 4 ++--
intern/cycles/util/system.cpp | 6 ++++++
intern/cycles/util/transform_inverse.h | 2 +-
intern/libmv/libmv/build/build_config.h | 8 ++++++++
.../simple_pipeline/camera_intrinsics_impl.h | 6 ++++--
.../intern/geometry_component_curves.cc | 2 +-
.../intern/geometry_component_instances.cc | 2 +-
.../blenkernel/intern/geometry_component_mesh.cc | 2 +-
.../intern/geometry_component_pointcloud.cc | 4 ++--
source/blender/blenkernel/intern/volume.cc | 3 +++
.../blenlib/BLI_enumerable_thread_specific.hh | 7 +++++++
source/blender/blenlib/BLI_hash.hh | 3 +++
source/blender/blenlib/BLI_math_matrix_types.hh | 16 ++++++++++++++++
source/blender/blenlib/BLI_memory_utils.hh | 1 +
source/blender/blenlib/BLI_utildefines.h | 2 +-
source/blender/blenlib/BLI_virtual_array.hh | 3 +++
.../interface_template_attribute_search.cc | 4 ++++
26 files changed, 88 insertions(+), 19 deletions(-)
diff --git a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
index d2641c5..a0af3a4 100644
--- a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
+++ b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
@@ -115,7 +115,11 @@ static inline __m128 btSimdDot3(__m128 vec0, __m128 vec1)
#define USE_FMA 1
#define USE_FMA3_INSTEAD_FMA4 1
+#ifdef __e2k__
+#define USE_SSE4_DOT 0
+#else
#define USE_SSE4_DOT 1
+#endif
#define SSE4_DP(a, b) _mm_dp_ps(a, b, 0x7f)
#define SSE4_DP_FP(a, b) _mm_cvtss_f32(_mm_dp_ps(a, b, 0x7f))
diff --git a/extern/cuew/include/cuew.h b/extern/cuew/include/cuew.h
index 278fb11..ab32d0c 100644
--- a/extern/cuew/include/cuew.h
+++ b/extern/cuew/include/cuew.h
@@ -127,7 +127,7 @@ typedef uint32_t cuuint32_t;
typedef uint64_t cuuint64_t;
#endif
-#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__) || defined(__ppc64__) || defined(__PPC64__)
+#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__LP64__)
typedef unsigned long long CUdeviceptr;
#else
typedef unsigned int CUdeviceptr;
diff --git a/extern/fast_float/fast_float.h b/extern/fast_float/fast_float.h
index 155363a..b3918fa 100644
--- a/extern/fast_float/fast_float.h
+++ b/extern/fast_float/fast_float.h
@@ -2352,7 +2352,7 @@ struct pow5_tables {
298023223876953125UL, 1490116119384765625UL, 7450580596923828125UL,
};
#ifdef FASTFLOAT_64BIT_LIMB
- constexpr static limb large_power_of_5[] = {
+ constexpr static limb large_power_of_5[5] = {
1414648277510068013UL, 9180637584431281687UL, 4539964771860779200UL,
10482974169319127550UL, 198276706040285095UL};
#else
diff --git a/extern/hipew/include/hipew.h b/extern/hipew/include/hipew.h
index f82654f..b9c3b7e 100644
--- a/extern/hipew/include/hipew.h
+++ b/extern/hipew/include/hipew.h
@@ -86,7 +86,7 @@ typedef uint32_t hipuint32_t;
typedef uint64_t hipuint64_t;
#endif
-#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__) || defined(__ppc64__) || defined(__PPC64__)
+#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__LP64__)
typedef unsigned long long hipDeviceptr_t;
#else
typedef unsigned int hipDeviceptr_t;
diff --git a/intern/cycles/kernel/osl/osl.h b/intern/cycles/kernel/osl/osl.h
index 347b635..8797182 100644
--- a/intern/cycles/kernel/osl/osl.h
+++ b/intern/cycles/kernel/osl/osl.h
@@ -78,7 +78,11 @@ ccl_device void flatten_closure_tree(KernelGlobals kg,
case OSL_CLOSURE_MUL_ID: {
ccl_private const OSLClosureMul *mul = static_cast<ccl_private const OSLClosureMul *>(
closure);
+#ifdef __EDG__
+ weight = weight * mul->weight;
+#else
weight *= mul->weight;
+#endif
closure = mul->closure;
continue;
}
diff --git a/intern/cycles/util/defines.h b/intern/cycles/util/defines.h
index dd0299a..e6b9686 100644
--- a/intern/cycles/util/defines.h
+++ b/intern/cycles/util/defines.h
@@ -13,7 +13,7 @@
/* Bitness */
#if defined(__ppc64__) || defined(__PPC64__) || defined(__x86_64__) || defined(__ia64__) || \
- defined(_M_X64) || defined(__aarch64__)
+ defined(_M_X64) || defined(__aarch64__) || defined(__e2k__)
# define __KERNEL_64_BIT__
#endif
diff --git a/intern/cycles/util/math_float3.h b/intern/cycles/util/math_float3.h
index a123197..00eabcc 100644
--- a/intern/cycles/util/math_float3.h
+++ b/intern/cycles/util/math_float3.h
@@ -200,7 +200,7 @@ ccl_device_inline bool operator!=(const float3 a, const float3 b)
ccl_device_inline float dot(const float3 a, const float3 b)
{
-# if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__)
+# if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) && !defined(__e2k__)
return _mm_cvtss_f32(_mm_dp_ps(a, b, 0x7F));
# else
return a.x * b.x + a.y * b.y + a.z * b.z;
@@ -220,7 +220,7 @@ ccl_device_inline float dot_xy(const float3 a, const float3 b)
ccl_device_inline float len(const float3 a)
{
-#if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__)
+#if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) && !defined(__e2k__)
return _mm_cvtss_f32(_mm_sqrt_ss(_mm_dp_ps(a.m128, a.m128, 0x7F)));
#else
return sqrtf(dot(a, a));
@@ -264,7 +264,7 @@ ccl_device_inline float3 cross(const float3 a, const float3 b)
ccl_device_inline float3 normalize(const float3 a)
{
-# if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__)
+# if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) && !defined(__e2k__)
__m128 norm = _mm_sqrt_ps(_mm_dp_ps(a.m128, a.m128, 0x7F));
return float3(_mm_div_ps(a.m128, norm));
# else
diff --git a/intern/cycles/util/math_float4.h b/intern/cycles/util/math_float4.h
index 235bf3f..3dda638 100644
--- a/intern/cycles/util/math_float4.h
+++ b/intern/cycles/util/math_float4.h
@@ -364,7 +364,7 @@ ccl_device_inline float reduce_max(const float4 a)
#if !defined(__KERNEL_METAL__)
ccl_device_inline float dot(const float4 a, const float4 b)
{
-# if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__)
+# if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) && !defined(__e2k__)
# if defined(__KERNEL_NEON__)
__m128 t = vmulq_f32(a, b);
return vaddvq_f32(t);
diff --git a/intern/cycles/util/optimization.h b/intern/cycles/util/optimization.h
index d4cdc4c..98456d2 100644
--- a/intern/cycles/util/optimization.h
+++ b/intern/cycles/util/optimization.h
@@ -49,6 +49,14 @@
# define __KERNEL_SSE3__
# define __KERNEL_SSE41__
+# elif defined(__e2k__)
+
+# define __KERNEL_SSE__
+# define __KERNEL_SSE2__
+# define __KERNEL_SSE3__
+# define __KERNEL_SSSE3__
+# define __KERNEL_SSE41__
+
# endif
#endif
diff --git a/intern/cycles/util/simd.h b/intern/cycles/util/simd.h
index e612475..9e15e95 100644
--- a/intern/cycles/util/simd.h
+++ b/intern/cycles/util/simd.h
@@ -21,7 +21,7 @@
# include "util/windows.h"
#elif defined(_MSC_VER)
# include <intrin.h>
-#elif (defined(__x86_64__) || defined(__i386__))
+#elif (defined(__x86_64__) || defined(__i386__) || defined(__e2k__))
# include <x86intrin.h>
#elif defined(__KERNEL_NEON__)
# define SSE2NEON_PRECISE_MINMAX 1
@@ -225,7 +225,7 @@ type shuffle_neon(const type &a, const type &b)
# endif
#endif
-#if defined(__LZCNT__)
+#if defined(__LZCNT__) && !defined(__e2k__)
# define _lzcnt_u32 __lzcnt32
# define _lzcnt_u64 __lzcnt64
#endif
diff --git a/intern/cycles/util/system.cpp b/intern/cycles/util/system.cpp
index 0af0d1f..e5256a0 100644
--- a/intern/cycles/util/system.cpp
+++ b/intern/cycles/util/system.cpp
@@ -216,6 +216,12 @@ bool system_cpu_support_avx2()
CPUCapabilities &caps = system_cpu_capabilities();
return caps.avx2;
}
+#elif defined(__e2k__)
+bool system_cpu_support_sse2() { return true; }
+bool system_cpu_support_sse3() { return true; }
+bool system_cpu_support_sse41() { return true; }
+bool system_cpu_support_avx() { return false; }
+bool system_cpu_support_avx2() { return false; }
#else
bool system_cpu_support_sse2()
diff --git a/intern/cycles/util/transform_inverse.h b/intern/cycles/util/transform_inverse.h
index 32a62a2..0d60c64 100644
--- a/intern/cycles/util/transform_inverse.h
+++ b/intern/cycles/util/transform_inverse.h
@@ -30,7 +30,7 @@ ccl_device_forceinline float3 transform_inverse_cross(const float3 a_, const flo
ccl_device_forceinline float transform_inverse_dot(const float3 a_, const float3 b_)
{
-#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__)
+#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__) && !defined(__e2k__)
const __m128 a = (const __m128 &)a_;
const __m128 b = (const __m128 &)b_;
return _mm_cvtss_f32(_mm_dp_ps(a, b, 0x7F));
diff --git a/intern/libmv/libmv/build/build_config.h b/intern/libmv/libmv/build/build_config.h
index 1d87660..d00de4d 100644
--- a/intern/libmv/libmv/build/build_config.h
+++ b/intern/libmv/libmv/build/build_config.h
@@ -308,6 +308,11 @@
# define ARCH_CPU_PPC64 1
# define ARCH_CPU_64_BITS 1
# define ARCH_CPU_LITTLE_ENDIAN 1
+#elif defined(__e2k__)
+# define ARCH_CPU_E2K_FAMILY 1
+# define ARCH_CPU_E2K 1
+# define ARCH_CPU_64_BITS 1
+# define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__ARMEL__)
# define ARCH_CPU_ARM_FAMILY 1
# define ARCH_CPU_ARMEL 1
@@ -372,6 +377,9 @@
#if !defined(ARCH_CPU_MIPS_FAMILY)
# define ARCH_CPU_MIPS_FAMILY 0
#endif
+#if !defined(ARCH_CPU_E2K_FAMILY)
+# define ARCH_CPU_E2K_FAMILY 0
+#endif
#if !defined(ARCH_CPU_PPC64_FAMILY)
# define ARCH_CPU_PPC64_FAMILY 0
#endif
diff --git a/intern/libmv/libmv/simple_pipeline/camera_intrinsics_impl.h b/intern/libmv/libmv/simple_pipeline/camera_intrinsics_impl.h
index c8c4700..633ee11 100644
--- a/intern/libmv/libmv/simple_pipeline/camera_intrinsics_impl.h
+++ b/intern/libmv/libmv/simple_pipeline/camera_intrinsics_impl.h
@@ -64,8 +64,9 @@ void LookupWarpGrid::Compute(const CameraIntrinsics& intrinsics,
double aspx = (double)w / intrinsics.image_width();
double aspy = (double)h / intrinsics.image_height();
#if defined(_OPENMP)
+ int nthreads __attribute__((unused)) = threads_;
# pragma omp parallel for schedule(static) \
- num_threads(threads_) if (threads_ > 1 && height > 100)
+ num_threads(nthreads) if (nthreads > 1 && height > 100)
#endif
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
@@ -133,8 +134,9 @@ void LookupWarpGrid::Apply(const PixelType* input_buffer,
int channels,
PixelType* output_buffer) {
#if defined(_OPENMP)
+ int nthreads __attribute__((unused)) = threads_;
# pragma omp parallel for schedule(static) \
- num_threads(threads_) if (threads_ > 1 && height > 100)
+ num_threads(nthreads) if (nthreads > 1 && height > 100)
#endif
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
diff --git a/source/blender/blenkernel/intern/geometry_component_curves.cc b/source/blender/blenkernel/intern/geometry_component_curves.cc
index dfc5c0c..e1628f9 100644
--- a/source/blender/blenkernel/intern/geometry_component_curves.cc
+++ b/source/blender/blenkernel/intern/geometry_component_curves.cc
@@ -659,9 +659,9 @@ static ComponentAttributeProviders create_attribute_providers_for_curve()
/** \} */
+static const ComponentAttributeProviders providers = create_attribute_providers_for_curve();
static AttributeAccessorFunctions get_curves_accessor_functions()
{
- static const ComponentAttributeProviders providers = create_attribute_providers_for_curve();
AttributeAccessorFunctions fn =
attribute_accessor_functions::accessor_functions_for_providers<providers>();
fn.domain_size = [](const void *owner, const eAttrDomain domain) {
diff --git a/source/blender/blenkernel/intern/geometry_component_instances.cc b/source/blender/blenkernel/intern/geometry_component_instances.cc
index 81fe794..936b780 100644
--- a/source/blender/blenkernel/intern/geometry_component_instances.cc
+++ b/source/blender/blenkernel/intern/geometry_component_instances.cc
@@ -201,9 +201,9 @@ static ComponentAttributeProviders create_attribute_providers_for_instances()
return ComponentAttributeProviders({&position, &id}, {&instance_custom_data});
}
+static const ComponentAttributeProviders providers = create_attribute_providers_for_instances();
static AttributeAccessorFunctions get_instances_accessor_functions()
{
- static const ComponentAttributeProviders providers = create_attribute_providers_for_instances();
AttributeAccessorFunctions fn =
attribute_accessor_functions::accessor_functions_for_providers<providers>();
fn.domain_size = [](const void *owner, const eAttrDomain domain) {
diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc
index ace3d1c..bb66533 100644
--- a/source/blender/blenkernel/intern/geometry_component_mesh.cc
+++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc
@@ -1107,9 +1107,9 @@ static ComponentAttributeProviders create_attribute_providers_for_mesh()
&face_custom_data});
}
+static const ComponentAttributeProviders providers = create_attribute_providers_for_mesh();
static AttributeAccessorFunctions get_mesh_accessor_functions()
{
- static const ComponentAttributeProviders providers = create_attribute_providers_for_mesh();
AttributeAccessorFunctions fn =
attribute_accessor_functions::accessor_functions_for_providers<providers>();
fn.domain_size = [](const void *owner, const eAttrDomain domain) {
diff --git a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc
index 8f3b801..f863cfb 100644
--- a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc
+++ b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc
@@ -165,10 +165,10 @@ static ComponentAttributeProviders create_attribute_providers_for_point_cloud()
return ComponentAttributeProviders({&position, &radius, &id}, {&point_custom_data});
}
+static const ComponentAttributeProviders providers =
+ create_attribute_providers_for_point_cloud();
static AttributeAccessorFunctions get_pointcloud_accessor_functions()
{
- static const ComponentAttributeProviders providers =
- create_attribute_providers_for_point_cloud();
AttributeAccessorFunctions fn =
attribute_accessor_functions::accessor_functions_for_providers<providers>();
fn.domain_size = [](const void *owner, const eAttrDomain domain) {
diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc
index a03b476..8fb2a4d 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -1530,6 +1530,9 @@ struct CreateGridOp {
else {
return GridType::create();
}
+#ifdef __EDG__
+ return 0;
+#endif
}
};
#endif
diff --git a/source/blender/blenlib/BLI_enumerable_thread_specific.hh b/source/blender/blenlib/BLI_enumerable_thread_specific.hh
index 32886f1..83b9da8 100644
--- a/source/blender/blenlib/BLI_enumerable_thread_specific.hh
+++ b/source/blender/blenlib/BLI_enumerable_thread_specific.hh
@@ -35,7 +35,14 @@ namespace blender::threading {
#ifndef WITH_TBB
namespace enumerable_thread_specific_utils {
inline std::atomic<int> next_id = 0;
+#ifdef __EDG__
+extern thread_local int thread_id;
+#ifdef EDG_THREAD_FIX
+thread_local int thread_id = next_id.fetch_add(1, std::memory_order_relaxed);
+#endif
+#else
inline thread_local int thread_id = next_id.fetch_add(1, std::memory_order_relaxed);
+#endif
} // namespace enumerable_thread_specific_utils
#endif
diff --git a/source/blender/blenlib/BLI_hash.hh b/source/blender/blenlib/BLI_hash.hh
index f5ba712..0356a2b 100644
--- a/source/blender/blenlib/BLI_hash.hh
+++ b/source/blender/blenlib/BLI_hash.hh
@@ -93,6 +93,9 @@ template<typename T> struct DefaultHash {
/* If this results in a compiler error, no hash function for the type has been found. */
return value.hash();
}
+#ifdef __EDG__
+ return 0;
+#endif
}
template<typename U> uint64_t operator()(const U &value) const
diff --git a/source/blender/blenlib/BLI_math_matrix_types.hh b/source/blender/blenlib/BLI_math_matrix_types.hh
index 978d304..f000778 100644
--- a/source/blender/blenlib/BLI_math_matrix_types.hh
+++ b/source/blender/blenlib/BLI_math_matrix_types.hh
@@ -428,7 +428,12 @@ struct alignas(Alignment) MatBase : public vec_struct_base<VecBase<T, NumRow>, N
/* This is the reference implementation.
* Might be overloaded with vectorized / optimized code. */
row_type result(0);
+#ifdef __EDG__
+ const int nrow = NumRow;
+ unroll<NumCol>([&](auto c) { unroll<nrow>([&](auto r) { result[c] += b[c][r] * a[r]; }); });
+#else
unroll<NumCol>([&](auto c) { unroll<NumRow>([&](auto r) { result[c] += b[c][r] * a[r]; }); });
+#endif
return result;
}
@@ -488,7 +493,14 @@ struct alignas(Alignment) MatBase : public vec_struct_base<VecBase<T, NumRow>, N
friend std::ostream &operator<<(std::ostream &stream, const MatBase &mat)
{
stream << "(\n";
+#ifdef __EDG__
+ const int nrow = NumRow, ncol = NumCol;
+ unroll<NumCol>([&,nrow](auto i) {
+#define NumRow nrow
+#define NumCol ncol
+#else
unroll<NumCol>([&](auto i) {
+#endif
stream << "(";
unroll<NumRow>([&](auto j) {
/** NOTE: j and i are swapped to follow mathematical convention. */
@@ -501,6 +513,10 @@ struct alignas(Alignment) MatBase : public vec_struct_base<VecBase<T, NumRow>, N
if (i < NumCol - 1) {
stream << ",";
}
+#ifdef __EDG__
+#undef NumRow
+#undef NumCol
+#endif
stream << "\n";
});
stream << ")\n";
diff --git a/source/blender/blenlib/BLI_memory_utils.hh b/source/blender/blenlib/BLI_memory_utils.hh
index bec0281..5f177e7 100644
--- a/source/blender/blenlib/BLI_memory_utils.hh
+++ b/source/blender/blenlib/BLI_memory_utils.hh
@@ -12,6 +12,7 @@
#include <memory>
#include <new>
#include <type_traits>
+#include <cstddef> // std::byte
#include "BLI_utildefines.h"
#include "MEM_guardedalloc.h"
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 509ac86..19b5029 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -499,7 +499,7 @@ extern "C" {
/* assuming a static array */
#ifndef __cplusplus
# if defined(__GNUC__) && !defined(__cplusplus) && !defined(__clang__) && \
- !defined(__INTEL_COMPILER)
+ !defined(__INTEL_COMPILER) && !defined(__EDG__)
# define ARRAY_SIZE(arr) \
((sizeof(struct { int isnt_array : ((const void *)&(arr) == &(arr)[0]); }) * 0) + \
(sizeof(arr) / sizeof(*(arr))))
diff --git a/source/blender/blenlib/BLI_virtual_array.hh b/source/blender/blenlib/BLI_virtual_array.hh
index 59ca7cd..2dec813 100644
--- a/source/blender/blenlib/BLI_virtual_array.hh
+++ b/source/blender/blenlib/BLI_virtual_array.hh
@@ -481,6 +481,9 @@ template<typename T> struct VArrayAnyExtraInfo {
BLI_assert_unreachable();
return {};
}
+#ifdef __EDG__
+ return {};
+#endif
}
};
diff --git a/source/blender/editors/interface/interface_template_attribute_search.cc b/source/blender/editors/interface/interface_template_attribute_search.cc
index d91cee8..c43275d 100644
--- a/source/blender/editors/interface/interface_template_attribute_search.cc
+++ b/source/blender/editors/interface/interface_template_attribute_search.cc
@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifdef __EDG__
+#define EDG_THREAD_FIX
+#endif
+
/** \file
* \ingroup edinterface
*/
--
2.34.1