Esempio n. 1
0
 private void SetupSumOut()
 {
     __SumOut = 0f;
     if (_IsReady)
     {
         _SumOutBuffer = ComputeBufferUtil.CreateBufferForStruct <float>(__SumOut);
         _Shader.SetBuffer(_SumKernel, BUFFER_RESULTOUT, _SumOutBuffer);
     }
 }
Esempio n. 2
0
 private void SetupValuesBuffer()
 {
     _IsReady = _IsReady && __ValuesIn != null;
     if (_IsReady)
     {
         _ValuesInBuffer = ComputeBufferUtil.CreateBufferForSimpleArray <float>(__ValuesIn);
         _Shader.SetBuffer(_SumKernel, BUFFER_VALUESIN, _ValuesInBuffer);
     }
 }
Esempio n. 3
0
 private void SetupColorsBuffer()
 {
     if (_IsReady)
     {
         _ColorsBuffer = ComputeBufferUtil.CreateBufferForSimpleArray <Color>(_TotalDataSize);
     }
     else
     {
         Logging.Warning <Texture3DCompute>("Not ready; cannot create color buffer!");
     }
 }
Esempio n. 4
0
 private void SetupDataBuffer()
 {
     if (_IsReady)
     {
         _DataBuffer = ComputeBufferUtil.CreateBufferForSimpleArray <float>(_TotalDataSize);
     }
     else
     {
         Logging.Warning <Texture3DCompute>("Not ready; failed to setup data buffer!");
     }
 }
Esempio n. 5
0
        private void ShowResult()
        {
            uint[] data;
            string message = "";

            data     = ComputeBufferUtil.GetBufferDataArray <uint>(_ThreadSequenceBuffer);
            message  = "Thread Sequence : " + GetArrayAsText(data);
            data     = ComputeBufferUtil.GetBufferDataArray <uint>(_GroupSequenceBuffer);
            message += "\nGroup Sequence  : " + GetArrayAsText(data);

            _OutputText.text = message;
        }
Esempio n. 6
0
 private void SetupSizeBuffer(int width, int height, int depth)
 {
     _SizeBuffer = ComputeBufferUtil.CreateBufferForStruct <HlslSizeType>(__Size);
 }
Esempio n. 7
0
 private void SetupBuffersFromRaw()
 {
     _ThreadSequenceBuffer = ComputeBufferUtil.CreateBufferForSimpleArray <uint>(__ThreadSequence);
     _GroupSequenceBuffer  = ComputeBufferUtil.CreateBufferForSimpleArray <uint>(__GroupSequence);
 }
Esempio n. 8
0
 private void SetupSize()
 {
     __Size      = new HlslSizeType(_Width, _Height, _Depth);
     _SizeBuffer = ComputeBufferUtil.CreateBufferForStruct <HlslSizeType>(__Size);
 }
Esempio n. 9
0
 private void CreateRandom3D()
 {
     Color[] pixels = new Color[_Width * _Height * _Depth];
     Randomize(pixels);
     _InputData = ComputeBufferUtil.CreateBufferForSimpleArray <Color>(pixels);
 }
Esempio n. 10
0
 private void CreateSpaceSize()
 {
     __SpaceSize      = new uint3((uint)_Width, (uint)_Height, (uint)_Depth);
     _SpaceSizeBuffer = ComputeBufferUtil.CreateBufferForStruct <uint3>(__SpaceSize);
 }