diff options
author | Axel Davy <[email protected]> | 2016-11-01 18:30:33 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-12-20 23:44:22 +0100 |
commit | bb666b0297cb81fc1b8192ba91efd2e0a69835c5 (patch) | |
tree | 2d842cd3caf6ccc5058931eca0d28d2f05023df9 /src/gallium/state_trackers | |
parent | f5f881fd3eac79fc2dad865bc1387bfcee40e352 (diff) |
st/nine: Back swvp in 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')
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/nine_state.c | 14 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/nine_state.h | 7 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/vertexshader9.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/vertexshader9.h | 2 |
5 files changed, 23 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 73b5888e4ec..8493e706fe8 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -173,6 +173,7 @@ NineDevice9_ctor( struct NineDevice9 *This, DBG("Application asked mixed Software Vertex Processing.\n"); This->may_swvp = true; } + This->context.swvp = This->swvp; /* TODO: check if swvp is resetted by device Resets */ if (This->may_swvp && @@ -2681,7 +2682,7 @@ NineDevice9_SetSoftwareVertexProcessing( struct NineDevice9 *This, { if (This->params.BehaviorFlags & D3DCREATE_MIXED_VERTEXPROCESSING) { This->swvp = bSoftware; - This->context.changed.group |= NINE_STATE_SWVP; + nine_context_set_swvp(This, bSoftware); return D3D_OK; } else return D3DERR_INVALIDCALL; /* msdn. TODO: check in practice */ diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c index 4242301af0c..6b4c77c773a 100644 --- a/src/gallium/state_trackers/nine/nine_state.c +++ b/src/gallium/state_trackers/nine/nine_state.c @@ -212,7 +212,7 @@ prepare_vs_constants_userbuf(struct NineDevice9 *device) cb.buffer_size = context->vs->const_used_size; cb.user_buffer = context->vs_const_f; - if (device->swvp) { + if (context->swvp) { prepare_vs_constants_userbuf_swvp(device); return; } @@ -848,7 +848,7 @@ commit_vs_constants(struct NineDevice9 *device) if (unlikely(!context->programmable_vs)) pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 0, &context->pipe_data.cb_vs_ff); else { - if (device->swvp) { + if (context->swvp) { pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 0, &context->pipe_data.cb0_swvp); pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 1, &context->pipe_data.cb1_swvp); pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 2, &context->pipe_data.cb2_swvp); @@ -1684,6 +1684,16 @@ nine_context_set_clip_plane(struct NineDevice9 *device, context->changed.ucp = TRUE; } +void +nine_context_set_swvp(struct NineDevice9 *device, + boolean swvp) +{ + struct nine_context *context = &device->context; + + context->swvp = swvp; + context->changed.group |= NINE_STATE_SWVP; +} + #if 0 void diff --git a/src/gallium/state_trackers/nine/nine_state.h b/src/gallium/state_trackers/nine/nine_state.h index 42d45d959b9..d5cbbd4198b 100644 --- a/src/gallium/state_trackers/nine/nine_state.h +++ b/src/gallium/state_trackers/nine/nine_state.h @@ -299,6 +299,9 @@ struct nine_context { struct nine_ff_state ff; + /* software vertex processing */ + boolean swvp; + uint32_t commit; struct { struct pipe_framebuffer_state fb; @@ -459,6 +462,10 @@ nine_context_set_clip_plane(struct NineDevice9 *device, const float *pPlane); void +nine_context_set_swvp(struct NineDevice9 *device, + boolean swvp); + +void nine_context_apply_stateblock(struct NineDevice9 *device, const struct nine_state *src); diff --git a/src/gallium/state_trackers/nine/vertexshader9.c b/src/gallium/state_trackers/nine/vertexshader9.c index 947831d3bb4..71a56f4c6a2 100644 --- a/src/gallium/state_trackers/nine/vertexshader9.c +++ b/src/gallium/state_trackers/nine/vertexshader9.c @@ -194,7 +194,7 @@ NineVertexShader9_GetVariant( struct NineVertexShader9 *This ) info.fog_enable = device->context.rs[D3DRS_FOGENABLE]; info.point_size_min = asfloat(device->context.rs[D3DRS_POINTSIZE_MIN]); info.point_size_max = asfloat(device->context.rs[D3DRS_POINTSIZE_MAX]); - info.swvp_on = device->swvp; + info.swvp_on = device->context.swvp; info.process_vertices = false; hr = nine_translate_shader(This->base.device, &info, pipe); diff --git a/src/gallium/state_trackers/nine/vertexshader9.h b/src/gallium/state_trackers/nine/vertexshader9.h index a912d4628b4..888f1de35be 100644 --- a/src/gallium/state_trackers/nine/vertexshader9.h +++ b/src/gallium/state_trackers/nine/vertexshader9.h @@ -91,7 +91,7 @@ NineVertexShader9_UpdateKey( struct NineVertexShader9 *vs, if (vs->byte_code.version < 0x30) key |= (uint32_t) ((!!context->rs[D3DRS_FOGENABLE]) << 8); - key |= (uint32_t) (device->swvp << 9); + key |= (uint32_t) (context->swvp << 9); /* We want to use a 64 bits key for performance. * Use compressed float16 values for the pointsize min/max in the key. |