summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i915simple/i915_state_sampler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/i915simple/i915_state_sampler.c')
-rw-r--r--src/gallium/drivers/i915simple/i915_state_sampler.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/i915simple/i915_state_sampler.c b/src/gallium/drivers/i915simple/i915_state_sampler.c
index 9c1a5bbbd6..9dbb1b1b23 100644
--- a/src/gallium/drivers/i915simple/i915_state_sampler.c
+++ b/src/gallium/drivers/i915simple/i915_state_sampler.c
@@ -106,7 +106,8 @@ void i915_update_samplers( struct i915_context *i915 )
i915->current.sampler_enable_nr = 0;
i915->current.sampler_enable_flags = 0x0;
- for (unit = 0; unit < I915_TEX_UNITS; unit++) {
+ for (unit = 0; unit < i915->num_textures && unit < i915->num_samplers;
+ unit++) {
/* determine unit enable/disable by looking for a bound texture */
/* could also examine the fragment program? */
if (i915->texture[unit]) {
@@ -219,7 +220,8 @@ i915_update_textures(struct i915_context *i915)
{
uint unit;
- for (unit = 0; unit < I915_TEX_UNITS; unit++) {
+ for (unit = 0; unit < i915->num_textures && unit < i915->num_samplers;
+ unit++) {
/* determine unit enable/disable by looking for a bound texture */
/* could also examine the fragment program? */
if (i915->texture[unit]) {