replace xxhash with d implementation
This commit is contained in:
parent
f604b9a5ca
commit
486c17465b
11
dub.json
11
dub.json
@ -7,7 +7,7 @@
|
|||||||
"targetType": "executable",
|
"targetType": "executable",
|
||||||
"targetName": "Gears",
|
"targetName": "Gears",
|
||||||
"targetPath": "build",
|
"targetPath": "build",
|
||||||
"sourceFiles-linux": ["build/libvma.a", "build/libxxhash.a", "build/libstb_image.a"],
|
"sourceFiles-linux": ["build/libvma.a", "build/libstb_image.a"],
|
||||||
"sourceFiles-windows": [],
|
"sourceFiles-windows": [],
|
||||||
"importPaths": ["src/gears", "src/shared", "src/generated"],
|
"importPaths": ["src/gears", "src/shared", "src/generated"],
|
||||||
"sourcePaths": ["src/gears", "src/shared", "src/generated"],
|
"sourcePaths": ["src/gears", "src/shared", "src/generated"],
|
||||||
@ -15,6 +15,7 @@
|
|||||||
"libs-windows": [],
|
"libs-windows": [],
|
||||||
"preGenerateCommands-linux": ["./build-vma.sh", "build/Codegen", "dub main:packer", "build/Packer"],
|
"preGenerateCommands-linux": ["./build-vma.sh", "build/Codegen", "dub main:packer", "build/Packer"],
|
||||||
"preGenerateCommands-windows": [],
|
"preGenerateCommands-windows": [],
|
||||||
|
"dflags-dmd": ["-P=-DSTBI_NO_SIMD"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "packer",
|
"name": "packer",
|
||||||
@ -23,10 +24,10 @@
|
|||||||
"targetName": "Packer",
|
"targetName": "Packer",
|
||||||
"importPaths": ["src/packer", "src/shared", "src/generated"],
|
"importPaths": ["src/packer", "src/shared", "src/generated"],
|
||||||
"sourcePaths": ["src/packer", "src/shared", "src/generated"],
|
"sourcePaths": ["src/packer", "src/shared", "src/generated"],
|
||||||
"sourceFiles-linux": ["build/libxxhash.a", "build/libstb_image.a", "build/libm3d.a"],
|
"sourceFiles-linux": ["build/libstb_image.a", "build/libm3d.a"],
|
||||||
"preGenerateCommands-linux": ["./build-vma.sh"],
|
"preGenerateCommands-linux": ["./build-vma.sh"],
|
||||||
"preGenerateCommands-windows": [],
|
"preGenerateCommands-windows": [],
|
||||||
"dflags-dmd": ["-P=-DXXH_VECTOR=0", "-P=-DSTBI_NO_SIMD", "-P=-DXXH_NO_PREFTECH"],
|
"dflags-dmd": ["-P=-DSTBI_NO_SIMD"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "codegen",
|
"name": "codegen",
|
||||||
@ -35,11 +36,11 @@
|
|||||||
"targetName": "Codegen",
|
"targetName": "Codegen",
|
||||||
"importPaths": ["src/codegen", "src/shared"],
|
"importPaths": ["src/codegen", "src/shared"],
|
||||||
"sourcePaths": ["src/codegen", "src/shared"],
|
"sourcePaths": ["src/codegen", "src/shared"],
|
||||||
"sourceFiles-linux": ["build/libxxhash.a", "build/libstb_image.a"],
|
"sourceFiles-linux": ["build/libstb_image.a"],
|
||||||
"preGenerateCommands-linux": ["./build-vma.sh"],
|
"preGenerateCommands-linux": ["./build-vma.sh"],
|
||||||
"preGenerateCommands-windows": [],
|
"preGenerateCommands-windows": [],
|
||||||
"versions": ["codegen"],
|
"versions": ["codegen"],
|
||||||
"dflags-dmd": ["-P=-DXXH_VECTOR=0", "-P=-DSTBI_NO_SIMD", "-P=-DXXH_NO_PREFTECH"],
|
"dflags-dmd": ["-P=-DSTBI_NO_SIMD"],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
3332
external/xxhash/xxhash.d
vendored
Normal file
3332
external/xxhash/xxhash.d
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -22,8 +22,6 @@
|
|||||||
|
|
||||||
#include "../../external/vma/vk_mem_alloc.h"
|
#include "../../external/vma/vk_mem_alloc.h"
|
||||||
|
|
||||||
#include "../../external/xxhash/xxhash.c"
|
|
||||||
|
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
|
|
||||||
#include "../../external/stb/stb_image.h"
|
#include "../../external/stb/stb_image.h"
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import aliases;
|
import aliases;
|
||||||
|
import xxhash3;
|
||||||
import includes;
|
import includes;
|
||||||
import std.stdio;
|
import std.stdio;
|
||||||
import core.stdc.string : memset;
|
import core.stdc.string : memset;
|
||||||
@ -304,11 +305,11 @@ const u64 HASH_SEED = 5995;
|
|||||||
pragma(inline): u64
|
pragma(inline): u64
|
||||||
Hash(T)(T* value)
|
Hash(T)(T* value)
|
||||||
{
|
{
|
||||||
return XXH3_64bits_withSeed(value, T.sizeof / u8.sizeof, HASH_SEED);
|
return xxh3_64bits_withSeed(value, T.sizeof / u8.sizeof, HASH_SEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
pragma(inline): u64
|
pragma(inline): u64
|
||||||
Hash(string str)
|
Hash(string str)
|
||||||
{
|
{
|
||||||
return XXH3_64bits_withSeed(str.ptr, str.length, HASH_SEED);
|
return xxh3_64bits_withSeed(str.ptr, str.length, HASH_SEED);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user