mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-31 15:53:17 +00:00
Devtools: PM4 Explorer (#1094)
* Devtools: Pause system * Devtools: pm4 viewer - new menu bar - refactored video_info layer - dump & inspect pm4 packets - removed dumpPM4 config - renamed System to DebugState - add docking space - simple video info constrained to window size * Devtools: pm4 viewer - add combo to select the queue * Devtools: pm4 viewer - add hex editor * Devtools: pm4 viewer - dump current cmd * add monospaced font to devtools * Devtools: pm4 viewer - use spec op name avoid some allocations
This commit is contained in:
parent
009f956d8d
commit
af398e3684
46 changed files with 19323 additions and 242 deletions
|
@ -363,13 +363,16 @@ struct Liverpool {
|
|||
Stencil8 = 1,
|
||||
};
|
||||
|
||||
union {
|
||||
union ZInfo {
|
||||
BitField<0, 2, ZFormat> format;
|
||||
BitField<2, 2, u32> num_samples;
|
||||
BitField<13, 3, u32> tile_split;
|
||||
BitField<20, 3, u32> tile_mode_index;
|
||||
BitField<23, 4, u32> decompress_on_n_zplanes;
|
||||
BitField<27, 1, u32> allow_expclear;
|
||||
BitField<28, 1, u32> read_size;
|
||||
BitField<29, 1, u32> tile_surface_en;
|
||||
BitField<30, 1, u32> clear_disallowed;
|
||||
BitField<31, 1, u32> zrange_precision;
|
||||
} z_info;
|
||||
union {
|
||||
|
@ -472,6 +475,8 @@ struct Liverpool {
|
|||
BitField<13, 1, u32> enable_polygon_offset_para;
|
||||
BitField<16, 1, u32> enable_window_offset;
|
||||
BitField<19, 1, ProvokingVtxLast> provoking_vtx_last;
|
||||
BitField<20, 1, u32> persp_corr_dis;
|
||||
BitField<21, 1, u32> multi_prim_ib_ena;
|
||||
|
||||
PolygonMode PolyMode() const {
|
||||
return enable_polygon_mode ? polygon_mode_front.Value() : PolygonMode::Fill;
|
||||
|
@ -634,6 +639,7 @@ struct Liverpool {
|
|||
BitField<8, 1, u32> xy_transformed;
|
||||
BitField<9, 1, u32> z_transformed;
|
||||
BitField<10, 1, u32> w_transformed;
|
||||
BitField<11, 1, u32> perfcounter_ref;
|
||||
};
|
||||
|
||||
struct ClipUserData {
|
||||
|
@ -689,6 +695,7 @@ struct Liverpool {
|
|||
BitField<24, 5, BlendFactor> alpha_dst_factor;
|
||||
BitField<29, 1, u32> separate_alpha_blend;
|
||||
BitField<30, 1, u32> enable;
|
||||
BitField<31, 1, u32> disable_rop3;
|
||||
};
|
||||
|
||||
union ColorControl {
|
||||
|
@ -697,9 +704,11 @@ struct Liverpool {
|
|||
Normal = 1u,
|
||||
EliminateFastClear = 2u,
|
||||
Resolve = 3u,
|
||||
Err = 4u,
|
||||
FmaskDecompress = 5u,
|
||||
};
|
||||
|
||||
BitField<0, 1, u32> disable_dual_quad;
|
||||
BitField<3, 1, u32> degamma_enable;
|
||||
BitField<4, 3, OperationMode> mode;
|
||||
BitField<16, 8, u32> rop3;
|
||||
|
@ -737,7 +746,7 @@ struct Liverpool {
|
|||
BitField<0, 11, u32> slice_start;
|
||||
BitField<13, 11, u32> slice_max;
|
||||
} view;
|
||||
union {
|
||||
union Color0Info {
|
||||
BitField<0, 2, EndianSwap> endian;
|
||||
BitField<2, 5, DataFormat> format;
|
||||
BitField<7, 1, u32> linear_general;
|
||||
|
@ -750,10 +759,17 @@ struct Liverpool {
|
|||
BitField<17, 1, u32> simple_float;
|
||||
BitField<18, 1, RoundMode> round_mode;
|
||||
BitField<19, 1, u32> cmask_is_linear;
|
||||
BitField<20, 3, u32> blend_opt_dont_rd_dst;
|
||||
BitField<23, 3, u32> blend_opt_discard_pixel;
|
||||
BitField<26, 1, u32> fmask_compression_disable_ci;
|
||||
BitField<27, 1, u32> fmask_compress_1frag_only;
|
||||
BitField<28, 1, u32> dcc_enable;
|
||||
BitField<29, 1, u32> cmask_addr_type;
|
||||
} info;
|
||||
union {
|
||||
union Color0Attrib {
|
||||
BitField<0, 5, TilingMode> tile_mode_index;
|
||||
BitField<5, 5, u32> fmask_tile_mode_index;
|
||||
BitField<10, 2, u32> fmask_bank_height;
|
||||
BitField<12, 3, u32> num_samples_log2;
|
||||
BitField<15, 2, u32> num_fragments_log2;
|
||||
BitField<17, 1, u32> force_dst_alpha_1;
|
||||
|
@ -886,8 +902,14 @@ struct Liverpool {
|
|||
u32 raw;
|
||||
BitField<0, 1, u32> depth_clear_enable;
|
||||
BitField<1, 1, u32> stencil_clear_enable;
|
||||
BitField<2, 1, u32> depth_copy;
|
||||
BitField<3, 1, u32> stencil_copy;
|
||||
BitField<4, 1, u32> resummarize_enable;
|
||||
BitField<5, 1, u32> stencil_compress_disable;
|
||||
BitField<6, 1, u32> depth_compress_disable;
|
||||
BitField<7, 1, u32> copy_centroid;
|
||||
BitField<8, 1, u32> copy_sample;
|
||||
BitField<9, 1, u32> decompress_enable;
|
||||
};
|
||||
|
||||
union DepthView {
|
||||
|
@ -940,6 +962,22 @@ struct Liverpool {
|
|||
}
|
||||
};
|
||||
|
||||
union Eqaa {
|
||||
u32 raw;
|
||||
BitField<0, 1, u32> max_anchor_samples;
|
||||
BitField<4, 3, u32> ps_iter_samples;
|
||||
BitField<8, 3, u32> mask_export_num_samples;
|
||||
BitField<12, 3, u32> alpha_to_mask_num_samples;
|
||||
BitField<16, 1, u32> high_quality_intersections;
|
||||
BitField<17, 1, u32> incoherent_eqaa_reads;
|
||||
BitField<18, 1, u32> interpolate_comp_z;
|
||||
BitField<19, 1, u32> interpolate_src_z;
|
||||
BitField<20, 1, u32> static_anchor_associations;
|
||||
BitField<21, 1, u32> alpha_to_mask_eqaa_disable;
|
||||
BitField<24, 3, u32> overrasterization_amount;
|
||||
BitField<27, 1, u32> enable_postz_overrasterization;
|
||||
};
|
||||
|
||||
union Regs {
|
||||
struct {
|
||||
INSERT_PADDING_WORDS(0x2C08);
|
||||
|
|
|
@ -36,6 +36,8 @@ union PM4Type0Header {
|
|||
};
|
||||
|
||||
union PM4Type3Header {
|
||||
static constexpr u32 TYPE = 3;
|
||||
|
||||
constexpr PM4Type3Header(PM4ItOpcode code, u32 num_words_min_one,
|
||||
PM4ShaderType stype = PM4ShaderType::ShaderGraphics,
|
||||
PM4Predicate pred = PM4Predicate::PredDisable) {
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
|
||||
#include <vk_mem_alloc.h>
|
||||
|
||||
#include "core/debug_state.h"
|
||||
#include "core/devtools/layer.h"
|
||||
|
||||
namespace Vulkan {
|
||||
|
||||
bool CanBlitToSwapchain(const vk::PhysicalDevice physical_device, vk::Format format) {
|
||||
|
@ -96,7 +99,7 @@ RendererVulkan::RendererVulkan(Frontend::WindowSDL& window_, AmdGpu::Liverpool*
|
|||
draw_scheduler{instance}, present_scheduler{instance}, flip_scheduler{instance},
|
||||
swapchain{instance, window},
|
||||
rasterizer{std::make_unique<Rasterizer>(instance, draw_scheduler, liverpool)},
|
||||
texture_cache{rasterizer->GetTextureCache()}, video_info_ui{this} {
|
||||
texture_cache{rasterizer->GetTextureCache()} {
|
||||
const u32 num_images = swapchain.GetImageCount();
|
||||
const vk::Device device = instance.GetDevice();
|
||||
|
||||
|
@ -114,11 +117,11 @@ RendererVulkan::RendererVulkan(Frontend::WindowSDL& window_, AmdGpu::Liverpool*
|
|||
|
||||
// Setup ImGui
|
||||
ImGui::Core::Initialize(instance, window, num_images, swapchain.GetSurfaceFormat().format);
|
||||
ImGui::Layer::AddLayer(&video_info_ui);
|
||||
ImGui::Layer::AddLayer(Common::Singleton<Core::Devtools::Layer>::Instance());
|
||||
}
|
||||
|
||||
RendererVulkan::~RendererVulkan() {
|
||||
ImGui::Layer::RemoveLayer(&video_info_ui);
|
||||
ImGui::Layer::RemoveLayer(Common::Singleton<Core::Devtools::Layer>::Instance());
|
||||
draw_scheduler.Finish();
|
||||
const vk::Device device = instance.GetDevice();
|
||||
for (auto& frame : present_frames) {
|
||||
|
@ -416,6 +419,8 @@ void RendererVulkan::Present(Frame* frame) {
|
|||
std::scoped_lock fl{free_mutex};
|
||||
free_queue.push(frame);
|
||||
free_cv.notify_one();
|
||||
|
||||
DebugState.IncFlipFrameNum();
|
||||
}
|
||||
|
||||
Frame* RendererVulkan::GetRenderFrame() {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include <condition_variable>
|
||||
|
||||
#include "imgui/layer/video_info.h"
|
||||
#include "video_core/amdgpu/liverpool.h"
|
||||
#include "video_core/renderer_vulkan/vk_instance.h"
|
||||
#include "video_core/renderer_vulkan/vk_scheduler.h"
|
||||
|
@ -105,8 +104,6 @@ private:
|
|||
std::condition_variable_any frame_cv;
|
||||
std::optional<VideoCore::Image> splash_img;
|
||||
std::vector<VAddr> vo_buffers_addr;
|
||||
|
||||
ImGui::Layers::VideoInfo video_info_ui;
|
||||
};
|
||||
|
||||
} // namespace Vulkan
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue