mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
(PS3) Cleaned up RGL code + fixed ifdef error in Salamander
This commit is contained in:
parent
c800df6fd5
commit
bf746281bd
@ -41,6 +41,8 @@ else
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
endif
|
||||
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
DEFINES += -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_THREAD -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OPENGL_TEXREF -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES11 -DHAVE_CG -DHAVE_CG_MENU -DHAVE_FILEBROWSER -DHAVE_HDD_CACHE_PARTITION -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RGL -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
|
@ -34,6 +34,8 @@ else
|
||||
PPU_AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
|
||||
endif
|
||||
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
|
||||
PPU_LDLIBS = -lio_stub
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include <sys/synchronization.h>
|
||||
#endif
|
||||
|
||||
#include "../../../general.h"
|
||||
|
||||
using namespace cell::Gcm;
|
||||
|
||||
#define _RGL_MAX_TILED_REGIONS 15
|
||||
@ -307,7 +309,7 @@ GLboolean _RGLInit( PSGLinitOptions* options, RGLResource *resource )
|
||||
{
|
||||
if ( !_RGLInitFromRM( resource ) )
|
||||
{
|
||||
fprintf( stderr, "PSGL GCM failed initialisation" );
|
||||
RARCH_ERR("RGL GCM failed initialisation.\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@ -318,7 +320,7 @@ GLboolean _RGLInit( PSGLinitOptions* options, RGLResource *resource )
|
||||
resource->hostMemoryBase + resource->hostMemoryReserved,
|
||||
resource->hostMemorySize - resource->hostMemoryReserved ) == GMM_ERROR )
|
||||
{
|
||||
fprintf( stderr, "Could not init GPU memory manager" );
|
||||
RARCH_ERR("Could not initialize GPU memory manager.\n");
|
||||
_RGLDestroy();
|
||||
return GL_FALSE;
|
||||
}
|
||||
@ -405,7 +407,7 @@ const VideoMode *_RGLDetectVideoMode (void)
|
||||
int ret = cellVideoOutGetState( CELL_VIDEO_OUT_PRIMARY, 0, &videoState );
|
||||
if ( ret < 0 )
|
||||
{
|
||||
printf("RGL WARN: couldn't read the video configuration, using a default 720p resolution.\n");
|
||||
RARCH_WARN("Couldn't read the video configuration, using a default 720p resolution.\n");
|
||||
videoState.displayMode.scanMode = CELL_VIDEO_OUT_SCAN_MODE_PROGRESSIVE;
|
||||
videoState.displayMode.resolutionId = CELL_VIDEO_OUT_RESOLUTION_720;
|
||||
}
|
||||
@ -538,15 +540,15 @@ void _RGLGraphicsHandler( const uint32_t head )
|
||||
uint32_t *tmp = ( uint32_t * )(( char* )fifo->dmaPushBufferBegin - fifo->dmaPushBufferOffset + ( *(( volatile GLuint* ) & fifo->dmaControl->Get ) ) );
|
||||
if (( tmp >= fifo->begin ) && ( tmp <= fifo->end ) ) fifo->lastGetRead = tmp;
|
||||
|
||||
printf("RGL: Current PSGL FIFO info \n" );
|
||||
printf("RGL: Fifo Begin %p End %p Current %p and Get %p \n",
|
||||
RARCH_ERR("Current PSGL FIFO info:\n" );
|
||||
RARCH_ERR("FIFO Begin %p End %p Current %p and Get %p \n",
|
||||
_RGLState.fifo.begin, _RGLState.fifo.end, _RGLState.fifo.current,
|
||||
_RGLState.fifo.lastGetRead );
|
||||
|
||||
printf("RGL: Last 10 words of the PSGL Fifo from the ppu put/current position \n" );
|
||||
RARCH_ERR("Last 10 words of the PSGL Fifo from the ppu put/current position \n" );
|
||||
_RGLPrintFifoFromPut( 10 );
|
||||
|
||||
printf("RGL: Last 10 words of the PSGL Fifo from the gpu get position \n" );
|
||||
RARCH_ERR("Last 10 words of the PSGL Fifo from the gpu get position \n" );
|
||||
_RGLPrintFifoFromGet( 10 );
|
||||
}
|
||||
|
||||
@ -565,7 +567,7 @@ static int _RGLInitRM( RGLResource *gcmResource, unsigned int hostMemorySize, in
|
||||
|
||||
if ( cellGcmInit( _RGL_FIFO_SIZE, gcmResource->hostMemorySize, gcmResource->hostMemoryBase ) != 0 )
|
||||
{
|
||||
printf("RGL: RSXIF failed initialization\n" );
|
||||
RARCH_ERR("RSXIF failed initialization.\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@ -595,13 +597,14 @@ static int _RGLInitRM( RGLResource *gcmResource, unsigned int hostMemorySize, in
|
||||
|
||||
gCellGcmCurrentContext->callback = ( CellGcmContextCallback )_RGLOutOfSpaceCallback;
|
||||
|
||||
|
||||
printf( "RGL: MClk: %f Mhz NVClk: %f Mhz\n", ( float )gcmResource->MemoryClock / 1E6, ( float )gcmResource->GraphicsClock / 1E6 );
|
||||
printf( "RGL: Video Memory: %i MB\n", gcmResource->localSize / ( 1024*1024 ) );
|
||||
printf( "RGL: localAddress mapped at %p\n", gcmResource->localAddress );
|
||||
printf( "RGL: push buffer at %p - %p (size = 0x%X), offset=0x%lx\n",
|
||||
gcmResource->dmaPushBuffer, ( char* )gcmResource->dmaPushBuffer + gcmResource->dmaPushBufferSize, gcmResource->dmaPushBufferSize, gcmResource->dmaPushBufferOffset );
|
||||
printf( "RGL: dma control at %p\n", gcmResource->dmaControl );
|
||||
#ifdef LOG_VERBOSE
|
||||
RARCH_LOG("MClk: %f Mhz NVClk: %f Mhz.\n", ( float )gcmResource->MemoryClock / 1E6, ( float )gcmResource->GraphicsClock / 1E6 );
|
||||
RARCH_LOG("Video Memory: %i MB.\n", gcmResource->localSize / ( 1024*1024 ) );
|
||||
RARCH_LOG("Local address mapped at %p.\n", gcmResource->localAddress );
|
||||
RARCH_LOG("Push buffer at %p - %p (size = 0x%X), offset=0x%lx.\n",
|
||||
gcmResource->dmaPushBuffer, ( char* )gcmResource->dmaPushBuffer + gcmResource->dmaPushBufferSize, gcmResource->dmaPushBufferSize, gcmResource->dmaPushBufferOffset );
|
||||
RARCH_LOG("DMA control at %p.\n", gcmResource->dmaControl );
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -621,7 +624,7 @@ void _RGLDeviceInit( PSGLinitOptions* options )
|
||||
|
||||
if ( !_RGLInitRM( &_RGLResource, hostSize, 0, fifoSize ) )
|
||||
{
|
||||
printf("RGL: RM resource failed initialisation\n" );
|
||||
RARCH_ERR("RM resource failed initialization.\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -714,7 +717,9 @@ GLboolean _RGLAllocateColorSurface(
|
||||
*pitchAllocated = 0;
|
||||
}
|
||||
else
|
||||
printf("RGL: Allocating GPU memory (tiled): %d bytes allocated at id 0x%08x.\n", *bytesAllocated, *id );
|
||||
{
|
||||
RARCH_LOG("Allocating GPU memory (tiled): %d bytes allocated at id 0x%08x.\n", *bytesAllocated, *id );
|
||||
}
|
||||
|
||||
return *bytesAllocated > 0;
|
||||
}
|
||||
@ -731,8 +736,7 @@ GLboolean _RGLAllocateColorSurface(
|
||||
|
||||
static void rescInit( const PSGLdeviceParameters* params, RGLDevice *gcmDevice )
|
||||
{
|
||||
printf("RGL WARN: RESC is enabled.\n");
|
||||
GLboolean result = 0;
|
||||
RARCH_WARN("RESC is enabled.\n");
|
||||
|
||||
CellRescBufferMode dstBufferMode;
|
||||
if ( params->width == 720 && params->height == 480 ) dstBufferMode = CELL_RESC_720x480;
|
||||
@ -742,7 +746,7 @@ static void rescInit( const PSGLdeviceParameters* params, RGLDevice *gcmDevice )
|
||||
else
|
||||
{
|
||||
dstBufferMode = CELL_RESC_720x480;
|
||||
printf("RGL: Invalid display resolution for resolution conversion: %ux%u. Defaulting to 720x480...\n", params->width, params->height );
|
||||
RARCH_ERR("Invalid display resolution for resolution conversion: %ux%u. Defaulting to 720x480...\n", params->width, params->height );
|
||||
}
|
||||
|
||||
CellRescInitConfig conf;
|
||||
@ -763,7 +767,7 @@ static void rescInit( const PSGLdeviceParameters* params, RGLDevice *gcmDevice )
|
||||
GLuint colorBuffersPitch;
|
||||
uint32_t numColorBuffers = cellRescGetNumColorBuffers( dstBufferMode, ( CellRescPalTemporalMode )conf.palTemporalMode, 0 );
|
||||
|
||||
result = _RGLAllocateColorSurface( params->width, params->height * numColorBuffers,
|
||||
_RGLAllocateColorSurface( params->width, params->height * numColorBuffers,
|
||||
4*8, &(gcmDevice->RescColorBuffersId), &colorBuffersPitch, &size );
|
||||
|
||||
CellRescDsts dsts = { CELL_RESC_SURFACE_A8R8G8B8, colorBuffersPitch, 1 };
|
||||
@ -814,13 +818,10 @@ static int _RGLPlatformCreateDevice( PSGLdevice* device )
|
||||
jsTiledMemoryManager* mm = &_RGLTiledMemoryManager;
|
||||
|
||||
_RGLDuringDestroyDevice = GL_FALSE;
|
||||
GLboolean result = 0;
|
||||
|
||||
int32_t retVal;
|
||||
|
||||
memset( mm->region, 0, sizeof( mm->region ) );
|
||||
for ( int i = 0;i < _RGL_MAX_TILED_REGIONS;++i )
|
||||
retVal = cellGcmUnbindTile( i );
|
||||
cellGcmUnbindTile( i );
|
||||
|
||||
|
||||
const VideoMode *vm = NULL;
|
||||
@ -873,7 +874,7 @@ static int _RGLPlatformCreateDevice( PSGLdevice* device )
|
||||
gcmDevice->color[i].pool = _RGL_SURFACE_POOL_LINEAR;
|
||||
|
||||
GLuint size;
|
||||
result = _RGLAllocateColorSurface(width, height,
|
||||
_RGLAllocateColorSurface(width, height,
|
||||
gcmDevice->color[i].bpp*8, &gcmDevice->color[i].dataId,
|
||||
&gcmDevice->color[i].pitch, &size );
|
||||
}
|
||||
@ -961,7 +962,7 @@ static int _RGLPlatformCreateDevice( PSGLdevice* device )
|
||||
|
||||
if ( cellRescSetSrc( i, &rescSrc ) != CELL_OK )
|
||||
{
|
||||
printf("RGL: Registering display buffer %d failed\n", i );
|
||||
RARCH_ERR("Registering display buffer %d failed.\n", i );
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -978,7 +979,7 @@ static int _RGLPlatformCreateDevice( PSGLdevice* device )
|
||||
{
|
||||
if ( cellGcmSetDisplayBuffer( i, gmmIdToOffset( gcmDevice->color[i].dataId ), gcmDevice->color[i].pitch , width, height ) != CELL_OK )
|
||||
{
|
||||
printf("RGL: Registering display buffer %d failed\n", i );
|
||||
RARCH_ERR("Registering display buffer %d failed.\n", i );
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -1221,7 +1222,7 @@ GLAPI void psglSwap( void )
|
||||
int32_t res = cellRescSetConvertAndFlip(( uint8_t ) drawBuffer );
|
||||
if ( res != CELL_OK )
|
||||
{
|
||||
printf("RGL WARN: RESC cellRescSetConvertAndFlip returned error code %d.\n", res);
|
||||
RARCH_WARN("RESC cellRescSetConvertAndFlip returned error code %d.\n", res);
|
||||
if ( _CurrentContext ) _CurrentContext->needValidate |= PSGL_VALIDATE_FRAMEBUFFER;
|
||||
return;
|
||||
}
|
||||
@ -1301,7 +1302,6 @@ static inline void _RGLUtilWaitForIdle (void)
|
||||
GLboolean _RGLTryResizeTileRegion( GLuint address, GLuint size, void* data )
|
||||
{
|
||||
jsTiledRegion* region = ( jsTiledRegion* )data;
|
||||
int32_t retVal = 0;
|
||||
|
||||
if ( size == 0 )
|
||||
{
|
||||
@ -1312,7 +1312,7 @@ GLboolean _RGLTryResizeTileRegion( GLuint address, GLuint size, void* data )
|
||||
if ( ! _RGLDuringDestroyDevice )
|
||||
{
|
||||
_RGLUtilWaitForIdle();
|
||||
retVal = cellGcmUnbindTile( region->id );
|
||||
cellGcmUnbindTile( region->id );
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
}
|
||||
return GL_TRUE;
|
||||
@ -1322,11 +1322,11 @@ GLboolean _RGLTryResizeTileRegion( GLuint address, GLuint size, void* data )
|
||||
|
||||
_RGLUtilWaitForIdle();
|
||||
|
||||
retVal = cellGcmSetTileInfo(region->id, CELL_GCM_LOCATION_LOCAL,
|
||||
cellGcmSetTileInfo(region->id, CELL_GCM_LOCATION_LOCAL,
|
||||
region->offset, region->size, region->pitch, CELL_GCM_COMPMODE_DISABLED, 0,
|
||||
region->bank );
|
||||
|
||||
retVal = cellGcmBindTile( region->id );
|
||||
cellGcmBindTile( region->id );
|
||||
|
||||
_RGLFifoFinish( &_RGLState.fifo );
|
||||
|
||||
|
@ -307,24 +307,16 @@ static inline GLuint _RGLMapMinTextureFilter( GLenum filter )
|
||||
{
|
||||
case GL_NEAREST:
|
||||
return CELL_GCM_TEXTURE_NEAREST;
|
||||
break;
|
||||
case GL_LINEAR:
|
||||
return CELL_GCM_TEXTURE_LINEAR;
|
||||
break;
|
||||
case GL_NEAREST_MIPMAP_NEAREST:
|
||||
return CELL_GCM_TEXTURE_NEAREST_NEAREST;
|
||||
break;
|
||||
case GL_NEAREST_MIPMAP_LINEAR:
|
||||
return CELL_GCM_TEXTURE_NEAREST_LINEAR;
|
||||
break;
|
||||
case GL_LINEAR_MIPMAP_NEAREST:
|
||||
return CELL_GCM_TEXTURE_LINEAR_NEAREST;
|
||||
break;
|
||||
case GL_LINEAR_MIPMAP_LINEAR:
|
||||
return CELL_GCM_TEXTURE_LINEAR_LINEAR;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
return filter;
|
||||
}
|
||||
@ -335,12 +327,8 @@ static inline GLuint _RGLMapMagTextureFilter( GLenum filter )
|
||||
{
|
||||
case GL_NEAREST:
|
||||
return CELL_GCM_TEXTURE_NEAREST;
|
||||
break;
|
||||
case GL_LINEAR:
|
||||
return CELL_GCM_TEXTURE_LINEAR;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
return filter;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <cell/sysmodule.h>
|
||||
|
||||
#include "../../../compat/strl.h"
|
||||
#include "../../../general.h"
|
||||
|
||||
#define RGL_ALIGN_FAST_TRANSFER 128
|
||||
|
||||
@ -933,7 +934,7 @@ static GLenum _RGLPlatformFramebufferCheckStatus( jsFramebuffer* framebuffer )
|
||||
{
|
||||
if ( !_RGLTextureIsValid( colorTexture ) )
|
||||
{
|
||||
printf("RGL ERR: Framebuffer color attachment texture is not complete.\n");
|
||||
RARCH_ERR("Framebuffer color attachment texture is not complete.\n");
|
||||
return GL_FRAMEBUFFER_UNSUPPORTED_OES;
|
||||
}
|
||||
|
||||
@ -941,7 +942,7 @@ static GLenum _RGLPlatformFramebufferCheckStatus( jsFramebuffer* framebuffer )
|
||||
|
||||
if ( colorFormat && colorFormat != image[nBuffers]->internalFormat )
|
||||
{
|
||||
printf("RGL ERR: Framebuffer attachments have inconsistent color formats.\n" );
|
||||
RARCH_ERR("Framebuffer attachments have inconsistent color formats.\n" );
|
||||
return GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES;
|
||||
}
|
||||
colorFormat = image[nBuffers]->internalFormat;
|
||||
@ -952,7 +953,7 @@ static GLenum _RGLPlatformFramebufferCheckStatus( jsFramebuffer* framebuffer )
|
||||
|
||||
if ( nBuffers && colorFormat != RGL_ARGB8)
|
||||
{
|
||||
printf("RGL: Color attachment to framebuffer must be a supported drawable format (GL_ARGB_SCE)\n");
|
||||
RARCH_ERR("Color attachment to framebuffer must be a supported drawable format (GL_ARGB_SCE)\n");
|
||||
return GL_FRAMEBUFFER_UNSUPPORTED_OES;
|
||||
}
|
||||
|
||||
@ -4813,7 +4814,7 @@ static GLboolean _RGLPlatformTexturePBOImage(
|
||||
LContext->unpackAlignment );
|
||||
if (( pboPitch&3 ) != 0 )
|
||||
{
|
||||
printf("RGL WARN: PBO image pitch not a multiple of 4, using slow path.\n" );
|
||||
RARCH_WARN("PBO image pitch not a multiple of 4, using slow path.\n" );
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@ -4822,7 +4823,7 @@ static GLboolean _RGLPlatformTexturePBOImage(
|
||||
|
||||
if ( gmmIdToOffset(gpuId)+gpuIdOffset & 63 )
|
||||
{
|
||||
printf("RGL: PBO offset not 64-byte aligned, using slow path.\n");
|
||||
RARCH_WARN("PBO offset not 64-byte aligned, using slow path.\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@ -4850,13 +4851,13 @@ static GLboolean _RGLPlatformTexturePBOImage(
|
||||
|
||||
if ( !formatOK )
|
||||
{
|
||||
printf("RGL: PBO format/type requires conversion to texture internal format, using slow path.\n");
|
||||
RARCH_WARN("PBO format/type requires conversion to texture internal format, using slow path.\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
if ( !_RGLTextureIsValid( texture ) )
|
||||
{
|
||||
printf("RGL: PBO transfering to incomplete texture, using slow path.\n");
|
||||
RARCH_WARN("PBO transfering to incomplete texture, using slow path.\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@ -6083,7 +6084,7 @@ static GLboolean _RGLPlatformNeedsConversion( const jsAttributeState* as, GLuint
|
||||
default:
|
||||
break;
|
||||
}
|
||||
printf("RGL WARN: Attribute %d needs conversion. Slow path ahead.\n", index);
|
||||
RARCH_WARN("Attribute %d needs conversion. Slow path ahead.\n", index);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
@ -7004,7 +7005,7 @@ CG_API CGprogram cgCreateProgram( CGcontext ctx,
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("RGL ERR: The CG runtime compiler hasn't been setup. cgRTCgcInit() should be called prior to this function.\n" );
|
||||
RARCH_ERR("The CG runtime compiler hasn't been setup. cgRTCgcInit() should be called prior to this function.\n" );
|
||||
_RGLCgRaiseError( CG_INVALID_ENUMERANT_ERROR );
|
||||
return NULL;
|
||||
}
|
||||
@ -7026,7 +7027,7 @@ CG_API CGprogram cgCreateProgram( CGcontext ctx,
|
||||
// don't throw the warning if it was source, cause clearly that would have been on purpose.
|
||||
if ( program_type == CG_BINARY )
|
||||
{
|
||||
printf("RGL WARN: A binary shader is being loaded using a deprecated binary format. Please use the cgnv2elf tool to convert to the new, memory-saving, faster-loading format.\n");
|
||||
RARCH_WARN("A binary shader is being loaded using a deprecated binary format. Please use the cgnv2elf tool to convert to the new, memory-saving, faster-loading format.\n");
|
||||
}
|
||||
|
||||
//convert from NV format to the runtime format
|
||||
@ -7048,7 +7049,7 @@ CG_API CGprogram cgCreateProgram( CGcontext ctx,
|
||||
int res = convertNvToElfFromMemory( binaryBuffer, totalSize, 2, 0, ( void** ) & runtimeElfShader, &compiled_program_size, stringTableArray, defaultValuesArray );
|
||||
if ( res != 0 )
|
||||
{
|
||||
printf("RGL ERR: invalid CG binary program.\n");
|
||||
RARCH_ERR("Invalid CG binary program.\n");
|
||||
_RGLCgRaiseError( CG_COMPILER_ERROR );
|
||||
if ( compiled_program )
|
||||
_cgRTCgcFreeCompiledProgramHook( compiled_program );
|
||||
@ -7098,20 +7099,20 @@ CG_API CGprogram cgCreateProgram( CGcontext ctx,
|
||||
CGELFProgram elfProgram;
|
||||
if ((( intptr_t )binaryBuffer ) & 15 )
|
||||
{
|
||||
printf("RGL ERR: CG Binary not aligned on 16 bytes, needed for ucode section.\n");
|
||||
RARCH_ERR("CG Binary not aligned on 16 bytes, needed for ucode section.\n");
|
||||
_RGLCgRaiseError( CG_PROGRAM_LOAD_ERROR );
|
||||
return NULL;
|
||||
}
|
||||
bool res = cgOpenElf( binaryBuffer, 0, &elfBinary );
|
||||
if ( !res )
|
||||
{
|
||||
printf("RGL ERR: not a valid ELF.\n");
|
||||
RARCH_ERR("Not a valid ELF.\n");
|
||||
_RGLCgRaiseError( CG_PROGRAM_LOAD_ERROR );
|
||||
return NULL;
|
||||
}
|
||||
if ( !cgGetElfProgramByName( &elfBinary, entry, &elfProgram ) )
|
||||
{
|
||||
printf("RGL ERR: couldn't find the shader entry in the CG binary.\n");
|
||||
RARCH_ERR("Couldn't find the shader entry in the CG binary.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -7227,7 +7228,7 @@ CG_API CGprogram cgCreateProgramFromFile( CGcontext ctx,
|
||||
int index = _RGLCgGetProgramIndex( group, entry );
|
||||
if ( index == -1 )
|
||||
{
|
||||
printf("RGL ERR: couldn't find the shader entry in the CG binary.\n");
|
||||
RARCH_ERR("Couldn't find the shader entry in the CG binary.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -7691,39 +7692,26 @@ CG_API CGprofile cgGetProfile( const char* profile_string )
|
||||
return CG_PROFILE_UNKNOWN;
|
||||
}
|
||||
|
||||
CG_API CGerror cgGetError( void )
|
||||
CG_API CGerror cgGetError(void)
|
||||
{
|
||||
CGerror err = _CurrentContext->RGLcgLastError;
|
||||
_CurrentContext->RGLcgLastError = CG_NO_ERROR;
|
||||
return err;
|
||||
CGerror err = _CurrentContext->RGLcgLastError;
|
||||
_CurrentContext->RGLcgLastError = CG_NO_ERROR;
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
CG_API const char* cgGetErrorString( CGerror error )
|
||||
{
|
||||
return "cgGetErrorString: N/A\n";
|
||||
}
|
||||
|
||||
CG_API const char* cgGetLastErrorString( CGerror* error )
|
||||
{
|
||||
return "cgGetErrorString: N/A\n";
|
||||
}
|
||||
|
||||
CG_API void cgSetErrorCallback( CGerrorCallbackFunc func )
|
||||
{
|
||||
_CurrentContext->RGLcgErrorCallbackFunction = func;
|
||||
}
|
||||
|
||||
|
||||
CG_API CGerrorCallbackFunc cgGetErrorCallback( void )
|
||||
{
|
||||
return _CurrentContext->RGLcgErrorCallbackFunction;
|
||||
static char strbuf[256];
|
||||
snprintf(strbuf, sizeof(strbuf), "%d", error);
|
||||
return strbuf;
|
||||
}
|
||||
|
||||
void _RGLCgDestroyContextParam( CgRuntimeParameter* ptr )
|
||||
{
|
||||
if ( _cgParameterDestroyHook ) _cgParameterDestroyHook( ptr );
|
||||
_RGLEraseName( &_CurrentContext->cgParameterNameSpace, ( jsName )( ptr->id ) );
|
||||
free( ptr );
|
||||
if ( _cgParameterDestroyHook ) _cgParameterDestroyHook( ptr );
|
||||
_RGLEraseName( &_CurrentContext->cgParameterNameSpace, ( jsName )( ptr->id ) );
|
||||
free( ptr );
|
||||
}
|
||||
|
||||
static int _RGLGetSizeofSubArray( const short *dimensions, int count )
|
||||
@ -8400,8 +8388,7 @@ void _RGLCgRaiseError( CGerror error )
|
||||
{
|
||||
_CurrentContext->RGLcgLastError = error;
|
||||
|
||||
|
||||
printf("RGL: Cg error:%s.\n", cgGetErrorString( error ) );
|
||||
RARCH_ERR("Cg error: %d.\n", error);
|
||||
|
||||
if ( _CurrentContext->RGLcgErrorCallbackFunction )
|
||||
_CurrentContext->RGLcgErrorCallbackFunction();
|
||||
|
@ -620,26 +620,10 @@ typedef struct
|
||||
#pragma warning ( pop )
|
||||
#endif
|
||||
|
||||
#ifndef MSVC
|
||||
#define MAX(A,B) ({ \
|
||||
__typeof__(A) At=(A); \
|
||||
__typeof__(B) Bt=(B); \
|
||||
At>Bt?At:Bt; })
|
||||
|
||||
#define MIN(A,B) ({ \
|
||||
__typeof__(A) At=(A); \
|
||||
__typeof__(B) Bt=(B); \
|
||||
At<Bt?At:Bt; })
|
||||
|
||||
#define RGL_LIKELY(COND) __builtin_expect((COND),1)
|
||||
#define RGL_UNLIKELY(COND) __builtin_expect((COND),0)
|
||||
|
||||
#else
|
||||
#define MAX(A,B) ((A)>(B)?(A):(B))
|
||||
#define MIN(A,B) ((A)<(B)?(A):(B))
|
||||
#define RGL_LIKELY(COND) (COND)
|
||||
#define RGL_UNLIKELY(COND) (COND)
|
||||
#endif
|
||||
|
||||
#define _RGL_ALLOC_FIRST_FIT 0
|
||||
#define _RGL_ALLOC_BEST_FIT 1
|
||||
|
@ -1,10 +1,6 @@
|
||||
// vector standard header
|
||||
|
||||
#ifndef _VECTOR_
|
||||
#define _VECTOR_
|
||||
|
||||
#define RGL_STD_VECTOR
|
||||
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
||||
|
@ -171,7 +171,7 @@ static void init_settings(void)
|
||||
char core_executable[1024];
|
||||
#if defined(_XBOX360)
|
||||
snprintf(core_executable, sizeof(core_executable), "game:\\CORE.xex");
|
||||
#if defined(_XBOX1)
|
||||
#elif defined(_XBOX1)
|
||||
snprintf(core_executable, sizeof(core_executable), "D:\\CORE.xbe");
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
snprintf(core_executable, sizeof(core_executable), "%s/CORE.SELF", LIBRETRO_DIR_PATH);
|
||||
|
Loading…
x
Reference in New Issue
Block a user