Skip to content

Commit 2faae09

Browse files
committed
Add small debug stuff for DirectX.
1 parent 3bbec52 commit 2faae09

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/Layers/xrRender/Debug/dxPixEventWrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define dxPixEventWrapper_included
33
#pragma once
44

5-
#if defined(DEBUG) && !defined(USE_OGL)
5+
#if !defined(MASTER_GOLD) && !defined(USE_OGL)
66

77
#define PIX_EVENT(Name) dxPixEventWrapper pixEvent##Name(L#Name)
88

src/Layers/xrRender/r__dsgraph_render.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ template <class T> void sort_tlist(xr_vector<T::template value_type *>& lst, xr_
107107

108108
void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
109109
{
110-
// PIX_EVENT(r_dsgraph_render_graph);
110+
PIX_EVENT(r_dsgraph_render_graph);
111111
BasicStats.Primitives.Begin();
112112

113113
// **************************************************** NORMAL
@@ -351,7 +351,7 @@ void D3DXRenderBase::r_dsgraph_render_hud()
351351
{
352352
extern ENGINE_API float psHUD_FOV;
353353

354-
// PIX_EVENT(r_dsgraph_render_hud);
354+
PIX_EVENT(r_dsgraph_render_hud);
355355

356356
// Change projection
357357
Fmatrix Pold = Device.mProject;
@@ -419,6 +419,8 @@ void D3DXRenderBase::r_dsgraph_render_hud_ui()
419419

420420
extern ENGINE_API float psHUD_FOV;
421421

422+
PIX_EVENT(r_dsgraph_render_hud_ui);
423+
422424
// Change projection
423425
Fmatrix Pold = Device.mProject;
424426
Fmatrix FTold = Device.mFullTransform;
@@ -472,6 +474,7 @@ void D3DXRenderBase::r_dsgraph_render_hud_ui()
472474
// strict-sorted render
473475
void D3DXRenderBase::r_dsgraph_render_sorted()
474476
{
477+
PIX_EVENT(r_dsgraph_render_sorted);
475478
std::sort(mapSorted.begin(), mapSorted.end(), cmp_first_h<R_dsgraph::mapSorted_T::value_type>); // back-to-front
476479
for (auto &i : mapSorted)
477480
sorted_L1(i);
@@ -483,6 +486,7 @@ void D3DXRenderBase::r_dsgraph_render_sorted()
483486
void D3DXRenderBase::r_dsgraph_render_emissive()
484487
{
485488
#if RENDER != R_R1
489+
PIX_EVENT(r_dsgraph_render_emissive);
486490
std::sort(mapEmissive.begin(), mapEmissive.end(), cmp_first_l<R_dsgraph::mapSorted_T::value_type>); // front-to-back
487491
for (auto &i : mapEmissive)
488492
sorted_L1(i);
@@ -522,6 +526,7 @@ void D3DXRenderBase::r_dsgraph_render_emissive()
522526
void D3DXRenderBase::r_dsgraph_render_wmarks()
523527
{
524528
#if RENDER != R_R1
529+
PIX_EVENT(r_dsgraph_render_wmarks);
525530
std::sort(mapWmark.begin(), mapWmark.end(), cmp_first_l<R_dsgraph::mapSorted_T::value_type>); // front-to-back
526531
for (auto &i : mapWmark)
527532
sorted_L1(i);
@@ -533,6 +538,7 @@ void D3DXRenderBase::r_dsgraph_render_wmarks()
533538
// strict-sorted render
534539
void D3DXRenderBase::r_dsgraph_render_distort()
535540
{
541+
PIX_EVENT(r_dsgraph_render_distort);
536542
std::sort(mapDistort.begin(), mapDistort.end(), cmp_first_h<R_dsgraph::mapSorted_T::value_type>); // back-to-front
537543
for (auto &i : mapDistort)
538544
sorted_L1(i);
@@ -554,6 +560,7 @@ void D3DXRenderBase::r_dsgraph_render_subspace(IRender_Sector* _sector, CFrustum
554560
Fvector& _cop, BOOL _dynamic, BOOL _precise_portals)
555561
{
556562
VERIFY(_sector);
563+
PIX_EVENT(r_dsgraph_render_subspace);
557564
RImplementation.marker++; // !!! critical here
558565

559566
// Save and build new frustum, disable HOM
@@ -639,6 +646,8 @@ void D3DXRenderBase::r_dsgraph_render_subspace(IRender_Sector* _sector, CFrustum
639646

640647
void D3DXRenderBase::r_dsgraph_render_R1_box(IRender_Sector* S, Fbox& BB, int sh)
641648
{
649+
PIX_EVENT(r_dsgraph_render_R1_box);
650+
642651
lstVisuals.clear();
643652
lstVisuals.push_back(((CSector*)S)->root());
644653

src/Layers/xrRenderPC_R1/stdafx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <d3dx9.h>
1212

1313
#include "Layers/xrRender/xrD3DDefs.h"
14+
#include "Layers/xrRender/Debug/dxPixEventWrapper.h"
1415
#include "Layers/xrRender/HW.h"
1516
#include "Layers/xrRender/Shader.h"
1617
#include "Layers/xrRender/R_Backend.h"

0 commit comments

Comments
 (0)