Skip to content

Instantly share code, notes, and snippets.

View recp's full-sized avatar
🔭
Inventing

Recep Aslantas recp

🔭
Inventing
View GitHub Profile
set_target_properties(json PROPERTIES VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})
@recp
recp / mat3-test.c
Created December 24, 2018 10:15
mat3-test.c
#include "test_common.h"
void
test_mat3(void **state) {
mat3 m1 = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}};
int i, j, k;
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
@recp
recp / mat4_inv_sse2.c
Created October 29, 2018 09:32
mat4 SSE2
CGLM_INLINE
void
glm_mat4_inv_sse2(mat4 mat, mat4 dest) {
__m128 r0, r1, r2, r3,
v0, v1, v2, v3,
t0, t1, t2, t3, t4, t5,
x0, x1, x2, x3, x4, x5, x6, x7;
/* 127 <- 0 */
r0 = glmm_load(mat[0]); /* d c b a */
@recp
recp / mat4_inv_avx.c
Last active November 1, 2018 08:02
mat4_inv AVX
CGLM_INLINE
void
glm_mat4_inv_avx(mat4 mat, mat4 dest) {
__m256 y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13;
__m256 yt0, yt1, yt2;
__m256 t0, t1, t2;
__m256 r1, r2;
__m256 flpsign;
__m256i yi1, yi2, yi3;
@recp
recp / glm_mat4_mul_sse2.txt
Last active August 5, 2018 11:56
cglm-mat4-mul-sse2.txt
glm_mat4_mul_sse2:
movaps xmm0, XMMWORD PTR [rsi]
movaps xmm3, XMMWORD PTR [rdi]
movaps xmm2, XMMWORD PTR [rdi+16]
movaps xmm4, XMMWORD PTR [rdi+32]
movaps xmm1, XMMWORD PTR [rdi+48]
movaps xmm5, xmm0
movaps xmm7, xmm0
movaps xmm6, xmm0
shufps xmm5, xmm0, 255
@recp
recp / cglm-assembly-archiving.txt
Last active August 5, 2018 09:38
cglm-glm-test
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 12
.file 1 "/Users/recp/Projects/recp/math/glm" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/include/xmmintrin.h"
.file 2 "/Users/recp/Projects/recp/math/glm" "/Users/recp/Projects/recp/math/glm/include/cglm/common.h"
.file 3 "/Users/recp/Projects/recp/math/glm" "/Users/recp/Projects/recp/math/glm/include/cglm/simd/intrin.h"
.file 4 "/Users/recp/Projects/recp/math/glm" "/Users/recp/Projects/recp/math/glm/include/cglm/util.h"
.file 5 "/Users/recp/Projects/recp/math/glm" "/Users/recp/Projects/recp/math/glm/include/cglm/io.h"
.file 6 "/Users/recp/Projects/recp/math/glm" "/Users/recp/Projects/recp/math/glm/test/src/test_main.c"
.section __TEXT,__literal16,16byte_literals
.p2align 4 ## -- Begin function main
CGLM_INLINE
void
glm_rotate_make_sse(mat4 m, float angle, vec3 axis) {
__m128 x0, x1, x2, x3, x4, x5, x6, x7, x8;
float c, s;
c = cosf(angle);
s = sinf(angle);
x0 = glmm_load3(axis);
CGLM_INLINE
void
glm_mat4_quat_sse2(mat4 m, versor dest) {
__m128 c0, c1, c2, x0, x1, x2, x3, m00, m11, m22, r;
__m128 zero, one, half, ngone;
c0 = _mm_load_ps(m[0]);
c1 = _mm_load_ps(m[1]);
c2 = _mm_load_ps(m[2]);
@recp
recp / COLLADA_PBR.xml
Last active March 21, 2018 15:01
COLLADA_PBR Extension
<extra>
<ext name="pbr">
<metallic_roughness>
<metallic>
<factor>FloatOrParam</factor>
<bind_tex ref="texture-0" channel="G" />
</metallic>
<roughness>
<factor>FloatOrParam</factor>
<bind_tex ref="texture-0" channel="B" />
@recp
recp / GLView.h
Last active July 27, 2022 10:35
Cocoa: Custom OpenGL View
/*
* Copyright (c), Recep Aslantas. All rights reserved.
*/
#import <Cocoa/Cocoa.h>
@protocol GLViewDelegate;
@interface GLView : NSView {
NSOpenGLContext * m_openGLContext;