From f384d8704430e2e5248996825f91c05eb2f13f0d Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 7 Mar 2016 20:51:32 +0300 Subject: [PATCH] Fix build dependancies and fix gcc build Factor out _aligned_malloc functions to WIN32 only Attempt to fix CmakeLists error More CMakeLists fixes (glslang) Add OSDependent libs Add OGLCompiler and SPIRV as well --- rpcs3/CMakeLists.txt | 6 +++--- rpcs3/Emu/RSX/VK/VKHelpers.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index c74ceb44a1..8ba5a8f38c 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -191,14 +191,14 @@ if(WIN32) # I'm not sure we need all of these libs, but we link them in vs else() target_link_libraries(rpcs3 dxgi.lib d2d1.lib dwrite.lib) endif() - target_link_libraries(rpcs3 asmjit.lib avformat.lib avcodec.lib avutil.lib swresample.lib swscale.lib png16_static ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${ADDITIONAL_LIBS} ${vulkan} ${glslang}) + target_link_libraries(rpcs3 asmjit.lib avformat.lib avcodec.lib avutil.lib swresample.lib swscale.lib png16_static ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${ADDITIONAL_LIBS} vulkan glslang OSDependent OGLCompiler SPIRV) else() if(LLVM_FOUND) target_link_libraries(rpcs3 asmjit.a ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) - target_link_libraries(rpcs3 libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a png16_static ${ZLIB_LIBRARIES} ${LLVM_LIBS} ${ADDITIONAL_LIBS} ${vulkan} ${glslang}) + target_link_libraries(rpcs3 libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a png16_static ${ZLIB_LIBRARIES} ${LLVM_LIBS} ${ADDITIONAL_LIBS} vulkan glslang OSDependent OGLCompiler SPIRV) else() target_link_libraries(rpcs3 asmjit.a ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) - target_link_libraries(rpcs3 libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a png16_static ${ZLIB_LIBRARIES} ${ADDITIONAL_LIBS} ${vulkan} ${glslang}) + target_link_libraries(rpcs3 libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a png16_static ${ZLIB_LIBRARIES} ${ADDITIONAL_LIBS} vulkan glslang OSDependent OGLCompiler SPIRV) endif() endif() diff --git a/rpcs3/Emu/RSX/VK/VKHelpers.cpp b/rpcs3/Emu/RSX/VK/VKHelpers.cpp index 001265384f..a9c2c54a32 100644 --- a/rpcs3/Emu/RSX/VK/VKHelpers.cpp +++ b/rpcs3/Emu/RSX/VK/VKHelpers.cpp @@ -19,12 +19,20 @@ namespace vk VKAPI_ATTR void *VKAPI_CALL mem_alloc(void *pUserData, size_t size, size_t alignment, VkSystemAllocationScope allocationScope) { +#ifdef _WIN32 return _aligned_malloc(size, alignment); +#else + return malloc(size); +#endif } VKAPI_ATTR void VKAPI_CALL mem_free(void *pUserData, void *pMemory) { +#ifdef _WIN32 _aligned_free(pMemory); +#else + free(pMemory); +#endif } VkFormat get_compatible_sampler_format(u32 format, VkComponentMapping& swizzle, u8 swizzle_mask) @@ -278,7 +286,9 @@ namespace vk uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg, void *pUserData) { +#ifdef _WIN32 DebugBreak(); +#endif return false; }