• Advertisement
Sign in to follow this  

Problem with shaders and ati video cards

This topic is 3353 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
look in the Cg manual. These values, that are shown in the warnings, should be manually set - by passing them as parameters to the Cg compiler.

Share this post


Link to post
Share on other sites
even the demo programs of "the Cg Tutorial" don't work in the ati computers :S

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
perhaps you can copy paste your piece of code and we can see what's going on... I never had problems using cg or GLSL on my ATI x700.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement