[D3D12] PIX: Capture with F4, disable tiled resources when attached
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
// This must be included before D3D and DXGI for things like NOMINMAX.
|
||||
#include "xenia/base/platform_win.h"
|
||||
|
||||
#include <DXProgrammableCapture.h>
|
||||
#include <d3d12.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <dxgi1_4.h>
|
||||
|
||||
@@ -43,6 +43,9 @@ D3D12Provider::D3D12Provider(Window* main_window)
|
||||
: GraphicsProvider(main_window) {}
|
||||
|
||||
D3D12Provider::~D3D12Provider() {
|
||||
if (graphics_analysis_ != nullptr) {
|
||||
graphics_analysis_->Release();
|
||||
}
|
||||
if (direct_queue_ != nullptr) {
|
||||
direct_queue_->Release();
|
||||
}
|
||||
@@ -167,6 +170,10 @@ bool D3D12Provider::Initialize() {
|
||||
"sample positions tier %u",
|
||||
tiled_resources_tier_, programmable_sample_positions_tier_);
|
||||
|
||||
// Get the graphics analysis interface, will silently fail if PIX not
|
||||
// attached.
|
||||
DXGIGetDebugInterface1(0, IID_PPV_ARGS(&graphics_analysis_));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@ class D3D12Provider : public GraphicsProvider {
|
||||
std::unique_ptr<GraphicsContext> CreateOffscreenContext() override;
|
||||
|
||||
IDXGIFactory2* GetDXGIFactory() const { return dxgi_factory_; }
|
||||
// nullptr if PIX not attached.
|
||||
IDXGraphicsAnalysis* GetGraphicsAnalysis() const {
|
||||
return graphics_analysis_;
|
||||
}
|
||||
ID3D12Device* GetDevice() const { return device_; }
|
||||
ID3D12CommandQueue* GetDirectQueue() const { return direct_queue_; }
|
||||
|
||||
@@ -69,6 +73,7 @@ class D3D12Provider : public GraphicsProvider {
|
||||
bool Initialize();
|
||||
|
||||
IDXGIFactory2* dxgi_factory_ = nullptr;
|
||||
IDXGraphicsAnalysis* graphics_analysis_ = nullptr;
|
||||
ID3D12Device* device_ = nullptr;
|
||||
ID3D12CommandQueue* direct_queue_ = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user