Skip to content

Commit

Permalink
Add checks for unused topology values when loading pipeline caches.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Oct 8, 2023
1 parent 0332863 commit c73e235
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions GPU/Vulkan/PipelineManagerVulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ void PipelineManagerVulkan::SavePipelineCache(FILE *file, bool saveRawPipelineCa
failed = true;
return;
}
_dbg_assert_(pkey.raster.topology != VK_PRIMITIVE_TOPOLOGY_POINT_LIST && pkey.raster.topology != VK_PRIMITIVE_TOPOLOGY_LINE_LIST);
StoredVulkanPipelineKey key{};
key.raster = pkey.raster;
key.useHWTransform = pkey.useHWTransform;
Expand Down Expand Up @@ -788,6 +789,12 @@ bool PipelineManagerVulkan::LoadPipelineCache(FILE *file, bool loadRawPipelineCa
ERROR_LOG(G3D, "Truncated Vulkan pipeline cache file, stopping.");
break;
}

if (key.raster.topology == VK_PRIMITIVE_TOPOLOGY_POINT_LIST || key.raster.topology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST) {
WARN_LOG(G3D, "Bad raster key in cache, ignoring");
continue;
}

VulkanVertexShader *vs = shaderManager->GetVertexShaderFromID(key.vShaderID);
VulkanFragmentShader *fs = shaderManager->GetFragmentShaderFromID(key.fShaderID);
VulkanGeometryShader *gs = shaderManager->GetGeometryShaderFromID(key.gShaderID);
Expand Down

0 comments on commit c73e235

Please sign in to comment.