generate a link error if the vertex shader references too many textures

This commit is contained in:
Brian Paul 2008-07-02 09:16:10 -06:00
parent 43346fb1fb
commit 6befdca6a3

View file

@ -474,6 +474,12 @@ _slang_link(GLcontext *ctx,
}
}
/* Check that the vertex program doesn't use too many sampler units */
if (shProg->VertexProgram &&
_mesa_bitcount(shProg->VertexProgram->Base.SamplersUsed) > ctx->Const.MaxVertexTextureImageUnits) {
link_error(shProg, "Vertex program uses too many samplers.\n");
return;
}
if (fragProg && shProg->FragmentProgram) {
/* notify driver that a new fragment program has been compiled/linked */