mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
docs: fix typos
This commit is contained in:
@@ -21,17 +21,17 @@ Types:
|
|||||||
As you can see types don't store extra informations in favor of space.
|
As you can see types don't store extra informations in favor of space.
|
||||||
You can send these values e.g. matrix to OpenGL directly without casting or calling a function like *value_ptr*
|
You can send these values e.g. matrix to OpenGL directly without casting or calling a function like *value_ptr*
|
||||||
|
|
||||||
Aligment is Required:
|
Alignment is Required:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**vec4** and **mat4** requires 16 byte aligment because vec4 and mat4 operations are
|
**vec4** and **mat4** requires 16 byte alignment because vec4 and mat4 operations are
|
||||||
vectorized by SIMD instructions (SSE/AVX).
|
vectorized by SIMD instructions (SSE/AVX).
|
||||||
|
|
||||||
Allocations:
|
Allocations:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
*cglm* doesn't alloc any memory on heap. So it doesn't provide any allocator.
|
*cglm* doesn't alloc any memory on heap. So it doesn't provide any allocator.
|
||||||
You must allocate memory yourself. You should alloc memory for out parameters too if you pass pointer of memory location.
|
You must allocate memory yourself. You should alloc memory for out parameters too if you pass pointer of memory location.
|
||||||
When allocating memory don't forget that **vec4** and **mat4** requires aligment.
|
When allocating memory don't forget that **vec4** and **mat4** requires alignment.
|
||||||
|
|
||||||
**NOTE:** Unaligned vec4 and unaligned mat4 operations will be supported in the future. Check todo list.
|
**NOTE:** Unaligned vec4 and unaligned mat4 operations will be supported in the future. Check todo list.
|
||||||
Because you may want to multiply a CGLM matrix with external matrix.
|
Because you may want to multiply a CGLM matrix with external matrix.
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ makes calculations then copy the result to dest.
|
|||||||
|
|
||||||
You are responsible for allocation of **src** and **dest** parameters.
|
You are responsible for allocation of **src** and **dest** parameters.
|
||||||
|
|
||||||
Aligment:
|
Alignment:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**vec4** and **mat4** types requires 16 byte aligment aligment.
|
**vec4** and **mat4** types requires 16 byte alignment.
|
||||||
These types are marked with align attribute to let compiler know about this
|
These types are marked with align attribute to let compiler know about this
|
||||||
requirement.
|
requirement.
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ But since MSVC (Windows) throws the error:
|
|||||||
|
|
||||||
**"formal parameter with requested alignment of 16 won't be aligned"**
|
**"formal parameter with requested alignment of 16 won't be aligned"**
|
||||||
|
|
||||||
The aligment attribute has been commented for MSVC
|
The alignment attribute has been commented for MSVC
|
||||||
|
|
||||||
.. code-block:: c
|
.. code-block:: c
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ The aligment attribute has been commented for MSVC
|
|||||||
# define CGLM_ALIGN(X) __attribute((aligned(X)))
|
# define CGLM_ALIGN(X) __attribute((aligned(X)))
|
||||||
#endif.
|
#endif.
|
||||||
|
|
||||||
So MSVC may not know about aligment requirements when creating variables.
|
So MSVC may not know about alignment requirements when creating variables.
|
||||||
The interesting thing is that, if I remember correctly Visual Studio 2017
|
The interesting thing is that, if I remember correctly Visual Studio 2017
|
||||||
doesn't throw the above error. So we may uncomment that line for Visual Studio 2017,
|
doesn't throw the above error. So we may uncomment that line for Visual Studio 2017,
|
||||||
you may do it yourself.
|
you may do it yourself.
|
||||||
|
|||||||
Reference in New Issue
Block a user