diff options
author | Axel Davy <[email protected]> | 2016-10-20 21:41:19 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-12-20 23:44:22 +0100 |
commit | c6ca7c747e47127bb0ced0c7ca38beaa760376a4 (patch) | |
tree | c136810cec1d712a621842cb6db29dfb469771ea /src/gallium/state_trackers/nine/device9.c | |
parent | d671190df907b7643ba00143b2fbf0a1f5bee6c4 (diff) |
st/nine: Back ps 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 | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 31765265e1c..f25d5a94670 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -3526,28 +3526,25 @@ NineDevice9_SetPixelShader( struct NineDevice9 *This, IDirect3DPixelShader9 *pShader ) { struct nine_state *state = This->update; - struct nine_context *context = &This->context; - unsigned old_mask = state->ps ? state->ps->rt_mask : 1; - unsigned mask; + struct NinePixelShader9 *ps = (struct NinePixelShader9*)pShader; DBG("This=%p pShader=%p\n", This, pShader); - if (!This->is_recording && state->ps == (struct NinePixelShader9*)pShader) - return D3D_OK; - - /* ff -> non-ff: commit back non-ff constants */ - if (!state->ps && pShader) - context->commit |= NINE_STATE_COMMIT_CONST_PS; + if (unlikely(This->is_recording)) { + /* Technically we need NINE_STATE_FB only + * if the ps mask changes, but put it always + * to be safe */ + nine_bind(&state->ps, pShader); + state->changed.group |= NINE_STATE_PS | NINE_STATE_FB; + return D3D_OK; + } - nine_bind(&state->ps, pShader); + if (state->ps == ps) + return D3D_OK; - state->changed.group |= NINE_STATE_PS; + nine_bind(&state->ps, ps); - mask = state->ps ? state->ps->rt_mask : 1; - /* We need to update cbufs if the pixel shader would - * write to different render targets */ - if (mask != old_mask) - state->changed.group |= NINE_STATE_FB; + nine_context_set_pixel_shader(This, ps); return D3D_OK; } |