Skip to content

Commit 60a6fc2

Browse files
committed
Fix compilation with gcc
1 parent 6019477 commit 60a6fc2

File tree

10 files changed

+35
-30
lines changed

10 files changed

+35
-30
lines changed

.github/workflows/rpcsx.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,22 @@ jobs:
2525
run: |
2626
sudo apt update
2727
sudo apt install -y cmake build-essential libunwind-dev \
28-
libglfw3-dev libvulkan-dev vulkan-validationlayers-dev \
28+
libglfw3-dev libvulkan-dev vulkan-validationlayers \
2929
libsox-dev
30+
echo "deb http://azure.archive.ubuntu.com/ubuntu noble main universe" | sudo tee /etc/apt/sources.list
31+
sudo apt update
32+
sudo apt install g++-14
3033
VULKANVER=1.3.259
3134
curl -sSfLo Vulkan-Headers.tar.gz https://github.com/KhronosGroup/Vulkan-Headers/archive/v${VULKANVER}.tar.gz
3235
tar -xf Vulkan-Headers*.tar.gz
3336
cd Vulkan-Headers*/
34-
mkdir build && cd build
35-
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
36-
make -j$(nproc)
37-
sudo make install
37+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_INSTALL_PREFIX=/usr
38+
cmake --build build --target install -j$(nproc)
3839
3940
- name: Build RPCSX
4041
run: |
41-
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_INIT="-march=native" && \
42-
cmake --build build -j4
42+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_CXX_FLAGS_INIT="-march=native" && \
43+
cmake --build build -j$(nproc)
4344
4445
- name: Upload RPCSX
4546
uses: actions/upload-artifact@v4

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
url = ../../RPCSX/xbyak.git
44
[submodule "3rdparty/SPIRV-Tools"]
55
path = 3rdparty/SPIRV-Tools
6-
url = ../../KhronosGroup/SPIRV-Tools.git
6+
url = ../../RPCSX/SPIRV-Tools.git
77
[submodule "3rdparty/SPIRV-Headers"]
88
path = 3rdparty/SPIRV-Headers
99
url = ../../KhronosGroup/SPIRV-Headers.git

3rdparty/CMakeLists.txt

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,32 @@ if(NOT SPIRV-Tools-opt_FOUND)
1313
endif()
1414

1515
if(NOT SPIRV-Cross_FOUND)
16-
set(SPIRV_CROSS_SHARED on)
17-
set(SPIRV_CROSS_STATIC on)
18-
set(SPIRV_CROSS_ENABLE_GLSL on)
19-
set(SPIRV_CROSS_ENABLE_HLSL off)
20-
set(SPIRV_CROSS_ENABLE_MSL off)
21-
set(SPIRV_CROSS_ENABLE_CPP off)
22-
set(SPIRV_CROSS_ENABLE_REFLECT off)
23-
set(SPIRV_CROSS_ENABLE_C_API off)
24-
set(SPIRV_CROSS_ENABLE_UTIL off)
25-
set(SPIRV_CROSS_CLI off)
26-
set(SPIRV_CROSS_ENABLE_TESTS off)
27-
set(SPIRV_CROSS_SKIP_INSTALL on)
16+
option(SPIRV_CROSS_SHARED "" on)
17+
option(SPIRV_CROSS_STATIC "" on)
18+
option(SPIRV_CROSS_ENABLE_GLSL "" on)
19+
option(SPIRV_CROSS_ENABLE_HLSL "" off)
20+
option(SPIRV_CROSS_ENABLE_MSL "" off)
21+
option(SPIRV_CROSS_ENABLE_CPP "" off)
22+
option(SPIRV_CROSS_ENABLE_REFLECT "" off)
23+
option(SPIRV_CROSS_ENABLE_C_API "" off)
24+
option(SPIRV_CROSS_ENABLE_UTIL "" off)
25+
option(SPIRV_CROSS_CLI "" off)
26+
option(SPIRV_CROSS_ENABLE_TESTS "" off)
27+
option(SPIRV_CROSS_SKIP_INSTALL "" on)
2828
add_subdirectory(SPIRV-Cross)
29+
30+
install(TARGETS spirv-cross-c-shared LIBRARY DESTINATION bin)
31+
set_target_properties(spirv-cross-c-shared PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
2932
endif()
3033

31-
if(NOT glslang_FOUND)
34+
# if(NOT glslang_FOUND)
3235
add_subdirectory(glslang)
3336
if(NOT TARGET glslang::glslang-standalone)
3437
add_executable(glslang::glslang-standalone ALIAS glslang-standalone)
3538
endif()
36-
endif()
39+
# endif()
3740

3841
if(NOT nlohmann_json_FOUND)
3942
add_subdirectory(json)
4043
endif()
44+

3rdparty/SPIRV-Cross

rpcsx-gpu2/Registers.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ amdgpu::Registers::Context amdgpu::Registers::Context::Default = [] {
4949
result.vgtOutDeallocCntl = 0x10;
5050
return result;
5151
}();
52-

rpcsx-gpu2/Registers.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,4 +928,4 @@ struct Registers {
928928
};
929929

930930
#pragma pack(pop)
931-
} // namespace amdgpu
931+
} // namespace amdgpu

rpcsx-gpu2/lib/amdgpu-tiler/include/amdgpu/tiler.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <cstdlib>
66
#include <gnm/constants.hpp>
77
#include <gnm/descriptors.hpp>
8+
#include <bit>
89

910
namespace amdgpu {
1011
inline constexpr uint32_t kMicroTileWidth = 8;

rpcsx-gpu2/lib/amdgpu-tiler/src/tiler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include "gnm/constants.hpp"
22
#include <amdgpu/tiler.hpp>
3-
#include <gnm/gnm.hpp>
43
#include <bit>
4+
#include <gnm/gnm.hpp>
55

66
using namespace amdgpu;
77

8-
static constexpr SurfaceInfo
8+
static SurfaceInfo
99
computeTexture1dInfo(ArrayMode arrayMode, gnm::TextureType type,
1010
gnm::DataFormat dfmt, std::uint32_t width,
1111
std::uint32_t height, std::uint32_t depth,
@@ -167,7 +167,7 @@ computeTexture1dInfo(ArrayMode arrayMode, gnm::TextureType type,
167167
return result;
168168
}
169169

170-
static constexpr SurfaceInfo computeTextureLinearInfo(
170+
static SurfaceInfo computeTextureLinearInfo(
171171
ArrayMode arrayMode, gnm::TextureType type, gnm::DataFormat dfmt,
172172
std::uint32_t width, std::uint32_t height, std::uint32_t depth,
173173
std::uint32_t pitch, int baseArrayLayer, int arrayCount, int baseMipLevel,

rpcsx-gpu2/lib/gnm/include/gnm/gnm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ constexpr int getTexelsPerElement(gnm::DataFormat dfmt) {
2525
}
2626
}
2727

28-
inline int getBitsPerElement(DataFormat dfmt) {
28+
constexpr int getBitsPerElement(DataFormat dfmt) {
2929
switch (dfmt) {
3030
case kDataFormatInvalid:
3131
return 0;

0 commit comments

Comments
 (0)