vega: fix missing include
[mesa.git] / src / gallium / state_trackers / vega / vg_tracker.c
index c262ce08fa9ba4afdac4877ace5902f40190c701..5a286b144916b6949961769af23a0141bc95fc2f 100644 (file)
@@ -33,6 +33,7 @@
 #include "pipe/p_screen.h"
 #include "util/u_memory.h"
 #include "util/u_math.h"
+#include "util/u_rect.h"
 
 static struct pipe_texture *
 create_texture(struct pipe_context *pipe, enum pipe_format format,
@@ -50,10 +51,9 @@ create_texture(struct pipe_context *pipe, enum pipe_format format,
    }
 
    templ.target = PIPE_TEXTURE_2D;
-   pf_get_block(templ.format, &templ.block);
-   templ.width[0] = width;
-   templ.height[0] = height;
-   templ.depth[0] = 1;
+   templ.width0 = width;
+   templ.height0 = height;
+   templ.depth0 = 1;
    templ.last_level = 0;
 
    if (pf_get_component_bits(format, PIPE_FORMAT_COMP_S)) {
@@ -235,13 +235,23 @@ static void setup_new_alpha_mask(struct vg_context *ctx,
          old_texture,
          0, 0, 0,
          PIPE_BUFFER_USAGE_GPU_READ);
-      pipe->surface_copy(pipe,
-                         surface,
-                         0, 0,
-                         old_surface,
-                         0, 0,
-                         MIN2(old_surface->width, width),
-                         MIN2(old_surface->height, height));
+      if (pipe->surface_copy) {
+         pipe->surface_copy(pipe,
+                            surface,
+                            0, 0,
+                            old_surface,
+                            0, 0,
+                            MIN2(old_surface->width, width),
+                            MIN2(old_surface->height, height));
+      } else {
+         util_surface_copy(pipe, FALSE,
+                           surface,
+                           0, 0,
+                           old_surface,
+                           0, 0,
+                           MIN2(old_surface->width, width),
+                           MIN2(old_surface->height, height));
+      }
       if (surface)
          pipe_surface_reference(&surface, NULL);
       if (old_surface)
@@ -367,6 +377,11 @@ void st_make_current(struct vg_context *st,
    }
 }
 
+struct vg_context *st_get_current(void)
+{
+   return vg_current_context();
+}
+
 void st_flush(struct vg_context *st, uint pipeFlushFlags,
               struct pipe_fence_handle **fence)
 {
@@ -399,8 +414,13 @@ void st_notify_swapbuffers_complete(struct st_framebuffer *stfb)
 {
 }
 
-int
-st_set_teximage(struct pipe_texture *pt, int target)
+int st_bind_texture_surface(struct pipe_surface *ps, int target, int level,
+                            enum pipe_format format)
+{
+   return 0;
+}
+
+int st_unbind_texture_surface(struct pipe_surface *ps, int target, int level)
 {
    return 0;
 }