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 <axel.davy@ens.fr>
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
@@ -458,6 +461,10 @@ nine_context_set_clip_plane(struct NineDevice9 *device,
|
||||
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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user