Navigation
API > API/Runtime > API/Runtime/VulkanRHI
Base class used for external code (such as plugins) to enable extensions in the Vulkan RHI. The lifetime is managed through the use of TSharedRef. Basic usage: Using this as a base class, pass in the ExtensionName and overload GetFeaturesStruct() to return the extension specific features struct. IMPORTANT: Make sure the feature struct has its sType correctly set and pNext to NULL.
Example to enable VK_EXT_memory_decompression: class FDeviceExtensionMemoryDecompression : public FVulkanRHIExternalDeviceExtensionBase { FDeviceExtensionMemoryDecompression() : FVulkanRHIExternalDeviceExtensionBase(VK_EXT_MEMORY_DECOMPRESSION_EXTENSION_NAME) { ZeroVulkanStruct(Features, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_EXT); } virtual VkBaseOutStructure* GetFeaturesStruct() final override { return reinterpret_cast
- If properties are needed, overload GetPropertiesStruct() to return the extension specific properties struct (with sType and pNext initialized).
- FeaturesCallback() / PropertiesCallback() are called after those property structures are filled.
- If inspection of the features and/or properties reveals the extension should not be loaded, the callbacks should return false.
- If the extension is already handled by the engine or loaded by another plugin, DuplicateCallback() will be called.
| Name | FVulkanRHIExternalDeviceExtensionBase |
| Type | class |
| Header File | /Engine/Source/Runtime/VulkanRHI/Public/IVulkanDynamicRHI.h |
| Include Path | #include "IVulkanDynamicRHI.h" |
Syntax
class FVulkanRHIExternalDeviceExtensionBase : public TSharedFromThis< FVulkanRHIExternalDeviceExtensionBase >
Inheritance Hierarchy
- TSharedFromThis< FVulkanRHIExternalDeviceExtensionBase > → FVulkanRHIExternalDeviceExtensionBase
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FVulkanRHIExternalDeviceExtensionBase
(
const ANSICHAR* InExtensionName |
IVulkanDynamicRHI.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FVulkanRHIExternalDeviceExtensionBase() |
IVulkanDynamicRHI.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ExtensionName | const FAnsiString | Name of the extension to be loaded. | IVulkanDynamicRHI.h |
Functions
Public
Public Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void DuplicateCallback() |
Callback if the extension is found to be a duplicate (already loaded by the engine or other plugin). | IVulkanDynamicRHI.h | |
virtual bool FeaturesCallback() |
Callback when the features structure has been filled. Return true if the features meet your requirements. | IVulkanDynamicRHI.h | |
virtual VkBaseOutStructure * GetFeaturesStruct() |
Returns a pointer to the extension's feature structure. | IVulkanDynamicRHI.h | |
virtual VkBaseOutStructure * GetPropertiesStruct() |
Pointer to the extension's properties structure. | IVulkanDynamicRHI.h | |
virtual bool PropertiesCallback() |
Callback when the properties structure has been filled. Return true if the properties meet your requirements. | IVulkanDynamicRHI.h |