Skip to content

Commit f248ccc

Browse files
authored
Atomics and Materials (erincatto#873)
- shape material - friction and restitution callbacks from narrow phase - platform atomic wrappers - removed experimental:c11atomics flag erincatto#812 erincatto#872
1 parent c7ce16a commit f248ccc

33 files changed

Lines changed: 461 additions & 209 deletions

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ endif()
4747

4848
# Deterministic math
4949
# https://box2d.org/posts/2024/08/determinism/
50+
# todo make this apply to ClangCL
5051
if (MINGW OR APPLE OR UNIX)
5152
add_compile_options(-ffp-contract=off)
5253
endif()
@@ -100,7 +101,6 @@ if(PROJECT_IS_TOP_LEVEL)
100101

101102
# enkiTS is used by all the test apps, but not directly by the Box2D library
102103
if(BOX2D_UNIT_TESTS OR BOX2D_SAMPLES OR BOX2D_BENCHMARKS)
103-
SET(ENKITS_BUILD_EXAMPLES OFF CACHE BOOL "Build enkiTS examples")
104104

105105
# Emscripten pthread support for enkiTS
106106
if(EMSCRIPTEN)
@@ -111,7 +111,8 @@ if(PROJECT_IS_TOP_LEVEL)
111111
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${EMSCRIPTEN_PTHREADS_LINKER_FLAGS}")
112112
endif()
113113

114-
# Used in tests and samples
114+
# Task system used in tests and samples
115+
set(ENKITS_BUILD_EXAMPLES OFF CACHE BOOL "Build enkiTS examples")
115116
FetchContent_Declare(
116117
enkits
117118
GIT_REPOSITORY https://github.com/dougbinks/enkiTS.git

benchmark/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ add_executable(benchmark ${BOX2D_BENCHMARK_FILES})
77

88
set_target_properties(benchmark PROPERTIES C_STANDARD 17)
99

10-
if (MSVC AND CMAKE_C_COMPILER_ID MATCHES "MSVC")
11-
target_compile_options(benchmark PRIVATE /experimental:c11atomics)
12-
endif()
13-
1410
target_link_libraries(benchmark PRIVATE box2d shared enkiTS)
1511

1612
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES ${BOX2D_BENCHMARK_FILES})
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
threads,fps
2-
1,197.415
3-
2,338.192
4-
3,485.363
5-
4,590.58
6-
5,678.894
7-
6,755.337
8-
7,830.03
9-
8,889.992
1+
threads,ms
2+
1,2565.3
3+
2,1533.85
4+
3,1053.01
5+
4,865.702
6+
5,748.989
7+
6,658.623
8+
7,613.633
9+
8,578.973
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
threads,fps
2-
1,337.398
3-
2,599.766
4-
3,853.652
5-
4,1095.24
6-
5,1288.22
7-
6,1467.1
8-
7,1669.81
9-
8,1704.72
1+
threads,ms
2+
1,1584.03
3+
2,841.862
4+
3,598.747
5+
4,471.697
6+
5,396.306
7+
6,347.983
8+
7,309.086
9+
8,308.832
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
threads,fps
2-
1,82.5412
3-
2,156.573
4-
3,233.64
5-
4,294.31
6-
5,357.121
7-
6,420.298
8-
7,487.163
9-
8,537.355
1+
threads,ms
2+
1,2663.34
3+
2,1407.85
4+
3,934.506
5+
4,725.271
6+
5,590.288
7+
6,502.513
8+
7,422.693
9+
8,395.369

benchmark/amd7950x_avx2/rain.csv

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
threads,fps
2-
1,158.379
3-
2,253.381
4-
3,337.197
5-
4,408.427
6-
5,475.14
7-
6,530.178
8-
7,583.798
9-
8,633.102
1+
threads,ms
2+
1,6526.9
3+
2,4017.74
4+
3,3052.28
5+
4,2493.5
6+
5,2149.12
7+
6,1911.45
8+
7,1735.97
9+
8,1625.71

benchmark/amd7950x_avx2/smash.csv

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
threads,fps
2-
1,194.531
3-
2,299.76
4-
3,389.501
5-
4,469.022
6-
5,532.045
7-
6,580.977
8-
7,620.559
9-
8,655.217
1+
threads,ms
2+
1,1562.06
3+
2,1020.55
4+
3,781.193
5+
4,661.318
6+
5,580.115
7+
6,530.502
8+
7,489.672
9+
8,467.998
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
threads,fps
2-
1,342.697
3-
2,549.335
4-
3,711.477
5-
4,889.473
6-
5,1011.82
7-
6,1141.73
8-
7,1261.39
9-
8,1338.51
1+
threads,ms
2+
1,4106.89
3+
2,2635.21
4+
3,1986.32
5+
4,1614.21
6+
5,1420.63
7+
6,1272.06
8+
7,1157.16
9+
8,1091.25
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
threads,fps
2-
1,461.248
3-
2,726.229
4-
3,947.347
5-
4,1152.31
6-
5,1335.66
7-
6,1483.59
8-
7,1613.59
9-
8,1715.86
1+
threads,ms
2+
1,1613.69
3+
2,1061.88
4+
3,810.738
5+
4,670.874
6+
5,578.959
7+
6,519.473
8+
7,479.842
9+
8,437.851

benchmark/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ int main( int argc, char** argv )
394394
continue;
395395
}
396396

397-
fprintf( file, "threads, ms\n" );
397+
fprintf( file, "threads,ms\n" );
398398
for ( int threadIndex = 1; threadIndex <= maxThreadCount; ++threadIndex )
399399
{
400400
fprintf( file, "%d,%g\n", threadIndex, minTime[threadIndex - 1] );

0 commit comments

Comments
 (0)