Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renderer R5 (DX12) #1620

Open
wants to merge 47 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f21c9ea
Required changes for the new renderer in the main loop
Feb 3, 2024
1c37c40
Added a new render based on DX 12 - Render 5
Feb 5, 2024
3b03804
Minor edits that I forgot to transfer to the new render
Feb 6, 2024
d746130
fixing errors related to changing settings
Feb 7, 2024
e64ecff
Revert "fixing errors related to changing settings"
Feb 7, 2024
b2a7ad9
Reapply "fixing errors related to changing settings"
Feb 7, 2024
bf69361
forgot to disable the debugger
Feb 7, 2024
1401197
+ added 12_2 mode in create device
Feb 9, 2024
6536446
Minor changes related to object initialization
Feb 11, 2024
a5deaa6
Fixed a bug related to rtv == 0
Feb 12, 2024
eb8773b
Merge branch 'OpenXRay:dev' into dev
viventaje Feb 12, 2024
77b3002
fixed warning when creating a buffer in direct 12
Feb 12, 2024
fd46820
Added modern SwapChain in DX12
Feb 12, 2024
dce3f6b
fixed init/drawing in imGui
Feb 12, 2024
8722550
Fixed a bug with shadows in the sun and minor edits
Feb 13, 2024
7c5cb21
added r5_D3D12SubmissionThread
Feb 13, 2024
057e2a9
fix flickering in imGui
Feb 13, 2024
37f625a
Merge branch 'OpenXRay:dev' into dev
viventaje Feb 13, 2024
5733c9a
fix bug related to CCryDX12DeviceContext::ResolveOcclusion
Feb 14, 2024
b09cfed
Merge branch 'dev' of https://github.com/viventaje/xray-16 into dev
Feb 14, 2024
f89543d
removed warnings from 12 direct messages that blocked the output
Feb 14, 2024
68afda4
added swapchain in queue
Feb 16, 2024
224815f
added ID3D12GraphicsCommandList1 and ID3D12GraphicsCommandList2
Feb 16, 2024
f7ce98c
remove test present
Feb 16, 2024
6c8074a
added some flags for resources
Feb 16, 2024
f56bad7
minor fixes
Feb 17, 2024
9377ea4
fogot fix for timestamp
Feb 17, 2024
87b7a7b
fix barrier log
Feb 18, 2024
c4f69d1
fix multiplayer crashing
Feb 18, 2024
781d1c6
fixed video playback in credits
Feb 18, 2024
6c52855
some minor edits
Feb 18, 2024
196bacd
Returned the old version of SwapChain
Feb 26, 2024
7bca206
attempt to fix the problem with the constant buffer
Feb 26, 2024
853f427
minor edits
Feb 29, 2024
37ab358
Merge branch 'dev' into dev
viventaje Feb 29, 2024
18a3198
update d3dx12.h
Mar 3, 2024
9b3764e
Fixed an error when setting initialization parameters
Mar 3, 2024
ab4359b
Cleaned up various junk in code and files
Mar 4, 2024
3ebb373
Fixed crash when exiting the game
Mar 5, 2024
36e7737
Fixed build error
Mar 5, 2024
1ffc0f2
added constant buffer allocator and fixed run in r4 mode
Mar 15, 2024
fc12cf9
Merge branch 'OpenXRay:dev' into dev
viventaje Mar 18, 2024
017954a
DXIL support
Mar 18, 2024
98fd65b
render imgui if only enabled
Mar 24, 2024
d05f15a
replace DXIL
Mar 25, 2024
970fb1f
refactoring constant allocator and added for dx11_1
Mar 25, 2024
53639af
forgot added for r4 dx11ConstantAllocator.h/cpp
Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Externals/imgui.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="imgui\backends\imgui_impl_dx11.cpp" />
<ClCompile Include="imgui\backends\imgui_impl_dx12.cpp" />
<ClCompile Include="imgui\backends\imgui_impl_dx9.cpp" />
<ClCompile Include="imgui\backends\imgui_impl_opengl3.cpp" />
<ClCompile Include="imgui\imgui.cpp" />
Expand All @@ -42,6 +43,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="imgui\backends\imgui_impl_dx11.h" />
<ClInclude Include="imgui\backends\imgui_impl_dx12.h" />
<ClInclude Include="imgui\backends\imgui_impl_dx9.h" />
<ClInclude Include="imgui\backends\imgui_impl_opengl3.h" />
<ClInclude Include="imgui\imconfig.h" />
Expand Down
10 changes: 5 additions & 5 deletions src/Layers/xrRender/Blender_Recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void CBlender_Compile::_cpp_Compile(ShaderElement* _SH)
bUseSteepParallax = true;
}
*/
#ifdef USE_DX11
#if defined(USE_DX11) || defined(USE_DX12)
TessMethod = 0;
#endif

Expand Down Expand Up @@ -210,16 +210,16 @@ void CBlender_Compile::PassSET_Shaders(pcstr _vs, pcstr _ps, pcstr _gs /*= nullp
dest.ps = RImplementation.Resources->_CreatePS(_ps);
ctable.merge(&dest.ps->constants);
u32 flags = 0;
#if defined(USE_DX11)
#if defined(USE_DX11) || defined(USE_DX12)
if (dest.ps->constants.dx9compatibility)
flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
#endif
dest.vs = RImplementation.Resources->_CreateVS(_vs, flags);
ctable.merge(&dest.vs->constants);
#if defined(USE_DX11) || defined(USE_OGL)
#if defined(USE_DX11) || defined(USE_DX12) || defined(USE_OGL)
dest.gs = RImplementation.Resources->_CreateGS(_gs);
ctable.merge(&dest.gs->constants);
# ifdef USE_DX11
#if defined(USE_DX11) || defined(USE_DX12)
dest.hs = RImplementation.Resources->_CreateHS(_hs);
dest.ds = RImplementation.Resources->_CreateDS(_ds);
ctable.merge(&dest.hs->constants);
Expand Down Expand Up @@ -254,7 +254,7 @@ void CBlender_Compile::PassSET_ablend_mode(BOOL bABlend, u32 abSRC, u32 abDST)
RS.SetRS(D3DRS_SRCBLEND, bABlend ? abSRC : D3DBLEND_ONE);
RS.SetRS(D3DRS_DESTBLEND, bABlend ? abDST : D3DBLEND_ZERO);

#if defined(USE_DX11) || defined(USE_OGL)
#if defined(USE_DX11) || defined(USE_DX12) || defined(USE_OGL)
// Since in our engine D3DRS_SEPARATEALPHABLENDENABLE state is
// always set to false and in DirectX 10 blend functions for
// color and alpha are always independent, assign blend options for
Expand Down
10 changes: 5 additions & 5 deletions src/Layers/xrRender/Blender_Recorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CBlender_Compile
CSimulator RS;
IBlender* BT;
ShaderElement* SH;
#ifdef USE_DX11
#if defined(USE_DX11) || defined(USE_DX12)
enum
{
NO_TESS = 0,
Expand Down Expand Up @@ -120,7 +120,7 @@ class CBlender_Compile
void i_Filter_Mip(u32 s, u32 f);
void i_Filter_Mag(u32 s, u32 f);
void i_Filter_Aniso(u32 s, u32 f);
#if defined(USE_DX11)
#if defined(USE_DX11) || defined(USE_DX12)
void i_dx11FilterAnizo(u32 s, BOOL value);
#endif
void i_Filter(u32 s, u32 _min, u32 _mip, u32 _mag);
Expand All @@ -131,11 +131,11 @@ class CBlender_Compile
D3DBLEND abSRC = D3DBLEND_ONE, D3DBLEND abDST = D3DBLEND_ZERO, BOOL aTest = FALSE, u32 aRef = 0);

void r_Constant(LPCSTR name, R_constant_setup* s);
#if defined(USE_DX11) || defined(USE_OGL)
#if defined(USE_DX11) || defined(USE_DX12) || defined(USE_OGL)
void r_Pass(LPCSTR vs, LPCSTR gs, LPCSTR ps, bool bFog, BOOL bZtest = TRUE, BOOL bZwrite = TRUE,
BOOL bABlend = FALSE, D3DBLEND abSRC = D3DBLEND_ONE, D3DBLEND abDST = D3DBLEND_ZERO, BOOL aTest = FALSE,
u32 aRef = 0);
#ifdef USE_DX11
#if defined(USE_DX11) || defined(USE_DX12)
void r_TessPass(LPCSTR vs, LPCSTR hs, LPCSTR ds, LPCSTR gs, LPCSTR ps, bool bFog, BOOL bZtest = TRUE,
BOOL bZwrite = TRUE, BOOL bABlend = FALSE, D3DBLEND abSRC = D3DBLEND_ONE, D3DBLEND abDST = D3DBLEND_ZERO,
BOOL aTest = FALSE, u32 aRef = 0);
Expand All @@ -147,7 +147,7 @@ class CBlender_Compile
void r_CullMode(D3DCULL Mode);
#endif // !USE_DX9

#if defined(USE_DX11)
#if defined(USE_DX11) || defined(USE_DX12)
void r_dx11Texture(LPCSTR ResourceName, LPCSTR texture, bool recursive = false);
void r_dx11Texture(LPCSTR ResourceName, shared_str texture, bool recursive = false)
{
Expand Down
8 changes: 4 additions & 4 deletions src/Layers/xrRender/Blender_Recorder_R2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ void CBlender_Compile::r_Pass(LPCSTR _vs, LPCSTR _ps, bool bFog, BOOL bZtest, BO
dest.ps = RImplementation.Resources->_CreatePS(_ps);
ctable.merge(&dest.ps->constants);
u32 flags = 0;
#if defined(USE_DX11)
#if defined(USE_DX11) || defined(USE_DX12)
if (dest.ps->constants.dx9compatibility)
flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
#endif
dest.vs = RImplementation.Resources->_CreateVS(_vs, flags);
ctable.merge(&dest.vs->constants);
#if defined(USE_DX11) || defined(USE_OGL)
#if defined(USE_DX11) || defined(USE_DX12) || defined(USE_OGL)
dest.gs = RImplementation.Resources->_CreateGS("null");
# ifdef USE_DX11
#if defined(USE_DX11) || defined(USE_DX12)
dest.hs = RImplementation.Resources->_CreateHS("null");
dest.ds = RImplementation.Resources->_CreateDS("null");
dest.cs = RImplementation.Resources->_CreateCS("null");
Expand Down Expand Up @@ -142,7 +142,7 @@ u32 CBlender_Compile::r_Sampler(
dwStage = i_Sampler(_name);
if (u32(-1) != dwStage)
{
#if defined(USE_DX11)
#if defined(USE_DX11) || defined(USE_DX12)
r_dx11Texture(_name, texture, true);
#elif defined(USE_DX9) || defined(USE_OGL)
i_Texture(dwStage, texture);
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/Blender_Recorder_StandartBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class cl_texgen : public R_constant_setup
0.0f, 0.0f, 1.0f, 0.0f,
0.5f + o_w, 0.5f + o_h, 0.0f, 1.0f
};
#elif defined(USE_DX11)
#elif defined(USE_DX11) || defined(USE_DX12)
Fmatrix mTexelAdjust =
{
0.5f, 0.0f, 0.0f, 0.0f,
Expand Down Expand Up @@ -122,7 +122,7 @@ class cl_VPtexgen : public R_constant_setup
0.0f, 0.0f, 1.0f, 0.0f,
0.5f + o_w, 0.5f + o_h, 0.0f, 1.0f
};
#elif defined(USE_DX11)
#elif defined(USE_DX11) || defined(USE_DX12)
Fmatrix mTexelAdjust =
{
0.5f, 0.0f, 0.0f, 0.0f,
Expand Down
6 changes: 3 additions & 3 deletions src/Layers/xrRender/ColorMapManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void ColorMapManager::UpdateTexture(const shared_str& strTexName, int iTex)
if (I != m_TexCache.end())
{

#if defined(USE_DX9) || defined(USE_DX11)
#if defined(USE_DX9) || defined(USE_DX11) || defined(USE_DX12)
ID3DBaseTexture* e0 = I->second->surface_get();
m_CMap[iTex]->surface_set(e0);
_RELEASE(e0);
Expand All @@ -44,7 +44,7 @@ void ColorMapManager::UpdateTexture(const shared_str& strTexName, int iTex)

m_TexCache.emplace(strTexName, tmp);

#if defined(USE_DX9) || defined(USE_DX11)
#if defined(USE_DX9) || defined(USE_DX11) || defined(USE_DX12)
ID3DBaseTexture* e0 = tmp->surface_get();
m_CMap[iTex]->surface_set(e0);
_RELEASE(e0);
Expand All @@ -58,7 +58,7 @@ void ColorMapManager::UpdateTexture(const shared_str& strTexName, int iTex)
}
else
{
#if defined(USE_DX9) || defined(USE_DX11)
#if defined(USE_DX9) || defined(USE_DX11) || defined(USE_DX12)
m_CMap[iTex]->surface_set(nullptr);
#elif defined(USE_OGL)
m_CMap[iTex]->surface_set(GL_TEXTURE_2D, 0);
Expand Down
19 changes: 9 additions & 10 deletions src/Layers/xrRender/D3DXRenderBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void D3DXRenderBase::OnDeviceDestroy(bool bKeepTextures)
destroy();

Resources->OnDeviceDestroy(bKeepTextures);
#if RENDER == R_R4
#if RENDER == R_R4 || RENDER == R_R5
for (int id = 0; id < R__NUM_CONTEXTS; ++id)
{
contexts_pool[id].cmd_list.OnDeviceDestroy();
Expand All @@ -76,13 +76,12 @@ void D3DXRenderBase::Destroy()

void D3DXRenderBase::Reset(SDL_Window* hWnd, u32& dwWidth, u32& dwHeight, float& fWidth_2, float& fHeight_2)
{
#if defined(DEBUG) && (defined(USE_DX9) || defined(USE_DX11))
#if defined(DEBUG) && (defined(USE_DX9) || defined(USE_DX11) || defined(USE_DX12))
_SHOW_REF("*ref -CRenderDevice::ResetTotal: DeviceREF:", HW.pDevice);
#endif // DEBUG

reset_begin();
Memory.mem_compact();

HW.Reset();

std::tie(dwWidth, dwHeight) = HW.GetSurfaceSize();
Expand All @@ -98,7 +97,7 @@ void D3DXRenderBase::Reset(SDL_Window* hWnd, u32& dwWidth, u32& dwHeight, float&
Resources->Dump(true);
#endif

#if defined(DEBUG) && (defined(USE_DX9) || defined(USE_DX11))
#if defined(DEBUG) && (defined(USE_DX9) || defined(USE_DX11) || defined(USE_DX12))
_SHOW_REF("*ref +CRenderDevice::ResetTotal: DeviceREF:", HW.pDevice);
#endif
}
Expand All @@ -111,7 +110,7 @@ void D3DXRenderBase::ObtainRequiredWindowFlags(u32& windowFlags)
void D3DXRenderBase::SetupStates()
{
HW.Caps.Update();
#if RENDER == R_R4
#if RENDER == R_R4 || RENDER == R_R5
for (int id = 0; id < R__NUM_CONTEXTS; ++id)
{
contexts_pool[id].cmd_list.SetupStates();
Expand All @@ -131,7 +130,7 @@ void D3DXRenderBase::OnDeviceCreate(const char* shName)

CreateQuadIB();

#if RENDER == R_R4
#if RENDER == R_R4 || RENDER == R_R5
for (int id = 0; id < R__NUM_CONTEXTS; ++id)
{
contexts_pool[id].cmd_list.context_id = id;
Expand All @@ -157,7 +156,7 @@ void D3DXRenderBase::OnDeviceCreate(const char* shName)

void D3DXRenderBase::Create(SDL_Window* hWnd, u32& dwWidth, u32& dwHeight, float& fWidth_2, float& fHeight_2)
{
#if defined(USE_RENDERDOC) && defined(USE_DX11)
#if defined(USE_RENDERDOC) && (defined(USE_DX11) || defined(USE_DX12))
if (!g_renderdoc_api)
{
HMODULE hModule = GetModuleHandleA("renderdoc.dll");
Expand Down Expand Up @@ -257,7 +256,7 @@ u32 D3DXRenderBase::GetCacheStatPolys()
void D3DXRenderBase::Begin()
{
HW.BeginScene();
#if RENDER == R_R4
#if RENDER == R_R4 || RENDER == R_R5
for (int id = 0; id < R__NUM_CONTEXTS; ++id)
{
contexts_pool[id].cmd_list.OnFrameBegin();
Expand Down Expand Up @@ -290,7 +289,7 @@ void D3DXRenderBase::End()
{
if (HW.Caps.SceneMode)
overdrawEnd();
#if RENDER == R_R4
#if RENDER == R_R4 || RENDER == R_R5
for (int id = 0; id < R__NUM_CONTEXTS; ++id)
{
contexts_pool[id].cmd_list.OnFrameEnd();
Expand Down Expand Up @@ -318,7 +317,7 @@ void D3DXRenderBase::ClearTarget()

void D3DXRenderBase::SetCacheXform(Fmatrix& mView, Fmatrix& mProject)
{
#if RENDER == R_R4
#if RENDER == R_R4 || RENDER == R_R5
for (int id = 0; id < R__NUM_CONTEXTS; ++id)
{
contexts_pool[id].cmd_list.set_xform_view(mView);
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/Debug/dxPixEventWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# define PIX_EVENT(Name) do { } while (false)
# define PIX_EVENT_CTX(C,Name) do { } while (false)
#else
#if defined(USE_DX9) || defined(USE_DX11)
#if defined(USE_DX9) || defined(USE_DX11) || defined(USE_DX12)
# define PIX_EVENT(Name) dxPixEventWrapper pixEvent##Name(RCache,L ## #Name)
# define PIX_EVENT_CTX(C,Name) dxPixEventWrapper pixEvent##Name(C,L ## #Name)

Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/DetailManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class ECORE_API CDetailManager
void hw_Render(CBackend& cmd_list);
#if defined(USE_DX9)
void hw_Render_dump(CBackend& cmd_list, ref_constant array, u32 var_id, u32 lod_id, u32 c_base);
#elif defined(USE_DX11) || defined(USE_OGL)
#elif defined(USE_DX11) || defined(USE_DX12) || defined(USE_OGL)
void hw_Render_dump(CBackend& cmd_list, const Fvector4& consts, const Fvector4& wave, const Fvector4& wind, u32 var_id, u32 lod_id);
#else
# error No graphics API selected or enabled!
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/DetailModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ void CDetail::Load(IReader* S)
bv_bb.modify(vertices[i].P);
bv_bb.getsphere(bv_sphere.P, bv_sphere.R);

#if !defined(_EDITOR) && (defined(USE_DX9) || defined(USE_DX11))
#if !defined(_EDITOR) && (defined(USE_DX9) || defined(USE_DX11) || defined(USE_DX12))
Optimize();
#endif
}

#if !defined(_EDITOR) && (defined(USE_DX9) || defined(USE_DX11))
#if !defined(_EDITOR) && (defined(USE_DX9) || defined(USE_DX11) || defined(USE_DX12))
#include "xrstripify.h"

void CDetail::Optimize()
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/FTreeVisual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void FTreeVisual::Render(CBackend& cmd_list, float /*LOD*/, bool use_fast_geo)
#endif
cmd_list.tree.set_c_sun(s * c_scale.sun, s * c_bias.sun, 0, 0); // sun

#if RENDER == R_R4
#if RENDER == R_R4 || RENDER == R_R5
if (ps_ssfx_grass_interactive.y > 0)
{
// Inter grass Settings
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/FVF.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#if defined(USE_DX9)
# define FVF_COLOR(c) (c)
#elif defined(USE_DX11)
#elif defined(USE_DX11) || defined(USE_DX12)
# define FVF_COLOR(c) ((c & 0xff00ff00) | ((c >> 16) & 0xff) | ((c & 0xff) << 16u))
#elif defined(USE_OGL) //the compiler should know to dedup this, defined explicitly for organization
# define FVF_COLOR(c) (c)
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/HOM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void CHOM::Render_DB(CFrustum& base)
{
// Update projection matrices on every frame to ensure valid HOM culling
float view_dim = occ_dim_0;
#if defined(USE_DX9) || defined(USE_DX11)
#if defined(USE_DX9) || defined(USE_DX11) || defined(USE_DX12)
Fmatrix m_viewport = {view_dim / 2.f, 0.0f, 0.0f, 0.0f, 0.0f, view_dim / 2.f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
view_dim / 2.f + 0 + 0, view_dim / 2.f + 0 + 0, 0.0f, 1.0f};
Fmatrix m_viewport_01 = {1.f / 2.f, 0.0f, 0.0f, 0.0f, 0.0f, 1.f / 2.f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/Light_Package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void light_Package::clear()
v_shadowed.clear();
}

#if (RENDER == R_R2) || (RENDER == R_R3) || (RENDER == R_R4) || (RENDER == R_GL)
#if (RENDER == R_R2) || (RENDER == R_R3) || (RENDER == R_R4) || (RENDER == R_R5) || (RENDER == R_GL)
void light_Package::sort()
{
const auto pred_light_cmp = [](const light* l1, const light* l2)
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/ParticleEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void ApplyTexgen(CBackend& cmd_list, const Fmatrix& mVP)
0.0f, 0.0f, 1.0f, 0.0f,
0.5f + o_w, 0.5f + o_h, 0.0f, 1.0f
};
#elif defined(USE_DX11)
#elif defined(USE_DX11) || defined(USE_DX12)
Fmatrix mTexelAdjust =
{
0.5f, 0.0f, 0.0f, 0.0f,
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/QueryHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma once

// Interface
#if defined(USE_DX9) || defined(USE_DX11)
#if defined(USE_DX9) || defined(USE_DX11) || defined(USE_DX12)
IC HRESULT CreateQuery(ID3DQuery** ppQuery);
IC HRESULT GetData(ID3DQuery* pQuery, void* pData, u32 DataSize);
IC HRESULT BeginQuery(ID3DQuery* pQuery);
Expand Down Expand Up @@ -38,7 +38,7 @@ IC HRESULT ReleaseQuery(ID3DQuery* pQuery)
return S_OK;
}

#elif defined(USE_DX11)
#elif defined(USE_DX11) || defined(USE_DX12)

IC HRESULT CreateQuery(ID3DQuery** ppQuery, D3D_QUERY type)
{
Expand Down
Loading