summaryrefslogtreecommitdiffstats
path: root/src/video_core/debug_utils/debug_utils.h
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
commitdc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch)
tree569a7f13128450bbab973236615587ff00bced5f /src/video_core/debug_utils/debug_utils.h
parentTravis: Import Dolphin’s clang-format hook. (diff)
downloadyuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/debug_utils/debug_utils.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h
index 92e9734ae..1a58f40ff 100644
--- a/src/video_core/debug_utils/debug_utils.h
+++ b/src/video_core/debug_utils/debug_utils.h
@@ -53,13 +53,16 @@ public:
* Most importantly this is used for our debugger GUI.
*
* To implement event handling, override the OnPicaBreakPointHit and OnPicaResume methods.
- * @warning All BreakPointObservers need to be on the same thread to guarantee thread-safe state access
- * @todo Evaluate an alternative interface, in which there is only one managing observer and multiple child observers running (by design) on the same thread.
+ * @warning All BreakPointObservers need to be on the same thread to guarantee thread-safe state
+ * access
+ * @todo Evaluate an alternative interface, in which there is only one managing observer and
+ * multiple child observers running (by design) on the same thread.
*/
class BreakPointObserver {
public:
/// Constructs the object such that it observes events of the given DebugContext.
- BreakPointObserver(std::shared_ptr<DebugContext> debug_context) : context_weak(debug_context) {
+ BreakPointObserver(std::shared_ptr<DebugContext> debug_context)
+ : context_weak(debug_context) {
std::unique_lock<std::mutex> lock(debug_context->breakpoint_mutex);
debug_context->breakpoint_observers.push_back(this);
}
@@ -122,7 +125,8 @@ public:
* The current thread then is halted until Resume() is called from another thread (or until
* emulation is stopped).
* @param event Event which has happened
- * @param data Optional data pointer (pass nullptr if unused). Needs to remain valid until Resume() is called.
+ * @param data Optional data pointer (pass nullptr if unused). Needs to remain valid until
+ * Resume() is called.
*/
void OnEvent(Event event, void* data) {
// This check is left in the header to allow the compiler to inline it.
@@ -132,11 +136,12 @@ public:
DoOnEvent(event, data);
}
- void DoOnEvent(Event event, void *data);
+ void DoOnEvent(Event event, void* data);
/**
* Resume from the current breakpoint.
- * @warning Calling this from the same thread that OnEvent was called in will cause a deadlock. Calling from any other thread is safe.
+ * @warning Calling this from the same thread that OnEvent was called in will cause a deadlock.
+ * Calling from any other thread is safe.
*/
void Resume();
@@ -144,7 +149,7 @@ public:
* Delete all set breakpoints and resume emulation.
*/
void ClearBreakpoints() {
- for (auto &bp : breakpoints) {
+ for (auto& bp : breakpoints) {
bp.enabled = false;
}
Resume();
@@ -182,8 +187,8 @@ namespace DebugUtils {
#define PICA_LOG_TEV 0
void DumpShader(const std::string& filename, const Regs::ShaderConfig& config,
- const Shader::ShaderSetup& setup, const Regs::VSOutputAttributes* output_attributes);
-
+ const Shader::ShaderSetup& setup,
+ const Regs::VSOutputAttributes* output_attributes);
// Utility class to log Pica commands.
struct PicaTrace {
@@ -216,7 +221,10 @@ struct TextureInfo {
* @param source Source pointer to read data from
* @param s,t Texture coordinates to read from
* @param info TextureInfo object describing the texture setup
- * @param disable_alpha This is used for debug widgets which use this method to display textures without providing a good way to visualize alpha by themselves. If true, this will return 255 for the alpha component, and either drop the information entirely or store it in an "unused" color channel.
+ * @param disable_alpha This is used for debug widgets which use this method to display textures
+ * without providing a good way to visualize alpha by themselves. If true, this will return 255 for
+ * the alpha component, and either drop the information entirely or store it in an "unused" color
+ * channel.
* @todo Eventually we should get rid of the disable_alpha parameter.
*/
const Math::Vec4<u8> LookupTexture(const u8* source, int s, int t, const TextureInfo& info,
@@ -237,7 +245,8 @@ class MemoryAccessTracker {
/// Combine overlapping and close ranges
void SimplifyRanges() {
for (auto it = ranges.begin(); it != ranges.end(); ++it) {
- // NOTE: We add 32 to the range end address to make sure "close" ranges are combined, too
+ // NOTE: We add 32 to the range end address to make sure "close" ranges are combined,
+ // too
auto it2 = std::next(it);
while (it2 != ranges.end() && it->first + it->second + 32 >= it2->first) {
it->second = std::max(it->second, it2->first + it2->second - it->first);