mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-27 16:02:37 +00:00
remove unused helpers and the -64 suffix
This commit is contained in:
1 parent
697b18b366
commit
c5cebc1d19
11 files changed
+12
-153
No files matched your search
@@ -24,8 +24,4 @@ std::string Debug::GetLinker() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Debug::GetBitness() {
|
|
||||||
return "64";
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
@@ -10,7 +10,6 @@ namespace Common {
|
|||||||
namespace Debug {
|
namespace Debug {
|
||||||
std::string GetCompiler();
|
std::string GetCompiler();
|
||||||
std::string GetLinker();
|
std::string GetLinker();
|
||||||
std::string GetBitness();
|
|
||||||
} // namespace Debug
|
} // namespace Debug
|
||||||
|
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
|||||||
@@ -54,103 +54,6 @@ inline uint32_t hash(const void* key, uint32_t key_len) {
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint32_t hash8(uint8_t key) {
|
|
||||||
uint32_t hash = 0;
|
|
||||||
|
|
||||||
uint8_t* ptr = &key;
|
|
||||||
|
|
||||||
hash += ptr[0];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
|
|
||||||
hash += (hash << 3u);
|
|
||||||
hash ^= (hash >> 11u);
|
|
||||||
hash += (hash << 15u);
|
|
||||||
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline uint32_t hash16(uint16_t key) {
|
|
||||||
uint32_t hash = 0;
|
|
||||||
|
|
||||||
auto* ptr = reinterpret_cast<uint8_t*>(&key);
|
|
||||||
|
|
||||||
hash += ptr[0];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[1];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
|
|
||||||
hash += (hash << 3u);
|
|
||||||
hash ^= (hash >> 11u);
|
|
||||||
hash += (hash << 15u);
|
|
||||||
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline uint32_t hash32(uint32_t key) {
|
|
||||||
uint32_t hash = 0;
|
|
||||||
|
|
||||||
auto* ptr = reinterpret_cast<uint8_t*>(&key);
|
|
||||||
|
|
||||||
hash += ptr[0];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[1];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[2];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[3];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
|
|
||||||
hash += (hash << 3u);
|
|
||||||
hash ^= (hash >> 11u);
|
|
||||||
hash += (hash << 15u);
|
|
||||||
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline uint32_t hash64(uint64_t key) {
|
|
||||||
uint32_t hash = 0;
|
|
||||||
|
|
||||||
auto* ptr = reinterpret_cast<uint8_t*>(&key);
|
|
||||||
|
|
||||||
hash += ptr[0];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[1];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[2];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[3];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[4];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[5];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[6];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
hash += ptr[7];
|
|
||||||
hash += (hash << 10u);
|
|
||||||
hash ^= (hash >> 6u);
|
|
||||||
|
|
||||||
hash += (hash << 3u);
|
|
||||||
hash ^= (hash >> 11u);
|
|
||||||
hash += (hash << 15u);
|
|
||||||
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
|
||||||
#endif /* KYTY_COMMON_HASH_H_ */
|
#endif /* KYTY_COMMON_HASH_H_ */
|
||||||
@@ -253,10 +253,6 @@ void Thread::Detach() {
|
|||||||
m_thread->m_thread.detach();
|
m_thread->m_thread.detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Thread::Sleep(uint32_t millis) {
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(millis));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Thread::SleepMicro(uint32_t micros) {
|
void Thread::SleepMicro(uint32_t micros) {
|
||||||
#ifdef KYTY_WIN_CS
|
#ifdef KYTY_WIN_CS
|
||||||
SleepHighResolution100ns(static_cast<uint64_t>(micros) * 10);
|
SleepHighResolution100ns(static_cast<uint64_t>(micros) * 10);
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ public:
|
|||||||
// The id is unique and can't be reused by another thread.
|
// The id is unique and can't be reused by another thread.
|
||||||
[[nodiscard]] int GetUniqueId() const;
|
[[nodiscard]] int GetUniqueId() const;
|
||||||
|
|
||||||
static void Sleep(uint32_t millis);
|
|
||||||
static void SleepMicro(uint32_t micros);
|
static void SleepMicro(uint32_t micros);
|
||||||
static void SleepNano(uint64_t nanos);
|
static void SleepNano(uint64_t nanos);
|
||||||
static bool IsMainThread();
|
static bool IsMainThread();
|
||||||
|
|||||||
@@ -62,23 +62,6 @@ double Timer::GetTimeS() const {
|
|||||||
return (static_cast<double>(current_time - m_StartTime)) / static_cast<double>(m_Frequency);
|
return (static_cast<double>(current_time - m_StartTime)) / static_cast<double>(m_Frequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
// return time in ticks
|
|
||||||
uint64_t Timer::GetTicks() const {
|
|
||||||
if (m_is_paused) {
|
|
||||||
return (m_PauseTime - m_StartTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t current_time = 0;
|
|
||||||
SysQueryPerformanceCounter(¤t_time);
|
|
||||||
|
|
||||||
return (current_time - m_StartTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
// return ticks frequency
|
|
||||||
uint64_t Timer::GetFrequency() const {
|
|
||||||
return m_Frequency;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t Timer::QueryPerformanceFrequency() {
|
uint64_t Timer::QueryPerformanceFrequency() {
|
||||||
uint64_t ret = 0;
|
uint64_t ret = 0;
|
||||||
SysQueryPerformanceFrequency(&ret);
|
SysQueryPerformanceFrequency(&ret);
|
||||||
|
|||||||
@@ -24,12 +24,6 @@ public:
|
|||||||
// return time in seconds
|
// return time in seconds
|
||||||
[[nodiscard]] double GetTimeS() const;
|
[[nodiscard]] double GetTimeS() const;
|
||||||
|
|
||||||
// return time in ticks
|
|
||||||
[[nodiscard]] uint64_t GetTicks() const;
|
|
||||||
|
|
||||||
// return ticks frequency
|
|
||||||
[[nodiscard]] uint64_t GetFrequency() const;
|
|
||||||
|
|
||||||
KYTY_CLASS_NO_COPY(Timer);
|
KYTY_CLASS_NO_COPY(Timer);
|
||||||
|
|
||||||
[[nodiscard]] static uint64_t QueryPerformanceFrequency();
|
[[nodiscard]] static uint64_t QueryPerformanceFrequency();
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ static uint64_t KernelGetTscFrequencyNative() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
KernelReadTscNative();
|
KernelReadTscNative();
|
||||||
Common::Thread::Sleep(1);
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||||
KernelReadTscNative();
|
KernelReadTscNative();
|
||||||
|
|
||||||
const auto host_start = Common::Timer::QueryPerformanceCounter();
|
const auto host_start = Common::Timer::QueryPerformanceCounter();
|
||||||
@@ -993,7 +993,7 @@ static void FreeDetachedThreads(void* /*arg*/) {
|
|||||||
auto* pthread_pool = g_pthread_context->GetPthreadPool();
|
auto* pthread_pool = g_pthread_context->GetPthreadPool();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
Common::Thread::Sleep(10000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(10000));
|
||||||
pthread_pool->FreeDetachedThreads();
|
pthread_pool->FreeDetachedThreads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -27,8 +27,7 @@ static std::string GetBuildString() {
|
|||||||
std::string type = "????";
|
std::string type = "????";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string compiler =
|
std::string compiler = Debug::GetCompiler() + "-" + Debug::GetLinker();
|
||||||
Debug::GetCompiler() + "-" + Debug::GetLinker() + "-" + Debug::GetBitness();
|
|
||||||
|
|
||||||
std::string str =
|
std::string str =
|
||||||
fmt::format("{}, {}, ver = {}, git = {}, date = {}", type.c_str(), compiler.c_str(),
|
fmt::format("{}, {}, ver = {}, git = {}, date = {}", type.c_str(), compiler.c_str(),
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ namespace Ime = Libs::Dialog::ImeDialog;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr int Error(uint32_t value) { return static_cast<int32_t>(value); }
|
|
||||||
|
|
||||||
int g_filter_calls = 0;
|
int g_filter_calls = 0;
|
||||||
int g_keyboard_filter_calls = 0;
|
int g_keyboard_filter_calls = 0;
|
||||||
bool g_block_keyboard = false;
|
bool g_block_keyboard = false;
|
||||||
@@ -110,7 +108,7 @@ void TestAcceptLifecycle() {
|
|||||||
auto param = MakeParam(text.data());
|
auto param = MakeParam(text.data());
|
||||||
CHECK(Ime::ImeDialogInit(¶m, nullptr) == 0);
|
CHECK(Ime::ImeDialogInit(¶m, nullptr) == 0);
|
||||||
CHECK(Ime::ImeDialogGetStatus() == static_cast<int>(Ime::Status::Running));
|
CHECK(Ime::ImeDialogGetStatus() == static_cast<int>(Ime::Status::Running));
|
||||||
CHECK(Ime::ImeDialogInit(nullptr, nullptr) == Error(0x80bc0001));
|
CHECK(Ime::ImeDialogInit(nullptr, nullptr) == static_cast<int32_t>(0x80bc0001));
|
||||||
|
|
||||||
Ime::HostSnapshot snapshot;
|
Ime::HostSnapshot snapshot;
|
||||||
CHECK(Ime::GetHostSnapshot(&snapshot));
|
CHECK(Ime::GetHostSnapshot(&snapshot));
|
||||||
@@ -154,16 +152,16 @@ void TestValidation() {
|
|||||||
std::array<char16_t, 32> text{};
|
std::array<char16_t, 32> text{};
|
||||||
auto param = MakeParam(text.data());
|
auto param = MakeParam(text.data());
|
||||||
param.reserved[0] = 1;
|
param.reserved[0] = 1;
|
||||||
CHECK(Ime::ImeDialogInit(¶m, nullptr) == Error(0x80bc0032));
|
CHECK(Ime::ImeDialogInit(¶m, nullptr) == static_cast<int32_t>(0x80bc0032));
|
||||||
param.reserved[0] = 0;
|
param.reserved[0] = 0;
|
||||||
param.max_text_length = Ime::IME_DIALOG_MAX_TEXT_LENGTH + 1;
|
param.max_text_length = Ime::IME_DIALOG_MAX_TEXT_LENGTH + 1;
|
||||||
CHECK(Ime::ImeDialogInit(¶m, nullptr) == Error(0x80bc0016));
|
CHECK(Ime::ImeDialogInit(¶m, nullptr) == static_cast<int32_t>(0x80bc0016));
|
||||||
CHECK(Ime::ImeDialogGetResult(nullptr) == Error(0x80bc0107));
|
CHECK(Ime::ImeDialogGetResult(nullptr) == static_cast<int32_t>(0x80bc0107));
|
||||||
|
|
||||||
param = MakeParam(text.data());
|
param = MakeParam(text.data());
|
||||||
Ime::ExtendedParam extended{};
|
Ime::ExtendedParam extended{};
|
||||||
extended.ext_keyboard_mode = 0x00000004;
|
extended.ext_keyboard_mode = 0x00000004;
|
||||||
CHECK(Ime::ImeDialogInit(¶m, &extended) == Error(0x80bc001c));
|
CHECK(Ime::ImeDialogInit(¶m, &extended) == static_cast<int32_t>(0x80bc001c));
|
||||||
extended = {};
|
extended = {};
|
||||||
extended.option = 0x00000200;
|
extended.option = 0x00000200;
|
||||||
extended.disable_device =
|
extended.disable_device =
|
||||||
@@ -187,8 +185,8 @@ void TestFilteringAndInputPolicy() {
|
|||||||
CHECK(Ime::ImeDialogInit(¶m, nullptr) == 0);
|
CHECK(Ime::ImeDialogInit(¶m, nullptr) == 0);
|
||||||
CHECK(Ime::ImeDialogGetStatus() == static_cast<int>(Ime::Status::Running));
|
CHECK(Ime::ImeDialogGetStatus() == static_cast<int>(Ime::Status::Running));
|
||||||
CHECK(g_filter_calls == 0);
|
CHECK(g_filter_calls == 0);
|
||||||
CHECK(Ime::ImeDialogGetResult(nullptr) == Error(0x80bc0031));
|
CHECK(Ime::ImeDialogGetResult(nullptr) == static_cast<int32_t>(0x80bc0031));
|
||||||
CHECK(Ime::ImeDialogTerm() == Error(0x80bc0106));
|
CHECK(Ime::ImeDialogTerm() == static_cast<int32_t>(0x80bc0106));
|
||||||
CHECK(g_filter_calls == 0);
|
CHECK(g_filter_calls == 0);
|
||||||
|
|
||||||
Ime::HostSnapshot snapshot;
|
Ime::HostSnapshot snapshot;
|
||||||
|
|||||||
@@ -926,10 +926,6 @@ std::string Hex(u32 value) {
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string VulkanResultName(vk::Result result) {
|
|
||||||
return vk::to_string(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[noreturn]] void Fail(const char *shader_name, const char *stage,
|
[[noreturn]] void Fail(const char *shader_name, const char *stage,
|
||||||
const std::string &message) {
|
const std::string &message) {
|
||||||
std::fprintf(stderr, "ShaderRecompilerComputeTests: %s failed at %s: %s\n",
|
std::fprintf(stderr, "ShaderRecompilerComputeTests: %s failed at %s: %s\n",
|
||||||
@@ -960,7 +956,7 @@ void RequireVk(const char *shader_name, const char *stage, vk::Result result,
|
|||||||
const char *action) {
|
const char *action) {
|
||||||
if (result != vk::Result::eSuccess) {
|
if (result != vk::Result::eSuccess) {
|
||||||
Fail(shader_name, stage,
|
Fail(shader_name, stage,
|
||||||
std::string(action) + " returned " + VulkanResultName(result));
|
std::string(action) + " returned " + vk::to_string(result));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15597,15 +15593,11 @@ enum class CoverageClass {
|
|||||||
NeedsGraphicsStageCase,
|
NeedsGraphicsStageCase,
|
||||||
};
|
};
|
||||||
|
|
||||||
bool IsCovered(const std::set<ShaderOpcode> &covered, ShaderOpcode opcode) {
|
|
||||||
return covered.find(opcode) != covered.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
CoverageClass ClassifyOpcode(ShaderOpcode opcode,
|
CoverageClass ClassifyOpcode(ShaderOpcode opcode,
|
||||||
const std::set<ShaderOpcode> &covered) {
|
const std::set<ShaderOpcode> &covered) {
|
||||||
using ShaderRecompiler::Decoder::Opcode;
|
using ShaderRecompiler::Decoder::Opcode;
|
||||||
|
|
||||||
if (IsCovered(covered, opcode)) {
|
if (covered.contains(opcode)) {
|
||||||
return CoverageClass::Covered;
|
return CoverageClass::Covered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user