st/nine: Track changed.texture only for stateblocks
authorAxel Davy <axel.davy@ens.fr>
Sun, 16 Oct 2016 13:29:46 +0000 (15:29 +0200)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:44:21 +0000 (23:44 +0100)
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>
src/gallium/state_trackers/nine/basetexture9.c
src/gallium/state_trackers/nine/device9.c
src/gallium/state_trackers/nine/nine_state.c
src/gallium/state_trackers/nine/nine_state.h
src/gallium/state_trackers/nine/stateblock9.c

index 829a7c61f50568a3b07b936d0c41faecdb6ee1e6..e7b049c431180a477318e7ede8d0040f69cece63 100644 (file)
@@ -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 */
index e039a3f5c913947e7873bc769f2ff692910ca645..7519eaaa789c1390920f43606a986fb14ae5e7f1 100644 (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;
index d6f5cc18f0fcfec5373fbb96f18e2decb7c78a72..49e36a0ab5cb90597b7af7c3c8b668e59de03647 100644 (file)
@@ -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);
index b5f49769ec0411281378b9af78d0d1defaabc0da..99b0a3835bd61e83ca5528fa524f310020e0bfca 100644 (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;
index 0a5641f831a64efe3f49ece1baece5d085a59b6a..d04ac8f7bfebd820c6bb7329c986f043f26b6fe5 100644 (file)
@@ -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;