diff options
author | Lionel Landwerlin <[email protected]> | 2018-10-26 15:02:06 +0100 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2018-11-13 18:56:21 +0000 |
commit | fe3b7fe98295a26588053426feee01e8d2179061 (patch) | |
tree | 346357cdcab39ab2280f9dcdbf3847bfceabc6d2 /src/intel/vulkan | |
parent | ee8d65c25a3419b07e76816930a4f917064e0f6f (diff) |
anv/lower_ycbcr: make sure to set 0s on all components
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 <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_nir_lower_ycbcr_textures.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c b/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c index 3962356708b..97cfe945429 100644 --- a/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c +++ b/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c @@ -373,11 +373,11 @@ 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, - /* Use extra 2 channels for following swizzle */ - nir_imm_float(builder, 1.0f), - nir_imm_float(builder, 0.0f), - }; + nir_ssa_def *zero = nir_imm_float(builder, 0.0f); + nir_ssa_def *one = nir_imm_float(builder, 1.0f); + /* Use extra 2 channels for following swizzle */ + nir_ssa_def *ycbcr_comp[5] = { zero, zero, zero, one, zero }; + uint8_t ycbcr_bpcs[5]; memset(ycbcr_bpcs, y_bpc, sizeof(ycbcr_bpcs)); |