protected OptixBuffer CreateOutputBuffer(Format format, int width, int height) { if (UsePBO) { //Allocate first the memory for the gl buffer, then attach it to OptiX. uint pbo = CreatePBO(format); OGLBufferDesc glDesc = new OGLBufferDesc() { Width = (uint)width, Height = (uint)height, Format = format, Type = BufferType.Output, Resource = pbo }; return(new OGLBuffer(OptixContext, glDesc)); } else { BufferDesc desc = new BufferDesc() { Width = (uint)width, Height = (uint)height, Format = format, Type = BufferType.Output }; return(new OptixBuffer(OptixContext, desc)); } }
protected OptixDotNet.Buffer CreateOutputBuffer(Format format, int width, int height) { if (UsePBO) { //Allocate first the memory for the gl buffer, then attach it to OptiX. uint pbo = CreatePBO(format); OGLBufferDesc glDesc = new OGLBufferDesc() { Width = (uint)width, Height = (uint)height, Format = format, Type = BufferType.Output, Resource = pbo }; return new OGLBuffer(Context, glDesc); } else { BufferDesc desc = new BufferDesc() { Width = (uint)width, Height = (uint)height, Format = format, Type = BufferType.Output }; return new OptixDotNet.Buffer(Context, desc); } }
protected void CreateOutputBuffer(Format format) { if (UsePBO) { //Allocate first the memory for the gl buffer, then attach it to OptiX. uint pbo = CreatePBO(format); OGLBufferDesc glDesc = new OGLBufferDesc() { Width = (uint)Width, Height = (uint)Height, Format = format, Type = BufferType.Output, Resource = pbo }; OutputBuffer = new OGLBuffer(Context, glDesc); } else { BufferDesc desc = new BufferDesc() { Width = (uint)Width, Height = (uint)Height, Format = format, Type = BufferType.Output }; OutputBuffer = EngineContext.Instance.ResourceManager.CreateBuffer(Context, desc); } }