[Vulkan] Trace viewer

This commit is contained in:
Triang3l 2022-07-01 19:53:41 +03:00
parent ad1ef84145
commit 636585e0aa
2 changed files with 126 additions and 0 deletions

View File

@ -23,6 +23,65 @@ project("xenia-gpu-vulkan")
"../shaders/bytecode/vulkan_spirv/*.h",
})
group("src")
project("xenia-gpu-vulkan-trace-viewer")
uuid("86a1dddc-a26a-4885-8c55-cf745225d93e")
kind("WindowedApp")
language("C++")
links({
"xenia-apu",
"xenia-apu-nop",
"xenia-base",
"xenia-core",
"xenia-cpu",
"xenia-cpu-backend-x64",
"xenia-gpu",
"xenia-gpu-vulkan",
"xenia-hid",
"xenia-hid-nop",
"xenia-kernel",
"xenia-ui",
"xenia-ui-vulkan",
"xenia-vfs",
})
links({
"aes_128",
"capstone",
"fmt",
"glslang-spirv",
"imgui",
"libavcodec",
"libavutil",
"mspack",
"snappy",
"xxhash",
})
includedirs({
project_root.."/third_party/Vulkan-Headers/include",
})
files({
"vulkan_trace_viewer_main.cc",
"../../ui/windowed_app_main_"..platform_suffix..".cc",
})
filter("platforms:Linux")
links({
"X11",
"xcb",
"X11-xcb",
})
filter("platforms:Windows")
-- Only create the .user file if it doesn't already exist.
local user_file = project_root.."/build/xenia-gpu-vulkan-trace-viewer.vcxproj.user"
if not os.isfile(user_file) then
debugdir(project_root)
debugargs({
"2>&1",
"1>scratch/stdout-trace-viewer.txt",
})
end
group("src")
project("xenia-gpu-vulkan-trace-dump")
uuid("0dd0dd1c-b321-494d-ab9a-6c062f0c65cc")
@ -56,6 +115,9 @@ project("xenia-gpu-vulkan-trace-dump")
"snappy",
"xxhash",
})
includedirs({
project_root.."/third_party/Vulkan-Headers/include",
})
files({
"vulkan_trace_dump_main.cc",
"../../base/console_app_main_"..platform_suffix..".cc",

View File

@ -0,0 +1,64 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2022 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include <memory>
#include <string>
#include "xenia/base/logging.h"
#include "xenia/gpu/trace_viewer.h"
#include "xenia/gpu/vulkan/vulkan_command_processor.h"
#include "xenia/gpu/vulkan/vulkan_graphics_system.h"
namespace xe {
namespace gpu {
namespace vulkan {
class VulkanTraceViewer final : public TraceViewer {
public:
static std::unique_ptr<WindowedApp> Create(
xe::ui::WindowedAppContext& app_context) {
return std::unique_ptr<WindowedApp>(new VulkanTraceViewer(app_context));
}
std::unique_ptr<gpu::GraphicsSystem> CreateGraphicsSystem() override {
return std::unique_ptr<gpu::GraphicsSystem>(new VulkanGraphicsSystem());
}
uintptr_t GetColorRenderTarget(
uint32_t pitch, xenos::MsaaSamples samples, uint32_t base,
xenos::ColorRenderTargetFormat format) override {
// TODO(Triang3l): EDRAM viewer.
return 0;
}
uintptr_t GetDepthRenderTarget(
uint32_t pitch, xenos::MsaaSamples samples, uint32_t base,
xenos::DepthRenderTargetFormat format) override {
// TODO(Triang3l): EDRAM viewer.
return 0;
}
uintptr_t GetTextureEntry(const TextureInfo& texture_info,
const SamplerInfo& sampler_info) override {
// TODO(Triang3l): Textures, but from a fetch constant rather than
// TextureInfo/SamplerInfo which are going away.
return 0;
}
private:
explicit VulkanTraceViewer(xe::ui::WindowedAppContext& app_context)
: TraceViewer(app_context, "xenia-gpu-vulkan-trace-viewer") {}
};
} // namespace vulkan
} // namespace gpu
} // namespace xe
XE_DEFINE_WINDOWED_APP(xenia_gpu_vulkan_trace_viewer,
xe::gpu::vulkan::VulkanTraceViewer::Create);