[Mesa-dev] [PATCH 59/84] st/nine: Simplify ColorFill

Axel Davy axel.davy at ens.fr
Wed Dec 7 22:55:32 UTC 2016


For render targets, NineSurface9_GetSurface is not
expected to fail.

Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
 src/gallium/state_trackers/nine/device9.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index f659a27..5090f6b 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -1757,7 +1757,6 @@ NineDevice9_ColorFill( struct NineDevice9 *This,
     struct pipe_surface *psurf;
     unsigned x, y, w, h;
     union pipe_color_union rgba;
-    boolean fallback;
 
     DBG("This=%p pSurface=%p pRect=%p color=%08x\n", This,
         pSurface, pRect, color);
@@ -1793,15 +1792,8 @@ NineDevice9_ColorFill( struct NineDevice9 *This,
     }
     d3dcolor_to_pipe_color_union(&rgba, color);
 
-    fallback = !(surf->base.info.bind & PIPE_BIND_RENDER_TARGET);
-
-    if (!fallback) {
+    if (surf->base.info.bind & PIPE_BIND_RENDER_TARGET) {
         psurf = NineSurface9_GetSurface(surf, 0);
-        if (!psurf)
-            fallback = TRUE;
-    }
-
-    if (!fallback) {
         pipe->clear_render_target(pipe, psurf, &rgba, x, y, w, h, false);
     } else {
         D3DLOCKED_RECT lock;
-- 
2.10.2



More information about the mesa-dev mailing list