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 &&
{
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 */
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;
}
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);
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
struct nine_ff_state ff;
+ /* software vertex processing */
+ boolean swvp;
+
uint32_t commit;
struct {
struct pipe_framebuffer_state fb;
DWORD Index,
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);
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);
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.