[Mesa-dev] [PATCH 03/13] anv/lower_ycbcr: make sure to set 0s on all components

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon Nov 5 15:35:57 UTC 2018


To play around with debugging, we might want to disable one or the
other component. Having 0s as default values makes this work.
Otherwise we might have NULL components, leading to crashes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 src/intel/vulkan/anv_nir_lower_ycbcr_textures.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c b/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c
index 71e511f34b7..29e5de481bb 100644
--- a/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c
+++ b/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c
@@ -373,7 +373,9 @@ try_lower_tex_ycbcr(struct anv_pipeline_layout *layout,
    uint8_t y_bpc = y_isl_layout->channels_array[0].bits;
 
    /* |ycbcr_comp| holds components in the order : Cr-Y-Cb */
-   nir_ssa_def *ycbcr_comp[5] = { NULL, NULL, NULL,
+   nir_ssa_def *ycbcr_comp[5] = { nir_imm_float(builder, 0.0f),
+                                  nir_imm_float(builder, 0.0f),
+                                  nir_imm_float(builder, 0.0f),
                                   /* Use extra 2 channels for following swizzle */
                                   nir_imm_float(builder, 1.0f),
                                   nir_imm_float(builder, 0.0f),
-- 
2.19.1



More information about the mesa-dev mailing list