summaryrefslogtreecommitdiffstats
path: root/src/video_core/debug_utils
diff options
context:
space:
mode:
authorTony Wasserka <NeoBrainX@gmail.com>2014-08-24 17:23:02 +0200
committerTony Wasserka <NeoBrainX@gmail.com>2014-12-09 16:37:34 +0100
commit2793619dcef9fb2f97db5f0258ca950e18fe7f13 (patch)
tree47f0b608ca674d7dce921de2e11b10fc1ca9807a /src/video_core/debug_utils
parentcitra-qt: Add texture viewer to Pica command list. (diff)
downloadyuzu-2793619dcef9fb2f97db5f0258ca950e18fe7f13.tar
yuzu-2793619dcef9fb2f97db5f0258ca950e18fe7f13.tar.gz
yuzu-2793619dcef9fb2f97db5f0258ca950e18fe7f13.tar.bz2
yuzu-2793619dcef9fb2f97db5f0258ca950e18fe7f13.tar.lz
yuzu-2793619dcef9fb2f97db5f0258ca950e18fe7f13.tar.xz
yuzu-2793619dcef9fb2f97db5f0258ca950e18fe7f13.tar.zst
yuzu-2793619dcef9fb2f97db5f0258ca950e18fe7f13.zip
Diffstat (limited to 'src/video_core/debug_utils')
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp12
-rw-r--r--src/video_core/debug_utils/debug_utils.h4
2 files changed, 16 insertions, 0 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index 59909c827..31ce09faf 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -382,6 +382,18 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
return { source_ptr[2], source_ptr[1], source_ptr[0], 255 };
}
+TextureInfo TextureInfo::FromPicaRegister(const Regs::TextureConfig& config,
+ const Regs::TextureFormat& format)
+{
+ TextureInfo info;
+ info.address = config.GetPhysicalAddress();
+ info.width = config.width;
+ info.height = config.height;
+ info.format = format;
+ info.stride = Pica::Regs::BytesPerPixel(info.format) * info.width;
+ return info;
+}
+
void DumpTexture(const Pica::Regs::TextureConfig& texture_config, u8* data) {
// NOTE: Permanently enabling this just trashes hard disks for no reason.
// Hence, this is currently disabled.
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h
index bad4c919a..51f14f12f 100644
--- a/src/video_core/debug_utils/debug_utils.h
+++ b/src/video_core/debug_utils/debug_utils.h
@@ -192,10 +192,14 @@ void OnPicaRegWrite(u32 id, u32 value);
std::unique_ptr<PicaTrace> FinishPicaTracing();
struct TextureInfo {
+ unsigned int address;
int width;
int height;
int stride;
Pica::Regs::TextureFormat format;
+
+ static TextureInfo FromPicaRegister(const Pica::Regs::TextureConfig& config,
+ const Pica::Regs::TextureFormat& format);
};
const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const TextureInfo& info);