mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-11 19:56:39 +00:00
Vulkan: Prep pipeline and shader cache for restore.
This commit is contained in:
parent
cac3e6582d
commit
a4268fe0b8
@ -27,6 +27,16 @@ void PipelineManagerVulkan::Clear() {
|
||||
pipelines_.clear();
|
||||
}
|
||||
|
||||
void PipelineManagerVulkan::DeviceLost() {
|
||||
Clear();
|
||||
vulkan_->Delete().QueueDeletePipelineCache(pipelineCache_);
|
||||
}
|
||||
|
||||
void PipelineManagerVulkan::DeviceRestore(VulkanContext *vulkan) {
|
||||
vulkan_ = vulkan;
|
||||
pipelineCache_ = vulkan->CreatePipelineCache();
|
||||
}
|
||||
|
||||
struct DeclTypeInfo {
|
||||
VkFormat type;
|
||||
const char *name;
|
||||
|
@ -87,6 +87,9 @@ public:
|
||||
|
||||
void Clear();
|
||||
|
||||
void DeviceLost();
|
||||
void DeviceRestore(VulkanContext *vulkan);
|
||||
|
||||
std::string DebugGetObjectString(std::string id, DebugShaderType type, DebugShaderStringType stringType);
|
||||
std::vector<std::string> DebugGetObjectIDs(DebugShaderType type);
|
||||
|
||||
|
@ -437,6 +437,11 @@ void ShaderManagerVulkan::BoneUpdateUniforms(int dirtyUniforms) {
|
||||
}
|
||||
}
|
||||
|
||||
void ShaderManagerVulkan::DeviceRestore(VulkanContext *vulkan) {
|
||||
vulkan_ = vulkan;
|
||||
uboAlignment_ = vulkan_->GetPhysicalDeviceProperties().limits.minUniformBufferOffsetAlignment;
|
||||
}
|
||||
|
||||
void ShaderManagerVulkan::Clear() {
|
||||
for (auto iter = fsCache_.begin(); iter != fsCache_.end(); ++iter) {
|
||||
delete iter->second;
|
||||
|
@ -229,6 +229,8 @@ public:
|
||||
ShaderManagerVulkan(VulkanContext *vulkan);
|
||||
~ShaderManagerVulkan();
|
||||
|
||||
void DeviceRestore(VulkanContext *vulkan);
|
||||
|
||||
void GetShaders(int prim, u32 vertType, VulkanVertexShader **vshader, VulkanFragmentShader **fshader, bool useHWTransform);
|
||||
void ClearShaders();
|
||||
void DirtyShader();
|
||||
|
Loading…
x
Reference in New Issue
Block a user