Skip to content

Commit 5b67a75

Browse files
Sunflower DollsSunflower Dolls
authored andcommitted
Add sanitizer build option and refactor interpolateLattice kernel
Ensures bit-exact deterministic output
1 parent 17781a4 commit 5b67a75

File tree

4 files changed

+258
-192
lines changed

4 files changed

+258
-192
lines changed

lib/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,17 @@ add_library(eedi2metal SHARED
1515
target_include_directories(eedi2metal PRIVATE ${VAPOURSYNTH_INCLUDE_DIRS})
1616
option(DUMP_METAL_BUFFERS "Enable dumping of intermediate Metal buffers" OFF)
1717

18+
option(ENABLE_SANITIZERS "Enable sanitizers for detecting possible errors" OFF)
19+
1820
if(DUMP_METAL_BUFFERS)
1921
target_compile_definitions(eedi2metal PRIVATE DUMP_METAL_BUFFERS)
2022
endif()
2123

24+
if(ENABLE_SANITIZERS)
25+
target_compile_options(eedi2metal PRIVATE -fsanitize=address,undefined -fno-omit-frame-pointer)
26+
target_link_options(eedi2metal PRIVATE -fsanitize=address,undefined)
27+
endif()
28+
2229
set_target_properties(eedi2metal PROPERTIES
2330
CXX_FLAGS "-Wno-c23-extensions -mmacosx-version-min=12.0"
2431
COMPILE_FLAGS "-fobjc-arc"

lib/eedi2_common.metal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ struct EEDI2Param {
2626
uint estr, dstr, maxd;
2727
uint subSampling;
2828
uint shift;
29+
uint int_pitch;
2930
};
3031

3132
constant int limlut[33] = {6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10,

0 commit comments

Comments
 (0)