diff options
author | Dave Airlie <[email protected]> | 2010-09-10 22:41:00 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2010-09-10 22:41:00 +1000 |
commit | fcae8ca57512f84c51b7445456aab7ec92a21254 (patch) | |
tree | 238b9b1af10697b14c721f65c6e756969954a277 /src/gallium/winsys/r600/drm/radeon_ctx.c | |
parent | f61b241ebabf2d8db9b96f7860afe79bec980df7 (diff) |
r600g: fixup state calculations for picking states.
for evergreen I ended up using a non-contig array of states, but
this code needs a bit of fixing up to deal with that.
Diffstat (limited to 'src/gallium/winsys/r600/drm/radeon_ctx.c')
-rw-r--r-- | src/gallium/winsys/r600/drm/radeon_ctx.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/gallium/winsys/r600/drm/radeon_ctx.c b/src/gallium/winsys/r600/drm/radeon_ctx.c index 5d9cdca112e..bd0916aeb0b 100644 --- a/src/gallium/winsys/r600/drm/radeon_ctx.c +++ b/src/gallium/winsys/r600/drm/radeon_ctx.c @@ -259,25 +259,24 @@ int radeon_ctx_set_draw(struct radeon_ctx *ctx, struct radeon_draw *draw) { unsigned previous_cdwords; int r = 0; + int i; - for (int i = 0; i < (ctx->radeon->nstate_per_shader * R600_SHADER_MAX); i++) { + for (i = 0; i < ctx->radeon->max_states; i++) { r = radeon_ctx_state_bo(ctx, draw->state[i]); if (r) return r; } previous_cdwords = ctx->cdwords; - for (int i = 0, id = 0; i < ctx->radeon->nstate_per_shader; i++) { - for (int j = 0; j < R600_SHADER_MAX; j++) { - id = j * ctx->radeon->nstate_per_shader + i; - if (draw->state[id]) { - r = radeon_ctx_state_schedule(ctx, draw->state[id]); - if (r) { - ctx->cdwords = previous_cdwords; - return r; - } + for (i = 0; i < ctx->radeon->max_states; i++) { + if (draw->state[i]) { + r = radeon_ctx_state_schedule(ctx, draw->state[i]); + if (r) { + ctx->cdwords = previous_cdwords; + return r; } } } + return 0; } |