(PS3 RGL) Use rglGcmSwap16Float32

This commit is contained in:
twinaphex 2013-11-18 11:00:53 +01:00
parent 4e800574c0
commit b7d1d6fe34
2 changed files with 15 additions and 2 deletions

View File

@ -63,6 +63,18 @@ static inline void rglGcmSetVertexProgramParameterBlock(struct CellGcmContextDat
#define SUBPIXEL_BITS 12
#define SUBPIXEL_ADJUST (0.5/(1<<SUBPIXEL_BITS))
#define rglGcmSwap16Float32(fp, f) \
{ \
union SwapF32_16 \
{ \
uint32_t ui; \
float f; \
} v; \
v.f = *f; \
v.ui = (v.ui>>16) | (v.ui<<16); \
*fp = v.f; \
}
#define rglDeallocateBuffer(bufferObject, rglBuffer) \
if (rglBuffer->pool == RGLGCM_SURFACE_POOL_LINEAR) \
gmmFree( rglBuffer->bufferId ); \

View File

@ -91,8 +91,9 @@ template<int SIZE> inline static void swapandsetfp( int ucodeSize, unsigned int
float *src = (float*)v;
for (uint32_t j=0; j<SIZE;j++)
{
*fp = cellGcmSwap16Float32(*src);
fp++;src++;
rglGcmSwap16Float32(fp, src);
fp++;
src++;
}
}