Cglm Versions Save

📽 Highly Optimized 2D / 3D Graphics Math (glm) for C

v0.8.4

2 years ago

Now there are _no and _zo vesions of project / unproject functions. They are placed in include/cglm/clipspace/ and include/cglm/call/clipspace/ folders.

if CGLM_CLIPSPACE_INCLUDE_ALL is defined then all clipspace headers are icluded in project.h or related main headers, otherwise only related clipspace headers will be included to avoid including unused headers...

New Features

Bugfix and Improvements

Sponsorship: Consider become a sponsor for cglm

Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:

https://opencollective.com/cglm#backer

v0.8.3

2 years ago

Major New Feature: Clipspace Control (https://github.com/recp/cglm/pull/198) 🎉

cglm now supports different clipspace configurations.

Many many thanks to @raedwulf and @michael-g to provide this feature to cglm which was in TODOs long time. There are missing tests for now but tests will or should be added as soon as possible. Also thanks to @hartenfels and @bwhmather fixing build files...

Options

#define CGLM_FORCE_DEPTH_ZERO_TO_ONE
#define CGLM_FORCE_LEFT_HANDED
#define CGLM_CLIPSPACE_INCLUDE_ALL

/* auto created in cglm */
#define CGLM_CONFIG_CLIP_CONTROL
#define CGLM_CLIP_CONTROL_LH_ZO
#define CGLM_CLIP_CONTROL_LH_NO
#define CGLM_CLIP_CONTROL_RH_ZO
#define CGLM_CLIP_CONTROL_RH_NO

New functions

Now there are _no, _zo, _lh, _rh... vesions of projection and view functions. No need to paste all of them here, they are placed in include/cglm/clipspace/, include/cglm/struct/clipspace/ and include/cglm/call/clipspace/ folders.

if CGLM_CLIPSPACE_INCLUDE_ALL is defined then all clipspace headers are icluded in cam.h or related main headers, otherwise only related clipspace headers will be included to avoid including unused headers...

New Features

Bugfix and Improvements

  • simd: optimize glm_mat4_zero() with simd
  • simd, sse: optimize mat4 inv with sse
    • reduce a few shufflees
    • re-oder instructions for ILP
  • simd, sse: optimize mat4 mul with sse
  • simd, sse: optimize mat4 mul-v with sse
  • arm neon: optimize mat4 mul with neon
  • arm neon: optimize affine with neon
  • sse: optimize affine with sse
  • sse: optimize glm_quat_mul with sse
  • sse: optimize glm_mat2_mul_sse2 with sse
  • sse2: optimize glm_mat3_mul_sse2() with sse2
  • simd, sse: reduce some computation at glm_mul_rot_sse2()
  • arm, neon: impove hadd performance
  • arm, neon: use negate instruction instead of xor in glm_inv_tr_neon()
  • style: rename nearVal, farVal to nearZ and farZ
  • https://github.com/recp/cglm/pull/192 fix function param type ( thanks to @Winter091 )
  • other improvements may not be mentioned here....

Sponsorship: Consider become a sponsor for cglm

Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:

https://opencollective.com/cglm#backer

v0.8.2

3 years ago

New Features and Improvements

  • #188 configure and install cglm.pc with cmake ( thanks to @wdouglass )
  • minor doc impovements ( thanks to @ylecuyer )
  • rename glmm_shuff1x() to glmm_splat(), mark glmm_shuff1x() as DEPRECATED
  • optimize translate functions with FMA and NEON
  • use unified glmm api for vec4
  • arm: define CGLM_ARM64 for identify arm64
  • arm: optimize vec4 div with NEON
  • arm, neon: implement mat4 determinant with NEON
  • arm, neon: implement mat4 inv with NEON
  • arm, neon: update mat4_mul to use FMA
  • arm, neon: neon/fma support for glm_mul()
  • arm, neon: neon/fma support for glm_mul_rot()
  • arm, neon: neon/fma support for glm_inv_tr()
  • arm, neon: neon/fma support for glm_mat2_mul()
  • arm, neon: neon/fma support for glm_quat_mul()

New glmm functions:

  • glmm_set1(x)
  • glmm_splat_x(x)
  • glmm_splat_y(x)
  • glmm_splat_z(x)
  • glmm_splat_w(x)
  • glmm_xor(a, b) for neon
  • glmm_vhadd(a) for neon

v0.8.1

3 years ago

New Features:

Implement FMA

SIMD operations are optimized with FMA instructions to reduce operations and increasee accuracy. The gennerated CPU instructions are reduced. All matrix and related-vector operations are optimized.

FMA must be enable for these optimizations (with -mfma flag on GCC and Clang, /arch:AVX2 /O1-2 on MSVC)

  • optimize mat4 SSE operations with FMA
  • optimize mat3 SSE operations with FMA
  • optimize mat2 SSE operations with FMA
  • optimize affine mat SSE operations with FMA
  • optimize vec4 muladd and muladds operations with FMA

New glmm functions (SSE + NEON):

  • glmm_vhadd() - broadcast-ed hadd
  • glmm_fmadd(a, b, c) - fused multiply add
  • glmm_fnmadd(a, b, c) - fused negative multiply add
  • glmm_fmsub(a, b, c) - fused multiply sub
  • glmm_fnmsub(a, b, c) - fused negative multiply sub

New glmm functions (AVX):

  • glmm256_fmadd(a, b, c) - fused multiply add AVX
  • glmm256_fnmadd(a, b, c) - fused negative multiply add AVX
  • glmm256_fmsub(a, b, c) - fused multiply sub AVX
  • glmm256_fnmsub(a, b, c) - fused negative multiply sub AVX
  • glm_mat4_scale_avx(mat4 m, float s) - scale matrix with scalar (if AVX enabled)

CMake

  • #183: add CMake interface library target ( thanks to @legends2k )

Use as header-only library with your CMake project

This requires no building or installation of cglm.

  • Example:
cmake_minimum_required(VERSION 3.8.2)

project(<Your Project Name>)

add_executable(${PROJECT_NAME} src/main.c)
target_link_libraries(${LIBRARY_NAME} PRIVATE
  cglm_headers)

add_subdirectory(external/cglm/ EXCLUDE_FROM_ALL)

v0.8.0

3 years ago

Bugfixes and Improvements:

  • #180: aabb v sphere intesect fix (glm_aabb_sphere()) ( thanks to @ILeonor to report this ) - todo: more aabb v sphere intersect options
  • #178: fix cmake config install path ( thanks to @gaurapanasenko )
  • #177: remove wrong c standard bug ( thanks to @Winter091 )
  • #172: replace hex floating point literals ( thanks to @SanderMertens ) - todo: https://github.com/recp/cglm/pull/172#issuecomment-737080592
  • #169: fix Documentions WARNING for __restrict attribute ( thanks to @podsvirov )
  • update cglm.podspec
  • improve documentation

v0.7.9

3 years ago

New Features:

  • arm neon: support transpose mat4 with neon
  • arm neon: multiply mat4 with vec4
  • Swift Package Manager support, swiftpm package file with module map ( thanks to @smumryakW )
  • meson: add 'install' option ( thanks to @Akaricchi )  

    This is useful for people who want to use cglm as a meson subproject without polluting the main project's install target.

Bugfixes and Improvements:

  • arm neon: move neon-scale to simd header
  • fix docs for glm_vec2() ( thanks to @emersion )
  • simd/x86: fix -Wcast-align warnings (gcc/clang) ( thanks to @Akaricchi )  

    This modifies glmm_{load,store}3 functions to make the compiler assume the v pointer is appropriately aligned for the type it is being cast to. Not tested with CGLM_ALL_UNALIGNED, but it probably doesn't matter.

v0.7.8

3 years ago

New Features:

Bugfixes and Improvements:

  • win32: fix symbol exports, drop CGLM_DLL, add CGLM_STATIC... ( thanks to @randy408 )
    • CGLM_EXPORTS - building a shared library (dllexport)
    • CGLM_STATIC - required for cglm\call headers with statically built library (no attributes)
    • No defines - assume dynamic (dllimport)
  • win32, test: don't link 'm' with msvc ( thanks to @randy408 )
  • gcc: fix some warnings ( thanks to @randy408 )
  • io: make options changeable by user, define colors as empty macro to remove colors from prints
  • io: add documentation to io.h header
  • io: deprecate CGLM_NO_PRINTS_NOOP
  • documentation improvements and fixes

v0.7.7

3 years ago

New Features:

2D Affine Transforms

Now we have 2D Affine Transform functions. 2D Transform functions are suffixed with 2d, functions that don't have any suffixes are 3D. For instance glm_translate2d() is 2D and glm_translate() is 3D.

New Functions:

Translate2D:

  • glm_translate2d()
  • glm_translate2d_to()
  • glm_translate2d_x()
  • glm_translate2d_y()
  • glm_translate2d_make()

Scale2D:

  • glm_scale2d_to()
  • glm_scale2d_make()
  • glm_scale2d()
  • glm_scale2d_uni()

Rotate2D:

  • glm_rotate2d_make()
  • glm_rotate2d()
  • glm_rotate2d_to()

All these functions are documented at https://cglm.readthedocs.io/en/latest/affine2d.html . Rotate functions are rotating around Z axes. SIMD optimizations will be applied in the future releases.

Bugfixes and Improvements:

  • mat3_mulv: function behaviour to match with mat4 ( thanks to @Terri00 )
  • mat2: don't use vec4 directly on mat2 because of alignment requirements may be different
  • define CGLM_DEFINE_PRINTS macro for test targets to see printed results
  • documentation fixes

Build:

  • build: update CFLAGS (-O3 -std=gnu11) for check/test target to match the main target
  • build: remove RTC1 from CMake build for Windows/MSVC

v0.7.6

3 years ago

Critical Bugfix:

Bugfixes and Improvements:

Core
  • Use epsilon to compare vec2/vec3/vec4_eq_all
  • mat2: suppress warnings for initializing mat2 sruct
Build
  • Build: Improve CMake build integration
  • Build: Update CMake to export Config to use find_package()
  • Build: Drop pedantic from C Flags and allow extensions
Tests
  • tests: add option to disable colors in test output
  • tests: add test for frustum

New Features:

  • Option to override FLT_EPSILON with GLM_FLT_EPSILON

v0.7.4

3 years ago

Critical Bugfix:

Improvements:

  • io: in release mode, make print functions macro to suppress unused parameter warnings
  • build, cmake: use PROJECT_VERSION_** to set so version instead of custom variables