Is it possible to get what DirectX version is currently in use?

I’m targeting DX12 to use some features and use DX11 as a fallback. Is there a way to detect what DX version is currently us use? I want to gray out unavailable features in game settings

1 Like

Did u find a solution? Looking for that, too.

From PixelStreaming Source code (engine plugin) :

https://github.com/EpicGames/UnrealEngine/blob/d9d435c9c280b99a6c679b517adedd3f4b02cfd7/Engine/Plugins/Media/PixelStreaming/Source/PixelStreaming/Private/EncoderFrameFactory.cpp#L127

In case link is broken slightly edited version (due to fact that e source code needs registered github account) here :

FString RHIName = GDynamicRHI->GetName();
	if (RHIName == TEXT("Vulkan")) // Vulkan is crossplateform
	{
		if (IsRHIDeviceAMD())
			// Vulkan + AMD
		else if (IsRHIDeviceNVIDIA())
			// Vulkan + Nvidia
	}
#if PLATFORM_WINDOWS   // needed because non-windows systems dont have dx libs and headers
	else if (RHIName == TEXT("D3D11"))
	{
		if (IsRHIDeviceAMD())
			// DX11+ AMD
		else if (IsRHIDeviceNVIDIA())
			// DX11+ Nvidia
	}
	else if (RHIName == TEXT("D3D12"))
	{
		if (IsRHIDeviceAMD())
			// DX12+ AMD
		else if (IsRHIDeviceNVIDIA())
			// DX12+ Nvidia
	}
#endif
	UE_LOG(LogPixelStreaming, Error, TEXT("Current RHI %s is not supported in Pixel Streaming"), *RHIName);
	return nullptr;
}

The nvidia / amd is not mandatory ofc but is used here for pixel streaming gpu-supported hardware video encoding and is also an interesting available feature !

Hope it helps !