示例#1
0
 /// <summary>
 /// Sets an indirect buffer as a compute resource.
 /// </summary>
 /// <param name="stage">The resource stage to set.</param>
 /// <param name="buffer">The buffer to set.</param>
 /// <param name="access">Access control flags.</param>
 public void SetComputeBuffer(byte stage, IndirectBuffer buffer, ComputeBufferAccess access)
 {
     NativeMethods.bgfx_encoder_set_compute_indirect_buffer(ptr, stage, buffer.handle, access);
 }
示例#2
0
 /// <summary>
 /// Dispatches an indirect compute job.
 /// </summary>
 /// <param name="id">The index of the view to dispatch.</param>
 /// <param name="program">The shader program to use.</param>
 /// <param name="indirectBuffer">The buffer containing drawing commands.</param>
 /// <param name="startIndex">The index of the first command to process.</param>
 /// <param name="count">The number of commands to process from the buffer.</param>
 public void Dispatch(ushort id, Program program, IndirectBuffer indirectBuffer, int startIndex = 0, int count = 1)
 {
     NativeMethods.bgfx_encoder_dispatch_indirect(ptr, id, program.handle, indirectBuffer.handle, (ushort)startIndex, (ushort)count);
 }
示例#3
0
 /// <summary>
 /// Submits an indirect batch of drawing commands to be used for rendering.
 /// </summary>
 /// <param name="id">The index of the view to submit.</param>
 /// <param name="program">The program with which to render.</param>
 /// <param name="indirectBuffer">The buffer containing drawing commands.</param>
 /// <param name="startIndex">The index of the first command to process.</param>
 /// <param name="count">The number of commands to process from the buffer.</param>
 /// <param name="depth">A depth value to use for sorting the batch.</param>
 /// <param name="preserveState"><c>true</c> to preserve internal draw state after the call.</param>
 /// <returns>The number of draw calls.</returns>
 public int Submit(ushort id, Program program, IndirectBuffer indirectBuffer, int startIndex = 0, int count = 1, int depth = 0, bool preserveState = false)
 {
     return(NativeMethods.bgfx_encoder_submit_indirect(ptr, id, program.handle, indirectBuffer.handle, (ushort)startIndex, (ushort)count, depth, preserveState));
 }