Fixed transient index buffer functions to all have 32-bit indices support, and removed 16-bit only restriction from docs.

This commit is contained in:
Бранимир Караџић
2021-05-25 12:47:28 -07:00
parent 5ecddbf4d5
commit 6baa370801
11 changed files with 64 additions and 73 deletions

View File

@@ -2814,9 +2814,10 @@ public static class bgfx
/// </summary>
///
/// <param name="_num">Number of required indices.</param>
/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
///
[LinkName("bgfx_get_avail_transient_index_buffer")]
public static extern uint32 get_avail_transient_index_buffer(uint32 _num);
public static extern uint32 get_avail_transient_index_buffer(uint32 _num, bool _index32);
/// <summary>
/// Returns number of requested or maximum available vertices.
@@ -2840,8 +2841,6 @@ public static class bgfx
/// <summary>
/// Allocate transient index buffer.
/// @remarks
/// Only 16-bit index buffer is supported.
/// </summary>
///
/// <param name="_tib">TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
@@ -2866,8 +2865,6 @@ public static class bgfx
/// Check for required space and allocate transient vertex and index
/// buffers. If both space requirements are satisfied function returns
/// true.
/// @remarks
/// Only 16-bit index buffer is supported.
/// </summary>
///
/// <param name="_tvb">TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
@@ -2875,9 +2872,10 @@ public static class bgfx
/// <param name="_numVertices">Number of vertices to allocate.</param>
/// <param name="_tib">TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
/// <param name="_numIndices">Number of indices to allocate.</param>
/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
///
[LinkName("bgfx_alloc_transient_buffers")]
public static extern bool alloc_transient_buffers(TransientVertexBuffer* _tvb, VertexLayout* _layout, uint32 _numVertices, TransientIndexBuffer* _tib, uint32 _numIndices);
public static extern bool alloc_transient_buffers(TransientVertexBuffer* _tvb, VertexLayout* _layout, uint32 _numVertices, TransientIndexBuffer* _tib, uint32 _numIndices, bool _index32);
/// <summary>
/// Allocate instance data buffer.

View File

@@ -2768,9 +2768,10 @@ public static partial class bgfx
/// </summary>
///
/// <param name="_num">Number of required indices.</param>
/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
///
[DllImport(DllName, EntryPoint="bgfx_get_avail_transient_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint get_avail_transient_index_buffer(uint _num);
public static extern unsafe uint get_avail_transient_index_buffer(uint _num, bool _index32);
/// <summary>
/// Returns number of requested or maximum available vertices.
@@ -2794,8 +2795,6 @@ public static partial class bgfx
/// <summary>
/// Allocate transient index buffer.
/// @remarks
/// Only 16-bit index buffer is supported.
/// </summary>
///
/// <param name="_tib">TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
@@ -2820,8 +2819,6 @@ public static partial class bgfx
/// Check for required space and allocate transient vertex and index
/// buffers. If both space requirements are satisfied function returns
/// true.
/// @remarks
/// Only 16-bit index buffer is supported.
/// </summary>
///
/// <param name="_tvb">TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
@@ -2829,10 +2826,11 @@ public static partial class bgfx
/// <param name="_numVertices">Number of vertices to allocate.</param>
/// <param name="_tib">TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
/// <param name="_numIndices">Number of indices to allocate.</param>
/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
///
[DllImport(DllName, EntryPoint="bgfx_alloc_transient_buffers", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern unsafe bool alloc_transient_buffers(TransientVertexBuffer* _tvb, VertexLayout* _layout, uint _numVertices, TransientIndexBuffer* _tib, uint _numIndices);
public static extern unsafe bool alloc_transient_buffers(TransientVertexBuffer* _tvb, VertexLayout* _layout, uint _numVertices, TransientIndexBuffer* _tib, uint _numIndices, bool _index32);
/// <summary>
/// Allocate instance data buffer.

View File

@@ -539,8 +539,9 @@ version(BindBgfx_Static)
* Returns number of requested or maximum available indices.
* Params:
* _num = Number of required indices.
* _index32 = Set to `true` if input indices will be 32-bit.
*/
uint bgfx_get_avail_transient_index_buffer(uint _num);
uint bgfx_get_avail_transient_index_buffer(uint _num, bool _index32);
/**
* Returns number of requested or maximum available vertices.
@@ -560,8 +561,6 @@ version(BindBgfx_Static)
/**
* Allocate transient index buffer.
* Remarks:
* Only 16-bit index buffer is supported.
* Params:
* _tib = TransientIndexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
@@ -586,8 +585,6 @@ version(BindBgfx_Static)
* Check for required space and allocate transient vertex and index
* buffers. If both space requirements are satisfied function returns
* true.
* Remarks:
* Only 16-bit index buffer is supported.
* Params:
* _tvb = TransientVertexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
@@ -598,8 +595,9 @@ version(BindBgfx_Static)
* for the duration of frame, and it can be reused for multiple draw
* calls.
* _numIndices = Number of indices to allocate.
* _index32 = Set to `true` if input indices will be 32-bit.
*/
bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const(bgfx_vertex_layout_t)* _layout, uint _numVertices, bgfx_transient_index_buffer_t* _tib, uint _numIndices);
bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const(bgfx_vertex_layout_t)* _layout, uint _numVertices, bgfx_transient_index_buffer_t* _tib, uint _numIndices, bool _index32);
/**
* Allocate instance data buffer.
@@ -2729,8 +2727,9 @@ else
* Returns number of requested or maximum available indices.
* Params:
* _num = Number of required indices.
* _index32 = Set to `true` if input indices will be 32-bit.
*/
alias da_bgfx_get_avail_transient_index_buffer = uint function(uint _num);
alias da_bgfx_get_avail_transient_index_buffer = uint function(uint _num, bool _index32);
da_bgfx_get_avail_transient_index_buffer bgfx_get_avail_transient_index_buffer;
/**
@@ -2753,8 +2752,6 @@ else
/**
* Allocate transient index buffer.
* Remarks:
* Only 16-bit index buffer is supported.
* Params:
* _tib = TransientIndexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
@@ -2781,8 +2778,6 @@ else
* Check for required space and allocate transient vertex and index
* buffers. If both space requirements are satisfied function returns
* true.
* Remarks:
* Only 16-bit index buffer is supported.
* Params:
* _tvb = TransientVertexBuffer structure is filled and is valid
* for the duration of frame, and it can be reused for multiple draw
@@ -2793,8 +2788,9 @@ else
* for the duration of frame, and it can be reused for multiple draw
* calls.
* _numIndices = Number of indices to allocate.
* _index32 = Set to `true` if input indices will be 32-bit.
*/
alias da_bgfx_alloc_transient_buffers = bool function(bgfx_transient_vertex_buffer_t* _tvb, const(bgfx_vertex_layout_t)* _layout, uint _numVertices, bgfx_transient_index_buffer_t* _tib, uint _numIndices);
alias da_bgfx_alloc_transient_buffers = bool function(bgfx_transient_vertex_buffer_t* _tvb, const(bgfx_vertex_layout_t)* _layout, uint _numVertices, bgfx_transient_index_buffer_t* _tib, uint _numIndices, bool _index32);
da_bgfx_alloc_transient_buffers bgfx_alloc_transient_buffers;
/**

View File

@@ -10,7 +10,7 @@ public import core.stdc.stdarg : va_list;
extern(C) @nogc nothrow:
enum uint BGFX_API_VERSION = 114;
enum uint BGFX_API_VERSION = 115;
alias bgfx_view_id_t = ushort;