(RGL PS3) Opts

This commit is contained in:
twinaphex 2013-04-15 22:00:52 +02:00
parent e91f8f1c82
commit 80d249cd61
2 changed files with 25 additions and 4 deletions

View File

@ -3126,8 +3126,15 @@ GLAPI void RGL_EXPORT psglSwap (void)
}
rglGcmDriver *driver = (rglGcmDriver*)_CurrentDevice->rasterDriver;
const char * __restrict v = driver->sharedVPConstants;
GCM_FUNC( cellGcmSetVertexProgramParameterBlock, 0, 8, ( float* )v ); // GCM_PORT_UNTESTED [KHOFF]
float * __restrict v = (float*)driver->sharedVPConstants;
thisContext->current[0] = (((33) << (18)) | ((0x00001efc)));
thisContext->current[1] = 0;
__builtin_memcpy(&thisContext->current[2], v, sizeof(float)*16);
__builtin_memcpy(&thisContext->current[18], &v[16], sizeof(float)*16);
thisContext->current += 34;
v += 32;
rglGcmSetDitherEnable(thisContext, RGLGCM_TRUE );

View File

@ -168,6 +168,7 @@ template<int SIZE> static void setVectorTypeSharedfpIndexArray (void *data, cons
}
template<int SIZE> static void setVectorTypeSharedvpIndex (void *data, const void* __restrict v, const int /*index*/ )
{
CellGcmContextData *thisContext = (CellGcmContextData*)gCellGcmCurrentContext;
CgRuntimeParameter *ptr = (CgRuntimeParameter*)data;
const float * __restrict f = ( const float * __restrict )v;
const CgParameterResource *parameterResource = rglGetParameterResource( ptr->program, ptr->parameterEntry );
@ -182,11 +183,18 @@ template<int SIZE> static void setVectorTypeSharedvpIndex (void *data, const voi
memcpy(driver->sharedVPConstants + resource * 4 * sizeof( float ),
dst, 4 * sizeof(float));
GCM_FUNC( cellGcmSetVertexProgramParameterBlock, resource, 1, dst );
thisContext->current[0] = (((5) << (18)) | ((0x00001efc)));
thisContext->current[1] = resource;
thisContext->current += 2;
__builtin_memcpy(thisContext->current, dst, sizeof(float)*4);
thisContext->current += 4;
dst += 4;
}
template<int SIZE> static void setVectorTypeSharedvpIndexArray (void *data, const void* __restrict v, const int index )
{
CellGcmContextData *thisContext = (CellGcmContextData*)gCellGcmCurrentContext;
CgRuntimeParameter *ptr = (CgRuntimeParameter*)data;
const float * __restrict f = ( const float * __restrict )v;
const CgParameterResource *parameterResource = rglGetParameterResource( ptr->program, ptr->parameterEntry );
@ -201,7 +209,13 @@ template<int SIZE> static void setVectorTypeSharedvpIndexArray (void *data, cons
memcpy(driver->sharedVPConstants + resource * 4 * sizeof( float ),
dst, 4 * sizeof(float));
GCM_FUNC( cellGcmSetVertexProgramParameterBlock, resource, 1, dst );
thisContext->current[0] = (((5) << (18)) | ((0x00001efc)));
thisContext->current[1] = resource;
thisContext->current += 2;
__builtin_memcpy(thisContext->current, dst, sizeof(float)*4);
thisContext->current += 4;
dst += 4;
}