Sign in to follow this  
zoser

Problem with shaders and ati video cards

Recommended Posts

my shaders work perfect on nvidia gpu, i tested in a 8800gt, 8500 and 8600gt but the shaders don't work on ati video cards... i tested on glsl and cg but the fragment program never compile i tested 3 ati video cards with the same results i don't know the models but they run crysis and the lastest games. the cg program throw this: ZoserProgramTest: 10: CG ERROR : The compile returned an error. (0) : warning C6502: Profile option 'NumInstructionSlots' value (-1) too small; clamped to 0 (0) : warning C6502: Profile option 'NumTexInstructionSlots' value (-1) too small; clamped to 0 (0) : warning C6502: Profile option 'NumMathInstructionSlots' value (-1) too small; clamped to 0 (0) : warning C6503: Profile option 'MaxDrawBuffers' value (8) too large; clamped to 4 (0) : warning C6502: Profile option 'NumInstructionSlots' value (-1) too small; clamped to 0 (0) : warning C6502: Profile option 'NumTexInstructionSlots' value (-1) too small; clamped to 0 (0) : warning C6502: Profile option 'NumMathInstructionSlots' value (-1) too small; clamped to 0 (0) : warning C6503: Profile option 'MaxDrawBuffers' value (8) too large; clamped to 4 (0) : error C6002: Instruction limit of 0 exceeded; 5 instructions needed to compile program i don't know what to do... any idea? thanks pd: sorry for my english..

Share this post


Link to post
Share on other sites
nVidia and ATi like making their tutes not working on the competition's products :).
But Cg can be compiled to ARB asm (limited SM2.0 shader features) once you stop using nVidia-specific stuff.


Here is some code, that contains the params to Cg and cgc.exe for ARB compilation:


static const char* cgExe = "C:\\nVidiaCG\\bin\\cgc.exe";
static const char* cgProfiles[3]={null,null,null};
static const char* cgOpts = "-nowarn=7011,7503,7506,7529";
static const char* cgPathFormat= "%s -quiet -oglsl -profile %s %s %s -DIS_FRAGMENT=%d -DIS_VERTEX=%d -DIS_GEOMETRY=%d %s";

static ILXFILER CurCompilerFiler={uffetch,ufdump,ufGetDate,ufSetDate};

void ILX_SetCompilerProfile(ILXCOMPILER_PROFILE profileID){
switch(profileID){
case ILXCOMPILERPROFILE_ARB:
cgProfiles[0]="arbfp1 -profileopts MaxDrawBuffers=4,NumTemps=32,MaxTexIndirections=4,MaxLocalParams=224";
cgProfiles[1]="arbvp1";
cgProfiles[2]=0;
break;
case ILXCOMPILERPROFILE_NV30:
cgProfiles[0]="fp30";
cgProfiles[1]="vp30";
cgProfiles[2]=0;
break;
case ILXCOMPILERPROFILE_NV40:
cgProfiles[0]="fp40";
cgProfiles[1]="vp40";
cgProfiles[2]=0;
break;
case ILXCOMPILERPROFILE_GP4:
cgProfiles[0]="gp4fp";
cgProfiles[1]="gp4vp";
cgProfiles[2]="gp4gp";
break;
}
}





//note: ShaderArgOpts="";
usprintf(CommandLine,cgPathFormat,cgExe,cgProfiles[ShaderType],ShaderArgOpts,cgOpts,ShaderType==0,ShaderType==1,ShaderType==2,FileName);
char* asmcode = ExecuteCommandLine(CommandLine);

Share this post


Link to post
Share on other sites
Quote:
Original post by idinev
nVidia and ATi like making their tutes not working on the competition's products :).


If that`s the case, then just code your shaders with GLSL.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this