1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Changes done by [DH] rewritten

Added rsx_program_decompiler submodule
Added fs::dir iterator
Added fmt::match
This commit is contained in:
Nekotekina 2015-12-22 22:24:35 +03:00
parent e8310e6c50
commit 3ed603074c
105 changed files with 339 additions and 117 deletions

3
.gitmodules vendored
View File

@ -16,3 +16,6 @@
[submodule "minidx9"]
path = minidx9
url = https://github.com/hrydgard/minidx9.git
[submodule "rsx_program_decompiler"]
path = rsx_program_decompiler
url = https://github.com/RPCS3/rsx_program_decompiler

View File

@ -51,7 +51,7 @@ before_install:
fi;
before_script:
- git submodule update --init asmjit ffmpeg
- git submodule update --init asmjit ffmpeg rsx_program_decompiler
- 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

View File

@ -797,6 +797,24 @@ bool fs::dir::read(std::string& name, stat_t& info)
return true;
}
bool fs::dir::first(std::string& name, stat_t& info)
{
#ifdef _WIN32
if (m_path && m_dd != -1)
{
CHECK_ASSERTION(FindClose((HANDLE)m_dd));
m_dd = -1;
}
#else
if (m_path)
{
::rewinddir((DIR*)m_dd);
}
#endif
return read(name, info);
}
std::string fs::get_config_dir()
{
// Use magic static for dir initialization

View File

@ -289,6 +289,78 @@ namespace fs
// Get next directory entry (UTF-8 name and file stat)
bool read(std::string& name, stat_t& info);
bool first(std::string& name, stat_t& info);
struct entry
{
std::string name;
stat_t info;
};
class iterator
{
entry m_entry;
dir* m_parent;
public:
enum class mode
{
from_first,
from_current
};
iterator(dir* parent, mode mode_ = mode::from_first)
: m_parent(parent)
{
if (!m_parent)
{
return;
}
bool is_ok;
if (mode_ == mode::from_first)
{
is_ok = m_parent->first(m_entry.name, m_entry.info);
}
else
{
is_ok = m_parent->read(m_entry.name, m_entry.info);
}
if (!is_ok)
{
m_parent = nullptr;
}
}
entry& operator *()
{
return m_entry;
}
iterator& operator++()
{
*this = { m_parent, mode::from_current };
return *this;
}
bool operator !=(const iterator& rhs) const
{
return m_parent != rhs.m_parent;
}
};
iterator begin()
{
return{ this };
}
iterator end()
{
return{ nullptr };
}
};
// Get configuration directory

View File

@ -259,3 +259,42 @@ std::string fmt::escape(std::string source)
return source;
}
bool fmt::match(const std::string &source, const std::string &mask)
{
std::size_t source_position = 0, mask_position = 0;
for (; source_position < source.size() && mask_position < mask.size(); ++mask_position, ++source_position)
{
switch (mask[mask_position])
{
case '?': break;
case '*':
for (std::size_t test_source_position = source_position; test_source_position < source.size(); ++test_source_position)
{
if (match(source.substr(test_source_position), mask.substr(mask_position + 1)))
{
return true;
}
}
return false;
default:
if (source[source_position] != mask[mask_position])
{
return false;
}
break;
}
}
if (source_position != source.size())
return false;
if (mask_position != mask.size())
return false;
return true;
}

View File

@ -354,4 +354,5 @@ namespace fmt
std::string tolower(std::string source);
std::string toupper(std::string source);
std::string escape(std::string source);
bool match(const std::string &source, const std::string &mask);
}

View File

@ -14,7 +14,7 @@ branches:
before_build:
# until git for win 2.5 release with commit checkout
- git submodule update --init ffmpeg asmjit minidx9
- git submodule update --init ffmpeg asmjit minidx9 rsx_program_decompiler
- 7z x wxWidgets.7z -aos -oC:\rpcs3\wxWidgets > null
- if %configuration%==Release (cmake -G "Visual Studio 14 Win64")
else (7z x llvmlibs.7z -aos -oC:\rpcs3 > null && cmake -G "Visual Studio 14 Win64" -DLLVM_DIR=C:/rpcs3/llvm_build/share/llvm/cmake)

View File

@ -195,6 +195,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3-tests", "rpcs3-tests\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLGSRender", "rpcs3\GLGSRender.vcxproj", "{3384223A-6D97-4799-9862-359F85312892}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rpcs3.emu", "rpcs3.emu", "{10FBF193-D532-4CCF-B875-4C7091A7F6C2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shader_code", "rsx_program_decompiler\shader_code\shader_code.vcxproj", "{97E17077-A21F-45EF-9C3A-73A0BC092D7E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rsx_decompiler", "rsx_program_decompiler\rsx_decompiler\rsx_decompiler.vcxproj", "{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - LLVM|x64 = Debug - LLVM|x64
@ -638,6 +644,34 @@ Global
{3384223A-6D97-4799-9862-359F85312892}.Release - LLVM|x64.Build.0 = Release - LLVM|x64
{3384223A-6D97-4799-9862-359F85312892}.Release|x64.ActiveCfg = Release|x64
{3384223A-6D97-4799-9862-359F85312892}.Release|x64.Build.0 = Release|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.Debug - LLVM|x64.ActiveCfg = Debug|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.Debug - LLVM|x64.Build.0 = Debug|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.Debug - MemLeak|x64.Build.0 = Debug|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.Debug|x64.ActiveCfg = Debug|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.Debug|x64.Build.0 = Debug|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.DLL Debug|x64.ActiveCfg = Debug|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.DLL Debug|x64.Build.0 = Debug|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.DLL Release|x64.ActiveCfg = Release|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.DLL Release|x64.Build.0 = Release|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.Release - LLVM|x64.ActiveCfg = Release|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.Release - LLVM|x64.Build.0 = Release|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.Release|x64.ActiveCfg = Release|x64
{97E17077-A21F-45EF-9C3A-73A0BC092D7E}.Release|x64.Build.0 = Release|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.Debug - LLVM|x64.ActiveCfg = Debug|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.Debug - LLVM|x64.Build.0 = Debug|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.Debug - MemLeak|x64.Build.0 = Debug|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.Debug|x64.ActiveCfg = Debug|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.Debug|x64.Build.0 = Debug|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.DLL Debug|x64.ActiveCfg = Debug|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.DLL Debug|x64.Build.0 = Debug|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.DLL Release|x64.ActiveCfg = Release|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.DLL Release|x64.Build.0 = Release|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.Release - LLVM|x64.ActiveCfg = Release|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.Release - LLVM|x64.Build.0 = Release|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.Release|x64.ActiveCfg = Release|x64
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -666,10 +700,12 @@ Global
{23E1C437-A951-5943-8639-A17F3CF2E606} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{74827EBD-93DC-5110-BA95-3F2AB029B6B0} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{AC40FF01-426E-4838-A317-66354CEFAE88} = {E2A982F2-4B1A-48B1-8D77-A17A589C58D7}
{C4A10229-4712-4BD2-B63E-50D93C67A038} = {10FBF193-D532-4CCF-B875-4C7091A7F6C2}
{8BC303AB-25BE-4276-8E57-73F171B2D672} = {C8068CE9-D626-4FEA-BEE7-893F06A25BF3}
{01F4CE10-2CFB-41A8-B41F-E54337868A1D} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{00D36322-6188-4A66-B514-3B3F183E998D} = {5812E712-6213-4372-B095-9EB9BAA1F2DF}
{FAC9B17B-F4B8-4B75-8AEB-C8C7CB92B078} = {1A43FD7A-C7DD-4D04-A4D6-FAA194AAD9D2}
{3384223A-6D97-4799-9862-359F85312892} = {1A43FD7A-C7DD-4D04-A4D6-FAA194AAD9D2}
{FAC9B17B-F4B8-4B75-8AEB-C8C7CB92B078} = {10FBF193-D532-4CCF-B875-4C7091A7F6C2}
{3384223A-6D97-4799-9862-359F85312892} = {10FBF193-D532-4CCF-B875-4C7091A7F6C2}
{7D73447B-3D2D-4DFE-BF62-57E644C1D09F} = {10FBF193-D532-4CCF-B875-4C7091A7F6C2}
EndGlobalSection
EndGlobal

View File

@ -112,6 +112,8 @@ ${LLVM_INCLUDE_DIRS}
"${RPCS3_SRC_DIR}/.."
"${RPCS3_SRC_DIR}/../asmjit/src/asmjit"
"${RPCS3_SRC_DIR}/../glm"
"${RPCS3_SRC_DIR}/../rsx_program_decompiler/rsx_decompiler"
"${RPCS3_SRC_DIR}/../rsx_program_decompiler/shader_code"
)
if(WIN32)
include_directories(BEFORE "${RPCS3_SRC_DIR}/../minidx9/Include")
@ -159,6 +161,8 @@ RPCS3_SRC
"${RPCS3_SRC_DIR}/Loader/*"
"${RPCS3_SRC_DIR}/Crypto/*"
"${RPCS3_SRC_DIR}/../Utilities/*"
"${RPCS3_SRC_DIR}/../rsx_program_decompiler/rsx_decompiler/*"
"${RPCS3_SRC_DIR}/../rsx_program_decompiler/shader_code/*"
)
add_executable(rpcs3 ${RPCS3_SRC})

View File

@ -1,8 +1,6 @@
#include "stdafx.h"
#include "key_vault.h"
#include "unedat.h"
#include "Utilities/Log.h"
#include "Utilities/File.h"
void generate_key(int crypto_mode, int version, unsigned char *key_final, unsigned char *iv_final, unsigned char *key, unsigned char *iv)
{

View File

@ -1,6 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Utilities/File.h"
#include "utils.h"
#include "aes.h"
#include "sha1.h"

View File

@ -1,6 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Utilities/File.h"
#include "aes.h"
#include "sha1.h"
#include "utils.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "ARMv7Thread.h"
#include "ARMv7Interpreter.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/System.h"
#include "Emu/Memory/Memory.h"
#include "Emu/CPU/CPUDecoder.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/state.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/System.h"
#include "Emu/ARMv7/PSVFuncList.h"
#include "Emu/ARMv7/ARMv7Thread.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/System.h"
#include "Emu/state.h"

View File

@ -1,5 +1,4 @@
#pragma once
#include "Utilities/File.h"
struct WAVHeader
{

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#ifdef _MSC_VER
#include "Utilities/Log.h"
#include "Emu/System.h"
#include "Emu/state.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/IdManager.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#ifdef LLVM_AVAILABLE
#include "Utilities/Log.h"
#include "Emu/System.h"
#include "Emu/state.h"
#include "Emu/Cell/PPUDisAsm.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#ifdef LLVM_AVAILABLE
#include "Utilities/Log.h"
#include "Emu/System.h"
#include "Emu/Cell/PPULLVMRecompiler.h"
#include "Emu/Memory/Memory.h"

View File

@ -1,7 +1,6 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "PPUProgramCompiler.h"
#include "Utilities/File.h"
/*
using namespace PPU_instr;

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/state.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/SysCalls/Callback.h"

View File

@ -1,6 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Utilities/File.h"
#include "Emu/System.h"
#include "SPUDisAsm.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Crypto/sha1.h"
#include "SPURecompiler.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/IdManager.h"
#include "Emu/Memory/Memory.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/state.h"

View File

@ -7,7 +7,6 @@
#include "vfsDeviceLocalFile.h"
#include "Emu/System.h"
#include "Emu/state.h"
#include "Utilities/Log.h"
std::vector<std::string> simplify_path_blocks(const std::string& path)
{

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/File.h"
#include "vfsDirBase.h"
vfsDirBase::vfsDirBase(vfsDevice* device)

View File

@ -1,6 +1,5 @@
#pragma once
#include "vfsDirBase.h"
#include "Utilities/File.h"
class vfsLocalDir : public vfsDirBase
{

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "vfsLocalFile.h"
vfsLocalFile::vfsLocalFile(vfsDevice* device) : vfsFileBase(device)

View File

@ -1,7 +1,5 @@
#pragma once
#include "Utilities/File.h"
struct vfsStream
{
vfsStream() = default;

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "HDD.h"
void vfsHDDManager::CreateBlock(vfsHDD_Block& block)

View File

@ -1,7 +1,6 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#ifdef _MSC_VER
#include "Utilities/Log.h"
#include "XInputPadHandler.h"
namespace {

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Memory.h"
VirtualMemoryBlock RSXIOMem;

View File

@ -1,7 +1,5 @@
#pragma once
#include "Utilities/Log.h"
struct MemInfo
{
u32 addr;

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Memory.h"
#include "Emu/System.h"
#include "Utilities/Thread.h"

View File

@ -1,7 +1,6 @@
#include "stdafx.h"
#include "Emu/System.h"
#include "Utilities/Log.h"
#include "CgBinaryProgram.h"
#include "Emu/RSX/RSXFragmentProgram.h"

View File

@ -1,7 +1,5 @@
#pragma once
#include <sstream>
#include "Utilities/File.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/RSX/GL/GLVertexProgram.h"
#include "Emu/RSX/GL/GLFragmentProgram.h"

View File

@ -1,7 +1,6 @@
#include "stdafx.h"
#include "Emu/System.h"
#include "Utilities/Log.h"
#include "CgBinaryProgram.h"
#include "Emu/RSX/RSXVertexProgram.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "BufferUtils.h"
#include "Utilities/Log.h"
#define MIN2(x, y) ((x) < (y)) ? (x) : (y)
#define MAX2(x, y) ((x) > (y)) ? (x) : (y)

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"

View File

@ -2,7 +2,6 @@
#include "Emu/RSX/RSXFragmentProgram.h"
#include "Emu/RSX/RSXVertexProgram.h"
#include "Utilities/Log.h"
enum class SHADER_TYPE

View File

@ -2,7 +2,6 @@
#include "Emu/Memory/vm.h"
#include "TextureUtils.h"
#include "../RSXThread.h"
#include "Utilities/Log.h"
#define MAX2(a, b) ((a) > (b)) ? (a) : (b)

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/System.h"
#include "VertexProgramDecompiler.h"

View File

@ -1,7 +1,6 @@
#include "stdafx.h"
#include "stdafx_d3d12.h"
#ifdef _MSC_VER
#include "Utilities/Log.h"
#include "D3D12GSRender.h"
#include "d3dx12.h"

View File

@ -3,7 +3,6 @@
#ifdef _MSC_VER
#include "D3D12FragmentProgramDecompiler.h"
#include "D3D12CommonDecompiler.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"

View File

@ -2,8 +2,6 @@
#include "D3D12Utils.h"
#include "Utilities/rPlatform.h" // only for rImage
#include "Utilities/File.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/RSX/GSRender.h"

View File

@ -4,7 +4,6 @@
#include "../Common/ProgramStateCache.h"
#include "D3D12VertexProgramDecompiler.h"
#include "D3D12FragmentProgramDecompiler.h"
#include "Utilities/File.h"
struct D3D12PipelineProperties
{

View File

@ -3,8 +3,6 @@
#ifdef _MSC_VER
#include "D3D12RenderTargetSets.h"
#include "Utilities/rPlatform.h" // only for rImage
#include "Utilities/File.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/state.h"

View File

@ -3,7 +3,6 @@
#ifdef _MSC_VER
#include "D3D12GSRender.h"
#include "d3dx12.h"
#include "Utilities/Log.h"
#define STRINGIFY(x) #x
extern PFN_D3D12_SERIALIZE_ROOT_SIGNATURE wrapD3D12SerializeRootSignature;

View File

@ -3,7 +3,6 @@
#include <d3d12.h>
#include <cassert>
#include <wrl/client.h>
#include "Utilities/Log.h"
#include "Emu/Memory/vm.h"
#include "Emu/RSX/GCM.h"

View File

@ -3,7 +3,6 @@
#ifdef _MSC_VER
#include "D3D12VertexProgramDecompiler.h"
#include "D3D12CommonDecompiler.h"
#include "Utilities/Log.h"
#include "Emu/System.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "GLFragmentProgram.h"

View File

@ -1,7 +1,5 @@
#include "stdafx.h"
#include "Utilities/rPlatform.h" // only for rImage
#include "Utilities/File.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/state.h"
@ -11,6 +9,7 @@
GLGSRender::GLGSRender() : GSRender(frame_type::OpenGL)
{
shaders_cache.load(rsx::shader_language::glsl);
}
u32 GLGSRender::enable(u32 condition, u32 cap)

View File

@ -2,7 +2,6 @@
#include "GLVertexProgram.h"
#include "GLFragmentProgram.h"
#include "../Common/ProgramStateCache.h"
#include "Utilities/File.h"
struct GLTraits
{

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/System.h"
#include "GLVertexProgram.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "OpenGL.h"
void gl::init()

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "rsx_gl_texture.h"
#include "gl_helpers.h"
#include "../GCM.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/System.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules/cellVideoOut.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/state.h"
@ -12,8 +11,6 @@
#include "Common/BufferUtils.h"
#include "Utilities/types.h"
extern "C"
{
#include "libswscale/swscale.h"
@ -808,6 +805,68 @@ namespace rsx
}
} __rsx_methods;
std::string shaders_cache::path_to_root()
{
return fs::get_executable_dir() + "data/";
}
void shaders_cache::load(const std::string &path, shader_language lang)
{
std::string lang_name = convert::to<std::string>(lang);
auto extract_hash = [](const std::string &string)
{
return std::stoull(string.substr(0, string.find('.')).c_str(), 0, 16);
};
for (const fs::dir::entry &entry : fs::dir{ path })
{
if (entry.name == "." || entry.name == "..")
continue;
u64 hash;
try
{
hash = extract_hash(entry.name);
}
catch (...)
{
LOG_ERROR(RSX, "Cache file '%s' ignored", entry.name);
continue;
}
if (fmt::match(entry.name, "*.fs." + lang_name))
{
fs::file file{ path + entry.name };
decompiled_fragment_shaders.insert(hash, { (const std::string)file });
continue;
}
if (fmt::match(entry.name, "*.vs." + lang_name))
{
fs::file file{ path + entry.name };
decompiled_vertex_shaders.insert(hash, { (const std::string)file });
continue;
}
}
}
void shaders_cache::load(shader_language lang)
{
std::string root = path_to_root();
//shared cache
load(root + "cache/", lang);
std::string title_id = Emu.GetTitleID();
if (!title_id.empty())
{
load(root + title_id + "/cache/", lang);
}
}
u32 get_address(u32 offset, u32 location)
{
u32 res = 0;

View File

@ -9,6 +9,7 @@
#include "Utilities/Semaphore.h"
#include "Utilities/Thread.h"
#include "Utilities/Timer.h"
#include "Utilities/convert.h"
extern u64 get_system_time();
@ -41,6 +42,49 @@ struct frame_capture_data
extern bool user_asked_for_frame_capture;
extern frame_capture_data frame_debug;
namespace rsx
{
enum class shader_language
{
glsl,
hlsl
};
}
namespace convert
{
template<>
struct to_impl_t<rsx::shader_language, std::string>
{
static rsx::shader_language func(const std::string &from)
{
if (from == "glsl")
return rsx::shader_language::glsl;
if (from == "hlsl")
return rsx::shader_language::hlsl;
throw;
}
};
template<>
struct to_impl_t<std::string, rsx::shader_language>
{
static std::string func(rsx::shader_language from)
{
switch (from)
{
case rsx::shader_language::glsl:
return "glsl";
case rsx::shader_language::hlsl:
return "hlsl";
}
throw;
}
};
}
namespace rsx
{
namespace limits
@ -57,6 +101,53 @@ namespace rsx
};
}
struct decompiled_shader
{
std::string code;
};
struct finalized_shader
{
u64 ucode_hash;
std::string code;
};
template<typename Type, typename KeyType = u64, typename Hasher = std::hash<KeyType>>
struct cache
{
private:
std::unordered_map<KeyType, Type, Hasher> m_entries;
public:
const Type* find(u64 key) const
{
auto found = m_entries.find(key);
if (found == m_entries.end())
return nullptr;
return &found->second;
}
void insert(KeyType key, const Type &shader)
{
m_entries.insert({ key, shader });
}
};
struct shaders_cache
{
cache<decompiled_shader> decompiled_fragment_shaders;
cache<decompiled_shader> decompiled_vertex_shaders;
cache<finalized_shader> finailized_fragment_shaders;
cache<finalized_shader> finailized_vertex_shaders;
void load(const std::string &path, shader_language lang);
void load(shader_language lang);
static std::string path_to_root();
};
//TODO
union alignas(4) method_registers_t
{
@ -260,6 +351,8 @@ namespace rsx
std::stack<u32> m_call_stack;
public:
struct shaders_cache shaders_cache;
CellGcmControl* ctrl = nullptr;
Timer timer_sync;

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/IdManager.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/System.h"
#include "Emu/state.h"
#include "LogBase.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/state.h"

View File

@ -3,7 +3,6 @@
#include "Emu/System.h"
#include "Emu/state.h"
#include "Emu/SysCalls/Modules.h"
#include "Utilities/Log.h"
#include "cellSysutil.h"
#include "cellNetCtl.h"

View File

@ -6,7 +6,6 @@
#include "Emu/FS/VFS.h"
#include "Emu/FS/vfsFile.h"
#include "Emu/FS/vfsDir.h"
#include "Utilities/File.h"
#include "Loader/PSF.h"
#include "cellSaveData.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/state.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/IdManager.h"

View File

@ -6,7 +6,6 @@
#include "Emu/SysCalls/lv2/sys_process.h"
#include "Emu/FS/VFS.h"
#include "Utilities/File.h"
#include "Emu/FS/vfsDir.h"
#include "Crypto/unedat.h"
#include "sceNp.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/SysCalls/Modules.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/SysCalls/Modules.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Utilities/AutoPause.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/SysCalls/SysCalls.h"

View File

@ -4,8 +4,6 @@
#include "events.h"
#include "state.h"
#include "Utilities/Log.h"
#include "Utilities/File.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"

View File

@ -1,5 +1,6 @@
#pragma once
#include "Utilities/event.h"
#include <Utilities/event.h>
namespace rpcs3
{
@ -7,4 +8,4 @@ namespace rpcs3
extern event<void> onstart;
extern event<void> onstop;
extern event<void> onpause;
}
}

View File

@ -2,8 +2,6 @@
#include "stdafx_gui.h"
#include "Emu/System.h"
#include "AutoPauseManager.h"
#include "Utilities/Log.h"
#include "Utilities/File.h"
//TODO::Get the enable configuration from ini.
AutoPauseManagerDialog::AutoPauseManagerDialog(wxWindow* parent)

View File

@ -5,7 +5,6 @@
#include <wx/clipbrd.h>
#include "Emu/state.h"
#include "Utilities/Log.h"
#include "Gui/ConLogFrame.h"
wxDEFINE_EVENT(EVT_LOG_COMMAND, wxCommandEvent);

View File

@ -1,8 +1,6 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "Utilities/AutoPause.h"
#include "Utilities/Log.h"
#include "Utilities/File.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/FS/VFS.h"

View File

@ -4,7 +4,6 @@
#include <wx/log.h>
#include "Emu/GameInfo.h"
#include "Emu/state.h"
#include "Utilities/Log.h"
struct Column
{

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "rpcs3.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "Utilities/Log.h"
#include "Loader/ELF64.h"
#include "Emu/FS/vfsDir.h"
#include "Emu/FS/vfsFile.h"

View File

@ -1,7 +1,6 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "Utilities/rPlatform.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "MemoryViewer.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/state.h"

View File

@ -4,8 +4,6 @@
#include "RSXDebugger.h"
#include "Utilities/rPlatform.h"
#include "Utilities/Log.h"
#include "Utilities/File.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/state.h"

View File

@ -1,8 +1,6 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "SaveDataUtility.h"
#include "Utilities/Log.h"
//#include "Utilities/File.h"
//Cause i can not decide what struct to be used to fill those. Just use no real data now.
//Currently variable info isn't used. it supposed to be a container for the information passed by other.

View File

@ -5,8 +5,6 @@
#include "Emu/state.h"
#include "Emu/SysCalls/Modules/cellVideoOut.h"
#include "SettingsDialog.h"
#include "Utilities/Log.h"
#include "Utilities/File.h"
#include <wx/radiobox.h>
#ifdef _WIN32

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/FS/VFS.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "stdafx_gui.h"
#include "Utilities/Log.h"
#include "VHDDManager.h"
#include "TextInputDialog.h"
#include "Emu/state.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "ELF32.h"
#include "Utilities/Log.h"
#include "Emu/FS/vfsStream.h"
#include "Emu/Memory/Memory.h"
#include "Emu/Cell/SPUThread.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/FS/vfsStream.h"
#include "Emu/FS/vfsFile.h"
#include "Emu/FS/vfsDir.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Loader.h"
#include "PSF.h"
#include "Emu/FS/vfsLocalFile.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/FS/vfsStream.h"
#include "PSF.h"

View File

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Utilities/rXml.h"
#include "Emu/FS/VFS.h"
#include "Emu/FS/vfsFileBase.h"

Some files were not shown because too many files have changed in this diff Show More