~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/virtio/vulkan/vn_pipeline.c

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
   for (uint32_t i = 0; i < pCreateInfo->setLayoutCount; i++) {
127
127
      struct vn_descriptor_set_layout *descriptor_set_layout =
128
128
         vn_descriptor_set_layout_from_handle(pCreateInfo->pSetLayouts[i]);
129
 
      if (descriptor_set_layout->is_push_descriptor) {
 
129
 
 
130
      /* Avoid null derefs. pSetLayouts may contain VK_NULL_HANDLE.
 
131
       *
 
132
       * From the Vulkan 1.3.254 spec:
 
133
       *    VUID-VkPipelineLayoutCreateInfo-pSetLayouts-parameter
 
134
       *
 
135
       *    If setLayoutCount is not 0, pSetLayouts must be a valid pointer to
 
136
       *    an array of setLayoutCount valid or VK_NULL_HANDLE
 
137
       *    VkDescriptorSetLayout handles
 
138
       */
 
139
      if (descriptor_set_layout &&
 
140
          descriptor_set_layout->is_push_descriptor) {
130
141
         layout->push_descriptor_set_layout =
131
142
            vn_descriptor_set_layout_ref(dev, descriptor_set_layout);
 
143
         break;
132
144
      }
133
 
      break;
134
145
   }
135
146
 
136
147
   layout->has_push_constant_ranges = pCreateInfo->pPushConstantRanges > 0;