replace _mesa_logbase2 with util_logbase2
[mesa.git] / src / mesa / state_tracker / st_cb_copyimage.c
index f5d8c0478008a80695165b11abfdb4bd07ce0571..a58cdf62703397640d310352c824b721ef0a5220 100644 (file)
 #include "state_tracker/st_cb_copyimage.h"
 #include "state_tracker/st_cb_fbo.h"
 #include "state_tracker/st_texture.h"
+#include "state_tracker/st_util.h"
 
 #include "util/u_box.h"
-#include "util/u_format.h"
+#include "util/format/u_format.h"
 #include "util/u_inlines.h"
 
 
@@ -360,7 +361,7 @@ same_size_and_swizzle(const struct util_format_description *d1,
 
 static struct pipe_resource *
 create_texture(struct pipe_screen *screen, enum pipe_format format,
-               unsigned nr_samples,
+               unsigned nr_samples, unsigned nr_storage_samples,
                unsigned width, unsigned height, unsigned depth)
 {
    struct pipe_resource templ;
@@ -372,6 +373,7 @@ create_texture(struct pipe_screen *screen, enum pipe_format format,
    templ.depth0 = 1;
    templ.array_size = depth;
    templ.nr_samples = nr_samples;
+   templ.nr_storage_samples = nr_storage_samples;
    templ.usage = PIPE_USAGE_DEFAULT;
    templ.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
 
@@ -443,7 +445,7 @@ handle_complex_copy(struct pipe_context *pipe,
        * then proceed the generic swizzled_copy.
        */
       temp = create_texture(pipe->screen, canon_format, src->nr_samples,
-                            src_box->width,
+                            src->nr_storage_samples, src_box->width,
                             src_box->height, src_box->depth);
 
       u_box_3d(0, 0, 0, src_box->width, src_box->height, src_box->depth,
@@ -468,7 +470,7 @@ handle_complex_copy(struct pipe_context *pipe,
       /* Use the temporary texture. First, use the generic copy, but use
        * a canonical format in the destination. Then convert */
       temp = create_texture(pipe->screen, canon_format, dst->nr_samples,
-                            src_box->width,
+                            dst->nr_storage_samples, src_box->width,
                             src_box->height, src_box->depth);
 
       u_box_3d(0, 0, 0, src_box->width, src_box->height, src_box->depth,