I'm working on a compute shader in DirectX 11. I want to dispatch the compute shader and then wait for it to complete. Under DirectX 10, I could check with IsDataAvailable if the query has completed, I haven't been able to find the corresponding method on how to do this in DirectX 11.
This is the code I'm currently using, reduced to just the necessary parts:
SlimDX.Direct3D11.QueryDescription queryDescription = new QueryDescription(QueryType.Event, QueryFlags.None);SlimDX.Direct3D11.Query query = new Query(device, queryDescription);device.ImmediateContext.ComputeShader.Set(compute);device.ImmediateContext.ComputeShader.SetUnorderedAccessView(computeResult, 0);device.ImmediateContext.ComputeShader.SetShaderResource(pointerView, 0);device.ImmediateContext.ComputeShader.SetShaderResource(spanView, 1);device.ImmediateContext.Dispatch(8, 4096, 1);device.ImmediateContext.End(query);// want to check here on when the compute shader has finishedstring outFileName = Path.Combine(outFilePath, Path.ChangeExtension(Path.GetFileName(fileName), ".dds"));Texture2D.ToFile(device.ImmediateContext, outputTexture, ImageFileFormat.Dds, outFileName);
Any help is greatly appreciated.
Thanks
Marcel