Skip to content

Commit a4b1a41

Browse files
azhirnovTheMostDiligent
authored andcommitted
Added AdapterVendorToVendorId()
1 parent 0b8ad16 commit a4b1a41

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

Graphics/GraphicsAccessories/interface/GraphicsAccessories.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ struct MipLevelProperties
432432
MipLevelProperties GetMipLevelProperties(const TextureDesc& TexDesc, Uint32 MipLevel);
433433

434434
ADAPTER_VENDOR VendorIdToAdapterVendor(Uint32 VendorId);
435+
Uint32 AdapterVendorToVendorId(ADAPTER_VENDOR Vendor);
435436

436437

437438
inline Int32 GetShaderTypeIndex(SHADER_TYPE Type)

Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,7 @@ MipLevelProperties GetMipLevelProperties(const TextureDesc& TexDesc, Uint32 MipL
13901390

13911391
ADAPTER_VENDOR VendorIdToAdapterVendor(Uint32 VendorId)
13921392
{
1393+
static_assert(ADAPTER_VENDOR_LAST == 10, "Please update the switch below to handle the new adapter type");
13931394
switch (VendorId)
13941395
{
13951396
case 0x01002: return ADAPTER_VENDOR_AMD;
@@ -1407,6 +1408,28 @@ ADAPTER_VENDOR VendorIdToAdapterVendor(Uint32 VendorId)
14071408
}
14081409
}
14091410

1411+
Uint32 AdapterVendorToVendorId(ADAPTER_VENDOR Vendor)
1412+
{
1413+
static_assert(ADAPTER_VENDOR_LAST == 10, "Please update the switch below to handle the new adapter type");
1414+
switch (Vendor)
1415+
{
1416+
// clang-format off
1417+
case ADAPTER_VENDOR_AMD: return 0x01002;
1418+
case ADAPTER_VENDOR_NVIDIA: return 0x010DE;
1419+
case ADAPTER_VENDOR_INTEL: return 0x08086;
1420+
case ADAPTER_VENDOR_ARM: return 0x013B5;
1421+
case ADAPTER_VENDOR_QUALCOMM: return 0x05143;
1422+
case ADAPTER_VENDOR_IMGTECH: return 0x01010;
1423+
case ADAPTER_VENDOR_MSFT: return 0x01414;
1424+
case ADAPTER_VENDOR_APPLE: return 0x0106B;
1425+
case ADAPTER_VENDOR_MESA: return 0x10005;
1426+
case ADAPTER_VENDOR_BROADCOM: return 0x014e4;
1427+
// clang-format on
1428+
default:
1429+
return 0;
1430+
}
1431+
}
1432+
14101433
bool IsConsistentShaderType(SHADER_TYPE ShaderType, PIPELINE_TYPE PipelineType)
14111434
{
14121435
static_assert(SHADER_TYPE_LAST == 0x4000, "Please update the switch below to handle the new shader type");

Graphics/GraphicsEngine/interface/GraphicsTypes.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,9 @@ DILIGENT_TYPED_ENUM(ADAPTER_VENDOR, Uint8)
17701770
ADAPTER_VENDOR_MESA,
17711771

17721772
/// Adapter vendor is Broadcom (Raspberry Pi)
1773-
ADAPTER_VENDOR_BROADCOM
1773+
ADAPTER_VENDOR_BROADCOM,
1774+
1775+
ADAPTER_VENDOR_LAST = ADAPTER_VENDOR_BROADCOM
17741776
};
17751777

17761778

0 commit comments

Comments
 (0)