remove unused helpers and the -64 suffix
This commit is contained in:
parent
697b18b366
commit
c5cebc1d19
|
|
@ -24,8 +24,4 @@ std::string Debug::GetLinker() {
|
|||
#endif
|
||||
}
|
||||
|
||||
std::string Debug::GetBitness() {
|
||||
return "64";
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ namespace Common {
|
|||
namespace Debug {
|
||||
std::string GetCompiler();
|
||||
std::string GetLinker();
|
||||
std::string GetBitness();
|
||||
} // namespace Debug
|
||||
|
||||
} // namespace Common
|
||||
|
|
|
|||
|
|
@ -54,103 +54,6 @@ inline uint32_t hash(const void* key, uint32_t key_len) {
|
|||
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
|
||||
|
||||
#endif /* KYTY_COMMON_HASH_H_ */
|
||||
|
|
|
|||
|
|
@ -253,10 +253,6 @@ void 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) {
|
||||
#ifdef KYTY_WIN_CS
|
||||
SleepHighResolution100ns(static_cast<uint64_t>(micros) * 10);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ public:
|
|||
// The id is unique and can't be reused by another thread.
|
||||
[[nodiscard]] int GetUniqueId() const;
|
||||
|
||||
static void Sleep(uint32_t millis);
|
||||
static void SleepMicro(uint32_t micros);
|
||||
static void SleepNano(uint64_t nanos);
|
||||
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 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 ret = 0;
|
||||
SysQueryPerformanceFrequency(&ret);
|
||||
|
|
|
|||
|
|
@ -24,12 +24,6 @@ public:
|
|||
// return time in seconds
|
||||
[[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);
|
||||
|
||||
[[nodiscard]] static uint64_t QueryPerformanceFrequency();
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ static uint64_t KernelGetTscFrequencyNative() {
|
|||
}
|
||||
|
||||
KernelReadTscNative();
|
||||
Common::Thread::Sleep(1);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
KernelReadTscNative();
|
||||
|
||||
const auto host_start = Common::Timer::QueryPerformanceCounter();
|
||||
|
|
@ -993,7 +993,7 @@ static void FreeDetachedThreads(void* /*arg*/) {
|
|||
auto* pthread_pool = g_pthread_context->GetPthreadPool();
|
||||
|
||||
while (true) {
|
||||
Common::Thread::Sleep(10000);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10000));
|
||||
pthread_pool->FreeDetachedThreads();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@ static std::string GetBuildString() {
|
|||
std::string type = "????";
|
||||
#endif
|
||||
|
||||
std::string compiler =
|
||||
Debug::GetCompiler() + "-" + Debug::GetLinker() + "-" + Debug::GetBitness();
|
||||
std::string compiler = Debug::GetCompiler() + "-" + Debug::GetLinker();
|
||||
|
||||
std::string str =
|
||||
fmt::format("{}, {}, ver = {}, git = {}, date = {}", type.c_str(), compiler.c_str(),
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ namespace Ime = Libs::Dialog::ImeDialog;
|
|||
|
||||
namespace {
|
||||
|
||||
constexpr int Error(uint32_t value) { return static_cast<int32_t>(value); }
|
||||
|
||||
int g_filter_calls = 0;
|
||||
int g_keyboard_filter_calls = 0;
|
||||
bool g_block_keyboard = false;
|
||||
|
|
@ -110,7 +108,7 @@ void TestAcceptLifecycle() {
|
|||
auto param = MakeParam(text.data());
|
||||
CHECK(Ime::ImeDialogInit(¶m, nullptr) == 0);
|
||||
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;
|
||||
CHECK(Ime::GetHostSnapshot(&snapshot));
|
||||
|
|
@ -154,16 +152,16 @@ void TestValidation() {
|
|||
std::array<char16_t, 32> text{};
|
||||
auto param = MakeParam(text.data());
|
||||
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.max_text_length = Ime::IME_DIALOG_MAX_TEXT_LENGTH + 1;
|
||||
CHECK(Ime::ImeDialogInit(¶m, nullptr) == Error(0x80bc0016));
|
||||
CHECK(Ime::ImeDialogGetResult(nullptr) == Error(0x80bc0107));
|
||||
CHECK(Ime::ImeDialogInit(¶m, nullptr) == static_cast<int32_t>(0x80bc0016));
|
||||
CHECK(Ime::ImeDialogGetResult(nullptr) == static_cast<int32_t>(0x80bc0107));
|
||||
|
||||
param = MakeParam(text.data());
|
||||
Ime::ExtendedParam extended{};
|
||||
extended.ext_keyboard_mode = 0x00000004;
|
||||
CHECK(Ime::ImeDialogInit(¶m, &extended) == Error(0x80bc001c));
|
||||
CHECK(Ime::ImeDialogInit(¶m, &extended) == static_cast<int32_t>(0x80bc001c));
|
||||
extended = {};
|
||||
extended.option = 0x00000200;
|
||||
extended.disable_device =
|
||||
|
|
@ -187,8 +185,8 @@ void TestFilteringAndInputPolicy() {
|
|||
CHECK(Ime::ImeDialogInit(¶m, nullptr) == 0);
|
||||
CHECK(Ime::ImeDialogGetStatus() == static_cast<int>(Ime::Status::Running));
|
||||
CHECK(g_filter_calls == 0);
|
||||
CHECK(Ime::ImeDialogGetResult(nullptr) == Error(0x80bc0031));
|
||||
CHECK(Ime::ImeDialogTerm() == Error(0x80bc0106));
|
||||
CHECK(Ime::ImeDialogGetResult(nullptr) == static_cast<int32_t>(0x80bc0031));
|
||||
CHECK(Ime::ImeDialogTerm() == static_cast<int32_t>(0x80bc0106));
|
||||
CHECK(g_filter_calls == 0);
|
||||
|
||||
Ime::HostSnapshot snapshot;
|
||||
|
|
|
|||
|
|
@ -926,10 +926,6 @@ std::string Hex(u32 value) {
|
|||
return buffer;
|
||||
}
|
||||
|
||||
std::string VulkanResultName(vk::Result result) {
|
||||
return vk::to_string(result);
|
||||
}
|
||||
|
||||
[[noreturn]] void Fail(const char *shader_name, const char *stage,
|
||||
const std::string &message) {
|
||||
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) {
|
||||
if (result != vk::Result::eSuccess) {
|
||||
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,
|
||||
};
|
||||
|
||||
bool IsCovered(const std::set<ShaderOpcode> &covered, ShaderOpcode opcode) {
|
||||
return covered.find(opcode) != covered.end();
|
||||
}
|
||||
|
||||
CoverageClass ClassifyOpcode(ShaderOpcode opcode,
|
||||
const std::set<ShaderOpcode> &covered) {
|
||||
using ShaderRecompiler::Decoder::Opcode;
|
||||
|
||||
if (IsCovered(covered, opcode)) {
|
||||
if (covered.contains(opcode)) {
|
||||
return CoverageClass::Covered;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue