Misc: Remove unused code
This commit is contained in:
@ -6,10 +6,6 @@
|
||||
#include <d3dcompiler.h>
|
||||
Log_SetChannel(D3D12::ShaderCache);
|
||||
|
||||
#ifdef _UWP
|
||||
#include <winrt/Windows.System.Profile.h>
|
||||
#endif
|
||||
|
||||
namespace D3D12 {
|
||||
|
||||
#pragma pack(push, 1)
|
||||
@ -24,19 +20,7 @@ struct CacheIndexEntry
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
static bool CanUsePipelineCache()
|
||||
{
|
||||
#ifdef _UWP
|
||||
// GetCachedBlob crashes on XBox UWP for some reason...
|
||||
const auto version_info = winrt::Windows::System::Profile::AnalyticsInfo::VersionInfo();
|
||||
const auto device_family = version_info.DeviceFamily();
|
||||
return (device_family != L"Windows.Xbox");
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
ShaderCache::ShaderCache() : m_use_pipeline_cache(CanUsePipelineCache()) {}
|
||||
ShaderCache::ShaderCache() = default;
|
||||
|
||||
ShaderCache::~ShaderCache()
|
||||
{
|
||||
@ -80,17 +64,14 @@ void ShaderCache::Open(std::string_view base_path, D3D_FEATURE_LEVEL feature_lev
|
||||
CreateNew(shader_index_filename, shader_blob_filename, m_shader_index_file, m_shader_blob_file);
|
||||
}
|
||||
|
||||
if (m_use_pipeline_cache)
|
||||
{
|
||||
const std::string base_pipelines_filename = GetCacheBaseFileName(base_path, "pipelines", feature_level, debug);
|
||||
const std::string pipelines_index_filename = base_pipelines_filename + ".idx";
|
||||
const std::string pipelines_blob_filename = base_pipelines_filename + ".bin";
|
||||
const std::string base_pipelines_filename = GetCacheBaseFileName(base_path, "pipelines", feature_level, debug);
|
||||
const std::string pipelines_index_filename = base_pipelines_filename + ".idx";
|
||||
const std::string pipelines_blob_filename = base_pipelines_filename + ".bin";
|
||||
|
||||
if (!ReadExisting(pipelines_index_filename, pipelines_blob_filename, m_pipeline_index_file, m_pipeline_blob_file,
|
||||
m_pipeline_index))
|
||||
{
|
||||
CreateNew(pipelines_index_filename, pipelines_blob_filename, m_pipeline_index_file, m_pipeline_blob_file);
|
||||
}
|
||||
if (!ReadExisting(pipelines_index_filename, pipelines_blob_filename, m_pipeline_index_file, m_pipeline_blob_file,
|
||||
m_pipeline_index))
|
||||
{
|
||||
CreateNew(pipelines_index_filename, pipelines_blob_filename, m_pipeline_index_file, m_pipeline_blob_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -110,14 +91,10 @@ void ShaderCache::InvalidatePipelineCache()
|
||||
m_pipeline_index_file = nullptr;
|
||||
}
|
||||
|
||||
if (m_use_pipeline_cache)
|
||||
{
|
||||
const std::string base_pipelines_filename =
|
||||
GetCacheBaseFileName(m_base_path, "pipelines", m_feature_level, m_debug);
|
||||
const std::string pipelines_index_filename = base_pipelines_filename + ".idx";
|
||||
const std::string pipelines_blob_filename = base_pipelines_filename + ".bin";
|
||||
CreateNew(pipelines_index_filename, pipelines_blob_filename, m_pipeline_index_file, m_pipeline_blob_file);
|
||||
}
|
||||
const std::string base_pipelines_filename = GetCacheBaseFileName(m_base_path, "pipelines", m_feature_level, m_debug);
|
||||
const std::string pipelines_index_filename = base_pipelines_filename + ".idx";
|
||||
const std::string pipelines_blob_filename = base_pipelines_filename + ".bin";
|
||||
CreateNew(pipelines_index_filename, pipelines_blob_filename, m_pipeline_index_file, m_pipeline_blob_file);
|
||||
}
|
||||
|
||||
bool ShaderCache::CreateNew(const std::string& index_filename, const std::string& blob_filename, std::FILE*& index_file,
|
||||
|
||||
@ -111,7 +111,6 @@ private:
|
||||
CacheIndex m_pipeline_index;
|
||||
|
||||
D3D_FEATURE_LEVEL m_feature_level = D3D_FEATURE_LEVEL_11_0;
|
||||
bool m_use_pipeline_cache = false;
|
||||
bool m_debug = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user