Skip to content

Commit

Permalink
Fix compilation with gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 committed Sep 25, 2024
1 parent 6019477 commit d8daad1
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 30 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/rpcsx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,22 @@ 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
sudo cmake --build build --target install -j$(nproc)
- 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
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 18 additions & 14 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

2 changes: 1 addition & 1 deletion 3rdparty/SPIRV-Cross
Submodule SPIRV-Cross updated 1 files
+5 −5 spirv_glsl.cpp
1 change: 0 additions & 1 deletion rpcsx-gpu2/Registers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ amdgpu::Registers::Context amdgpu::Registers::Context::Default = [] {
result.vgtOutDeallocCntl = 0x10;
return result;
}();

2 changes: 1 addition & 1 deletion rpcsx-gpu2/Registers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,4 +928,4 @@ struct Registers {
};

#pragma pack(pop)
} // namespace amdgpu
} // namespace amdgpu
1 change: 1 addition & 0 deletions rpcsx-gpu2/lib/amdgpu-tiler/include/amdgpu/tiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <cstdlib>
#include <gnm/constants.hpp>
#include <gnm/descriptors.hpp>
#include <bit>

namespace amdgpu {
inline constexpr uint32_t kMicroTileWidth = 8;
Expand Down
6 changes: 3 additions & 3 deletions rpcsx-gpu2/lib/amdgpu-tiler/src/tiler.cpp
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion rpcsx-gpu2/lib/gnm/include/gnm/gnm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d8daad1

Please sign in to comment.