GET_CURRENT_CONTEXT(ctx);
GLboolean success;
slang_emit_info emitInfo;
+ GLuint maxUniforms;
emitInfo.log = log;
emitInfo.vt = vt;
emitInfo.EmitHighLevelInstructions = GL_TRUE;
}
+ /* Check uniform/constant limits */
+ if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) {
+ maxUniforms = ctx->Const.FragmentProgram.MaxUniformComponents / 4;
+ }
+ else {
+ assert(prog->Target == GL_VERTEX_PROGRAM_ARB);
+ maxUniforms = ctx->Const.VertexProgram.MaxUniformComponents / 4;
+ }
+ if (prog->Parameters->NumParameters > maxUniforms) {
+ slang_info_log_error(log, "Constant/uniform register limit exceeded");
+ return GL_FALSE;
+ }
+
(void) emit(&emitInfo, n);
/* finish up by adding the END opcode to program */