Add GetNativePtr to GPUAdapter
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user