Permalink
Browse files

Vulkan: Make sure to clear the pipeline key to avoid padding bytes ca…

…using us to allocate duplicate pipelines.

Also pack the struct better.
  • Loading branch information...
hrydgard committed Nov 13, 2017
1 parent 4a09289 commit 5c7f7c1df647f91b3f5f2fc1520ac15d9856b333
Showing with 3 additions and 3 deletions.
  1. +1 −1 GPU/Vulkan/PipelineManagerVulkan.cpp
  2. +2 −2 GPU/Vulkan/PipelineManagerVulkan.h
@@ -299,7 +299,7 @@ static VulkanPipeline *CreateVulkanPipeline(VkDevice device, VkPipelineCache pip
}
VulkanPipeline *PipelineManagerVulkan::GetOrCreatePipeline(VkPipelineLayout layout, VkRenderPass renderPass, const VulkanPipelineRasterStateKey &rasterKey, const DecVtxFormat *decFmt, VulkanVertexShader *vs, VulkanFragmentShader *fs, bool useHwTransform) {
VulkanPipelineKey key;
VulkanPipelineKey key{};
if (!renderPass)
Crash();
@@ -40,10 +40,10 @@ enum class PspAttributeLocation {
struct VulkanPipelineKey {
VulkanPipelineRasterStateKey raster; // prim is included here
VkRenderPass renderPass;
bool useHWTransform;
uint32_t vtxDecId;
VkShaderModule vShader;
VkShaderModule fShader;
uint32_t vtxDecId;
bool useHWTransform;
void ToString(std::string *str) const {
str->resize(sizeof(*this));

0 comments on commit 5c7f7c1

Please sign in to comment.