summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/src/renderer_d3d9.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/src/renderer_d3d9.h')
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.h40
1 files changed, 30 insertions, 10 deletions
diff --git a/3rdparty/bgfx/src/renderer_d3d9.h b/3rdparty/bgfx/src/renderer_d3d9.h
index 06cd320b96f..0080c474eba 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.h
+++ b/3rdparty/bgfx/src/renderer_d3d9.h
@@ -1,17 +1,16 @@
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_D3D9_H_HEADER_GUARD
#define BGFX_RENDERER_D3D9_H_HEADER_GUARD
-#define BGFX_CONFIG_RENDERER_DIRECT3D9EX BX_PLATFORM_WINDOWS
+#define BGFX_CONFIG_RENDERER_DIRECT3D9EX (BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS)
-#if BX_PLATFORM_WINDOWS
-# include <sal.h>
-# include <d3d9.h>
-#endif // BX_PLATFORM_
+#include <sal.h>
+#include <unknwn.h>
+#include <d3d9.h>
#ifndef D3DSTREAMSOURCE_INDEXEDDATA
# define D3DSTREAMSOURCE_INDEXEDDATA (1<<30)
@@ -25,6 +24,24 @@
#include "renderer_d3d.h"
#include "nvapi.h"
+#define BGFX_D3D9_PROFILER_BEGIN(_view, _abgr) \
+ BX_MACRO_BLOCK_BEGIN \
+ PIX_BEGINEVENT(_abgr, s_viewNameW[_view]); \
+ BGFX_PROFILER_BEGIN(s_viewName[view], _abgr); \
+ BX_MACRO_BLOCK_END
+
+#define BGFX_D3D9_PROFILER_BEGIN_LITERAL(_name, _abgr) \
+ BX_MACRO_BLOCK_BEGIN \
+ PIX_BEGINEVENT(_abgr, L"" _name); \
+ BGFX_PROFILER_BEGIN_LITERAL("" _name, _abgr); \
+ BX_MACRO_BLOCK_END
+
+#define BGFX_D3D9_PROFILER_END() \
+ BX_MACRO_BLOCK_BEGIN \
+ BGFX_PROFILER_END(); \
+ PIX_ENDEVENT(); \
+ BX_MACRO_BLOCK_END
+
namespace bgfx { namespace d3d9
{
# if defined(D3D_DISABLE_9EX)
@@ -173,7 +190,7 @@ namespace bgfx { namespace d3d9
{
}
- void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle);
+ void create(uint32_t _size, void* _data, VertexLayoutHandle _layoutHandle);
void update(uint32_t _offset, uint32_t _size, void* _data, bool _discard = false)
{
if (NULL != m_dynamic
@@ -214,7 +231,7 @@ namespace bgfx { namespace d3d9
IDirect3DVertexBuffer9* m_ptr;
uint8_t* m_dynamic;
uint32_t m_size;
- VertexDeclHandle m_decl;
+ VertexLayoutHandle m_layoutHandle;
};
struct ShaderD3D9
@@ -428,7 +445,7 @@ namespace bgfx { namespace d3d9
void postReset();
void preReset();
- uint32_t begin(uint32_t _resultIdx);
+ uint32_t begin(uint32_t _resultIdx, uint32_t _frameNum);
void end(uint32_t _idx);
bool update();
@@ -439,6 +456,7 @@ namespace bgfx { namespace d3d9
IDirect3DQuery9* m_end;
IDirect3DQuery9* m_freq;
uint32_t m_resultIdx;
+ uint32_t m_frameNum;
bool m_ready;
};
@@ -450,12 +468,14 @@ namespace bgfx { namespace d3d9
m_end = 0;
m_frequency = 1;
m_pending = 0;
+ m_frameNum = 0;
}
uint64_t m_begin;
uint64_t m_end;
uint64_t m_frequency;
uint32_t m_pending;
+ uint32_t m_frameNum;
};
Result m_result[BGFX_CONFIG_MAX_VIEWS+1];