private int ReadCount(string src, DeviceContextProxy context, UnorderedAccessView uav) { context.CopyStructureCount(particleCountStaging, 0, uav); var db = context.MapSubresource(particleCountStaging, MapMode.Read, MapFlags.None); var CurrentParticleCount = 0; CurrentParticleCount = UnsafeHelper.Read <int>(db.DataPointer); #if OUTPUTDEBUGGING Debug.WriteLine("{0}: {1}", src, CurrentParticleCount); #endif context.UnmapSubresource(particleCountStaging, 0); return(CurrentParticleCount); }
private int ReadCount(string src, DeviceContextProxy context, UnorderedAccessView uav) { context.CopyStructureCount(particleCountStaging, 0, uav); var db = context.MapSubresource(particleCountStaging, MapMode.Read, MapFlags.None); var currentParticleCount = UnsafeHelper.Read <int>(db.DataPointer); #if OUTPUTDEBUGGING if (logger.IsEnabled(LogLevel.Debug)) { logger.LogDebug("{}: {}", src, currentParticleCount); } #endif context.UnmapSubresource(particleCountStaging, 0); return(currentParticleCount); }