Comparer les révisions

...

5 Révisions

Auteur SHA1 Message Date
Exverge 9f5709d73a
Comment out unimplemented check
In my testing on macOS, MK8 sometimes crashed at this function, giving a void type instead of u32.
I've temporarily commented this out until (if) this is implemented and added a check for if it is implemented
2024-03-31 19:47:57 -04:00
voidanix d3f67d1e9c Fix GCC builds with Debug build type
When compiling with -DCMAKE_BUILD_TYPE=Debug, GCC would (correctly) fail to
compile intrinsics in stb and host1x due to lack of optimizations.

Sadly, the compilation error given is bogus and Clang completing the builds
without issues does raise some eyebrows.

Therefore, force optimizations for the offending files under GCC when
creating Debug builds.

Signed-off-by: voidanix <voidanix@keyedlimepie.org>
2024-04-01 01:31:43 +02:00
Crimson-Hawk c25bcb6083 Merge branch 'dev' into dev 2024-03-31 00:45:46 +01:00
ilonachan 040893da00 formatting 2024-03-28 20:12:04 +01:00
Kelebek1 876d7f90b6 Add option to log synchronously, add tooltip to log filter. 2024-03-28 20:12:04 +01:00
8 fichiers modifiés avec 62 ajouts et 12 suppressions

Voir le fichier

@ -240,6 +240,15 @@ if (MSVC)
)
else()
set_source_files_properties(stb.cpp PROPERTIES COMPILE_OPTIONS "-Wno-implicit-fallthrough;-Wno-missing-declarations;-Wno-missing-field-initializers")
# Get around GCC failing with intrinsics in Debug
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_BUILD_TYPE MATCHES "Debug")
set_property(
SOURCE stb.cpp
APPEND
PROPERTY COMPILE_OPTIONS ";-O2"
)
endif()
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")

Voir le fichier

@ -4,6 +4,7 @@
#include <atomic>
#include <chrono>
#include <climits>
#include <mutex>
#include <thread>
#include <fmt/format.h>
@ -231,8 +232,15 @@ public:
if (!filter.CheckMessage(log_class, log_level)) {
return;
}
message_queue.EmplaceWait(
CreateEntry(log_class, log_level, filename, line_num, function, std::move(message)));
auto entry =
CreateEntry(log_class, log_level, filename, line_num, function, std::move(message));
if (Settings::values.log_async) {
message_queue.EmplaceWait(entry);
} else {
std::scoped_lock l{sync_mutex};
ForEachBackend([&entry](Backend& backend) { backend.Write(entry); });
}
}
private:
@ -313,6 +321,7 @@ private:
#endif
MPSCQueue<Entry> message_queue{};
std::mutex sync_mutex;
std::chrono::steady_clock::time_point time_origin{std::chrono::steady_clock::now()};
std::jthread backend_thread;
};
@ -345,9 +354,11 @@ void SetColorConsoleBackendEnabled(bool enabled) {
void FmtLogMessageImpl(Class log_class, Level log_level, const char* filename,
unsigned int line_num, const char* function, fmt::string_view format,
const fmt::format_args& args) {
if (!initialization_in_progress_suppress_logging) {
Impl::Instance().PushEntry(log_class, log_level, filename, line_num, function,
fmt::vformat(format, args));
if (initialization_in_progress_suppress_logging) {
return;
}
Impl::Instance().PushEntry(log_class, log_level, filename, line_num, function,
fmt::vformat(format, args));
}
} // namespace Common::Log

Voir le fichier

@ -171,6 +171,7 @@ const char* GetLogClassName(Class log_class) {
#define SUB(x, y) \
case Class::x##_##y: \
return #x "." #y;
// return #x "_" #y;
ALL_LOG_CLASSES()
#undef CLS
#undef SUB

Voir le fichier

@ -604,6 +604,7 @@ struct Values {
// Miscellaneous
Setting<std::string> log_filter{linkage, "*:Info", "log_filter", Category::Miscellaneous};
Setting<bool> log_async{linkage, true, "log_async", Category::Miscellaneous};
Setting<bool> use_dev_keys{linkage, false, "use_dev_keys", Category::Miscellaneous};
// Network

Voir le fichier

@ -196,9 +196,9 @@ Id Texture(EmitContext& ctx, IR::TextureInstInfo info, [[maybe_unused]] const IR
}
Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& index) {
if (!index.IsImmediate() || index.U32() != 0) {
throw NotImplementedException("Indirect image indexing");
}
// if (!index.IsImmediate() || index.Type() == Shader::IR::Type::U32 || index.U32() != 0) {
// throw NotImplementedException("Indirect image indexing");
// }
if (info.type == TextureType::Buffer) {
const TextureBufferDefinition& def{ctx.texture_buffers.at(info.descriptor_index)};
if (def.count > 1) {
@ -215,9 +215,9 @@ Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& ind
}
std::pair<Id, bool> Image(EmitContext& ctx, const IR::Value& index, IR::TextureInstInfo info) {
if (!index.IsImmediate() || index.U32() != 0) {
throw NotImplementedException("Indirect image indexing");
}
// if (!index.IsImmediate() || index.Type() == Shader::IR::Type::U32 || index.U32() != 0) {
// throw NotImplementedException("Indirect image indexing");
// }
if (info.type == TextureType::Buffer) {
const ImageBufferDefinition def{ctx.image_buffers.at(info.descriptor_index)};
return {ctx.OpLoad(def.image_type, def.id), def.is_integer};

Voir le fichier

@ -73,6 +73,7 @@ void ConfigureDebug::SetConfiguration() {
ui->disable_loop_safety_checks->setChecked(
Settings::values.disable_shader_loop_safety_checks.GetValue());
ui->extended_logging->setChecked(Settings::values.extended_logging.GetValue());
ui->log_async->setChecked(Settings::values.log_async.GetValue());
ui->perform_vulkan_check->setChecked(Settings::values.perform_vulkan_check.GetValue());
#ifdef SUYU_USE_QT_WEB_ENGINE
@ -115,6 +116,7 @@ void ConfigureDebug::ApplyConfiguration() {
Common::Log::Filter filter;
filter.ParseFilterString(Settings::values.log_filter.GetValue());
Common::Log::SetGlobalFilter(filter);
Settings::values.log_async = ui->log_async->isChecked();
}
void ConfigureDebug::changeEvent(QEvent* event) {

Voir le fichier

@ -164,6 +164,20 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="log_async">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>When checked, logging will run asynchronously. This may cut the log on crashes.
When unchecked, logging will run synchronously. This will slow down the emulator, but allow all logs to be written. Useful for debugging.</string>
</property>
<property name="text">
<string>Log asynchronously</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QWidget" name="logging_widget" native="true">
<property name="sizePolicy">
@ -199,7 +213,14 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="log_filter_edit"/>
<widget class="QLineEdit" name="log_filter_edit">
<property name="toolTip">
<string>Log filter in the form class:level.
Separate multiple filters with a space.
Levels: Trace, Debug, Info, Warning, Error, Critical
Classes: See Common/logging/types.h</string>
</property>
</widget>
</item>
</layout>
</widget>

Voir le fichier

@ -425,6 +425,11 @@ else()
# VMA
set_source_files_properties(vulkan_common/vma.cpp PROPERTIES COMPILE_OPTIONS "-Wno-conversion;-Wno-unused-variable;-Wno-unused-parameter;-Wno-missing-field-initializers")
# Get around GCC failing with intrinsics in Debug
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_BUILD_TYPE MATCHES "Debug")
set_source_files_properties(host1x/vic.cpp PROPERTIES COMPILE_OPTIONS "-O2")
endif()
endif()
if (ARCHITECTURE_x86_64)