mirror of
https://github.com/libretro/RetroArch
synced 2025-03-16 07:21:03 +00:00
(PSL1GHT/Rgl) Compatibility changes
This commit is contained in:
parent
a48376efd9
commit
8c7e235e32
@ -248,26 +248,24 @@ static GLboolean _RGLInitFromRM( RGLResource *rmResource )
|
||||
|
||||
ref = RGL_CLAMPF_01(ref);
|
||||
|
||||
cellGcmSetAlphaFuncInline( &_RGLState.fifo, CELL_GCM_ALWAYS, RGL_QUICK_FLOAT2UINT( ref * 255.0f ));
|
||||
cellGcmSetBlendColor( &_RGLState.fifo, hwColor, hwColor);
|
||||
cellGcmSetBlendEquation( &_RGLState.fifo, CELL_GCM_FUNC_ADD, CELL_GCM_FUNC_ADD );
|
||||
cellGcmSetBlendFunc( &_RGLState.fifo, CELL_GCM_ONE, CELL_GCM_ZERO, CELL_GCM_ONE, CELL_GCM_ZERO );
|
||||
cellGcmSetClearColor( &_RGLState.fifo, hwColor);
|
||||
cellGcmSetScissor( &_RGLState.fifo, 0, 0, 4095, 4095);
|
||||
cellGcmSetVertexAttribOutputMask( &_RGLState.fifo, s->vertexProgramAttribMask & s->fragmentProgramAttribMask);
|
||||
|
||||
cellGcmSetBlendColorInline( &_RGLState.fifo, hwColor, hwColor);
|
||||
cellGcmSetBlendEquationInline( &_RGLState.fifo, CELL_GCM_FUNC_ADD, CELL_GCM_FUNC_ADD );
|
||||
cellGcmSetBlendFuncInline( &_RGLState.fifo, CELL_GCM_ONE, CELL_GCM_ZERO, CELL_GCM_ONE, CELL_GCM_ZERO );
|
||||
cellGcmSetClearColorInline( &_RGLState.fifo, hwColor);
|
||||
cellGcmSetScissorInline( &_RGLState.fifo, 0, 0, 4095, 4095);
|
||||
cellGcmSetVertexAttribOutputMaskInline( &_RGLState.fifo, s->vertexProgramAttribMask & s->fragmentProgramAttribMask);
|
||||
cellGcmSetPointSpriteControl( &_RGLState.fifo, CELL_GCM_FALSE, 1, 0);
|
||||
cellGcmSetFrequencyDividerOperation( &_RGLState.fifo, 0);
|
||||
|
||||
cellGcmSetPointSpriteControlInline( &_RGLState.fifo, CELL_GCM_FALSE, 1, 0);
|
||||
cellGcmSetFrequencyDividerOperationInline( &_RGLState.fifo, 0);
|
||||
|
||||
cellGcmSetRestartIndexInline( &_RGLState.fifo, 0);
|
||||
cellGcmSetShadeModeInline( &_RGLState.fifo, CELL_GCM_SMOOTH);
|
||||
cellGcmSetRestartIndex( &_RGLState.fifo, 0);
|
||||
cellGcmSetShadeMode( &_RGLState.fifo, CELL_GCM_SMOOTH);
|
||||
|
||||
for (i = 0; i < CELL_GCM_MAX_TEXIMAGE_COUNT; i++)
|
||||
{
|
||||
cellGcmSetTextureAddressInline( &_RGLState.fifo, i, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_CLAMP_TO_EDGE, CELL_GCM_TEXTURE_UNSIGNED_REMAP_NORMAL, CELL_GCM_TEXTURE_ZFUNC_NEVER, 0 );
|
||||
cellGcmSetTextureFilterInline( &_RGLState.fifo, i, 0, CELL_GCM_TEXTURE_NEAREST_LINEAR, CELL_GCM_TEXTURE_LINEAR, CELL_GCM_TEXTURE_CONVOLUTION_QUINCUNX );
|
||||
cellGcmSetTextureControlInline( &_RGLState.fifo, i, CELL_GCM_TRUE, 0, 12 << 8, CELL_GCM_TEXTURE_MAX_ANISO_1 );
|
||||
cellGcmSetTextureAddress( &_RGLState.fifo, i, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_CLAMP_TO_EDGE, CELL_GCM_TEXTURE_UNSIGNED_REMAP_NORMAL, CELL_GCM_TEXTURE_ZFUNC_NEVER, 0 );
|
||||
cellGcmSetTextureFilter( &_RGLState.fifo, i, 0, CELL_GCM_TEXTURE_NEAREST_LINEAR, CELL_GCM_TEXTURE_LINEAR, CELL_GCM_TEXTURE_CONVOLUTION_QUINCUNX );
|
||||
cellGcmSetTextureControl( &_RGLState.fifo, i, CELL_GCM_TRUE, 0, 12 << 8, CELL_GCM_TEXTURE_MAX_ANISO_1 );
|
||||
}
|
||||
|
||||
_RGLFifoGlViewport( 0, 0, CELL_GCM_MAX_RT_DIMENSION, CELL_GCM_MAX_RT_DIMENSION, 0.0f, 1.0f );
|
||||
@ -948,7 +946,7 @@ static int _RGLPlatformCreateDevice( PSGLdevice* device )
|
||||
_RGLSetDisplayMode(vm, gcmDevice->color[0].bpp*8, gcmDevice->color[0].pitch);
|
||||
|
||||
cellGcmSetFlipMode(gcmDevice->vsync ? CELL_GCM_DISPLAY_VSYNC : CELL_GCM_DISPLAY_HSYNC);
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
|
||||
for (int i = 0; i < params->bufferingMode; ++i)
|
||||
@ -1066,7 +1064,7 @@ void psglDestroyDevice(PSGLdevice *device)
|
||||
RGLDevice *gcmDevice = ( RGLDevice * )device->platformDevice;
|
||||
PSGLdeviceParameters* params = &device->deviceParameters;
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
|
||||
if ( rescIsEnabled( params ) )
|
||||
@ -1106,7 +1104,7 @@ static void *_RGLPlatformRasterInit (void)
|
||||
{
|
||||
RGLDriver *driver = (RGLDriver*)malloc(sizeof(RGLDriver));
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
memset( driver, 0, sizeof( RGLDriver ) );
|
||||
driver->rt.yInverted = CELL_GCM_TRUE;
|
||||
@ -1246,13 +1244,13 @@ GLAPI void psglSwap(void)
|
||||
|
||||
LContext->attribs->DirtyMask = (1 << MAX_VERTEX_ATTRIBS) - 1;
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
|
||||
_RGLFifoFlush(fifo);
|
||||
|
||||
while(sys_semaphore_wait(FlipSem, 1000) != CELL_OK);
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline(&_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache(&_RGLState.fifo);
|
||||
_RGLFifoFlush(fifo);
|
||||
|
||||
if (device->deviceParameters.bufferingMode == PSGL_BUFFERING_MODE_DOUBLE)
|
||||
|
@ -624,7 +624,7 @@ static void _RGLPlatformBufferObjectSetData( jsBufferObject* bufferObject, GLint
|
||||
}
|
||||
break;
|
||||
default:
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
memcpy( gmmIdToAddress( dstId ) + offset, src, size );
|
||||
break;
|
||||
@ -732,7 +732,7 @@ static GLvoid _RGLPlatformBufferObjectCopyData( jsBufferObject* bufferObjectDst,
|
||||
_RGLMemcpy( dst->bufferId, 0, dst->pitch, src->bufferId, src->bufferSize );
|
||||
break;
|
||||
case SURFACE_POOL_SYSTEM:
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
memcpy( gmmIdToAddress( dst->bufferId ), gmmIdToAddress( src->bufferId ),
|
||||
src->bufferSize );
|
||||
@ -1149,7 +1149,7 @@ static void _RGLPlatformCopyGPUTexture( jsTexture* texture )
|
||||
{
|
||||
_RGLImageAllocCPUStorage( image );
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
|
||||
char* gpuData = gmmIdToAddress(gcmTexture->gpuAddressId) + gcmTexture->gpuAddressIdOffset;
|
||||
@ -1701,7 +1701,7 @@ GLAPI void APIENTRY glClear( GLbitfield mask )
|
||||
gmmFree( bufferId );
|
||||
}
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFlush( fifo );
|
||||
}
|
||||
|
||||
@ -4273,7 +4273,7 @@ static char *_RGLPlatformBufferObjectMap( jsBufferObject* bufferObject, GLenum a
|
||||
}
|
||||
else
|
||||
{
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
}
|
||||
|
||||
@ -5333,7 +5333,7 @@ void psglDestroyContext( PSGLcontext* LContext )
|
||||
|
||||
if ( _CurrentContext == LContext )
|
||||
{
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
}
|
||||
|
||||
@ -5569,7 +5569,7 @@ GLAPI void APIENTRY glFlush(void)
|
||||
if ( RGL_UNLIKELY( LContext->needValidate ) )
|
||||
_RGLValidateStates();
|
||||
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
|
||||
_RGLFifoFlush( fifo );
|
||||
}
|
||||
@ -5577,7 +5577,7 @@ GLAPI void APIENTRY glFlush(void)
|
||||
GLAPI void APIENTRY glFinish(void)
|
||||
{
|
||||
glFlush();
|
||||
cellGcmSetInvalidateVertexCacheInline( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
}
|
||||
|
||||
@ -5623,7 +5623,7 @@ void psglExit (void)
|
||||
if ( LContext )
|
||||
{
|
||||
glFlush();
|
||||
cellGcmSetInvalidateVertexCacheInline ( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache ( &_RGLState.fifo);
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
|
||||
psglMakeCurrent( NULL, NULL );
|
||||
@ -5990,7 +5990,7 @@ GLAPI void APIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count )
|
||||
if(driver->invalidateVertexCache)
|
||||
{
|
||||
driver->invalidateVertexCache = GL_FALSE;
|
||||
cellGcmSetInvalidateVertexCacheInline ( &_RGLState.fifo);
|
||||
cellGcmSetInvalidateVertexCache ( &_RGLState.fifo);
|
||||
}
|
||||
|
||||
GmmBaseBlock *pBaseBlock = (GmmBaseBlock *)driver->fpLoadProgramId;
|
||||
|
@ -823,7 +823,7 @@ static inline void TransferDataVidToVid(transfer_params_t *params)
|
||||
GLuint dstOffset_tmp = gmmAddressToOffset(pBaseBlock_dst->address, pBaseBlock_dst->isMain) + params->dst_id_offset;
|
||||
GLuint srcOffset_tmp = gmmAddressToOffset(pBaseBlock_src->address, pBaseBlock_src->isMain) + params->src_id_offset;
|
||||
|
||||
cellGcmSetTransferImageInline( (RGLFifo*)params->fifo_ptr, CELL_GCM_TRANSFER_LOCAL_TO_LOCAL, dstOffset_tmp, params->dst_pitch, params->dst_x, params->dst_y, srcOffset_tmp, params->src_pitch, params->src_x, params->src_y, params->width, params->height, params->bpp);
|
||||
cellGcmSetTransferImage( (RGLFifo*)params->fifo_ptr, CELL_GCM_TRANSFER_LOCAL_TO_LOCAL, dstOffset_tmp, params->dst_pitch, params->dst_x, params->dst_y, srcOffset_tmp, params->src_pitch, params->src_x, params->src_y, params->width, params->height, params->bpp);
|
||||
}
|
||||
|
||||
typedef struct RGLRenderTarget RGLRenderTarget;
|
||||
|
@ -368,6 +368,31 @@
|
||||
|
||||
#define CELL_GCM_COMPMODE_DISABLED 0
|
||||
|
||||
#define CELL_GCM_TRANSFER_LOCAL_TO_LOCAL 0
|
||||
|
||||
#define CELL_GCM_TEXTURE_REMAP_ORDER_XYXY (0)
|
||||
#define CELL_GCM_TEXTURE_REMAP_ORDER_XXXY (1)
|
||||
|
||||
#define CELL_GCM_TEXTURE_UNSIGNED_REMAP_NORMAL (0)
|
||||
|
||||
#define CELL_GCM_TEXTURE_REMAP_FROM_A (0)
|
||||
#define CELL_GCM_TEXTURE_REMAP_FROM_R (1)
|
||||
#define CELL_GCM_TEXTURE_REMAP_FROM_G (2)
|
||||
#define CELL_GCM_TEXTURE_REMAP_FROM_B (3)
|
||||
|
||||
#define CELL_GCM_TEXTURE_REMAP_ZERO (0)
|
||||
#define CELL_GCM_TEXTURE_REMAP_ONE (1)
|
||||
#define CELL_GCM_TEXTURE_REMAP_REMAP (2)
|
||||
|
||||
#define CELL_GCM_MAX_TEXIMAGE_COUNT (16)
|
||||
|
||||
#define CELL_GCM_TEXTURE_WRAP (1)
|
||||
|
||||
#define CELL_GCM_TEXTURE_NR (0x00)
|
||||
#define CELL_GCM_TEXTURE_LN (0x20)
|
||||
|
||||
#define CELL_GCM_TEXTURE_B8 (0x81)
|
||||
|
||||
#define CELL_RESC_720x480 RESC_720x480
|
||||
#define CELL_RESC_720x576 RESC_720x576
|
||||
#define CELL_RESC_1280x720 RESC_1280x720
|
||||
@ -481,7 +506,17 @@
|
||||
#define cellGcmSetTextureFilterInline rsxTextureFilter
|
||||
#define cellGcmSetTextureControlInline rsxTextureControl
|
||||
#define cellGcmSetCullFaceEnableInline rsxSetCullFaceEnable
|
||||
#define cellGcmSetShadeModeInline rxSetShadeModel
|
||||
#define cellGcmSetShadeModeInline rsxSetShadeModel
|
||||
#define cellGcmSetTransferImage rsxSetTransferImage
|
||||
#define cellGcmSetBlendColor rsxSetBlendColor
|
||||
#define cellGcmSetBlendEquation rsxSetBlendEquation
|
||||
#define cellGcmSetBlendFunc rsxSetBlendFunc
|
||||
#define cellGcmSetClearColor rsxSetClearColor
|
||||
#define cellGcmSetScissor rsxSetScissor
|
||||
#define celGcmSetInvalidateVertexCache(fifo) rsxInvalidateTextureCache(fifo, GCM_INVALIDATE_VERTEX_TEXTURE)
|
||||
#else
|
||||
#define cellGcmSetTransferImage cellGcmSetTransferImageInline
|
||||
#define celGcmSetInvalidateVertexCache cellGcmSetInvalidateVertexCacheInline
|
||||
#endif
|
||||
|
||||
/*============================================================
|
||||
@ -498,4 +533,7 @@
|
||||
#define CELL_GCM_METHOD_DATA_TEXTURE_ADDRESS(wraps, wrapt, wrapr, unsignedremap, zfunc, gamma) ((wraps) | ((0) << 4) | ((wrapt) << 8) | (unsignedremap << 12) | ((wrapr) << 16) | (gamma << 20) | (zfunc << 28))
|
||||
#endif
|
||||
|
||||
#define CELL_GCM_REMAP_MODE(order, inputA, inputR, inputG, inputB, outputA, outputR, outputG, outputB) \
|
||||
(((order)<<16)|((inputA))|((inputR)<<2)|((inputG)<<4)|((inputB)<<6)|((outputA)<<8)|((outputR)<<10)|((outputG)<<12)|((outputB)<<14))
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user