1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 04:02:42 +01:00

cmake: simplify glslang integration (#4652)

* cmake: simplify glslang integration

* Fix warning (ignored attributes), part 2
This commit is contained in:
scribam 2018-06-06 14:45:28 +02:00 committed by kd-11
parent 5c9d0e4b46
commit 824ad4fea7
4 changed files with 13 additions and 29 deletions

View File

@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.1)
option(WITH_GDB "WITH_GDB" OFF)
option(WITHOUT_LLVM "WITHOUT_LLVM" OFF)
option(USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON)
option(VULKAN_PREBUILT "" OFF)
if (WITH_GDB)
add_definitions(-DWITH_GDB_DEBUGGER)

View File

@ -1,3 +1,4 @@
if(WIN32 AND NOT VULKAN_PREBUILT)
add_subdirectory( glslang )
endif()
set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "Skip installation" FORCE)
set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "Builds glslangValidator and spirv-remap" FORCE)
set(ENABLE_HLSL OFF CACHE BOOL "Enables HLSL input support" FORCE)
add_subdirectory(glslang)

View File

@ -259,10 +259,6 @@ if(NOT APPLE AND USE_VULKAN)
find_package(Vulkan)
if(VULKAN_FOUND)
add_definitions(-DHAVE_VULKAN)
list(APPEND ADDITIONAL_LIBS Vulkan::Vulkan)
if(VULKAN_PREBUILT)
list(APPEND ADDITIONAL_LIBS glslang HLSL OGLCompiler SPIRV OSDependent)
endif()
else()
message("WARNING! USE_VULKAN was enabled, but libvulkan was not found. RPCS3 will be compiled without Vulkan support.")
endif()
@ -299,8 +295,6 @@ ${LLVM_INCLUDE_DIRS}
"${RPCS3_SRC_DIR}/../Utilities/yaml-cpp/include"
"${RPCS3_SRC_DIR}/../asmjit/src/asmjit"
"${RPCS3_SRC_DIR}/../3rdparty/GSL/include"
"${RPCS3_SRC_DIR}/../Vulkan/glslang/glslang/Public"
"${RPCS3_SRC_DIR}/../Vulkan/glslang/"
"${RPCS3_SRC_DIR}/../3rdparty/hidapi/hidapi"
# Includes 3rdparty stuff that isn't included yet
"${RPCS3_SRC_DIR}/../3rdparty/GL"
@ -352,21 +346,6 @@ RPCS3_SRC
"${RPCS3_SRC_DIR}/../asmjit/src/asmjit/*.cpp"
)
if(NOT WIN32 AND VULKAN_FOUND)
# Compile glslang and SPIRV modules needed for glsl compilation
file(
GLOB_RECURSE
UNIX_GLSLANG
"${RPCS3_SRC_DIR}/../Vulkan/glslang/glslang/GenericCodeGen/*.cpp"
"${RPCS3_SRC_DIR}/../Vulkan/glslang/glslang/MachineIndependent/*.cpp"
"${RPCS3_SRC_DIR}/../Vulkan/glslang/glslang/OSDependent/Unix/*.cpp"
"${RPCS3_SRC_DIR}/../Vulkan/glslang/OGLCompilersDLL/*.cpp"
"${RPCS3_SRC_DIR}/../Vulkan/glslang/SPIRV/*.cpp"
)
set(RPCS3_SRC ${RPCS3_SRC} ${UNIX_GLSLANG})
endif()
#File exclusion section
if(NOT WIN32 AND NOT VULKAN_FOUND)
@ -414,10 +393,15 @@ if(UNIX)
target_link_libraries(rpcs3 ${X11_LIBRARIES})
endif()
if(VULKAN_FOUND)
target_include_directories(rpcs3 PUBLIC ${glslang_SOURCE_DIR})
target_link_libraries(rpcs3 SPIRV Vulkan::Vulkan)
endif()
target_link_libraries(rpcs3 xxhash)
if(WIN32)
target_link_libraries(rpcs3 ws2_32.lib Winmm.lib Psapi.lib gdi32.lib glslang OSDependent OGLCompiler SPIRV HLSL setupapi.lib hidapi-hid Shlwapi.lib)
target_link_libraries(rpcs3 ws2_32.lib Winmm.lib Psapi.lib gdi32.lib setupapi.lib hidapi-hid Shlwapi.lib)
if(NOT MSVC)
target_link_libraries(rpcs3 ${OPENGL_LIBRARIES} opengl32.lib glu32.lib)
else()

View File

@ -307,20 +307,20 @@ extern bool ppu_stdcx(ppu_thread& ppu, u32 addr, u64 reg_value);
class ppu_scale_table_t
{
std::array<__m128, 32 + 31> m_data;
std::array<v128, 32 + 31> m_data;
public:
ppu_scale_table_t()
{
for (s32 i = -31; i < 32; i++)
{
m_data[i + 31] = _mm_set1_ps(static_cast<float>(std::exp2(i)));
m_data[i + 31].vf = _mm_set1_ps(static_cast<float>(std::exp2(i)));
}
}
FORCE_INLINE __m128 operator [] (s32 scale) const
{
return m_data[scale + 31];
return m_data[scale + 31].vf;
}
}
const g_ppu_scale_table;