예제 #1
0
            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);
            }
예제 #2
0
            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);
            }