diff options
author | Axel Davy <[email protected]> | 2016-10-16 15:56:14 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-12-20 23:44:21 +0100 |
commit | 6bbb7b9fc5bc978ac3236064a1de50376177c735 (patch) | |
tree | 2eacfcc82e4751485560888103a9541643ace105 /src/gallium/state_trackers/nine/device9.c | |
parent | c1871e829aa220a7040ca6e423d404f072256db9 (diff) |
st/nine: Move texture setting to nine_context_*
And move samplers_shadow to nine_context.
Part of the refactor to move all gallium calls to
nine_state.c, and have all internal states required
for those calls in nine_context.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/device9.c')
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 36 |
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; } |