st/nine: Track changed.texture only for stateblocks

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:
Axel Davy
2016-10-16 15:29:46 +02:00
parent 64e232bd60
commit c1871e829a
5 changed files with 4 additions and 10 deletions
@@ -210,9 +210,7 @@ NineBaseTexture9_UploadSelf( struct NineBaseTexture9 *This )
unsigned s;
for (s = 0; s < NINE_MAX_SAMPLERS; ++s)
if (state->texture[s] == This)
state->changed.texture |= 1 << s;
if (state->changed.texture)
state->changed.group |= NINE_STATE_TEXTURE;
state->changed.group |= NINE_STATE_TEXTURE;
}
/* Allocate a new resource */
+2 -1
View File
@@ -2482,7 +2482,8 @@ NineDevice9_SetTexture( struct NineDevice9 *This,
}
nine_bind(&state->texture[Stage], pTexture);
state->changed.texture |= 1 << Stage;
if (This->is_recording)
state->changed.texture |= 1 << Stage;
state->changed.group |= NINE_STATE_TEXTURE;
return D3D_OK;
@@ -859,8 +859,6 @@ update_textures_and_samplers(struct NineDevice9 *device)
if (commit_samplers)
cso_single_sampler_done(device->cso, PIPE_SHADER_VERTEX);
state->changed.texture = 0;
}
/* State commit only */
@@ -1670,7 +1668,6 @@ void nine_state_restore_non_cso(struct NineDevice9 *device)
state->changed.group = NINE_STATE_ALL;
state->changed.vtxbuf = (1ULL << device->caps.MaxStreams) - 1;
state->changed.ucp = (1 << PIPE_MAX_CLIP_PLANES) - 1;
state->changed.texture = NINE_PS_SAMPLERS_MASK | NINE_VS_SAMPLERS_MASK;
context->commit |= NINE_STATE_COMMIT_CONST_VS | NINE_STATE_COMMIT_CONST_PS;
}
@@ -1718,7 +1715,6 @@ nine_state_set_defaults(struct NineDevice9 *device, const D3DCAPS9 *caps,
state->changed.group = NINE_STATE_ALL;
state->changed.vtxbuf = (1ULL << device->caps.MaxStreams) - 1;
state->changed.ucp = (1 << PIPE_MAX_CLIP_PLANES) - 1;
state->changed.texture = NINE_PS_SAMPLERS_MASK | NINE_VS_SAMPLERS_MASK;
state->ff.changed.transform[0] = ~0;
state->ff.changed.transform[D3DTS_WORLD / 32] |= 1 << (D3DTS_WORLD % 32);
+1 -1
View File
@@ -138,7 +138,7 @@ struct nine_state
uint32_t rs[(NINED3DRS_COUNT + 31) / 32]; /* stateblocks only */
uint32_t vtxbuf;
uint32_t stream_freq;
uint32_t texture;
uint32_t texture; /* stateblocks only */
uint16_t sampler[NINE_MAX_SAMPLERS];
struct nine_range *vs_const_f;
struct nine_range *ps_const_f;
@@ -581,7 +581,6 @@ NineStateBlock9_Apply( struct NineStateBlock9 *This )
/* Textures */
if (src->changed.texture) {
uint32_t m = src->changed.texture;
dst->changed.texture |= m;
dst->samplers_shadow &= ~m;