Add a D3D12MarkerRegion for future use

* Not used yet, as I need to figure out how to apply list markers when
  we record multiple individual lists. Doing open/close of a list just
  for the marker seems wasteful. It could be fired directly at the queue
This commit is contained in:
baldurk
2017-03-20 21:20:15 +00:00
parent 1b992db45c
commit f3d7dc774f
2 changed files with 36 additions and 0 deletions
+26
View File
@@ -28,6 +28,32 @@
#include "d3d12_manager.h"
#include "d3d12_resources.h"
D3D12MarkerRegion::D3D12MarkerRegion(ID3D12GraphicsCommandList *l, const std::string &marker)
{
list = l;
if(list)
{
std::wstring text = StringFormat::UTF82Wide(marker);
list->BeginEvent(0, text.c_str(), (UINT)text.size());
}
}
void D3D12MarkerRegion::Set(ID3D12GraphicsCommandList *list, const std::string &marker)
{
if(list)
{
std::wstring text = StringFormat::UTF82Wide(marker);
list->SetMarker(0, text.c_str(), (UINT)text.size());
}
}
D3D12MarkerRegion::~D3D12MarkerRegion()
{
if(list)
list->EndEvent();
}
static ShaderConstant MakeConstantBufferVariable(const DXBC::CBufferVariable &var, uint32_t &offset);
static ShaderVariableType MakeShaderVariableType(DXBC::CBufferVariableType type, uint32_t &offset)
+10
View File
@@ -33,6 +33,16 @@
#include "driver/shaders/dxbc/dxbc_compile.h"
#include "serialise/serialiser.h"
// replay only class for handling marker regions
struct D3D12MarkerRegion
{
D3D12MarkerRegion(ID3D12GraphicsCommandList *list, const std::string &marker);
~D3D12MarkerRegion();
static void Set(ID3D12GraphicsCommandList *list, const std::string &marker);
ID3D12GraphicsCommandList *list;
};
void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
ShaderBindpointMapping *mapping);