Originally posted by Hekus:
[b]Sorry for my english =).
I have CG shader and when i compile it with ABR_VP1 profile there is about 124 instructions.
When i use same shader in glsl, linker return " available number of ALU instructions exceeded"
How can i know number of instructions in glsl shader.
Where i can look max number of instructon or other max parameter than i can use in glsl
GPU: ATI Raderon 9800[/b]
every card has its own max number of instruction, texture indications etc.
check out the sgi opengl specifications for more information on how to look up the cards limits:
void GetProgramivARB(enum target, enum pname, int *params);
obtains program state for the program target <target>, writing the
state into the array given by <params>. GetProgramivARB can be used
to determine the properties of the currently bound program object or
implementation limits for <target>.
If <pname> is PROGRAM_LENGTH_ARB, PROGRAM_FORMAT_ARB, or
PROGRAM_BINDING_ARB, GetProgramivARB returns one integer holding the
program string length (in bytes), program string format, and program
name, respectively, for the program object currently bound to
<target>.
If <pname> is MAX_PROGRAM_LOCAL_PARAMETERS_ARB or
MAX_PROGRAM_ENV_PARAMETERS_ARB, GetProgramivARB returns one integer
holding the maximum number of program local parameters or program
environment parameters, respectively, supported for the program
target <target>.
If <pname> is MAX_PROGRAM_INSTRUCTIONS_ARB,
MAX_PROGRAM_ALU_INSTRUCTIONS_ARB, MAX_PROGRAM_TEX_INSTRUCTIONS_ARB,
MAX_PROGRAM_TEX_INDIRECTIONS_ARB, MAX_PROGRAM_TEMPORARIES_ARB,
MAX_PROGRAM_PARAMETERS_ARB, or MAX_PROGRAM_ATTRIBS_ARB,
GetProgramivARB returns a single integer giving the maximum number
of total instructions, ALU instructions, texture instructions,
texture indirections, temporaries, parameters, and attributes that
can be used by a program of type <target>. If <pname> is
PROGRAM_INSTRUCTIONS_ARB, PROGRAM_ALU_INSTRUCTIONS_ARB,
PROGRAM_TEX_INSTRUCTIONS_ARB, PROGRAM_TEX_INDIRECTIONS_ARB,
PROGRAM_TEMPORARIES_ARB, PROGRAM_PARAMETERS_ARB, or
PROGRAM_ATTRIBS_ARB, GetProgramivARB returns a single integer giving
the number of total instructions, ALU instructions, texture
instructions, texture indirections, temporaries, parameters, and
attributes used by the current program for <target>.
If <pname> is MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB,
MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB,
MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB,
MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB,
MAX_PROGRAM_NATIVE_TEMPORARIES_ARB,
MAX_PROGRAM_NATIVE_PARAMETERS_ARB, or
MAX_PROGRAM_NATIVE_ATTRIBS_ARB, GetProgramivARB returns a single
integer giving the maximum number of native instruction, ALU
instruction, texture instruction, texture indirection, temporary,
parameter, and attribute resources available to a program of type
<target>. If <pname> is PROGRAM_NATIVE_INSTRUCTIONS_ARB,
PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB,
PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB,
PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB,
PROGRAM_NATIVE_TEMPORARIES_ARB, PROGRAM_NATIVE_PARAMETERS_ARB, or
PROGRAM_NATIVE_ATTRIBS_ARB, GetProgramivARB returns a single integer
giving the number of native instruction, ALU instruction, texture
instruction, texture indirection, temporary, parameter, and
attribute resources consumed by the program currently bound to
<target>. Native resource counts will reflect the results of
implementation-dependent scheduling and optimization algorithms
applied by the GL, as well as emulation of non-native features. If
<pname> is PROGRAM_UNDER_NATIVE_LIMITS_ARB, GetProgramivARB returns
0 if the native resource consumption of the program currently bound
to <target> exceeds the number of available resources for any
resource type, and 1 otherwise.
http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_program.txt