aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/r600/drm/radeon_ctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/r600/drm/radeon_ctx.c')
-rw-r--r--src/gallium/winsys/r600/drm/radeon_ctx.c19
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;
}