Module: Mesa
Branch: 17.2
Commit: 07b5c788367df13afe5027a84b2ec305f1e94e5a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=07b5c788367df13afe5027a84b2ec305f1e94e5a

Author: Dave Airlie <airl...@redhat.com>
Date:   Fri Aug  4 02:13:55 2017 +0100

radv: avoid GPU hangs if someone does a resolve with non-multisample src (v2)

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 <b...@basnieuwenhuizen.nl>
Cc: <mesa-sta...@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airl...@redhat.com>
(cherry picked from commit 36a1b61321561634c6b243cf876c347fef73dfa4)

---

 src/amd/vulkan/radv_meta_resolve.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/amd/vulkan/radv_meta_resolve.c 
b/src/amd/vulkan/radv_meta_resolve.c
index 6cd0c381a5..6023e0f899 100644
--- a/src/amd/vulkan/radv_meta_resolve.c
+++ b/src/amd/vulkan/radv_meta_resolve.c
@@ -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) {

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to