summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/src/renderer_d3d12.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/src/renderer_d3d12.h')
-rw-r--r--3rdparty/bgfx/src/renderer_d3d12.h39
1 files changed, 30 insertions, 9 deletions
diff --git a/3rdparty/bgfx/src/renderer_d3d12.h b/3rdparty/bgfx/src/renderer_d3d12.h
index 25de46c80bb..c658459f446 100644
--- a/3rdparty/bgfx/src/renderer_d3d12.h
+++ b/3rdparty/bgfx/src/renderer_d3d12.h
@@ -306,7 +306,7 @@ namespace bgfx { namespace d3d12
, m_num(0)
, m_numTh(0)
{
- m_depth.idx = bgfx::invalidHandle;
+ m_depth.idx = bgfx::kInvalidHandle;
}
void create(uint8_t _num, const Attachment* _attachment);
@@ -449,24 +449,45 @@ namespace bgfx { namespace d3d12
struct TimerQueryD3D12
{
TimerQueryD3D12()
- : m_control(4)
+ : m_control(BX_COUNTOF(m_query) )
{
}
void init();
void shutdown();
- void begin(ID3D12GraphicsCommandList* _commandList);
- void end(ID3D12GraphicsCommandList* _commandList);
- bool get();
+ uint32_t begin(uint32_t _resultIdx);
+ void end(uint32_t _idx);
+ bool update();
+
+ struct Query
+ {
+ uint32_t m_resultIdx;
+ bool m_ready;
+ uint64_t m_fence;
+ };
+
+ struct Result
+ {
+ void reset()
+ {
+ m_begin = 0;
+ m_end = 0;
+ m_pending = 0;
+ }
+
+ uint64_t m_begin;
+ uint64_t m_end;
+ uint32_t m_pending;
+ };
- uint64_t m_begin;
- uint64_t m_end;
- uint64_t m_elapsed;
uint64_t m_frequency;
+ Result m_result[BGFX_CONFIG_MAX_VIEWS+1];
+ Query m_query[BGFX_CONFIG_MAX_VIEWS*4];
+
ID3D12Resource* m_readback;
ID3D12QueryHeap* m_queryHeap;
- uint64_t* m_result;
+ uint64_t* m_queryResult;
bx::RingBufferControl m_control;
};