diff options
author | Ilia Mirkin <[email protected]> | 2015-10-28 15:38:53 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-10-29 13:20:45 -0400 |
commit | 6166a8e369b86395ffec7229257f797662f9d1aa (patch) | |
tree | b1f9b088a31c5ae8663e4a3ee3ae959ee5722e35 /src/mesa/state_tracker | |
parent | afbe8b6085c4761c25b7bc49a051a08e10a87805 (diff) |
st/mesa: create temporary textures with the same nr_samples as source
Not sure if this is actually reachable in practice (to have a complex
copy with MS textures).
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_copyimage.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_copyimage.c b/src/mesa/state_tracker/st_cb_copyimage.c index c94a0b22ea8..75114cdb712 100644 --- a/src/mesa/state_tracker/st_cb_copyimage.c +++ b/src/mesa/state_tracker/st_cb_copyimage.c @@ -359,6 +359,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 width, unsigned height, unsigned depth) { struct pipe_resource templ; @@ -369,6 +370,7 @@ create_texture(struct pipe_screen *screen, enum pipe_format format, templ.height0 = height; templ.depth0 = 1; templ.array_size = depth; + templ.nr_samples = nr_samples; templ.usage = PIPE_USAGE_DEFAULT; templ.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET; @@ -439,7 +441,8 @@ handle_complex_copy(struct pipe_context *pipe, /* Use the temporary texture. Src is converted to a canonical format, * then proceed the generic swizzled_copy. */ - temp = create_texture(pipe->screen, canon_format, src_box->width, + temp = create_texture(pipe->screen, canon_format, src->nr_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, @@ -463,7 +466,8 @@ 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, src_box->width, + temp = create_texture(pipe->screen, canon_format, dst->nr_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, |