mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Fix] (MG_Backend/DirectVulkan): disable pipeline cache on PowerVR
This commit is contained in:
@@ -13,6 +13,11 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
m_device(device), m_config(config) {
|
m_device(device), m_config(config) {
|
||||||
MOBILEGL_ASSERT(m_device != VK_NULL_HANDLE, "PipelineFactory: device is null");
|
MOBILEGL_ASSERT(m_device != VK_NULL_HANDLE, "PipelineFactory: device is null");
|
||||||
|
|
||||||
|
if (m_config.DisablePipelineCache) {
|
||||||
|
MGLOG_I("DirectVulkan: pipeline cache disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
VkPipelineCacheCreateInfo pipelineCacheInfo{VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO};
|
VkPipelineCacheCreateInfo pipelineCacheInfo{VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO};
|
||||||
VK_VERIFY(vkCreatePipelineCache(m_device, &pipelineCacheInfo, nullptr, &m_pipelineCache),
|
VK_VERIFY(vkCreatePipelineCache(m_device, &pipelineCacheInfo, nullptr, &m_pipelineCache),
|
||||||
"vkCreatePipelineCache");
|
"vkCreatePipelineCache");
|
||||||
|
|||||||
@@ -26,6 +26,10 @@
|
|||||||
#include <vulkan/vulkan_core.h>
|
#include <vulkan/vulkan_core.h>
|
||||||
|
|
||||||
namespace MobileGL::MG_Backend::DirectVulkan {
|
namespace MobileGL::MG_Backend::DirectVulkan {
|
||||||
|
static Bool IsPowerVRDevice(const VkPhysicalDeviceProperties& properties) {
|
||||||
|
return std::strstr(properties.deviceName, "PowerVR") != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
static VkPipelineColorBlendAttachmentState MakeColorBlendAttachmentState(
|
static VkPipelineColorBlendAttachmentState MakeColorBlendAttachmentState(
|
||||||
Bool blendEnable,
|
Bool blendEnable,
|
||||||
VkBlendFactor srcColorBlendFactor,
|
VkBlendFactor srcColorBlendFactor,
|
||||||
@@ -1762,6 +1766,11 @@ void main() {
|
|||||||
|
|
||||||
const Uint32 maxProgramBindings = ComputeMaxProgramBindings(m_physicalDevice.properties);
|
const Uint32 maxProgramBindings = ComputeMaxProgramBindings(m_physicalDevice.properties);
|
||||||
MGLOG_I("DirectVulkan: using %u program descriptor bindings", maxProgramBindings);
|
MGLOG_I("DirectVulkan: using %u program descriptor bindings", maxProgramBindings);
|
||||||
|
if (IsPowerVRDevice(m_physicalDevice.properties)) {
|
||||||
|
m_config.DisablePipelineCache = true;
|
||||||
|
MGLOG_W("DirectVulkan: disabling pipeline cache on PowerVR device %s",
|
||||||
|
m_physicalDevice.properties.deviceName);
|
||||||
|
}
|
||||||
|
|
||||||
RecreateSwapchain();
|
RecreateSwapchain();
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
Uint64 CacheVersion = MG_Config::CacheVersion;
|
Uint64 CacheVersion = MG_Config::CacheVersion;
|
||||||
Uint32 SurfaceWidth = 1;
|
Uint32 SurfaceWidth = 1;
|
||||||
Uint32 SurfaceHeight = 1;
|
Uint32 SurfaceHeight = 1;
|
||||||
|
Bool DisablePipelineCache = false;
|
||||||
#if MOBILEGL_LOG_ACTIVE_LEVEL <= MOBILEGL_LOG_LEVEL_DEBUG
|
#if MOBILEGL_LOG_ACTIVE_LEVEL <= MOBILEGL_LOG_LEVEL_DEBUG
|
||||||
Bool EnableValidationLayers = true;
|
Bool EnableValidationLayers = true;
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user