diff options
author | Axel Davy <[email protected]> | 2016-10-16 15:29:46 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-12-20 23:44:21 +0100 |
commit | c1871e829aa220a7040ca6e423d404f072256db9 (patch) | |
tree | 598357eb89e1b9ce12d35a6f3c7f8841ce31ebda | |
parent | 64e232bd60336591e55e6c95112bac334cb38970 (diff) |
st/nine: Track changed.texture only for stateblocks
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]>
-rw-r--r-- | src/gallium/state_trackers/nine/basetexture9.c | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/nine_state.c | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/nine_state.h | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/stateblock9.c | 1 |
5 files changed, 4 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_trackers/nine/basetexture9.c index 829a7c61f50..e7b049c4311 100644 --- a/src/gallium/state_trackers/nine/basetexture9.c +++ b/src/gallium/state_trackers/nine/basetexture9.c @@ -210,9 +210,7 @@ NineBaseTexture9_UploadSelf( struct NineBaseTexture9 *This ) unsigned s; for (s = 0; s < NINE_MAX_SAMPLERS; ++s) if (state->texture[s] == This) - state->changed.texture |= 1 << s; - if (state->changed.texture) - state->changed.group |= NINE_STATE_TEXTURE; + state->changed.group |= NINE_STATE_TEXTURE; } /* Allocate a new resource */ diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index e039a3f5c91..7519eaaa789 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -2482,7 +2482,8 @@ NineDevice9_SetTexture( struct NineDevice9 *This, } nine_bind(&state->texture[Stage], pTexture); - state->changed.texture |= 1 << Stage; + if (This->is_recording) + state->changed.texture |= 1 << Stage; state->changed.group |= NINE_STATE_TEXTURE; return D3D_OK; diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c index d6f5cc18f0f..49e36a0ab5c 100644 --- a/src/gallium/state_trackers/nine/nine_state.c +++ b/src/gallium/state_trackers/nine/nine_state.c @@ -859,8 +859,6 @@ update_textures_and_samplers(struct NineDevice9 *device) if (commit_samplers) cso_single_sampler_done(device->cso, PIPE_SHADER_VERTEX); - - state->changed.texture = 0; } /* State commit only */ @@ -1670,7 +1668,6 @@ void nine_state_restore_non_cso(struct NineDevice9 *device) state->changed.group = NINE_STATE_ALL; state->changed.vtxbuf = (1ULL << device->caps.MaxStreams) - 1; state->changed.ucp = (1 << PIPE_MAX_CLIP_PLANES) - 1; - state->changed.texture = NINE_PS_SAMPLERS_MASK | NINE_VS_SAMPLERS_MASK; context->commit |= NINE_STATE_COMMIT_CONST_VS | NINE_STATE_COMMIT_CONST_PS; } @@ -1718,7 +1715,6 @@ nine_state_set_defaults(struct NineDevice9 *device, const D3DCAPS9 *caps, state->changed.group = NINE_STATE_ALL; state->changed.vtxbuf = (1ULL << device->caps.MaxStreams) - 1; state->changed.ucp = (1 << PIPE_MAX_CLIP_PLANES) - 1; - state->changed.texture = NINE_PS_SAMPLERS_MASK | NINE_VS_SAMPLERS_MASK; state->ff.changed.transform[0] = ~0; state->ff.changed.transform[D3DTS_WORLD / 32] |= 1 << (D3DTS_WORLD % 32); diff --git a/src/gallium/state_trackers/nine/nine_state.h b/src/gallium/state_trackers/nine/nine_state.h index b5f49769ec0..99b0a3835bd 100644 --- a/src/gallium/state_trackers/nine/nine_state.h +++ b/src/gallium/state_trackers/nine/nine_state.h @@ -138,7 +138,7 @@ struct nine_state uint32_t rs[(NINED3DRS_COUNT + 31) / 32]; /* stateblocks only */ uint32_t vtxbuf; uint32_t stream_freq; - uint32_t texture; + uint32_t texture; /* stateblocks only */ uint16_t sampler[NINE_MAX_SAMPLERS]; struct nine_range *vs_const_f; struct nine_range *ps_const_f; diff --git a/src/gallium/state_trackers/nine/stateblock9.c b/src/gallium/state_trackers/nine/stateblock9.c index 0a5641f831a..d04ac8f7bfe 100644 --- a/src/gallium/state_trackers/nine/stateblock9.c +++ b/src/gallium/state_trackers/nine/stateblock9.c @@ -581,7 +581,6 @@ NineStateBlock9_Apply( struct NineStateBlock9 *This ) /* Textures */ if (src->changed.texture) { uint32_t m = src->changed.texture; - dst->changed.texture |= m; dst->samplers_shadow &= ~m; |