Fix compilation with gcc

This commit is contained in:
DH 2024-09-25 20:09:46 +03:00
parent 6019477fcb
commit 9a9006f2b4
10 changed files with 36 additions and 30 deletions

View File

@ -25,21 +25,23 @@ jobs:
run: |
sudo apt update
sudo apt install -y cmake build-essential libunwind-dev \
libglfw3-dev libvulkan-dev vulkan-validationlayers-dev \
libglfw3-dev libvulkan-dev vulkan-validationlayers \
libsox-dev
echo "deb http://azure.archive.ubuntu.com/ubuntu noble main universe" | sudo tee /etc/apt/sources.list
sudo apt update
sudo apt install g++-14
VULKANVER=1.3.259
curl -sSfLo Vulkan-Headers.tar.gz https://github.com/KhronosGroup/Vulkan-Headers/archive/v${VULKANVER}.tar.gz
tar -xf Vulkan-Headers*.tar.gz
cd Vulkan-Headers*/
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make -j$(nproc)
sudo make install
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build -j$(nproc)
sudo cmake --build build --target install
- name: Build RPCSX
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_INIT="-march=native" && \
cmake --build build -j4
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_CXX_FLAGS_INIT="-march=native" && \
cmake --build build -j$(nproc)
- name: Upload RPCSX
uses: actions/upload-artifact@v4

2
.gitmodules vendored
View File

@ -3,7 +3,7 @@
url = ../../RPCSX/xbyak.git
[submodule "3rdparty/SPIRV-Tools"]
path = 3rdparty/SPIRV-Tools
url = ../../KhronosGroup/SPIRV-Tools.git
url = ../../RPCSX/SPIRV-Tools.git
[submodule "3rdparty/SPIRV-Headers"]
path = 3rdparty/SPIRV-Headers
url = ../../KhronosGroup/SPIRV-Headers.git

View File

@ -13,28 +13,32 @@ if(NOT SPIRV-Tools-opt_FOUND)
endif()
if(NOT SPIRV-Cross_FOUND)
set(SPIRV_CROSS_SHARED on)
set(SPIRV_CROSS_STATIC on)
set(SPIRV_CROSS_ENABLE_GLSL on)
set(SPIRV_CROSS_ENABLE_HLSL off)
set(SPIRV_CROSS_ENABLE_MSL off)
set(SPIRV_CROSS_ENABLE_CPP off)
set(SPIRV_CROSS_ENABLE_REFLECT off)
set(SPIRV_CROSS_ENABLE_C_API off)
set(SPIRV_CROSS_ENABLE_UTIL off)
set(SPIRV_CROSS_CLI off)
set(SPIRV_CROSS_ENABLE_TESTS off)
set(SPIRV_CROSS_SKIP_INSTALL on)
option(SPIRV_CROSS_SHARED "" on)
option(SPIRV_CROSS_STATIC "" on)
option(SPIRV_CROSS_ENABLE_GLSL "" on)
option(SPIRV_CROSS_ENABLE_HLSL "" off)
option(SPIRV_CROSS_ENABLE_MSL "" off)
option(SPIRV_CROSS_ENABLE_CPP "" off)
option(SPIRV_CROSS_ENABLE_REFLECT "" off)
option(SPIRV_CROSS_ENABLE_C_API "" off)
option(SPIRV_CROSS_ENABLE_UTIL "" off)
option(SPIRV_CROSS_CLI "" off)
option(SPIRV_CROSS_ENABLE_TESTS "" off)
option(SPIRV_CROSS_SKIP_INSTALL "" on)
add_subdirectory(SPIRV-Cross)
install(TARGETS spirv-cross-c-shared LIBRARY DESTINATION bin)
set_target_properties(spirv-cross-c-shared PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
endif()
if(NOT glslang_FOUND)
# if(NOT glslang_FOUND)
add_subdirectory(glslang)
if(NOT TARGET glslang::glslang-standalone)
add_executable(glslang::glslang-standalone ALIAS glslang-standalone)
endif()
endif()
# endif()
if(NOT nlohmann_json_FOUND)
add_subdirectory(json)
endif()

@ -1 +1 @@
Subproject commit 6a1fb66eef1bdca14acf7d0a51a3f883499d79f0
Subproject commit f84c1fbe3cbb69fa99e9115f658e52df0e95f1bf

@ -1 +1 @@
Subproject commit b21dda0ee7a3ea4e0192a7b2b09db1df1de9d5e7
Subproject commit dafc684588304bdf3b745457fd517ec8f2edc3c6

View File

@ -49,4 +49,3 @@ amdgpu::Registers::Context amdgpu::Registers::Context::Default = [] {
result.vgtOutDeallocCntl = 0x10;
return result;
}();

View File

@ -5,6 +5,7 @@
#include <cstdlib>
#include <gnm/constants.hpp>
#include <gnm/descriptors.hpp>
#include <bit>
namespace amdgpu {
inline constexpr uint32_t kMicroTileWidth = 8;

View File

@ -1,11 +1,11 @@
#include "gnm/constants.hpp"
#include <amdgpu/tiler.hpp>
#include <gnm/gnm.hpp>
#include <bit>
#include <gnm/gnm.hpp>
using namespace amdgpu;
static constexpr SurfaceInfo
static SurfaceInfo
computeTexture1dInfo(ArrayMode arrayMode, gnm::TextureType type,
gnm::DataFormat dfmt, std::uint32_t width,
std::uint32_t height, std::uint32_t depth,
@ -167,7 +167,7 @@ computeTexture1dInfo(ArrayMode arrayMode, gnm::TextureType type,
return result;
}
static constexpr SurfaceInfo computeTextureLinearInfo(
static SurfaceInfo computeTextureLinearInfo(
ArrayMode arrayMode, gnm::TextureType type, gnm::DataFormat dfmt,
std::uint32_t width, std::uint32_t height, std::uint32_t depth,
std::uint32_t pitch, int baseArrayLayer, int arrayCount, int baseMipLevel,

View File

@ -25,7 +25,7 @@ constexpr int getTexelsPerElement(gnm::DataFormat dfmt) {
}
}
inline int getBitsPerElement(DataFormat dfmt) {
constexpr int getBitsPerElement(DataFormat dfmt) {
switch (dfmt) {
case kDataFormatInvalid:
return 0;