Esempio n. 1
0
        public void Compute()
        {
            OpenClApplication.Queue.AcquireGLObjects(new[] { Output.ComputeBuffer }, null);

            _kernel.SetValueArgument(0, Alpha / 180f * (float)Math.PI);
            _kernel.SetValueArgument(1, Amplitude);
            _kernel.SetMemoryArgument(2, Output.ComputeBuffer);

            OpenClApplication.ExecuteInQueue(_kernel, Output.Width, Output.Height);
            OpenClApplication.Queue.Finish();

            OpenClApplication.Queue.ReleaseGLObjects(new[] { Output.ComputeBuffer }, null);
            OnUpdated();
            Output.Update();
        }
Esempio n. 2
0
        public void Compute()
        {
            OpenClApplication.Queue.AcquireGLObjects(new[] { Output.ComputeBuffer }, null);

            _kernel.SetMemoryArgument(0, Output.ComputeBuffer);
            _kernel.SetValueArgument(1, Lambda / 1000f);
            _kernel.SetValueArgument(2, Distance * 1000f);
            _kernel.SetValueArgument(3, SizeX * 1000f);
            _kernel.SetValueArgument(4, SizeY * 1000f);
            _kernel.SetValueArgument(5, AlphaX / 360f * (float)Math.PI);
            _kernel.SetValueArgument(6, AlphaY / 360f * (float)Math.PI);
            _kernel.SetValueArgument(7, Amplitude);

            OpenClApplication.ExecuteInQueue(_kernel, Output.Width, Output.Height);

            OpenClApplication.Queue.ReleaseGLObjects(new[] { Output.ComputeBuffer }, null);
            OnUpdated();
            Output.Update();
        }