summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_link.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2008-12-31 11:54:02 -0700
committerBrian Paul <brianp@vmware.com>2008-12-31 12:00:17 -0700
commite9b34885b8ff2ccb67a801cd1ce07e0df1b0e397 (patch)
tree588afee46d734cba7e002fdc01cfc588a999f52e /src/mesa/shader/slang/slang_link.c
parentbfebeffc0045266d354a36968336337e099a9f27 (diff)
mesa: increase max texture image units and GLSL samplers to 16
The max texture coord units is still 8. All the fixed-function paths are still limited to 8 too. But GLSL shaders can use more samplers now. Note that some texcoord-related data structures are declared to be 16 elements in size rather than 8. This just simplifies the code in a few places; the extra elements aren't accessible to the user. These changes haven't been extensively tested yet, but sanity checking has been done. It should be possible to increase the max image units/samplers to 32 without doing anything special. Beyond that we'll need longer bitfields in a few places.
Diffstat (limited to 'src/mesa/shader/slang/slang_link.c')
-rw-r--r--src/mesa/shader/slang/slang_link.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 22ae635b06..b49fd0e99d 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -208,7 +208,8 @@ link_varying_vars(struct gl_shader_program *shProg, struct gl_program *prog)
* the vertex and fragment shaders.
*/
static GLboolean
-link_uniform_vars(struct gl_shader_program *shProg,
+link_uniform_vars(GLcontext *ctx,
+ struct gl_shader_program *shProg,
struct gl_program *prog,
GLuint *numSamplers)
{
@@ -239,10 +240,10 @@ link_uniform_vars(struct gl_shader_program *shProg,
/* Allocate a new sampler index */
GLuint sampNum = *numSamplers;
GLuint oldSampNum = (GLuint) prog->Parameters->ParameterValues[i][0];
- if (oldSampNum >= MAX_SAMPLERS) {
+ if (oldSampNum >= ctx->Const.MaxTextureImageUnits) {
char s[100];
sprintf(s, "Too many texture samplers (%u, max is %u)",
- oldSampNum + 1, MAX_SAMPLERS);
+ oldSampNum + 1, ctx->Const.MaxTextureImageUnits);
link_error(shProg, s);
return GL_FALSE;
}
@@ -568,13 +569,13 @@ _slang_link(GLcontext *ctx,
/* link uniform vars */
if (shProg->VertexProgram) {
- if (!link_uniform_vars(shProg, &shProg->VertexProgram->Base,
+ if (!link_uniform_vars(ctx, shProg, &shProg->VertexProgram->Base,
&numSamplers)) {
return;
}
}
if (shProg->FragmentProgram) {
- if (!link_uniform_vars(shProg, &shProg->FragmentProgram->Base,
+ if (!link_uniform_vars(ctx, shProg, &shProg->FragmentProgram->Base,
&numSamplers)) {
return;
}