Linux build fix

This commit is contained in:
Connor McLaughlin 2020-06-19 01:36:46 +10:00
parent 1212d24ea9
commit c023bcd234
3 changed files with 6 additions and 9 deletions

View File

@ -111,12 +111,7 @@ bool LoadVulkanLibrary()
if (libvulkan_env)
vulkan_module = dlopen(libvulkan_env, RTLD_NOW);
if (!vulkan_module)
{
// Use the libvulkan.dylib from the application bundle.
std::string executable_path = FileSystem::GetProgramPath();
std::string path = FileSystem::GetPathDirectory(executable_path.c_str()) + "/libvulkan.dylib";
vulkan_module = dlopen(path.c_str(), RTLD_NOW);
}
vulkan_module = dlopen("libvulkan.dylib", RTLD_NOW);
#else
// Names of libraries to search. Desktop should use libvulkan.so.1 or libvulkan.so.
static const char* search_lib_names[] = {"libvulkan.so.1", "libvulkan.so"};

View File

@ -400,7 +400,7 @@ std::string ShaderCache::GetPipelineCacheBaseFileName(const std::string_view& ba
ShaderCache::CacheIndexKey ShaderCache::GetCacheKey(ShaderCompiler::Type type, const std::string_view& shader_code)
{
union
union HashParts
{
struct
{
@ -409,12 +409,13 @@ ShaderCache::CacheIndexKey ShaderCache::GetCacheKey(ShaderCompiler::Type type, c
};
u8 hash[16];
};
HashParts h;
MD5Digest digest;
digest.Update(shader_code.data(), static_cast<u32>(shader_code.length()));
digest.Final(hash);
digest.Final(h.hash);
return CacheIndexKey{hash_low, hash_high, static_cast<u32>(shader_code.length()), type};
return CacheIndexKey{h.hash_low, h.hash_high, static_cast<u32>(shader_code.length()), type};
}
std::optional<ShaderCompiler::SPIRVCodeVector> ShaderCache::GetShaderSPV(ShaderCompiler::Type type,

View File

@ -4,6 +4,7 @@
#include "shader_compiler.h"
#include "vulkan_loader.h"
#include <cstdio>
#include <memory>
#include <optional>
#include <string_view>
#include <unordered_map>