shadps4-emu / shadPS4

PS4 emulator for Windows,Linux,MacOS
https://shadps4.net/
GNU General Public License v2.0
9.4k stars 517 forks source link

Fails to build on Arch Linux #1042

Open elxkot opened 2 hours ago

elxkot commented 2 hours ago

I tried to build master with official instruction and it fails with message:

> /home/elxkot/shadPS4/src/video_core/renderer_vulkan/vk_instance.cpp:314:9: ошибка: designator order for field «vk::PhysicalDeviceVulkan12Features::samplerMirrorClampToEdge» does not match declaration order in «vk::PhysicalDeviceVulkan12Features»
>   314 |         },
>       |         ^
> /home/elxkot/shadPS4/src/video_core/renderer_vulkan/renderer_vulkan.cpp:16:32: предупреждение: неизвестная опция после «#pragma GCC diagnostic» kind [-Wpragmas]
>    16 | #pragma GCC diagnostic ignored "-Wnullability-completeness"
>       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> make[2]: *** [CMakeFiles/shadps4.dir/build.make:2442: CMakeFiles/shadps4.dir/src/video_core/renderer_vulkan/vk_instance.cpp.o] Ошибка 1
> make[2]: *** Ожидание завершения заданий…
> make[1]: *** [CMakeFiles/Makefile2:422: CMakeFiles/shadps4.dir/all] Ошибка 2
> make: *** [Makefile:156: all] Ошибка 2 

Fixed it by reordering fields in structure that was mentioned in error corresponding to official Vulkan specification: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceVulkan12Features.html

(I don't realy know what i'm doing, but now it compiles and launches)

I'm using intel Xeon E5-1650 CPU (6-core Sandy Bridge) AMD RX580 4GB 16 GB RAM Kernel: 6.10.10-zen1-1-zen Mesa Version: 24.2.3

Ein420 commented 1 hour ago

having the same/similar issue:

[ 97%] Building CXX object CMakeFiles/shadps4.dir/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp.o
/home/ein/Downloads/shadPS4/src/video_core/renderer_vulkan/vk_common.cpp:9:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
    9 | #pragma GCC diagnostic ignored "-Wnullability-completeness"
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ein/Downloads/shadPS4/src/video_core/buffer_cache/buffer.cpp:13:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
   13 | #pragma GCC diagnostic ignored "-Wnullability-completeness"
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 97%] Building CXX object CMakeFiles/shadps4.dir/src/video_core/renderer_vulkan/vk_pipeline_common.cpp.o
[ 97%] Building CXX object CMakeFiles/shadps4.dir/src/video_core/renderer_vulkan/vk_platform.cpp.o
/home/ein/Downloads/shadPS4/src/video_core/renderer_vulkan/vk_instance.cpp:18:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
   18 | #pragma GCC diagnostic ignored "-Wnullability-completeness"
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ein/Downloads/shadPS4/src/video_core/renderer_vulkan/vk_instance.cpp: In member function ‘bool Vulkan::Instance::CreateDevice()’:
/home/ein/Downloads/shadPS4/src/video_core/renderer_vulkan/vk_instance.cpp:314:9: error: designator order for field ‘vk::PhysicalDeviceVulkan12Features::samplerMirrorClampToEdge’ does not match declaration order in ‘vk::PhysicalDeviceVulkan12Features’
  314 |         },
      |         ^
/home/ein/Downloads/shadPS4/src/video_core/renderer_vulkan/renderer_vulkan.cpp:16:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
   16 | #pragma GCC diagnostic ignored "-Wnullability-completeness"
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/shadps4.dir/build.make:2865: CMakeFiles/shadps4.dir/src/video_core/renderer_vulkan/vk_instance.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:275: CMakeFiles/shadps4.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Ryzen 5 4600G RX 6600 16 GB RAM Kernel 6.10.9-arch1-2 Mesa: 24.3.0

Not exactly sure what that solution is/what to do exactly, but I assume it's to do with editing a specific part of the makefile to resemble what you linked (?)

elxkot commented 1 hour ago

Not exactly sure what that solution is/what to do exactly, but I assume it's to do with editing a specific part of the makefile to resemble what you linked (?)

I edited file ~/shadPS4/src/video_core/renderer_vulkan/vk_instance.cpp Replaced code at line 306 from:

vk::PhysicalDeviceVulkan12Features{
            .shaderFloat16 = vk12_features.shaderFloat16,
            .scalarBlockLayout = vk12_features.scalarBlockLayout,
            .uniformBufferStandardLayout = vk12_features.uniformBufferStandardLayout,
            .separateDepthStencilLayouts = vk12_features.separateDepthStencilLayouts,
            .hostQueryReset = vk12_features.hostQueryReset,
            .timelineSemaphore = vk12_features.timelineSemaphore,
            .samplerMirrorClampToEdge = vk12_features.samplerMirrorClampToEdge,
        },

To:

vk::PhysicalDeviceVulkan12Features{
            .samplerMirrorClampToEdge = vk12_features.samplerMirrorClampToEdge,
            .shaderFloat16 = vk12_features.shaderFloat16,
            .scalarBlockLayout = vk12_features.scalarBlockLayout,
            .uniformBufferStandardLayout = vk12_features.uniformBufferStandardLayout,
            .separateDepthStencilLayouts = vk12_features.separateDepthStencilLayouts,
            .hostQueryReset = vk12_features.hostQueryReset,
            .timelineSemaphore = vk12_features.timelineSemaphore,
        },

PS: It compiled, but BB crashes right after launch with some errors in log about unsupported instructions though. Sad. Apparently my CPU is too old :(

Ein420 commented 1 hour ago

Did exactly as you said, it compiles successfully. Thx