summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/device9.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/nine/device9.c')
-rw-r--r--src/gallium/state_trackers/nine/device9.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 7519eaaa789..9923c894dd2 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -2450,6 +2450,7 @@ NineDevice9_SetTexture( struct NineDevice9 *This,
{
struct nine_state *state = This->update;
struct NineBaseTexture9 *tex = NineBaseTexture9(pTexture);
+ struct NineBaseTexture9 *old;
DBG("This=%p Stage=%u pTexture=%p\n", This, Stage, pTexture);
@@ -2463,28 +2464,29 @@ NineDevice9_SetTexture( struct NineDevice9 *This,
if (Stage >= D3DDMAPSAMPLER)
Stage = Stage - D3DDMAPSAMPLER + NINE_MAX_SAMPLERS_PS;
- if (!This->is_recording) {
- struct NineBaseTexture9 *old = state->texture[Stage];
- if (old == tex)
- return D3D_OK;
+ if (This->is_recording) {
+ state->changed.texture |= 1 << Stage;
+ state->changed.group |= NINE_STATE_TEXTURE;
+ nine_bind(&state->texture[Stage], pTexture);
+ return D3D_OK;
+ }
- state->samplers_shadow &= ~(1 << Stage);
- if (tex) {
- state->samplers_shadow |= tex->shadow << Stage;
+ old = state->texture[Stage];
+ if (old == tex)
+ return D3D_OK;
- if ((tex->managed.dirty | tex->dirty_mip) && LIST_IS_EMPTY(&tex->list))
- list_add(&tex->list, &This->update_textures);
+ if (tex) {
+ if ((tex->managed.dirty | tex->dirty_mip) && LIST_IS_EMPTY(&tex->list))
+ list_add(&tex->list, &This->update_textures);
- tex->bind_count++;
- }
- if (old)
- old->bind_count--;
+ tex->bind_count++;
}
- nine_bind(&state->texture[Stage], pTexture);
+ if (old)
+ old->bind_count--;
- if (This->is_recording)
- state->changed.texture |= 1 << Stage;
- state->changed.group |= NINE_STATE_TEXTURE;
+ nine_context_set_texture(This, Stage, tex);
+
+ nine_bind(&state->texture[Stage], pTexture);
return D3D_OK;
}