Example #1
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         ContextMismatchException.ThrowIfContextNotEqual(Engine.GetValidCurrentContext(), _screen);
         ProgramObject.Delete(ref _program);
     }
     else
     {
         ContextAssociatedMemorySafety.OnFinalized(this);
     }
 }
Example #2
0
        public void Dispatch(int xGroupCount, int yGroupCount, int zGroupCount)
        {
            var screen = _screen;

            ContextMismatchException.ThrowIfContextNotEqual(Engine.GetValidCurrentContext(), screen);

            var program = _program;

            ProgramObject.UseProgram(program);
            var context = new ComputeShaderContext(screen);
            var uniform = new ShaderDataDispatcher(program);

            IComputeShader.OnDispatchingInternal(_shader, uniform, context);
            IComputeShader.DispatchCompute(xGroupCount, yGroupCount, zGroupCount);
        }