diff options
author | Axel Davy <[email protected]> | 2016-10-17 21:43:11 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-12-20 23:44:21 +0100 |
commit | 2a698c3df2a940a693d39c77692b32d946ccec1d (patch) | |
tree | 51fb54d5b061beb5079faf61442d6cb3895b379b /src/gallium/state_trackers/nine/device9.c | |
parent | 43288cf376a280f1f7757e2c47f6ddcaad0c384f (diff) |
st/nine: Back vs to nine_context
And move programmable_vs storage and computation.
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 | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 8b47d3eaf84..3b682065709 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -2928,6 +2928,7 @@ NineDevice9_ProcessVertices( struct NineDevice9 *This, struct pipe_stream_output_target *target; struct pipe_draw_info draw; struct pipe_box box; + bool programmable_vs = This->state.vs && !(This->state.vdecl && This->state.vdecl->position_t); unsigned offsets[1] = {0}; HRESULT hr; unsigned buffer_size; @@ -2944,7 +2945,7 @@ NineDevice9_ProcessVertices( struct NineDevice9 *This, } - vs = This->state.programmable_vs ? This->state.vs : This->ff.vs; + vs = programmable_vs ? This->state.vs : This->ff.vs; /* Note: version is 0 for ff */ user_assert(vdecl || (vs->byte_code.version < 0x30 && dst->desc.FVF), D3DERR_INVALIDCALL); @@ -2966,7 +2967,7 @@ NineDevice9_ProcessVertices( struct NineDevice9 *This, * if not set, everything from src will be used, and dst * must match exactly the ff vs outputs. * TODO: Handle all the checks, etc for ff */ - user_assert(vdecl->position_t || This->state.programmable_vs, + user_assert(vdecl->position_t || programmable_vs, D3DERR_INVALIDCALL); /* TODO: Support vs < 3 and ff */ @@ -3154,23 +3155,22 @@ NineDevice9_SetVertexShader( struct NineDevice9 *This, IDirect3DVertexShader9 *pShader ) { struct nine_state *state = This->update; - struct nine_context *context = &This->context; - BOOL was_programmable_vs = This->state.programmable_vs; + struct NineVertexShader9 *vs_shader = (struct NineVertexShader9*)pShader; DBG("This=%p pShader=%p\n", This, pShader); - if (!This->is_recording && state->vs == (struct NineVertexShader9*)pShader) - return D3D_OK; - - nine_bind(&state->vs, pShader); + if (unlikely(This->is_recording)) { + nine_bind(&state->vs, vs_shader); + state->changed.group |= NINE_STATE_VS; + return D3D_OK; + } - This->state.programmable_vs = This->state.vs && !(This->context.vdecl && This->context.vdecl->position_t); + if (state->vs == vs_shader) + return D3D_OK; - /* ff -> non-ff: commit back non-ff constants */ - if (!was_programmable_vs && This->state.programmable_vs) - context->commit |= NINE_STATE_COMMIT_CONST_VS; + nine_bind(&state->vs, vs_shader); - state->changed.group |= NINE_STATE_VS; + nine_context_set_vertex_shader(This, vs_shader); return D3D_OK; } |