summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_nir.h
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2018-01-25 10:25:00 +0100
committerIago Toral Quiroga <[email protected]>2018-01-26 14:06:46 +0100
commite1a49f974bc086c54b567471908f78c53b467072 (patch)
treeda3b9784d3c4a6370bbb47c97468846f7a5851a0 /src/intel/vulkan/anv_nir.h
parent14f6275c92f1aa2c76308132f58096b66fe3901a (diff)
anv/pipeline: don't take the layout from the pipeline to compile shaders
The Vulkan spec states that VkPipelineLayout objects must not be destroyed while any command buffer that uses them is in the recording state, but it permits them to be destroyed otherwise. This means that applications are allowed to free pipeline layouts after command recording is finished even if there are pipeline objects that still exist and were created with these layouts. There are two solutions to this, one is to use reference counting on pipeline layout objects. The other is to avoid holding references to pipeline layouts where they are not really needed. This patch takes a step towards the second option by making the pipeline shader compile code take pipeline layout from the VkGraphicsPipelineCreateInfo provided rather than the pipeline object. A follow-up patch will remove any remaining uses of the layout field so we can remove it from the pipeline object and avoid the need for reference counting. v2: Use ANV_FROM_HANDLE, remove unnecessary braces (Jason) Suggested-by: Jason Ekstrand <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_nir.h')
-rw-r--r--src/intel/vulkan/anv_nir.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_nir.h b/src/intel/vulkan/anv_nir.h
index 8ac0a119dac..ce95b40b014 100644
--- a/src/intel/vulkan/anv_nir.h
+++ b/src/intel/vulkan/anv_nir.h
@@ -38,9 +38,10 @@ void anv_nir_lower_push_constants(nir_shader *shader);
bool anv_nir_lower_multiview(nir_shader *shader, uint32_t view_mask);
bool anv_nir_lower_ycbcr_textures(nir_shader *shader,
- struct anv_pipeline *pipeline);
+ struct anv_pipeline_layout *layout);
void anv_nir_apply_pipeline_layout(struct anv_pipeline *pipeline,
+ struct anv_pipeline_layout *layout,
nir_shader *shader,
struct brw_stage_prog_data *prog_data,
struct anv_pipeline_bind_map *map);