diff --git a/.travis.yml b/.travis.yml index d05e2b979d..9b8c3de021 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ before_install: fi; before_script: - - git submodule update --init asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers Utilities/yaml-cpp + - git submodule update --init rsx_program_decompiler asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers Utilities/yaml-cpp - mkdir build - cd build - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake ..; else cmake .. -DLLVM_DIR=/usr/local/opt/llvm36/lib/llvm-3.6/share/llvm/cmake; fi diff --git a/CMakeLists.txt b/CMakeLists.txt index e9694ce636..ca5fb6699d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,4 +23,4 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin") add_subdirectory( Vulkan ) add_subdirectory( rpcs3 ) - +add_subdirectory( rsx_program_decompiler ) diff --git a/rpcs3.sln b/rpcs3.sln index 89f3bf4ee3..a8cb1bdaeb 100644 --- a/rpcs3.sln +++ b/rpcs3.sln @@ -18,6 +18,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3", "rpcs3\rpcs3.vcxpro {A1A8355B-0988-528E-9CC2-B971D6266669} = {A1A8355B-0988-528E-9CC2-B971D6266669} {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} = {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} {D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {D6973076-9317-4EF2-A0B8-B7A18AC0713E} + {97E17077-A21F-45EF-9C3A-73A0BC092D7E} = {97E17077-A21F-45EF-9C3A-73A0BC092D7E} + {7D73447B-3D2D-4DFE-BF62-57E644C1D09F} = {7D73447B-3D2D-4DFE-BF62-57E644C1D09F} {8B867186-A0B5-5479-B824-E176EDD27C40} = {8B867186-A0B5-5479-B824-E176EDD27C40} {87B42A9C-3F5C-53D7-9017-2B1CAE39457D} = {87B42A9C-3F5C-53D7-9017-2B1CAE39457D} {8BC303AB-25BE-4276-8E57-73F171B2D672} = {8BC303AB-25BE-4276-8E57-73F171B2D672} diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 3a2d74af8d..8812204613 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -128,6 +128,8 @@ ${LLVM_INCLUDE_DIRS} # Includes 3rdparty stuff that isn't included yet "${RPCS3_SRC_DIR}/../3rdparty/GL" "${RPCS3_SRC_DIR}/../3rdparty/stblib" +"${RPCS3_SRC_DIR}/../rsx_program_decompiler/rsx_decompiler" +"${RPCS3_SRC_DIR}/../rsx_program_decompiler/shader_code" ) if(WIN32) include_directories(BEFORE "${RPCS3_SRC_DIR}/../3rdparty/XAudio2_7") # Slimmed down version of minidx9 for XAudio2_7 only @@ -205,5 +207,7 @@ if(LLVM_FOUND) target_link_libraries(rpcs3 ${LLVM_LIBS}) endif() +target_link_libraries(rpcs3 rsx_decompiler shader_code) + set_target_properties(rpcs3 PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h") cotire(rpcs3) diff --git a/rpcs3/Emu/RSX/rsx_cache.cpp b/rpcs3/Emu/RSX/rsx_cache.cpp index 535055114f..86108992ea 100644 --- a/rpcs3/Emu/RSX/rsx_cache.cpp +++ b/rpcs3/Emu/RSX/rsx_cache.cpp @@ -25,7 +25,7 @@ namespace rsx .write(raw_shader.ucode.data(), raw_shader.ucode.size()); rsx::decompiled_shader decompiled_shader = decompile(raw_shader, ctxt.lang); - auto &inserted = m_entries.insert({ raw_shader, entry_t{ decompiled_shader } }).first; + auto inserted = m_entries.insert({ raw_shader, entry_t{ decompiled_shader } }).first; inserted->second.decompiled.raw = &inserted->first; entry = &inserted->second; } @@ -74,15 +74,15 @@ namespace rsx clear(); } - program_info programs_cache::get(raw_program &raw_program, decompile_language lang) + program_info programs_cache::get(raw_program raw_program_, decompile_language lang) { - raw_program.vertex_shader.type = program_type::vertex; - raw_program.fragment_shader.type = program_type::fragment; + raw_program_.vertex_shader.type = program_type::vertex; + raw_program_.fragment_shader.type = program_type::fragment; - analyze_raw_shader(raw_program.vertex_shader); - analyze_raw_shader(raw_program.fragment_shader); + analyze_raw_shader(raw_program_.vertex_shader); + analyze_raw_shader(raw_program_.fragment_shader); - auto found = m_program_cache.find(raw_program); + auto found = m_program_cache.find(raw_program_); if (found != m_program_cache.end()) { @@ -91,10 +91,10 @@ namespace rsx program_info result; - result.vertex_shader = m_vertex_shaders_cache.get(context, raw_program.vertex_shader, raw_program.state); - result.fragment_shader = m_vertex_shaders_cache.get(context, raw_program.fragment_shader, raw_program.state); + result.vertex_shader = m_vertex_shaders_cache.get(context, raw_program_.vertex_shader, raw_program_.state); + result.fragment_shader = m_vertex_shaders_cache.get(context, raw_program_.fragment_shader, raw_program_.state); result.program = context.make_program(result.vertex_shader.complete->user_data, result.fragment_shader.complete->user_data); - m_program_cache.insert({ raw_program, result }); + m_program_cache.insert({ raw_program_, result }); return result; } diff --git a/rpcs3/Emu/RSX/rsx_cache.h b/rpcs3/Emu/RSX/rsx_cache.h index e69ba9d2ba..306130b384 100644 --- a/rpcs3/Emu/RSX/rsx_cache.h +++ b/rpcs3/Emu/RSX/rsx_cache.h @@ -22,7 +22,7 @@ namespace rsx decompile_language lang; void*(*compile_shader)(program_type type, const std::string &code); - complete_shader(*complete_shader)(const decompiled_shader &shader, program_state state); + rsx::complete_shader(*complete_shader)(const decompiled_shader &shader, program_state state); void*(*make_program)(const void *vertex_shader, const void *fragment_shader); void(*remove_program)(void *ptr); void(*remove_shader)(void *ptr); @@ -55,7 +55,7 @@ namespace rsx ~programs_cache(); - program_info get(raw_program &raw_program, decompile_language lang); + program_info get(raw_program raw_program_, decompile_language lang); void clear(); }; } diff --git a/rsx_program_decompiler b/rsx_program_decompiler index 0d3807d2ab..e4d938c768 160000 --- a/rsx_program_decompiler +++ b/rsx_program_decompiler @@ -1 +1 @@ -Subproject commit 0d3807d2ab18b13617dd01981355a64144ecdc29 +Subproject commit e4d938c76850549acd837326e2fe0890d5b4be03