summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/device9.c
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-10-17 21:18:42 +0200
committerAxel Davy <[email protected]>2016-12-20 23:44:21 +0100
commit43288cf376a280f1f7757e2c47f6ddcaad0c384f (patch)
treea90ae9a74e3ad851acb4da1f47f3d0b471f0e112 /src/gallium/state_trackers/nine/device9.c
parent63633e2a08b227025f1e479fe26244e6bf37d7e7 (diff)
st/nine: Back vdecl 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.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index d11f3d1903c..8b47d3eaf84 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -3068,23 +3068,22 @@ NineDevice9_SetVertexDeclaration( struct NineDevice9 *This,
IDirect3DVertexDeclaration9 *pDecl )
{
struct nine_state *state = This->update;
- struct nine_context *context = &This->context;
- BOOL was_programmable_vs = This->state.programmable_vs;
+ struct NineVertexDeclaration9 *vdecl = NineVertexDeclaration9(pDecl);
DBG("This=%p pDecl=%p\n", This, pDecl);
- if (likely(!This->is_recording) && state->vdecl == NineVertexDeclaration9(pDecl))
+ if (unlikely(This->is_recording)) {
+ nine_bind(&state->vdecl, vdecl);
+ state->changed.group |= NINE_STATE_VDECL;
return D3D_OK;
+ }
- nine_bind(&state->vdecl, pDecl);
+ if (state->vdecl == vdecl)
+ return D3D_OK;
- This->state.programmable_vs = This->state.vs && !(This->state.vdecl && This->state.vdecl->position_t);
- if (likely(!This->is_recording) && was_programmable_vs != This->state.programmable_vs) {
- context->commit |= NINE_STATE_COMMIT_CONST_VS;
- state->changed.group |= NINE_STATE_VS;
- }
+ nine_bind(&state->vdecl, vdecl);
- state->changed.group |= NINE_STATE_VDECL;
+ nine_context_set_vertex_declaration(This, vdecl);
return D3D_OK;
}
@@ -3165,7 +3164,7 @@ NineDevice9_SetVertexShader( struct NineDevice9 *This,
nine_bind(&state->vs, pShader);
- This->state.programmable_vs = This->state.vs && !(This->state.vdecl && This->state.vdecl->position_t);
+ This->state.programmable_vs = This->state.vs && !(This->context.vdecl && This->context.vdecl->position_t);
/* ff -> non-ff: commit back non-ff constants */
if (!was_programmable_vs && This->state.programmable_vs)