2#include "Utilities/TransformVertices.h"
4#include "Services/Features.h"
17 void transformVertex3ToVertex4AVX(uint8_t* dst,
18 const size_t dst_stride,
19 const size_t dst_bytes,
20 const glm::mat4& matrix,
22 const size_t src_stride,
23 const size_t src_bytes,
24 const size_t src_count);
26 void transformVertex3ToVertex4FastPathAVX(uint8_t* dst,
27 const size_t dst_stride,
28 const size_t dst_bytes,
29 const glm::mat4& matrix,
31 const size_t src_stride,
32 const size_t src_bytes,
33 const size_t src_count);
35 void transformVertex3ToVertex4SSE1(uint8_t* dst,
const size_t dst_stride,
const size_t dst_bytes,
36 const glm::mat4& matrix,
38 const size_t src_stride,
39 const size_t src_bytes,
40 const size_t src_count);
43 void transformVertex3ToVertex4FastPathSSE1(uint8_t* dst,
const size_t dst_stride,
const size_t dst_bytes,
44 const glm::mat4& matrix,
46 const size_t src_stride,
47 const size_t src_bytes,
48 const size_t src_count);
54void Cogs::Core::transformVertex3ToVertex4(Context* context,
56 const size_t dst_stride,
57 const size_t dst_bytes,
58 const glm::mat4& matrix,
60 const size_t src_stride,
61 const size_t src_bytes,
62 const size_t src_count)
66#if !defined(EMSCRIPTEN) && !defined(__APPLE__)
68 if (context->features->supported(CPUFeature::AVX)) {
69 if ((((
size_t)dst & 0x1f) == 0) && (dst_stride == 16) && (((
size_t)src & 0xf) == 0) && ((src_stride & 0xf) == 0)) {
70 transformVertex3ToVertex4FastPathAVX(dst, dst_stride, dst_bytes, matrix, src, src_stride, src_bytes, src_count);
73 transformVertex3ToVertex4AVX(dst, dst_stride, dst_bytes, matrix, src, src_stride, src_bytes, src_count);
78 if (context->features->supported(CPUFeature::SSE)) {
79 if ((((
size_t)dst & 0xf) == 0) && ((dst_stride & 0xf) == 0) && (((
size_t)src & 0xf) == 0) && ((src_stride & 0xf) == 0)) {
80 transformVertex3ToVertex4FastPathSSE1(dst, dst_stride, dst_bytes, matrix, src, src_stride, src_bytes, src_count);
83 transformVertex3ToVertex4SSE1(dst, dst_stride, dst_bytes, matrix, src, src_stride, src_bytes, src_count);
93 for (; i < src_count; i++) {
94 glm::vec4& d = *
reinterpret_cast<glm::vec4*
>(dst + dst_stride*i);
95 const glm::vec3& s = *
reinterpret_cast<const glm::vec3*
>(src + src_stride*i);
96 d = matrix * glm::vec4(s[0], s[1], s[2], 1.f);
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....