Skip to content

Commit c38b084

Browse files
committed
Fix compilation with gcc
1 parent 6019477 commit c38b084

File tree

10 files changed

+30
-23
lines changed

10 files changed

+30
-23
lines changed

.github/workflows/rpcsx.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ 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*/
3437
mkdir build && cd build
35-
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
38+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_INSTALL_PREFIX=/usr
3639
make -j$(nproc)
3740
sudo make install
3841

.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: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,22 @@ 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

3134
if(NOT glslang_FOUND)
@@ -38,3 +41,4 @@ endif()
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)