radv: do not create meta pipelines with 16 samples

Graphics / Mesa 3D Graphics Library / Mesa - Samuel Pitoiset [gmail.com] - 23 October 2019 06:33 EDT

The driver only supports up to 8 samples, so it's useless to create more pipelines than needed.

This fixes a conditional jump reported by Valgrind on GFX10:

==194282== Conditional jump or move depends on uninitialised value(s)
==194282== at 0xDBF925A: radv_gfx10_compute_bin_size (radv_pipeline.c:3242)
==194282== by 0xDBF95A6: radv_pipeline_generate_binning_state (radv_pipeline.c:3334)
==194282== by 0xDBFC1A0: radv_pipeline_generate_pm4 (radv_pipeline.c:4440)
==194282== by 0xDBFD15E: radv_pipeline_init (radv_pipeline.c:4764)
==194282== by 0xDBFD23E: radv_graphics_pipeline_create (radv_pipeline.c:4788)
==194282== by 0xDBB95A3: create_pipeline (radv_meta_clear.c:114)
==194282== by 0xDBB9AC5: create_color_pipeline (radv_meta_clear.c:297)
==194282== by 0xDBBCF05: radv_device_init_meta_clear_state (radv_meta_clear.c:1277)
==194282== by 0xDB9ACD9: radv_device_init_meta (radv_meta.c:363)
==194282== by 0xDB7FE3A: radv_CreateDevice (radv_device.c:2080

This is caused by an out of bound access of 'fmask_array' (ie. index is 4 as for 16 samples).

Cc:

f4ab58c1a07 radv: do not create meta pipelines with 16 samples
src/amd/vulkan/radv_meta_blit2d.c | 4 ++--
src/amd/vulkan/radv_private.h | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)

Upstream: cgit.freedesktop.org


  • Share