summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-07-02 09:16:10 -0600
committerBrian Paul <[email protected]>2008-07-02 09:16:10 -0600
commit6befdca6a3d65d7e49c0c54a7a8f091cd05034ea (patch)
tree05717b2529352869b45baeef060e7e56aad78fae
parent43346fb1fb43f91cb3e90d84b442dc08d6c9550d (diff)
generate a link error if the vertex shader references too many textures
-rw-r--r--src/mesa/shader/slang/slang_link.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index dd4990ba023..f9a5ecef96c 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -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 */