[D3D12] Minor FINE_GRAINED_DRAW_SCOPES refactoring
This commit is contained in:
parent
e0916be5cd
commit
81ee7b4c39
|
@ -1798,9 +1798,9 @@ bool D3D12CommandProcessor::IssueDraw(xenos::PrimitiveType primitive_type,
|
||||||
auto device = GetD3D12Context().GetD3D12Provider().GetDevice();
|
auto device = GetD3D12Context().GetD3D12Provider().GetDevice();
|
||||||
auto& regs = *register_file_;
|
auto& regs = *register_file_;
|
||||||
|
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_f("gpu");
|
SCOPE_profile_cpu_f("gpu");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
|
|
||||||
xenos::ModeControl enable_mode = regs.Get<reg::RB_MODECONTROL>().edram_mode;
|
xenos::ModeControl enable_mode = regs.Get<reg::RB_MODECONTROL>().edram_mode;
|
||||||
if (enable_mode == xenos::ModeControl::kIgnore) {
|
if (enable_mode == xenos::ModeControl::kIgnore) {
|
||||||
|
@ -2336,9 +2336,9 @@ void D3D12CommandProcessor::InitializeTrace() {
|
||||||
void D3D12CommandProcessor::FinalizeTrace() {}
|
void D3D12CommandProcessor::FinalizeTrace() {}
|
||||||
|
|
||||||
bool D3D12CommandProcessor::IssueCopy() {
|
bool D3D12CommandProcessor::IssueCopy() {
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_f("gpu");
|
SCOPE_profile_cpu_f("gpu");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
BeginSubmission(true);
|
BeginSubmission(true);
|
||||||
uint32_t written_address, written_length;
|
uint32_t written_address, written_length;
|
||||||
if (!render_target_cache_->Resolve(*memory_, *shared_memory_, *texture_cache_,
|
if (!render_target_cache_->Resolve(*memory_, *shared_memory_, *texture_cache_,
|
||||||
|
@ -2472,9 +2472,9 @@ void D3D12CommandProcessor::CheckSubmissionFence(uint64_t await_submission) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D12CommandProcessor::BeginSubmission(bool is_guest_command) {
|
void D3D12CommandProcessor::BeginSubmission(bool is_guest_command) {
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_f("gpu");
|
SCOPE_profile_cpu_f("gpu");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
|
|
||||||
bool is_opening_frame = is_guest_command && !frame_open_;
|
bool is_opening_frame = is_guest_command && !frame_open_;
|
||||||
if (submission_open_ && !is_opening_frame) {
|
if (submission_open_ && !is_opening_frame) {
|
||||||
|
@ -2741,9 +2741,9 @@ void D3D12CommandProcessor::ClearCommandAllocatorCache() {
|
||||||
void D3D12CommandProcessor::UpdateFixedFunctionState(bool primitive_two_faced) {
|
void D3D12CommandProcessor::UpdateFixedFunctionState(bool primitive_two_faced) {
|
||||||
auto& regs = *register_file_;
|
auto& regs = *register_file_;
|
||||||
|
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_f("gpu");
|
SCOPE_profile_cpu_f("gpu");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
|
|
||||||
// Window parameters.
|
// Window parameters.
|
||||||
// http://ftp.tku.edu.tw/NetBSD/NetBSD-current/xsrc/external/mit/xf86-video-ati/dist/src/r600_reg_auto_r6xx.h
|
// http://ftp.tku.edu.tw/NetBSD/NetBSD-current/xsrc/external/mit/xf86-video-ati/dist/src/r600_reg_auto_r6xx.h
|
||||||
|
@ -2911,9 +2911,9 @@ void D3D12CommandProcessor::UpdateSystemConstantValues(
|
||||||
const RenderTargetCache::PipelineRenderTarget render_targets[4]) {
|
const RenderTargetCache::PipelineRenderTarget render_targets[4]) {
|
||||||
auto& regs = *register_file_;
|
auto& regs = *register_file_;
|
||||||
|
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_f("gpu");
|
SCOPE_profile_cpu_f("gpu");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
|
|
||||||
auto pa_cl_clip_cntl = regs.Get<reg::PA_CL_CLIP_CNTL>();
|
auto pa_cl_clip_cntl = regs.Get<reg::PA_CL_CLIP_CNTL>();
|
||||||
auto pa_cl_vte_cntl = regs.Get<reg::PA_CL_VTE_CNTL>();
|
auto pa_cl_vte_cntl = regs.Get<reg::PA_CL_VTE_CNTL>();
|
||||||
|
@ -3513,9 +3513,9 @@ bool D3D12CommandProcessor::UpdateBindings(
|
||||||
auto device = provider.GetDevice();
|
auto device = provider.GetDevice();
|
||||||
auto& regs = *register_file_;
|
auto& regs = *register_file_;
|
||||||
|
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_f("gpu");
|
SCOPE_profile_cpu_f("gpu");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
|
|
||||||
// Set the new root signature.
|
// Set the new root signature.
|
||||||
if (current_graphics_root_signature_ != root_signature) {
|
if (current_graphics_root_signature_ != root_signature) {
|
||||||
|
|
|
@ -931,9 +931,9 @@ bool PipelineCache::ConfigurePipeline(
|
||||||
const RenderTargetCache::PipelineRenderTarget render_targets[5],
|
const RenderTargetCache::PipelineRenderTarget render_targets[5],
|
||||||
void** pipeline_state_handle_out,
|
void** pipeline_state_handle_out,
|
||||||
ID3D12RootSignature** root_signature_out) {
|
ID3D12RootSignature** root_signature_out) {
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_f("gpu");
|
SCOPE_profile_cpu_f("gpu");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
|
|
||||||
assert_not_null(pipeline_state_handle_out);
|
assert_not_null(pipeline_state_handle_out);
|
||||||
assert_not_null(root_signature_out);
|
assert_not_null(root_signature_out);
|
||||||
|
|
|
@ -223,9 +223,9 @@ PrimitiveConverter::ConversionResult PrimitiveConverter::ConvertPrimitives(
|
||||||
return ConversionResult::kConversionNotNeeded;
|
return ConversionResult::kConversionNotNeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_f("gpu");
|
SCOPE_profile_cpu_f("gpu");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
|
|
||||||
// Exit early for clearly empty draws, without even reading the memory.
|
// Exit early for clearly empty draws, without even reading the memory.
|
||||||
uint32_t index_count_min;
|
uint32_t index_count_min;
|
||||||
|
|
|
@ -606,9 +606,9 @@ bool RenderTargetCache::UpdateRenderTargets(const D3D12Shader* pixel_shader) {
|
||||||
|
|
||||||
const auto& regs = register_file_;
|
const auto& regs = register_file_;
|
||||||
|
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_f("gpu");
|
SCOPE_profile_cpu_f("gpu");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
|
|
||||||
auto rb_surface_info = regs.Get<reg::RB_SURFACE_INFO>();
|
auto rb_surface_info = regs.Get<reg::RB_SURFACE_INFO>();
|
||||||
uint32_t surface_pitch = std::min(rb_surface_info.surface_pitch, 2560u);
|
uint32_t surface_pitch = std::min(rb_surface_info.surface_pitch, 2560u);
|
||||||
|
|
|
@ -1179,9 +1179,9 @@ void TextureCache::EndFrame() {
|
||||||
void TextureCache::RequestTextures(uint32_t used_texture_mask) {
|
void TextureCache::RequestTextures(uint32_t used_texture_mask) {
|
||||||
const auto& regs = register_file_;
|
const auto& regs = register_file_;
|
||||||
|
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_f("gpu");
|
SCOPE_profile_cpu_f("gpu");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
|
|
||||||
if (texture_invalidated_.exchange(false, std::memory_order_acquire)) {
|
if (texture_invalidated_.exchange(false, std::memory_order_acquire)) {
|
||||||
// Clear the bindings not only for this draw call, but entirely, because
|
// Clear the bindings not only for this draw call, but entirely, because
|
||||||
|
@ -1418,12 +1418,12 @@ void TextureCache::WriteActiveTextureBindfulSRV(
|
||||||
}
|
}
|
||||||
auto device = provider.GetDevice();
|
auto device = provider.GetDevice();
|
||||||
{
|
{
|
||||||
#if FINE_GRAINED_DRAW_SCOPES
|
#if XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
SCOPE_profile_cpu_i(
|
SCOPE_profile_cpu_i(
|
||||||
"gpu",
|
"gpu",
|
||||||
"xe::gpu::d3d12::TextureCache::WriteActiveTextureBindfulSRV->"
|
"xe::gpu::d3d12::TextureCache::WriteActiveTextureBindfulSRV->"
|
||||||
"CopyDescriptorsSimple");
|
"CopyDescriptorsSimple");
|
||||||
#endif // FINE_GRAINED_DRAW_SCOPES
|
#endif // XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES
|
||||||
device->CopyDescriptorsSimple(1, handle, source_handle,
|
device->CopyDescriptorsSimple(1, handle, source_handle,
|
||||||
D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
|
D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
#include "xenia/ui/d3d12/d3d12_provider.h"
|
#include "xenia/ui/d3d12/d3d12_provider.h"
|
||||||
#include "xenia/ui/graphics_context.h"
|
#include "xenia/ui/graphics_context.h"
|
||||||
|
|
||||||
#define FINE_GRAINED_DRAW_SCOPES 1
|
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace ui {
|
namespace ui {
|
||||||
namespace d3d12 {
|
namespace d3d12 {
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include "xenia/ui/d3d12/d3d12_api.h"
|
#include "xenia/ui/d3d12/d3d12_api.h"
|
||||||
#include "xenia/ui/graphics_provider.h"
|
#include "xenia/ui/graphics_provider.h"
|
||||||
|
|
||||||
|
#define XE_UI_D3D12_FINE_GRAINED_DRAW_SCOPES 1
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace ui {
|
namespace ui {
|
||||||
namespace d3d12 {
|
namespace d3d12 {
|
||||||
|
|
Loading…
Reference in New Issue