st/nine: Unify some check flags
authorAxel Davy <axel.davy@ens.fr>
Mon, 14 Mar 2016 20:26:19 +0000 (21:26 +0100)
committerAxel Davy <axel.davy@ens.fr>
Mon, 10 Oct 2016 21:43:48 +0000 (23:43 +0200)
The new defines will be reused in a later patch.

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

index 4f61982a724393da8588bbef74c9ae902266dca4..26aa064b1accac8de4f0409356c61332c391dad7 100644 (file)
@@ -54,4 +54,12 @@ uint16_t nine_d3d9_to_nine_declusage(unsigned usage, unsigned index);
 
 #define NINED3DCLEAR_DEPTHSTENCIL   (D3DCLEAR_ZBUFFER | D3DCLEAR_STENCIL)
 
+#define NINE_BIND_BACKBUFFER_FLAGS    (PIPE_BIND_RENDER_TARGET |\
+                                       PIPE_BIND_SAMPLER_VIEW)
+
+#define NINE_BIND_PRESENTBUFFER_FLAGS (PIPE_BIND_RENDER_TARGET |\
+                                       PIPE_BIND_DISPLAY_TARGET |\
+                                       PIPE_BIND_SCANOUT |\
+                                       PIPE_BIND_SHARED)
+
 #endif /* _NINE_DEFINES_H_ */
index 838c2488c6dc2270557e40514d10574cf2ffef5f..87beabc914318208844045c46a1712d633a7232b 100644 (file)
@@ -305,7 +305,7 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
         tmplt.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
         tmplt.nr_samples = pParams->MultiSampleType;
         if (!has_present_buffers)
-            tmplt.bind |= PIPE_BIND_SHARED | PIPE_BIND_SCANOUT | PIPE_BIND_DISPLAY_TARGET;
+            tmplt.bind |= NINE_BIND_PRESENTBUFFER_FLAGS;
         tmplt.format = d3d9_to_pipe_format_checked(This->screen,
                                                    pParams->BackBufferFormat,
                                                    PIPE_TEXTURE_2D,
@@ -339,7 +339,7 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
         }
         if (has_present_buffers) {
             tmplt.format = PIPE_FORMAT_B8G8R8X8_UNORM;
-            tmplt.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHARED | PIPE_BIND_SCANOUT | PIPE_BIND_DISPLAY_TARGET;
+            tmplt.bind = NINE_BIND_PRESENTBUFFER_FLAGS;
             tmplt.nr_samples = 0;
             if (This->actx->linear_framebuffer)
                 tmplt.bind |= PIPE_BIND_LINEAR;
@@ -548,8 +548,8 @@ create_present_buffer( struct NineSwapChain9 *This,
     tmplt.usage = PIPE_USAGE_DEFAULT;
     tmplt.flags = 0;
     tmplt.format = PIPE_FORMAT_B8G8R8X8_UNORM;
-    tmplt.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET |
-                 PIPE_BIND_SHARED | PIPE_BIND_SCANOUT | PIPE_BIND_DISPLAY_TARGET;
+    tmplt.bind = NINE_BIND_BACKBUFFER_FLAGS |
+                 NINE_BIND_PRESENTBUFFER_FLAGS;
     tmplt.nr_samples = 0;
     if (This->actx->linear_framebuffer)
         tmplt.bind |= PIPE_BIND_LINEAR;