mirror of
https://github.com/UberGames/ioef.git
synced 2025-02-26 05:11:03 +00:00
Fixed Altivec-based mesh rendering.
This commit is contained in:
parent
e67d270f2a
commit
dd4dce194e
2 changed files with 19 additions and 19 deletions
|
@ -1273,18 +1273,25 @@ typedef struct stageVars
|
||||||
vec2_t texcoords[NUM_TEXTURE_BUNDLES][SHADER_MAX_VERTEXES];
|
vec2_t texcoords[NUM_TEXTURE_BUNDLES][SHADER_MAX_VERTEXES];
|
||||||
} stageVars_t;
|
} stageVars_t;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define ALIGN16 __attribute__((aligned(16)))
|
||||||
|
#else
|
||||||
|
#define ALIGN16
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct shaderCommands_s
|
typedef struct shaderCommands_s
|
||||||
{
|
{
|
||||||
glIndex_t indexes[SHADER_MAX_INDEXES];
|
glIndex_t indexes[SHADER_MAX_INDEXES] ALIGN16;
|
||||||
vec4_t xyz[SHADER_MAX_VERTEXES];
|
vec4_t xyz[SHADER_MAX_VERTEXES] ALIGN16;
|
||||||
vec4_t normal[SHADER_MAX_VERTEXES];
|
vec4_t normal[SHADER_MAX_VERTEXES] ALIGN16;
|
||||||
vec2_t texCoords[SHADER_MAX_VERTEXES][2];
|
vec2_t texCoords[SHADER_MAX_VERTEXES][2] ALIGN16;
|
||||||
color4ub_t vertexColors[SHADER_MAX_VERTEXES];
|
color4ub_t vertexColors[SHADER_MAX_VERTEXES] ALIGN16;
|
||||||
int vertexDlightBits[SHADER_MAX_VERTEXES];
|
int vertexDlightBits[SHADER_MAX_VERTEXES] ALIGN16;
|
||||||
|
|
||||||
stageVars_t svars;
|
stageVars_t svars ALIGN16;
|
||||||
|
|
||||||
color4ub_t constantColor255[SHADER_MAX_VERTEXES];
|
color4ub_t constantColor255[SHADER_MAX_VERTEXES] ALIGN16;
|
||||||
|
|
||||||
shader_t *shader;
|
shader_t *shader;
|
||||||
float shaderTime;
|
float shaderTime;
|
||||||
|
|
|
@ -615,8 +615,10 @@ static void LerpMeshVertexes_altivec(md3Surface_t *surf, float backlerp)
|
||||||
{
|
{
|
||||||
short *oldXyz, *newXyz, *oldNormals, *newNormals;
|
short *oldXyz, *newXyz, *oldNormals, *newNormals;
|
||||||
float *outXyz, *outNormal;
|
float *outXyz, *outNormal;
|
||||||
float oldXyzScale, newXyzScale;
|
float oldXyzScale ALIGN16;
|
||||||
float oldNormalScale, newNormalScale;
|
float newXyzScale ALIGN16;
|
||||||
|
float oldNormalScale ALIGN16;
|
||||||
|
float newNormalScale ALIGN16;
|
||||||
int vertNum;
|
int vertNum;
|
||||||
unsigned lat, lng;
|
unsigned lat, lng;
|
||||||
int numVerts;
|
int numVerts;
|
||||||
|
@ -839,20 +841,11 @@ static void LerpMeshVertexes_scalar(md3Surface_t *surf, float backlerp)
|
||||||
static void LerpMeshVertexes(md3Surface_t *surf, float backlerp)
|
static void LerpMeshVertexes(md3Surface_t *surf, float backlerp)
|
||||||
{
|
{
|
||||||
#if idppc_altivec
|
#if idppc_altivec
|
||||||
// !!! FIXME: figure out what's broken and remove this.
|
|
||||||
#ifndef NDEBUG
|
|
||||||
static int already_complained = 0;
|
|
||||||
if (!already_complained) {
|
|
||||||
already_complained = 1;
|
|
||||||
Com_Printf("WARNING! FIXME! Altivec mesh lerping broken in debug builds!\n");
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (com_altivec->integer) {
|
if (com_altivec->integer) {
|
||||||
// must be in a seperate function or G3 systems will crash.
|
// must be in a seperate function or G3 systems will crash.
|
||||||
LerpMeshVertexes_altivec( surf, backlerp );
|
LerpMeshVertexes_altivec( surf, backlerp );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // idppc_altivec
|
#endif // idppc_altivec
|
||||||
LerpMeshVertexes_scalar( surf, backlerp );
|
LerpMeshVertexes_scalar( surf, backlerp );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue