Skip to content

Commit

Permalink
Add small debug stuff for DirectX.
Browse files Browse the repository at this point in the history
  • Loading branch information
intorr committed Feb 10, 2018
1 parent 3bbec52 commit 2faae09
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Layers/xrRender/Debug/dxPixEventWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define dxPixEventWrapper_included
#pragma once

#if defined(DEBUG) && !defined(USE_OGL)
#if !defined(MASTER_GOLD) && !defined(USE_OGL)

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

Expand Down
13 changes: 11 additions & 2 deletions src/Layers/xrRender/r__dsgraph_render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ template <class T> void sort_tlist(xr_vector<T::template value_type *>& lst, xr_

void D3DXRenderBase::r_dsgraph_render_graph(u32 _priority)
{
// PIX_EVENT(r_dsgraph_render_graph);
PIX_EVENT(r_dsgraph_render_graph);
BasicStats.Primitives.Begin();

// **************************************************** NORMAL
Expand Down Expand Up @@ -351,7 +351,7 @@ void D3DXRenderBase::r_dsgraph_render_hud()
{
extern ENGINE_API float psHUD_FOV;

// PIX_EVENT(r_dsgraph_render_hud);
PIX_EVENT(r_dsgraph_render_hud);

// Change projection
Fmatrix Pold = Device.mProject;
Expand Down Expand Up @@ -419,6 +419,8 @@ void D3DXRenderBase::r_dsgraph_render_hud_ui()

extern ENGINE_API float psHUD_FOV;

PIX_EVENT(r_dsgraph_render_hud_ui);

// Change projection
Fmatrix Pold = Device.mProject;
Fmatrix FTold = Device.mFullTransform;
Expand Down Expand Up @@ -472,6 +474,7 @@ void D3DXRenderBase::r_dsgraph_render_hud_ui()
// strict-sorted render
void D3DXRenderBase::r_dsgraph_render_sorted()
{
PIX_EVENT(r_dsgraph_render_sorted);
std::sort(mapSorted.begin(), mapSorted.end(), cmp_first_h<R_dsgraph::mapSorted_T::value_type>); // back-to-front
for (auto &i : mapSorted)
sorted_L1(i);
Expand All @@ -483,6 +486,7 @@ void D3DXRenderBase::r_dsgraph_render_sorted()
void D3DXRenderBase::r_dsgraph_render_emissive()
{
#if RENDER != R_R1
PIX_EVENT(r_dsgraph_render_emissive);
std::sort(mapEmissive.begin(), mapEmissive.end(), cmp_first_l<R_dsgraph::mapSorted_T::value_type>); // front-to-back
for (auto &i : mapEmissive)
sorted_L1(i);
Expand Down Expand Up @@ -522,6 +526,7 @@ void D3DXRenderBase::r_dsgraph_render_emissive()
void D3DXRenderBase::r_dsgraph_render_wmarks()
{
#if RENDER != R_R1
PIX_EVENT(r_dsgraph_render_wmarks);
std::sort(mapWmark.begin(), mapWmark.end(), cmp_first_l<R_dsgraph::mapSorted_T::value_type>); // front-to-back
for (auto &i : mapWmark)
sorted_L1(i);
Expand All @@ -533,6 +538,7 @@ void D3DXRenderBase::r_dsgraph_render_wmarks()
// strict-sorted render
void D3DXRenderBase::r_dsgraph_render_distort()
{
PIX_EVENT(r_dsgraph_render_distort);
std::sort(mapDistort.begin(), mapDistort.end(), cmp_first_h<R_dsgraph::mapSorted_T::value_type>); // back-to-front
for (auto &i : mapDistort)
sorted_L1(i);
Expand All @@ -554,6 +560,7 @@ void D3DXRenderBase::r_dsgraph_render_subspace(IRender_Sector* _sector, CFrustum
Fvector& _cop, BOOL _dynamic, BOOL _precise_portals)
{
VERIFY(_sector);
PIX_EVENT(r_dsgraph_render_subspace);
RImplementation.marker++; // !!! critical here

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

void D3DXRenderBase::r_dsgraph_render_R1_box(IRender_Sector* S, Fbox& BB, int sh)
{
PIX_EVENT(r_dsgraph_render_R1_box);

lstVisuals.clear();
lstVisuals.push_back(((CSector*)S)->root());

Expand Down
1 change: 1 addition & 0 deletions src/Layers/xrRenderPC_R1/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <d3dx9.h>

#include "Layers/xrRender/xrD3DDefs.h"
#include "Layers/xrRender/Debug/dxPixEventWrapper.h"
#include "Layers/xrRender/HW.h"
#include "Layers/xrRender/Shader.h"
#include "Layers/xrRender/R_Backend.h"
Expand Down

0 comments on commit 2faae09

Please sign in to comment.