api.binding_model: Wait for idle before throwing NotSupportedError
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 18 Dec 2015 18:09:41 +0000 (10:09 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 24 Dec 2015 06:06:15 +0000 (22:06 -0800)
If we don't, then the GPU could be busy and some of the objects destroyed
by the exception propagation could be in-use.  This is something of a
stop-gap measure; the problem of exceptions and the GPU being busy is
something that needs to be solved in general.  However, it does fix GPU
hangs on some drivers.

This is related to #20.

external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp

index b59160b..6733fc5 100644 (file)
@@ -740,7 +740,12 @@ void RenderInstanceShaders::addStage (const vk::DeviceInterface&                   vki,
                        *outModule = module;
                }
                else
+               {
+                       // Wait for the GPU to idle so that throwing the exception
+                       // below doesn't free in-use GPU resource.
+                       vki.deviceWaitIdle(device);
                        TCU_THROW(NotSupportedError, (de::toString(stage) + " is not supported").c_str());
+               }
        }
 }