diff --git a/GL/draw.c b/GL/draw.c index b6e5086..a8dade5 100644 --- a/GL/draw.c +++ b/GL/draw.c @@ -615,9 +615,13 @@ static void transform(SubmissionTarget* target) { TRACE(); /* Perform modelview transform, storing W */ - Vertex* vertex = _glSubmissionTargetStart(target); + Vertex* it = _glSubmissionTargetStart(target); + int count = target->count; - TransformVertices(vertex, target->count); + for(int i = 0; i < count; ++i, ++it) { + TransformVertex(it->xyz[0], it->xyz[1], it->xyz[2], it->w, + it->xyz, &it->w); + } } static void mat_transform_normal3(const float* xyz, const float* xyzOut, const uint32_t count, const uint32_t inStride, const uint32_t outStride) { diff --git a/GL/platforms/sh4.h b/GL/platforms/sh4.h index 6b9bad0..1139283 100644 --- a/GL/platforms/sh4.h +++ b/GL/platforms/sh4.h @@ -124,28 +124,6 @@ GL_FORCE_INLINE void TransformVertex(float x, float y, float z, float w, float* *ow = __w; } -static inline void TransformVertices(Vertex* vertices, const int count) { - Vertex* it = vertices; - for(int i = 0; i < count; ++i, ++it) { - register float __x __asm__("fr12") = (it->xyz[0]); - register float __y __asm__("fr13") = (it->xyz[1]); - register float __z __asm__("fr14") = (it->xyz[2]); - register float __w __asm__("fr15") = (it->w); - - __asm__ __volatile__( - "fldi1 fr15\n" - "ftrv xmtrx,fv12\n" - : "=f" (__x), "=f" (__y), "=f" (__z), "=f" (__w) - : "0" (__x), "1" (__y), "2" (__z), "3" (__w) - ); - - it->xyz[0] = __x; - it->xyz[1] = __y; - it->xyz[2] = __z; - it->w = __w; - } -} - void InitGPU(_Bool autosort, _Bool fsaa); static inline size_t GPUMemoryAvailable() { diff --git a/GL/platforms/software.c b/GL/platforms/software.c index 9a2b4e5..57940b6 100644 --- a/GL/platforms/software.c +++ b/GL/platforms/software.c @@ -619,34 +619,17 @@ void TransformVec4(float* v) { FASTCPY(v, ret, sizeof(float) * 4); } -void TransformVertices(Vertex* vertices, const int count) { - float ret[4]; - for(int i = 0; i < count; ++i, ++vertices) { - ret[0] = vertices->xyz[0]; - ret[1] = vertices->xyz[1]; - ret[2] = vertices->xyz[2]; - ret[3] = 1.0f; - - TransformVec4(ret); - - vertices->xyz[0] = ret[0]; - vertices->xyz[1] = ret[1]; - vertices->xyz[2] = ret[2]; - vertices->w = ret[3]; - } -} - void TransformVertex(float x, float y, float z, float w, float* oxyz, float* ow) { - float ret[4]; - ret[0] = x; - ret[1] = y; - ret[2] = z; - ret[3] = w; + float vec[4], ret[4]; + vec[0] = x; + vec[1] = y; + vec[2] = z; + vec[3] = w; - TransformVec4(ret); + TransformVec4NoMod(vec, ret); oxyz[0] = ret[0]; oxyz[1] = ret[1]; oxyz[2] = ret[2]; - *ow = ret[3]; + *ow = ret[3]; } diff --git a/GL/platforms/software.h b/GL/platforms/software.h index cc89f97..744a9bc 100644 --- a/GL/platforms/software.h +++ b/GL/platforms/software.h @@ -52,7 +52,6 @@ static inline void TransformNormalNoMod(const float* xIn, float* xOut) { (void) xOut; } -void TransformVertices(Vertex* vertices, const int count); void TransformVertex(float x, float y, float z, float w, float* oxyz, float* ow); void InitGPU(_Bool autosort, _Bool fsaa);