st/nine: Optimize ColorFill
authorAxel Davy <axel.davy@ens.fr>
Sun, 13 Nov 2016 11:41:53 +0000 (12:41 +0100)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:44:23 +0000 (23:44 +0100)
When we lock the whole surface to overwrite it, we can use DISCARD.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/device9.c

index 28442eb76fcac5410089b93f13926e2a32b0ca17..66bfc8d0181cd178f20baf821fe2552f3bd293ea 100644 (file)
@@ -1800,7 +1800,7 @@ NineDevice9_ColorFill( struct NineDevice9 *This,
         union util_color uc;
         HRESULT hr;
         /* XXX: lock pRect and fix util_fill_rect */
-        hr = NineSurface9_LockRect(surf, &lock, NULL, 0);
+        hr = NineSurface9_LockRect(surf, &lock, NULL, pRect ? 0 : D3DLOCK_DISCARD);
         if (FAILED(hr))
             return hr;
         util_pack_color_ub(color >> 16, color >> 8, color >> 0, color >> 24,