Skip to content

Commit

Permalink
Fix RPI 4/5 Vulkan Hardware support
Browse files Browse the repository at this point in the history
  • Loading branch information
luiscondesdi committed Jun 16, 2024
1 parent c23cfe3 commit 3cc334f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Source/Core/VideoBackends/Vulkan/VulkanContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,20 @@ void VulkanContext::InitDriverDetails()
vendor = DriverDetails::VENDOR_APPLE;
driver = DriverDetails::DRIVER_PORTABILITY;
}
else if (vendor_id == 0x14E4)
{
// Official Broadcom binary driver
vendor = DriverDetails::VENDOR_BROADCOM;
driver = DriverDetails::DRIVER_BROADCOM;

if (device_name.find("V3D") != std::string::npos)
{
// Raspberry Pi use Broadcom VideoCore GPU drivers:
// - RPI 4: DeviceName "V3D 4.2"
// - RPI 5: DeviceName "V3D 7.1"
driver = DriverDetails::DRIVER_RPI;
}
}
else
{
WARN_LOG_FMT(VIDEO, "Unknown Vulkan driver vendor, please report it to us.");
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/VideoCommon/DriverDetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ constexpr BugInfo m_known_bugs[] = {
BUG_BROKEN_DYNAMIC_SAMPLER_INDEXING, -1.0, -1.0, true},
{API_VULKAN, OS_ANDROID, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN,
BUG_SLOW_OPTIMAL_IMAGE_TO_BUFFER_COPY, -1.0, -1.0, true},
{API_VULKAN, OS_ALL, VENDOR_BROADCOM, DRIVER_RPI, Family::UNKNOWN,
BUG_SLOW_CACHED_READBACK_MEMORY, -1.0, -1.0, true},
};

static std::map<Bug, BugInfo> m_bugs;
Expand Down Expand Up @@ -260,6 +262,8 @@ static const char* to_string(Driver driver)
case DRIVER_VIVANTE: return "Vivante";
case DRIVER_PORTABILITY: return "Portability";
case DRIVER_APPLE: return "Apple";
case DRIVER_BROADCOM: return "Broadcom";
case DRIVER_RPI: return "Broadcom Videocore";
case DRIVER_UNKNOWN: return "Unknown";
}
return "Unknown";
Expand Down
3 changes: 3 additions & 0 deletions Source/Core/VideoCommon/DriverDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ enum Vendor
VENDOR_VIVANTE,
VENDOR_MESA,
VENDOR_APPLE,
VENDOR_BROADCOM,
VENDOR_UNKNOWN
};

Expand All @@ -67,6 +68,8 @@ enum Driver
DRIVER_VIVANTE, // Official Vivante driver
DRIVER_PORTABILITY, // Vulkan via Metal on macOS
DRIVER_APPLE, // Metal on macOS
DRIVER_BROADCOM, // Official Broadcom driver
DRIVER_RPI, // Raspberry Pi Broadcom Videocore drivers
DRIVER_UNKNOWN // Unknown driver, default to official hardware driver
};

Expand Down

0 comments on commit 3cc334f

Please sign in to comment.