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
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <xmmintrin.h>
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#pragma warning( push )
|
#pragma warning( push )
|
||||||
#pragma warning( disable: 4201 )
|
#pragma warning( disable: 4201 )
|
||||||
|
@ -30,10 +31,22 @@ namespace GS {
|
||||||
const uint32_t MAXIMUM_UVW_LAYERS = 8u;
|
const uint32_t MAXIMUM_UVW_LAYERS = 8u;
|
||||||
// ToDo: Optimize for use with GS::VertexBuffer so that it doesn't require in-memory copy.
|
// ToDo: Optimize for use with GS::VertexBuffer so that it doesn't require in-memory copy.
|
||||||
__declspec(align(16)) struct Vertex {
|
__declspec(align(16)) struct Vertex {
|
||||||
vec3 position;
|
union {
|
||||||
vec3 normal;
|
__m128 _positionM;
|
||||||
vec3 tangent;
|
vec3 position;
|
||||||
vec4 uv[MAXIMUM_UVW_LAYERS];
|
};
|
||||||
|
union {
|
||||||
|
__m128 _normalM;
|
||||||
|
vec3 normal;
|
||||||
|
};
|
||||||
|
union {
|
||||||
|
__m128 _tangentM;
|
||||||
|
vec3 tangent;
|
||||||
|
};
|
||||||
|
union {
|
||||||
|
__m128 _uvM[MAXIMUM_UVW_LAYERS];
|
||||||
|
vec4 uv[MAXIMUM_UVW_LAYERS];
|
||||||
|
};
|
||||||
uint32_t color;
|
uint32_t color;
|
||||||
|
|
||||||
// Operators
|
// Operators
|
||||||
|
|
Loading…
Reference in New Issue