From 5c3467e74a05787a63cfb1451d41c84b92d41ee9 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sat, 30 Mar 2019 14:28:06 +0100 Subject: [PATCH] radv: Run the new ycbcr lowering pass. Reviewed-by: Samuel Pitoiset --- src/amd/vulkan/radv_pipeline.c | 2 +- src/amd/vulkan/radv_shader.c | 4 +++- src/amd/vulkan/radv_shader.h | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 619b5a506ad..5383f00e754 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2155,7 +2155,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline, nir[i] = radv_shader_compile_to_nir(device, modules[i], stage ? stage->pName : "main", i, stage ? stage->pSpecializationInfo : NULL, - flags); + flags, pipeline->layout); /* We don't want to alter meta shaders IR directly so clone it * first. diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 13f1f9aa9dc..cd5a9f2afb4 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -181,7 +181,8 @@ radv_shader_compile_to_nir(struct radv_device *device, const char *entrypoint_name, gl_shader_stage stage, const VkSpecializationInfo *spec_info, - const VkPipelineCreateFlags flags) + const VkPipelineCreateFlags flags, + const struct radv_pipeline_layout *layout) { nir_shader *nir; nir_function *entry_point; @@ -310,6 +311,7 @@ radv_shader_compile_to_nir(struct radv_device *device, NIR_PASS_V(nir, nir_lower_system_values); NIR_PASS_V(nir, nir_lower_clip_cull_distance_arrays); + NIR_PASS_V(nir, radv_nir_lower_ycbcr_textures, layout); } /* Vulkan uses the separate-shader linking model */ diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index ac367bfc82e..bfd2787a123 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -347,7 +347,8 @@ radv_shader_compile_to_nir(struct radv_device *device, const char *entrypoint_name, gl_shader_stage stage, const VkSpecializationInfo *spec_info, - const VkPipelineCreateFlags flags); + const VkPipelineCreateFlags flags, + const struct radv_pipeline_layout *layout); void * radv_alloc_shader_memory(struct radv_device *device, -- 2.30.2