radv: avoid GPU hangs if someone does a resolve with non-multisample src (v2)
authorDave Airlie <airlied@redhat.com>
Fri, 4 Aug 2017 01:13:55 +0000 (02:13 +0100)
committerDave Airlie <airlied@redhat.com>
Sat, 5 Aug 2017 02:52:44 +0000 (03:52 +0100)
This is a bug in the app, but I'd rather avoid hanging the GPU,
esp if someone is running in validation and it takes out their
development environment.

v2: get it right, reverse the polarity.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_meta_resolve.c

index 6cd0c381a54b043f2873980992331f6163fb4fb0..6023e0f89998262e7cfdea1c531d056f28dfbba2 100644 (file)
@@ -382,6 +382,11 @@ void radv_CmdResolveImage(
        radv_meta_save_graphics_reset_vport_scissor_novertex(&saved_state, cmd_buffer);
 
        assert(src_image->info.samples > 1);
+       if (src_image->info.samples <= 1) {
+               /* this causes GPU hangs if we get past here */
+               fprintf(stderr, "radv: Illegal resolve operation (src not multisampled), will hang GPU.");
+               return;
+       }
        assert(dest_image->info.samples == 1);
 
        if (src_image->info.samples >= 16) {