Example #1
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 static void Dispatch(byte id, Program program, IndirectBuffer indirectBuffer, int startIndex = 0, int count = 1)
        {
            // TODO: unused
            byte unused = 0;

            NativeMethods.bgfx_dispatch_indirect(id, program.handle, indirectBuffer.handle, (ushort)startIndex, (ushort)count, unused);
        }
Example #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);
 }
Example #3
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);
 }
Example #4
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));
 }
Example #5
0
        ///// <summary>
        ///// Submits the current batch of primitives 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="query">An occlusion query to use as a predicate during rendering.</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, OcclusionQuery query, int depth = 0, bool preserveState = false) {
        //    return NativeMethods.bgfx_encoder_submit_occlusion_query(ptr, id, program.handle, query.handle, depth, preserveState);
        //}

        //!!!!betauser
        /// <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, int count, int depth, DiscardFlags flags)
        {
            return(NativeMethods.bgfx_encoder_submit_indirect(ptr, id, program.handle, indirectBuffer.handle, (ushort)startIndex, (ushort)count, depth, flags));
        }
Example #6
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>
 /// <returns>The number of draw calls.</returns>
 public static int Submit(byte id, Program program, IndirectBuffer indirectBuffer, int startIndex = 0, int count = 1, int depth = 0)
 {
     return(NativeMethods.bgfx_submit_indirect(id, program.handle, indirectBuffer.handle, (ushort)startIndex, (ushort)count, depth));
 }