Mesa (master): st/nine: Remove duplicated checks

Axel Davy axeldavy at kemper.freedesktop.org
Thu Jan 12 19:33:25 UTC 2017


Module: Mesa
Branch: master
Commit: d43bc05e8ba0f326273c21b10f714e4d2514adae
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d43bc05e8ba0f326273c21b10f714e4d2514adae

Author: Axel Davy <axel.davy at ens.fr>
Date:   Wed Dec 28 17:54:47 2016 +0100

st/nine: Remove duplicated checks

There is no need to check on csmt_active before
calling nine_csmt_process, because the function
checks already.

Signed-off-by: Axel Davy <axel.davy at ens.fr>

---

 src/gallium/state_trackers/nine/device9.c    |  3 +--
 src/gallium/state_trackers/nine/nine_state.c | 14 ++++++--------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index f095ff3..d76d506 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -522,8 +522,7 @@ NineDevice9_ctor( struct NineDevice9 *This,
     nine_state_init_sw(This);
 
     ID3DPresentGroup_Release(This->present);
-    if (This->csmt_active)
-        nine_csmt_process(This);
+    nine_csmt_process(This);
 
     return D3D_OK;
 }
diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c
index afc309f..697e216 100644
--- a/src/gallium/state_trackers/nine/nine_state.c
+++ b/src/gallium/state_trackers/nine/nine_state.c
@@ -280,8 +280,7 @@ nine_csmt_resume( struct NineDevice9 *device )
 struct pipe_context *
 nine_context_get_pipe( struct NineDevice9 *device )
 {
-    if (device->csmt_active)
-        nine_csmt_process(device);
+    nine_csmt_process(device);
     return device->context.pipe;
 }
 
@@ -1908,8 +1907,8 @@ nine_context_light_enable_stateblock(struct NineDevice9 *device,
 {
     struct nine_context *context = &device->context;
 
-    if (device->csmt_active) /* TODO: fix */
-        nine_csmt_process(device);
+    /* TODO: Use CSMT_* to avoid calling nine_csmt_process */
+    nine_csmt_process(device);
     memcpy(context->ff.active_light, active_light, NINE_MAX_LIGHTS_ACTIVE * sizeof(context->ff.active_light[0]));
     context->ff.num_lights_active = num_lights_active;
     context->changed.group |= NINE_STATE_FF_LIGHTING;
@@ -2821,10 +2820,9 @@ nine_context_get_query_result(struct NineDevice9 *device, struct pipe_query *que
     struct pipe_context *pipe;
     boolean ret;
 
-    if (wait) {
-        if (device->csmt_active)
-            nine_csmt_process(device);
-    } else if (p_atomic_read(counter) > 0) {
+    if (wait)
+        nine_csmt_process(device);
+    else if (p_atomic_read(counter) > 0) {
         if (flush && device->csmt_active)
             nine_queue_flush(device->csmt_ctx->pool);
         DBG("Pending begin/end. Returning\n");




More information about the mesa-commit mailing list