gallium/radeon: implement PIPE_CAP_INVALIDATE_BUFFER
[mesa.git] / src / gallium / drivers / svga / svga_context.c
index f8622b96f45b1cc3a8f873baa578e2624b37d471..b10eb45e54861adb83cfc76fdc5a7428f2a89dcb 100644 (file)
@@ -46,7 +46,6 @@
 #include "svga_winsys.h"
 
 #define CONST0_UPLOAD_DEFAULT_SIZE 65536
-#define CONST0_UPLOAD_ALIGNMENT 256
 
 DEBUG_GET_ONCE_BOOL_OPTION(no_swtnl, "SVGA_NO_SWTNL", FALSE)
 DEBUG_GET_ONCE_BOOL_OPTION(force_swtnl, "SVGA_FORCE_SWTNL", FALSE);
@@ -134,7 +133,7 @@ struct pipe_context *svga_context_create(struct pipe_screen *screen,
    enum pipe_error ret;
 
    svga = CALLOC_STRUCT(svga_context);
-   if (svga == NULL)
+   if (!svga)
       goto cleanup;
 
    LIST_INITHEAD(&svga->dirty_buffers);
@@ -220,8 +219,8 @@ struct pipe_context *svga_context_create(struct pipe_screen *screen,
 
    svga->const0_upload = u_upload_create(&svga->pipe,
                                          CONST0_UPLOAD_DEFAULT_SIZE,
-                                         CONST0_UPLOAD_ALIGNMENT,
-                                         PIPE_BIND_CONSTANT_BUFFER);
+                                         PIPE_BIND_CONSTANT_BUFFER,
+                                         PIPE_USAGE_STREAM);
    if (!svga->const0_upload)
       goto cleanup;
 
@@ -340,7 +339,7 @@ void svga_context_flush( struct svga_context *svga,
                                           PIPE_TIMEOUT_INFINITE);
    }
 
-   if(pfence)
+   if (pfence)
       svgascreen->sws->fence_reference(svgascreen->sws, pfence, fence);
 
    svgascreen->sws->fence_reference(svgascreen->sws, &fence, NULL);