From b9d2a05a286794177253014bb5943e76577c4103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 8 Apr 2015 21:15:37 -0700 Subject: [PATCH] Updated docs. --- include/bgfx.h | 80 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 59 insertions(+), 21 deletions(-) diff --git a/include/bgfx.h b/include/bgfx.h index 7462fc22..e2dd12d8 100644 --- a/include/bgfx.h +++ b/include/bgfx.h @@ -645,8 +645,19 @@ namespace bgfx /// Create static index buffer. /// - /// @remarks - /// Only 16-bit index buffer is supported. + /// @param _mem Index buffer data. + /// @param _flags Buffer creation flags. + /// - `BGFX_BUFFER_NONE` - No flags. + /// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. + /// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer + /// is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. + /// - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. + /// - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if different amount of + /// data is passed. If this flag is not specified if more data is passed on update buffer + /// will be trimmed to fit existing buffer size. This flag has effect only on dynamic + /// buffers. + /// - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on + /// index buffers. /// IndexBufferHandle createIndexBuffer(const Memory* _mem, uint8_t _flags = BGFX_BUFFER_NONE); @@ -671,24 +682,35 @@ namespace bgfx /// /// @param _num Number of indices. /// @param _flags Buffer creation flags. - /// `BGFX_BUFFER_COMPUTE_READ` - compute shader will read buffer. - /// `BGFX_BUFFER_COMPUTE_WRITE` - compute shader will write into buffer. - /// `BGFX_BUFFER_ALLOW_RESIZE` buffer can be resized if updated with different size buffer. - /// - /// @remarks - /// 1. Only 16-bit index buffer is supported. - /// - /// 2. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated - /// from CPU. + /// - `BGFX_BUFFER_NONE` - No flags. + /// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. + /// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer + /// is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. + /// - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. + /// - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if different amount of + /// data is passed. If this flag is not specified if more data is passed on update buffer + /// will be trimmed to fit existing buffer size. This flag has effect only on dynamic + /// buffers. + /// - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on + /// index buffers. /// DynamicIndexBufferHandle createDynamicIndexBuffer(uint32_t _num, uint8_t _flags = BGFX_BUFFER_NONE); /// Create dynamic index buffer and initialized it. /// /// @param _mem Index buffer data. - /// - /// @remarks - /// Only 16-bit index buffer is supported. + /// @param _flags Buffer creation flags. + /// - `BGFX_BUFFER_NONE` - No flags. + /// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. + /// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer + /// is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. + /// - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. + /// - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if different amount of + /// data is passed. If this flag is not specified if more data is passed on update buffer + /// will be trimmed to fit existing buffer size. This flag has effect only on dynamic + /// buffers. + /// - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on + /// index buffers. /// DynamicIndexBufferHandle createDynamicIndexBuffer(const Memory* _mem, uint8_t _flags = BGFX_BUFFER_NONE); @@ -710,13 +732,17 @@ namespace bgfx /// @param _num Number of vertices. /// @param _decl Vertex declaration. /// @param _flags Buffer creation flags. - /// `BGFX_BUFFER_COMPUTE_READ` - compute shader will read buffer. - /// `BGFX_BUFFER_COMPUTE_WRITE` - compute shader will write into buffer. - /// `BGFX_BUFFER_ALLOW_RESIZE` buffer can be resized if updated with different size buffer. - /// - /// @remarks - /// When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated - /// from CPU. + /// - `BGFX_BUFFER_NONE` - No flags. + /// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. + /// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer + /// is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. + /// - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. + /// - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if different amount of + /// data is passed. If this flag is not specified if more data is passed on update buffer + /// will be trimmed to fit existing buffer size. This flag has effect only on dynamic + /// buffers. + /// - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on + /// index buffers. /// DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexDecl& _decl, uint8_t _flags = BGFX_BUFFER_NONE); @@ -724,6 +750,18 @@ namespace bgfx /// /// @param _mem Vertex buffer data. /// @param _decl Vertex declaration. + /// @param _flags Buffer creation flags. + /// - `BGFX_BUFFER_NONE` - No flags. + /// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. + /// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer + /// is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. + /// - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. + /// - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if different amount of + /// data is passed. If this flag is not specified if more data is passed on update buffer + /// will be trimmed to fit existing buffer size. This flag has effect only on dynamic + /// buffers. + /// - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on + /// index buffers. /// DynamicVertexBufferHandle createDynamicVertexBuffer(const Memory* _mem, const VertexDecl& _decl, uint8_t _flags = BGFX_BUFFER_NONE);