Add GetNativePtr to GPUAdapter

This commit is contained in:
2022-12-14 16:16:25 +01:00
parent 713aa3e0f9
commit 79f4dfcaab
4 changed files with 17 additions and 5 deletions
+5
View File
@@ -41,6 +41,11 @@ public:
/// <returns>True if valid, otherwise false.</returns>
virtual bool IsValid() const = 0;
/// <summary>
/// Gets the native pointer to the underlying graphics device adapter. It's a low-level platform-specific handle.
/// </summary>
API_PROPERTY() virtual void* GetNativePtr() const = 0;
/// <summary>
/// Gets the GPU vendor identifier.
/// </summary>
@@ -38,12 +38,14 @@ public:
{
return Index != INVALID_INDEX && MaxFeatureLevel != static_cast<D3D_FEATURE_LEVEL>(0);
}
void* GetNativePtr() const override
{
return (void*)(intptr)Index;
}
uint32 GetVendorId() const override
{
return (uint32)Description.VendorId;
}
String GetDescription() const override
{
return Description.Description;
@@ -12,18 +12,19 @@
class GPUAdapterNull : public GPUAdapter
{
public:
// [GPUAdapter]
bool IsValid() const override
{
return true;
}
void* GetNativePtr() const override
{
return nullptr;
}
uint32 GetVendorId() const override
{
return 0;
}
String GetDescription() const override
{
return TEXT("Null");
@@ -61,6 +61,10 @@ public:
{
return Gpu != VK_NULL_HANDLE;
}
void* GetNativePtr() const override
{
return (void*)Gpu;
}
uint32 GetVendorId() const override
{
return GpuProps.vendorID;