}
pg->dd.binding_usage = has_bindings;
if (!has_bindings && !push_count && !pg->dd.bindless) {
- pg->layout = zink_pipeline_layout_create(screen, pg, &pg->compat_id);
+ pg->layout = zink_pipeline_layout_create(screen, pg->dsl, pg->num_dsl, pg->is_compute);
+ if (pg->layout)
+ pg->compat_id = _mesa_hash_data(pg->dsl, pg->num_dsl * sizeof(pg->dsl[0]));
return !!pg->layout;
}
pg->dd.binding_usage |= BITFIELD_MASK(ZINK_DESCRIPTOR_BASE_TYPES);
}
- pg->layout = zink_pipeline_layout_create(screen, pg, &pg->compat_id);
+ pg->layout = zink_pipeline_layout_create(screen, pg->dsl, pg->num_dsl, pg->is_compute);
if (!pg->layout)
return false;
+ pg->compat_id = _mesa_hash_data(pg->dsl, pg->num_dsl * sizeof(pg->dsl[0]));
VkDescriptorUpdateTemplateCreateInfo template[ZINK_DESCRIPTOR_NON_BINDLESS_TYPES] = {0};
/* type of template */
}
VkPipelineLayout
-zink_pipeline_layout_create(struct zink_screen *screen, struct zink_program *pg, uint32_t *compat)
+zink_pipeline_layout_create(struct zink_screen *screen, VkDescriptorSetLayout *dsl, unsigned num_dsl, bool is_compute)
{
VkPipelineLayoutCreateInfo plci = {0};
plci.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
- plci.pSetLayouts = pg->dsl;
- plci.setLayoutCount = pg->num_dsl;
+ plci.pSetLayouts = dsl;
+ plci.setLayoutCount = num_dsl;
VkPushConstantRange pcr[2] = {0};
- if (pg->is_compute) {
- if (((struct zink_compute_program*)pg)->shader->nir->info.stage == MESA_SHADER_KERNEL) {
- pcr[0].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT;
- pcr[0].offset = 0;
- pcr[0].size = sizeof(struct zink_cs_push_constant);
- plci.pushConstantRangeCount = 1;
- }
+ if (is_compute) {
+ pcr[0].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT;
+ pcr[0].offset = 0;
+ pcr[0].size = sizeof(struct zink_cs_push_constant);
+ plci.pushConstantRangeCount = 1;
} else {
pcr[0].stageFlags = VK_SHADER_STAGE_VERTEX_BIT;
pcr[0].offset = offsetof(struct zink_gfx_push_constant, draw_mode_is_indexed);
return VK_NULL_HANDLE;
}
- *compat = _mesa_hash_data(pg->dsl, pg->num_dsl * sizeof(pg->dsl[0]));
-
return layout;
}
}
VkPipelineLayout
-zink_pipeline_layout_create(struct zink_screen *screen, struct zink_program *pg, uint32_t *compat);
+zink_pipeline_layout_create(struct zink_screen *screen, VkDescriptorSetLayout *dsl, unsigned num_dsl, bool is_compute);
void
zink_program_update_compute_pipeline_state(struct zink_context *ctx, struct zink_compute_program *comp, const uint block[3]);