diff options
author | Brian Paul <brianp@vmware.com> | 2009-01-02 16:54:11 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-01-02 16:54:11 -0700 |
commit | d917ad5dbd17f2399a5a3590fe6c06a64d683771 (patch) | |
tree | eebd014fbf529c275770a38d62ed2c0065bdd81b /src | |
parent | 84cffc2e7fbeab8ed5dfb0b6b8d3829e0654ab02 (diff) |
gallium: assorted state tracker fixes for > 8 texture samplers
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 8 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_mesa_to_tgsi.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_mesa_to_tgsi.h | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 6 |
5 files changed, 13 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index 18ffc08c6b..21f7321f97 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -53,7 +53,7 @@ update_textures(struct st_context *st) st->state.num_textures = 0; /* loop over sampler units (aka tex image units) */ - for (su = 0; su < st->ctx->Const.MaxTextureCoordUnits; su++) { + for (su = 0; su < st->ctx->Const.MaxTextureImageUnits; su++) { struct pipe_texture *pt = NULL; if (samplersUsed & (1 << su)) { diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 33421149b0..7023659c17 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -84,9 +84,7 @@ void st_init_limits(struct st_context *st) c->MaxTextureRectSize = _min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE); - c->MaxTextureUnits - = c->MaxTextureImageUnits - = c->MaxTextureCoordUnits + c->MaxTextureImageUnits = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS), MAX_TEXTURE_IMAGE_UNITS); @@ -94,6 +92,10 @@ void st_init_limits(struct st_context *st) = _min(screen->get_param(screen, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS), MAX_VERTEX_TEXTURE_IMAGE_UNITS); + c->MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS; + + c->MaxTextureUnits = MIN2(c->MaxTextureImageUnits, c->MaxTextureCoordUnits); + c->MaxDrawBuffers = _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS), 1, MAX_DRAW_BUFFERS); diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index ce8b441194..5b5707fa1c 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -745,6 +745,7 @@ find_temporaries(const struct gl_program *program, */ GLuint st_translate_mesa_program( + GLcontext *ctx, uint procType, const struct gl_program *program, GLuint numInputs, @@ -992,7 +993,7 @@ st_translate_mesa_program( } /* texture samplers */ - for (i = 0; i < 8; i++) { + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { if (program->SamplersUsed & (1 << i)) { struct tgsi_full_declaration fulldecl; diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.h b/src/mesa/state_tracker/st_mesa_to_tgsi.h index 7b2bee1ab7..b465b3bddc 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.h +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.h @@ -41,6 +41,7 @@ struct gl_program; GLuint st_translate_mesa_program( + GLcontext *ctx, uint procType, const struct gl_program *program, GLuint numInputs, diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index cf4b39cee4..442eeed147 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -317,7 +317,8 @@ st_translate_vertex_program(struct st_context *st, /* XXX: fix static allocation of tokens: */ - num_tokens = st_translate_mesa_program(TGSI_PROCESSOR_VERTEX, + num_tokens = st_translate_mesa_program(st->ctx, + TGSI_PROCESSOR_VERTEX, &stvp->Base.Base, /* inputs */ vs_num_inputs, @@ -503,7 +504,8 @@ st_translate_fragment_program(struct st_context *st, /* XXX: fix static allocation of tokens: */ - num_tokens = st_translate_mesa_program(TGSI_PROCESSOR_FRAGMENT, + num_tokens = st_translate_mesa_program(st->ctx, + TGSI_PROCESSOR_FRAGMENT, &stfp->Base.Base, /* inputs */ fs_num_inputs, |