Skip to content

Commit 03e1151

Browse files
IRenderDeviceVk and IRenderDeviceD3D12: added GetDXCompiler() method (API256010)
1 parent 032cd1b commit 03e1151

File tree

6 files changed

+22
-2
lines changed

6 files changed

+22
-2
lines changed

Graphics/GraphicsEngine/interface/APIInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/// \file
3131
/// Diligent API information
3232

33-
#define DILIGENT_API_VERSION 256009
33+
#define DILIGENT_API_VERSION 256010
3434

3535
#include "../../../Primitives/interface/BasicTypes.h"
3636

Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ class RenderDeviceD3D12Impl final : public RenderDeviceNextGenBase<RenderDeviceD
204204
RESOURCE_STATE InitialState,
205205
ITopLevelAS** ppTLAS) override final;
206206

207+
/// Implementation of IRenderDeviceD3D12::GetDXCompiler().
208+
virtual IDXCompiler* DILIGENT_CALL_TYPE GetDXCompiler() const override final
209+
{
210+
return m_pDxCompiler.get();
211+
}
212+
207213
void CreateRootSignature(const RefCntAutoPtr<class PipelineResourceSignatureD3D12Impl>* ppSignatures, Uint32 SignatureCount, size_t Hash, RootSignatureD3D12** ppRootSig);
208214

209215
RootSignatureCacheD3D12& GetRootSignatureCache() { return m_RootSignatureCache; }

Graphics/GraphicsEngineD3D12/interface/RenderDeviceD3D12.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ DILIGENT_BEGIN_INTERFACE(IRenderDeviceD3D12, IRenderDevice)
119119
const TopLevelASDesc REF Desc,
120120
RESOURCE_STATE InitialState,
121121
ITopLevelAS** ppTLAS) PURE;
122+
123+
/// Returns DX compiler interface, or null if the compiler is not loaded.
124+
VIRTUAL struct IDXCompiler* METHOD(GetDXCompiler)(THIS) CONST PURE;
122125
};
123126
DILIGENT_END_INTERFACE
124127

@@ -133,7 +136,7 @@ DILIGENT_END_INTERFACE
133136
# define IRenderDeviceD3D12_CreateBufferFromD3DResource(This, ...) CALL_IFACE_METHOD(RenderDeviceD3D12, CreateBufferFromD3DResource, This, __VA_ARGS__)
134137
# define IRenderDeviceD3D12_CreateBLASFromD3DResource(This, ...) CALL_IFACE_METHOD(RenderDeviceD3D12, CreateBLASFromD3DResource, This, __VA_ARGS__)
135138
# define IRenderDeviceD3D12_CreateTLASFromD3DResource(This, ...) CALL_IFACE_METHOD(RenderDeviceD3D12, CreateTLASFromD3DResource, This, __VA_ARGS__)
136-
139+
# define IRenderDeviceD3D12_GetDXCompiler(This) CALL_IFACE_METHOD(RenderDeviceD3D12, GetDXCompiler, This)
137140
// clang-format on
138141

139142
#endif

Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ class RenderDeviceVkImpl final : public RenderDeviceNextGenBase<RenderDeviceBase
228228
/// Implementation of IRenderDeviceVk::GetDeviceFeaturesVk().
229229
virtual void DILIGENT_CALL_TYPE GetDeviceFeaturesVk(DeviceFeaturesVk& FeaturesVk) const override final;
230230

231+
/// Implementation of IRenderDeviceVk::GetDXCompiler().
232+
virtual IDXCompiler* DILIGENT_CALL_TYPE GetDXCompiler() const override final
233+
{
234+
return m_pDxCompiler.get();
235+
}
236+
231237
DescriptorSetAllocation AllocateDescriptorSet(Uint64 CommandQueueMask, VkDescriptorSetLayout SetLayout, const char* DebugName = "")
232238
{
233239
return m_DescriptorSetAllocator.Allocate(CommandQueueMask, SetLayout, DebugName);

Graphics/GraphicsEngineVulkan/interface/RenderDeviceVk.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ DILIGENT_BEGIN_INTERFACE(IRenderDeviceVk, IRenderDevice)
166166
/// Returns Vulkan-specific device features, see Diligent::DeviceFeaturesVk.
167167
VIRTUAL void METHOD(GetDeviceFeaturesVk)(THIS_
168168
DeviceFeaturesVk REF FeaturesVk) CONST PURE;
169+
170+
/// Returns DX compiler interface, or null if the compiler is not loaded.
171+
VIRTUAL struct IDXCompiler* METHOD(GetDXCompiler)(THIS) CONST PURE;
169172
};
170173
DILIGENT_END_INTERFACE
171174

@@ -184,6 +187,7 @@ DILIGENT_END_INTERFACE
184187
# define IRenderDeviceVk_CreateTLASFromVulkanResource(This, ...) CALL_IFACE_METHOD(RenderDeviceVk, CreateTLASFromVulkanResource, This, __VA_ARGS__)
185188
# define IRenderDeviceVk_CreateFenceFromVulkanResource(This, ...) CALL_IFACE_METHOD(RenderDeviceVk, CreateFenceFromVulkanResource, This, __VA_ARGS__)
186189
# define IRenderDeviceVk_GetDeviceFeaturesVk(This, ...) CALL_IFACE_METHOD(RenderDeviceVk, GetDeviceFeaturesVk, This, __VA_ARGS__)
190+
# define IRenderDeviceVk_GetDXCompiler(This) CALL_IFACE_METHOD(RenderDeviceVk, GetDXCompiler, This)
187191

188192
// clang-format on
189193

ReleaseHistory.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Current progress
44

5+
* Added `IRenderDeviceVk::GetDXCompiler()` and `IRenderDeviceD3D12::GetDXCompiler()` methods (API256010)
56
* Added `IEngineFactoryVk::GetVulkanVersion` method (API256009)
67
* Added `SHADER_COMPILE_FLAG_HLSL_TO_SPIRV_VIA_GLSL` flag (API256008)
78
* Added `IRenderDevice::CreateDeferredContext()` method (API256007)

0 commit comments

Comments
 (0)