mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
(RGL PS3) Slim down Cg implementation
This commit is contained in:
parent
949e2c3cae
commit
a3692f8854
@ -83,8 +83,6 @@ struct _CGprogram
|
||||
unsigned int * samplerIndices;
|
||||
unsigned int * samplerUnits;
|
||||
|
||||
unsigned int controlFlowBools;
|
||||
|
||||
//binary format additions
|
||||
//info previously contained in platformProgram ( loadAddress + nvBinary )
|
||||
CgProgramHeader header;
|
||||
@ -150,9 +148,6 @@ typedef struct _CGcontext
|
||||
|
||||
CGenum compileType; // compile manual, immediate or lazy (unused so far)
|
||||
|
||||
unsigned int controlFlowBoolsSharedMask;
|
||||
unsigned int controlFlowBoolsShared;
|
||||
|
||||
// default program, fake owner of the context parameters
|
||||
_CGprogram defaultProgram;
|
||||
|
||||
@ -170,16 +165,13 @@ RGL_EXPORT void rglCgRaiseError( CGerror error );
|
||||
// interface between object types
|
||||
extern void rglCgProgramDestroyAll( _CGcontext* c );
|
||||
extern void rglCgDestroyContextParam( CgRuntimeParameter* p );
|
||||
RGL_EXPORT CgRuntimeParameter*rglCgCreateParameterInternal( _CGprogram *program, const char* name, CGtype type );
|
||||
RGL_EXPORT void rglCgProgramErase( _CGprogram* prog );
|
||||
|
||||
// default setters
|
||||
void _cgRaiseInvalidParam( void *data, const void*v );
|
||||
void _cgRaiseNotMatrixParam( void *data, const void*v );
|
||||
void _cgIgnoreSetParam( void *dat, const void*v );
|
||||
void _cgRaiseInvalidParamIndex( void *dat, const void*v, const int index );
|
||||
void _cgRaiseNotMatrixParamIndex( void *dat, const void*v, const int index );
|
||||
void _cgIgnoreSetParamIndex( void *dat, const void*v, const int index );
|
||||
void _cgIgnoreParamIndex( void *dat, const void*v, const int index );
|
||||
|
||||
// cg helpers
|
||||
|
||||
@ -212,7 +204,6 @@ static inline bool isSampler (CGtype type)
|
||||
|
||||
|
||||
unsigned int rglCountFloatsInCgType( CGtype type );
|
||||
CGbool _cgMatrixDimensions( CGtype type, unsigned int* nrows, unsigned int* ncols );
|
||||
|
||||
unsigned int rglGetTypeRowCount( CGtype parameterType );
|
||||
unsigned int rglGetTypeColCount( CGtype parameterType );
|
||||
@ -314,9 +305,8 @@ void rglPlatformSetFragmentRegisterBlock (unsigned int reg, unsigned int count,
|
||||
void rglPlatformSetBoolVertexRegisters (unsigned int values );
|
||||
|
||||
// names API
|
||||
RGL_EXPORT unsigned int _cgHashString (const char *str);
|
||||
|
||||
inline static void _pullConnectedParameterValues (void *data)
|
||||
static inline void _pullConnectedParameterValues (void *data)
|
||||
{
|
||||
_CGprogram *ptr = (_CGprogram*)data;
|
||||
// we now use a pull method to get the data into the children parameters
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -770,15 +770,12 @@ void rglCreatePushBuffer(void *data)
|
||||
if ( containerEntry == NULL )
|
||||
containerEntry = parameterEntry;
|
||||
|
||||
//rtParameter->setter = _cgRaiseInvalidParam;
|
||||
//rtParameter->setterr = _cgRaiseNotMatrixParam;
|
||||
//rtParameter->setterc = _cgRaiseNotMatrixParam;
|
||||
rtParameter->samplerSetter = _cgRaiseInvalidParamIndex;
|
||||
rtParameter->samplerSetter = _cgIgnoreParamIndex;
|
||||
|
||||
//tentative
|
||||
rtParameter->setterIndex = _cgRaiseInvalidParamIndex;
|
||||
rtParameter->setterrIndex = _cgRaiseNotMatrixParamIndex;
|
||||
rtParameter->settercIndex = _cgRaiseNotMatrixParamIndex;
|
||||
rtParameter->setterIndex = _cgIgnoreParamIndex;
|
||||
rtParameter->setterrIndex = _cgIgnoreParamIndex;
|
||||
rtParameter->settercIndex = _cgIgnoreParamIndex;
|
||||
|
||||
CGparameter id = ( CGparameter )rglCreateName( &_CurrentContext->cgParameterNameSpace, ( void* )rtParameter );
|
||||
if ( !id )
|
||||
@ -833,7 +830,7 @@ void rglCreatePushBuffer(void *data)
|
||||
// the parameters should have a "validate" function instead
|
||||
if ( profileIndex == VERTEX_PROFILE_INDEX )
|
||||
{
|
||||
rtParameter->setterIndex = _cgIgnoreSetParamIndex;
|
||||
rtParameter->setterIndex = _cgIgnoreParamIndex;
|
||||
rtParameter->samplerSetter = setSamplervp;
|
||||
}
|
||||
else
|
||||
@ -1001,17 +998,17 @@ void rglCreatePushBuffer(void *data)
|
||||
{
|
||||
case CG_FLOAT:
|
||||
case CG_FLOAT1: case CG_FLOAT2: case CG_FLOAT3: case CG_FLOAT4:
|
||||
rtParameter->setterIndex = _cgIgnoreSetParamIndex;
|
||||
rtParameter->setterIndex = _cgIgnoreParamIndex;
|
||||
break;
|
||||
case CG_FLOAT1x1: case CG_FLOAT1x2: case CG_FLOAT1x3: case CG_FLOAT1x4:
|
||||
case CG_FLOAT2x1: case CG_FLOAT2x2: case CG_FLOAT2x3: case CG_FLOAT2x4:
|
||||
case CG_FLOAT3x1: case CG_FLOAT3x2: case CG_FLOAT3x3: case CG_FLOAT3x4:
|
||||
case CG_FLOAT4x1: case CG_FLOAT4x2: case CG_FLOAT4x3: case CG_FLOAT4x4:
|
||||
rtParameter->setterrIndex = _cgIgnoreSetParamIndex;
|
||||
rtParameter->settercIndex = _cgIgnoreSetParamIndex;
|
||||
rtParameter->setterrIndex = _cgIgnoreParamIndex;
|
||||
rtParameter->settercIndex = _cgIgnoreParamIndex;
|
||||
break;
|
||||
case CG_SAMPLER1D: case CG_SAMPLER2D: case CG_SAMPLER3D: case CG_SAMPLERRECT: case CG_SAMPLERCUBE:
|
||||
rtParameter->samplerSetter = _cgIgnoreSetParamIndex;
|
||||
rtParameter->samplerSetter = _cgIgnoreParamIndex;
|
||||
break;
|
||||
case CGP_SCF_BOOL:
|
||||
break;
|
||||
@ -1023,7 +1020,7 @@ void rglCreatePushBuffer(void *data)
|
||||
case CG_BOOL1: case CG_BOOL2: case CG_BOOL3: case CG_BOOL4:
|
||||
case CG_FIXED:
|
||||
case CG_FIXED1: case CG_FIXED2: case CG_FIXED3: case CG_FIXED4:
|
||||
rtParameter->setterIndex = _cgIgnoreSetParamIndex;
|
||||
rtParameter->setterIndex = _cgIgnoreParamIndex;
|
||||
break;
|
||||
case CG_HALF1x1: case CG_HALF1x2: case CG_HALF1x3: case CG_HALF1x4:
|
||||
case CG_HALF2x1: case CG_HALF2x2: case CG_HALF2x3: case CG_HALF2x4:
|
||||
@ -1041,8 +1038,8 @@ void rglCreatePushBuffer(void *data)
|
||||
case CG_FIXED2x1: case CG_FIXED2x2: case CG_FIXED2x3: case CG_FIXED2x4:
|
||||
case CG_FIXED3x1: case CG_FIXED3x2: case CG_FIXED3x3: case CG_FIXED3x4:
|
||||
case CG_FIXED4x1: case CG_FIXED4x2: case CG_FIXED4x3: case CG_FIXED4x4:
|
||||
rtParameter->setterrIndex = _cgIgnoreSetParamIndex;
|
||||
rtParameter->settercIndex = _cgIgnoreSetParamIndex;
|
||||
rtParameter->setterrIndex = _cgIgnoreParamIndex;
|
||||
rtParameter->settercIndex = _cgIgnoreParamIndex;
|
||||
break;
|
||||
// addition to be compatible with cgc 2.0
|
||||
case CG_STRING:
|
||||
|
Loading…
x
Reference in New Issue
Block a user