Vulkan-Samples icon indicating copy to clipboard operation
Vulkan-Samples copied to clipboard

Creating new samples via script generates non-working code

Open SaschaWillems opened this issue 8 months ago • 0 comments

While unifying our framework we obviously forgot to update the template for new samples. Generating a new sample via the provided script, one gets non-working code with the template specialization for the constructor missing:

std::unique_ptr<vkb::VulkanSample> create_ray_tracing_position_fetch();

This now needs to be

std::unique_ptr<vkb::VulkanSample<vkb::BindingType::C>> create_ray_tracing_position_fetch();

It also looks like some stuff used in the template is no longer directly accessible, e.g. this won't compile anymore:

	if (device)
	{
		vkDestroyPipeline(get_device().get_handle(), sample_pipeline, nullptr);
		vkDestroyPipelineLayout(get_device().get_handle(), sample_pipeline_layout, nullptr);
	}

And should be

	if (has_device())
	{
		vkDestroyPipeline(get_device().get_handle(), sample_pipeline, nullptr);
		vkDestroyPipelineLayout(get_device().get_handle(), sample_pipeline_layout, nullptr);
	}

So we need to update our templates and in the future make sure that templates continue to work when merging framework related changes.

SaschaWillems avatar Jun 07 '24 15:06 SaschaWillems