aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/nine')
-rw-r--r--src/gallium/state_trackers/nine/device9.c4
-rw-r--r--src/gallium/state_trackers/nine/device9ex.c2
-rw-r--r--src/gallium/state_trackers/nine/nine_state.c22
-rw-r--r--src/gallium/state_trackers/nine/nine_state.h2
-rw-r--r--src/gallium/state_trackers/nine/stateblock9.c14
5 files changed, 28 insertions, 16 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 0b1fe59cb70..f165f24ee46 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -531,7 +531,7 @@ NineDevice9_dtor( struct NineDevice9 *This )
nine_ff_fini(This);
nine_state_destroy_sw(This);
- nine_state_clear(&This->state, TRUE);
+ nine_device_state_clear(This);
nine_context_clear(This);
nine_bind(&This->record, NULL);
@@ -907,7 +907,7 @@ NineDevice9_Reset( struct NineDevice9 *This,
}
nine_csmt_process(This);
- nine_state_clear(&This->state, TRUE);
+ nine_device_state_clear(This);
nine_context_clear(This);
NineDevice9_SetDefaultState(This, TRUE);
diff --git a/src/gallium/state_trackers/nine/device9ex.c b/src/gallium/state_trackers/nine/device9ex.c
index 2853a813baa..3047657e95f 100644
--- a/src/gallium/state_trackers/nine/device9ex.c
+++ b/src/gallium/state_trackers/nine/device9ex.c
@@ -258,7 +258,7 @@ NineDevice9Ex_Reset( struct NineDevice9Ex *This,
}
nine_csmt_process(&This->base);
- nine_state_clear(&This->base.state, TRUE);
+ nine_device_state_clear((struct NineDevice9 *)This);
nine_context_clear(&This->base);
NineDevice9_SetDefaultState((struct NineDevice9 *)This, TRUE);
diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c
index 939acb77cb3..21d51c9715d 100644
--- a/src/gallium/state_trackers/nine/nine_state.c
+++ b/src/gallium/state_trackers/nine/nine_state.c
@@ -2790,8 +2790,9 @@ nine_state_set_defaults(struct NineDevice9 *device, const D3DCAPS9 *caps,
}
void
-nine_state_clear(struct nine_state *state, const boolean device)
+nine_device_state_clear(struct NineDevice9 *device)
{
+ struct nine_state *state = &device->state;
unsigned i;
for (i = 0; i < ARRAY_SIZE(state->rt); ++i)
@@ -2801,16 +2802,15 @@ nine_state_clear(struct nine_state *state, const boolean device)
nine_bind(&state->ps, NULL);
nine_bind(&state->vdecl, NULL);
for (i = 0; i < PIPE_MAX_ATTRIBS; ++i)
- nine_bind(&state->stream[i], NULL);
-
- nine_bind(&state->idxbuf, NULL);
- for (i = 0; i < NINE_MAX_SAMPLERS; ++i) {
- if (device &&
- state->texture[i] &&
- --state->texture[i]->bind_count == 0)
- list_delinit(&state->texture[i]->list);
- nine_bind(&state->texture[i], NULL);
- }
+ NineBindBufferToDevice(device,
+ (struct NineBuffer9 **)&state->stream[i],
+ NULL);
+ NineBindBufferToDevice(device,
+ (struct NineBuffer9 **)&state->idxbuf,
+ NULL);
+
+ for (i = 0; i < NINE_MAX_SAMPLERS; ++i)
+ NineBindTextureToDevice(device, &state->texture[i], NULL);
}
void
diff --git a/src/gallium/state_trackers/nine/nine_state.h b/src/gallium/state_trackers/nine/nine_state.h
index 55960007bfb..d8f7230e5b3 100644
--- a/src/gallium/state_trackers/nine/nine_state.h
+++ b/src/gallium/state_trackers/nine/nine_state.h
@@ -598,7 +598,7 @@ nine_context_get_query_result(struct NineDevice9 *device, struct pipe_query *que
void nine_state_restore_non_cso(struct NineDevice9 *device);
void nine_state_set_defaults(struct NineDevice9 *, const D3DCAPS9 *,
boolean is_reset);
-void nine_state_clear(struct nine_state *, const boolean device);
+void nine_device_state_clear(struct NineDevice9 *);
void nine_context_clear(struct NineDevice9 *);
void nine_state_init_sw(struct NineDevice9 *device);
diff --git a/src/gallium/state_trackers/nine/stateblock9.c b/src/gallium/state_trackers/nine/stateblock9.c
index 50ed70aec3a..c7bdc86e9d0 100644
--- a/src/gallium/state_trackers/nine/stateblock9.c
+++ b/src/gallium/state_trackers/nine/stateblock9.c
@@ -63,8 +63,20 @@ NineStateBlock9_dtor( struct NineStateBlock9 *This )
struct nine_state *state = &This->state;
struct nine_range *r;
struct nine_range_pool *pool = &This->base.device->range_pool;
+ unsigned i;
- nine_state_clear(state, false);
+ for (i = 0; i < ARRAY_SIZE(state->rt); ++i)
+ nine_bind(&state->rt[i], NULL);
+ nine_bind(&state->ds, NULL);
+ nine_bind(&state->vs, NULL);
+ nine_bind(&state->ps, NULL);
+ nine_bind(&state->vdecl, NULL);
+ for (i = 0; i < PIPE_MAX_ATTRIBS; ++i)
+ nine_bind(&state->stream[i], NULL);
+
+ nine_bind(&state->idxbuf, NULL);
+ for (i = 0; i < NINE_MAX_SAMPLERS; ++i)
+ nine_bind(&state->texture[i], NULL);
FREE(state->vs_const_f);
FREE(state->ps_const_f);