VendorName

VendorName

#Overview

name: VendorName

The value of this variable can be defined or overridden in .ini config files. 2 .ini config files referencing this setting variable.

It is referenced in 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of VendorName is to store and identify the graphics hardware vendor of the system on which the Unreal Engine is running. This information is crucial for various graphics-related operations and optimizations within the engine.

VendorName is primarily used in the OpenGL rendering subsystem of Unreal Engine 5. It is referenced in the OpenGLDrv module, which is responsible for OpenGL-based rendering on various platforms, including Android, Linux, and potentially Windows.

The value of this variable is typically set by querying the OpenGL API. Specifically, it’s obtained using the glGetString(GL_VENDOR) function call, which returns a string identifying the vendor of the OpenGL implementation.

VendorName interacts with several other variables and systems:

  1. GRHIVendorId: This global variable is set based on the VendorName to provide a numeric identifier for the vendor.
  2. bAmdWorkaround: A boolean flag set for certain vendors to enable specific workarounds.
  3. GPUFamily: Another string variable that stores information about the GPU family, often used in conjunction with VendorName.

Developers must be aware of the following when using this variable:

  1. VendorName is platform-specific and may have different formats or content depending on the operating system and graphics driver.
  2. The variable is used to enable vendor-specific optimizations or workarounds, so it’s critical for ensuring proper graphics performance and compatibility.
  3. In some cases, an unrecognized vendor might lead to a default or fallback behavior, which could affect performance or functionality.

Best practices when using this variable include:

  1. Always check for null or empty values before using VendorName.
  2. Use case-insensitive comparisons when checking for specific vendors, as the string format may vary.
  3. Consider adding new vendor checks if you encounter graphics hardware not covered by the existing conditions.
  4. Keep the vendor detection logic up-to-date with new hardware releases and driver changes.
  5. Use VendorName in conjunction with other GPU information (like GPUFamily) for more precise hardware identification when necessary.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseCompat.ini:33, section: [AppCompatGPU-0x10DE]

Location: <Workspace>/Engine/Config/BaseCompat.ini:193, section: [AppCompatGPU-0x1002]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/Android/AndroidOpenGL.cpp:369

Scope (from outer to inner):

file
function     bool PlatformInitOpenGL

Source code excerpt:


		// Needs to initialize GPU vendor id before AndroidEGL::AcquireCurrentRenderingContext
		FString& VendorName = FAndroidGPUInfo::Get().VendorName;
		if (VendorName.Contains(TEXT("ImgTec")) || VendorName.Contains(TEXT("Imagination")))
		{
			GRHIVendorId = 0x1010;
		}
		else if (VendorName.Contains(TEXT("ARM")))
		{
			GRHIVendorId = 0x13B5;
		}
		else if (VendorName.Contains(TEXT("Qualcomm")))
		{
			GRHIVendorId = 0x5143;
		}
	}
	return true;
}

#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/Android/AndroidOpenGLPrivate.h:27

Scope (from outer to inner):

file
class        class FAndroidGPUInfo

Source code excerpt:


	FString GLVersion;
	FString VendorName;
	bool bSupportsFloatingPointRenderTargets;
	bool bSupportsFrameBufferFetch;
	TArray<FString> TargetPlatformNames;

	void RemoveTargetPlatform(FString PlatformName)
	{

#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/Android/AndroidOpenGLPrivate.h:100

Scope (from outer to inner):

file
class        class FAndroidGPUInfo
function     FAndroidGPUInfo

Source code excerpt:

		GAndroidGPUInfoReady = true;

		VendorName = FString(ANSI_TO_TCHAR((const ANSICHAR*)glGetString(GL_VENDOR)));
	}

	void ReadGPUFamily()
	{
		GPUFamily = (const ANSICHAR*)glGetString(GL_RENDERER);
		check(!GPUFamily.IsEmpty());

#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/Linux/OpenGLLinux.cpp:1010

Scope (from outer to inner):

file
function     void FLinuxOpenGL::ProcessExtensions

Source code excerpt:

	FOpenGL4::ProcessExtensions(ExtensionsString);

	FString VendorName( ANSI_TO_TCHAR((const ANSICHAR*)glGetString(GL_VENDOR) ) );

	if ( VendorName.Contains(TEXT("ATI ")) )
	{
		// Workaround for AMD driver not handling GL_SRGB8_ALPHA8 in glTexStorage2D() properly (gets treated as non-sRGB)
		// FIXME: obsolete ? this was the case in <= 2014
		glTexStorage1D = nullptr;
		glTexStorage2D = nullptr;
		glTexStorage3D = nullptr;

#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/OpenGLDrv.cpp:591

Scope (from outer to inner):

file
function     void FOpenGLBase::ProcessExtensions

Source code excerpt:

	GRHIVendorId = 0x1010;
#else
	FString VendorName( ANSI_TO_TCHAR((const ANSICHAR*)glGetString(GL_VENDOR) ) );
	if (VendorName.Contains(TEXT("ATI ")))
	{
		GRHIVendorId = 0x1002;
#if PLATFORM_WINDOWS || PLATFORM_LINUX
		bAmdWorkaround = true;
#endif
	}
#if PLATFORM_LINUX
	else if (VendorName.Contains(TEXT("X.Org")))
	{
		GRHIVendorId = 0x1002;
		bAmdWorkaround = true;
	}
#endif
	else if (VendorName.Contains(TEXT("Intel ")) || VendorName == TEXT("Intel"))
	{
		GRHIVendorId = 0x8086;
#if PLATFORM_WINDOWS || PLATFORM_LINUX
		bAmdWorkaround = true;
#endif
	}
	else if (VendorName.Contains(TEXT("NVIDIA ")))
	{
		GRHIVendorId = 0x10DE;
	}
	else if (VendorName.Contains(TEXT("ImgTec")) || VendorName.Contains(TEXT("Imagination")))
	{
		GRHIVendorId = 0x1010;
	}
	else if (VendorName.Contains(TEXT("ARM")))
	{
		GRHIVendorId = 0x13B5;
	}
	else if (VendorName.Contains(TEXT("Qualcomm")))
	{
		GRHIVendorId = 0x5143;
	}

#if PLATFORM_LINUX
	if (GRHIVendorId == 0x0)

#Loc: <Workspace>/Engine/Source/Runtime/OpenGLDrv/Private/OpenGLDrv.cpp:662

Scope (from outer to inner):

file
function     void FOpenGLBase::ProcessExtensions

Source code excerpt:

				FString GlRenderer(ANSI_TO_TCHAR(AnsiRenderer));
				FText ErrorMessage = FText::Format(LOCTEXT("CannotDetermineGraphicsDriversVendor", "Unknown graphics drivers '{0}' by '{1}' are installed on this system. You may experience visual artifacts and other problems."),
					FText::FromString(GlRenderer), FText::FromString(VendorName));
				FPlatformMisc::MessageBoxExt(EAppMsgType::Ok, *ErrorMessage.ToString(),
					*LOCTEXT("CannotDetermineGraphicsDriversVendorTitle", "Cannot determine driver vendor.").ToString());
			}

			GRHIVendorId = 0xFFFF;
			bAmdWorkaround = true;	// be conservative here as well.