mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-28 18:41:14 +00:00
gs-vertex: Hint VS2013/2015 at proper alignment
The previous fix unfortunately didn't actually fix it and instead made the crash invisible at first and then corrupt the heap at a later point. With this, VS2013 and VS2015 create code identical to what VS2017 creates, and no longer seem to crash. Related: #9
This commit is contained in:
parent
e9fc9e89f2
commit
53568d445b
1 changed files with 17 additions and 4 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
#pragma once
|
||||
#include <inttypes.h>
|
||||
#include <xmmintrin.h>
|
||||
extern "C" {
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable: 4201 )
|
||||
|
@ -30,10 +31,22 @@ namespace GS {
|
|||
const uint32_t MAXIMUM_UVW_LAYERS = 8u;
|
||||
// ToDo: Optimize for use with GS::VertexBuffer so that it doesn't require in-memory copy.
|
||||
__declspec(align(16)) struct Vertex {
|
||||
vec3 position;
|
||||
vec3 normal;
|
||||
vec3 tangent;
|
||||
vec4 uv[MAXIMUM_UVW_LAYERS];
|
||||
union {
|
||||
__m128 _positionM;
|
||||
vec3 position;
|
||||
};
|
||||
union {
|
||||
__m128 _normalM;
|
||||
vec3 normal;
|
||||
};
|
||||
union {
|
||||
__m128 _tangentM;
|
||||
vec3 tangent;
|
||||
};
|
||||
union {
|
||||
__m128 _uvM[MAXIMUM_UVW_LAYERS];
|
||||
vec4 uv[MAXIMUM_UVW_LAYERS];
|
||||
};
|
||||
uint32_t color;
|
||||
|
||||
// Operators
|
||||
|
|
Loading…
Reference in a new issue