gallium: add pipe_resource::nr_storage_samples, and set it same as nr_samples
authorMarek Olšák <marek.olsak@amd.com>
Thu, 24 May 2018 02:25:12 +0000 (22:25 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 31 Jul 2018 22:28:41 +0000 (18:28 -0400)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
30 files changed:
src/gallium/auxiliary/driver_trace/tr_dump_state.c
src/gallium/auxiliary/postprocess/pp_mlaa.c
src/gallium/auxiliary/util/u_dump_state.c
src/gallium/auxiliary/util/u_tests.c
src/gallium/docs/source/screen.rst
src/gallium/include/pipe/p_state.h
src/gallium/state_trackers/dri/dri2.c
src/gallium/state_trackers/glx/xlib/xm_st.c
src/gallium/state_trackers/nine/buffer9.c
src/gallium/state_trackers/nine/cubetexture9.c
src/gallium/state_trackers/nine/device9.c
src/gallium/state_trackers/nine/surface9.c
src/gallium/state_trackers/nine/swapchain9.c
src/gallium/state_trackers/nine/texture9.c
src/gallium/state_trackers/nine/volume9.c
src/gallium/state_trackers/nine/volumetexture9.c
src/gallium/state_trackers/wgl/stw_st.c
src/gallium/tests/graw/clear.c
src/gallium/tests/graw/fs-test.c
src/gallium/tests/graw/graw_util.h
src/gallium/tests/graw/gs-test.c
src/gallium/tests/graw/quad-sample.c
src/gallium/tests/graw/shader-leak.c
src/gallium/tests/graw/tri-gs.c
src/gallium/tests/graw/tri-instanced.c
src/gallium/tests/graw/vs-test.c
src/mesa/state_tracker/st_cb_copyimage.c
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_texture.c

index 2d12720ddd9c48aecdfb669cfa187ef7549af54c..46fa5747460ea4eeeca664f8f7ac8cbcb380c08b 100644 (file)
@@ -69,6 +69,7 @@ void trace_dump_resource_template(const struct pipe_resource *templat)
 
    trace_dump_member(uint, templat, last_level);
    trace_dump_member(uint, templat, nr_samples);
+   trace_dump_member(uint, templat, nr_storage_samples);
    trace_dump_member(uint, templat, usage);
    trace_dump_member(uint, templat, bind);
    trace_dump_member(uint, templat, flags);
index 610cedbd1b3f49b27eee4939c08c73eb4242c2c7..f003ee75fd5f3420b8f07f740930b5542e80cee3 100644 (file)
@@ -240,7 +240,7 @@ pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n,
    res.width0 = res.height0 = 165;
    res.bind = PIPE_BIND_SAMPLER_VIEW;
    res.usage = PIPE_USAGE_DEFAULT;
-   res.depth0 = res.array_size = res.nr_samples = 1;
+   res.depth0 = res.array_size = res.nr_samples = res.nr_storage_samples = 1;
 
    if (!ppq->p->screen->is_format_supported(ppq->p->screen, res.format,
                                             res.target, 1, res.bind))
index b68de134275890f4ff819c84cad116129dc61ace..286d5fad75b3609e569a89ede1342e796a3d72b3 100644 (file)
@@ -319,6 +319,7 @@ util_dump_resource(FILE *stream, const struct pipe_resource *state)
 
    util_dump_member(stream, uint, state, last_level);
    util_dump_member(stream, uint, state, nr_samples);
+   util_dump_member(stream, uint, state, nr_storage_samples);
    util_dump_member(stream, uint, state, usage);
    util_dump_member(stream, uint, state, bind);
    util_dump_member(stream, uint, state, flags);
index bae3fa111a4697022b3a91c60a49aa9e3aac7c60..f8c001813c12abb4ffc93326d345df68e5ee13a6 100644 (file)
@@ -55,6 +55,7 @@ util_create_texture2d(struct pipe_screen *screen, unsigned width,
    templ.depth0 = 1;
    templ.array_size = 1;
    templ.nr_samples = num_samples;
+   templ.nr_storage_samples = num_samples;
    templ.format = format;
    templ.usage = PIPE_USAGE_DEFAULT;
    templ.bind = PIPE_BIND_SAMPLER_VIEW |
index 5fc49e24403833bda313c69c041152a09fec20d2..ecff0800bf8a7d3b8ffc702f5c5a12e377c8f1e7 100644 (file)
@@ -789,8 +789,27 @@ For cube maps this must be 6, for other textures 1.
 
 **last_level** the last mip map level present.
 
-**nr_samples** the nr of msaa samples. 0 (or 1) specifies a resource
-which isn't multisampled.
+**nr_samples**: Number of samples determining quality, driving the rasterizer,
+shading, and framebuffer. It is the number of samples seen by the whole
+graphics pipeline. 0 and 1 specify a resource which isn't multisampled.
+
+**nr_storage_samples**: Only color buffers can set this lower than nr_samples.
+Multiple samples within a pixel can have the same color. ``nr_storage_samples``
+determines how many slots for different colors there are per pixel.
+If there are not enough slots to store all sample colors, some samples will
+have an undefined color (called "undefined samples").
+
+The resolve blit behavior is driver-specific, but can be one of these two:
+1. Only defined samples will be averaged. Undefined samples will be ignored.
+2. Undefined samples will be approximated by looking at surrounding defined
+   samples (even in different pixels).
+
+Blits and MSAA texturing: If the sample being fetched is undefined, one of
+the defined samples is returned instead.
+
+Sample shading (``set_min_samples``) will operate at a sample frequency that
+is at most ``nr_storage_samples``. Greater ``min_samples`` values will be
+replaced by ``nr_storage_samples``.
 
 **usage** one of the :ref:`PIPE_USAGE` flags.
 
index 809aa087ce0087fe0d38d24c3840862ce3c77fac..671cccda4eb25fcf7557109117eb95b3b2a2c58c 100644 (file)
@@ -519,7 +519,6 @@ struct pipe_box
 struct pipe_resource
 {
    struct pipe_reference reference;
-   struct pipe_screen *screen; /**< screen that this texture belongs to */
 
    unsigned width0; /**< Used by both buffers and textures. */
    uint16_t height0; /* Textures: The maximum height/depth/array_size is 16k. */
@@ -529,9 +528,20 @@ struct pipe_resource
    enum pipe_format format:16;         /**< PIPE_FORMAT_x */
    enum pipe_texture_target target:8; /**< PIPE_TEXTURE_x */
    unsigned last_level:8;    /**< Index of last mipmap level present/defined */
-   unsigned nr_samples:8;    /**< for multisampled surfaces, nr of samples */
-   unsigned usage:8;         /**< PIPE_USAGE_x (not a bitmask) */
 
+   /** Number of samples determining quality, driving rasterizer, shading,
+    *  and framebuffer.
+    */
+   unsigned nr_samples:8;
+
+   /** Multiple samples within a pixel can have the same value.
+    *  nr_storage_samples determines how many slots for different values
+    *  there are per pixel. Only color buffers can set this lower than
+    *  nr_samples.
+    */
+   unsigned nr_storage_samples:8;
+
+   unsigned usage:8;         /**< PIPE_USAGE_x (not a bitmask) */
    unsigned bind;            /**< bitmask of PIPE_BIND_x */
    unsigned flags;           /**< bitmask of PIPE_RESOURCE_FLAG_x */
 
@@ -540,6 +550,8 @@ struct pipe_resource
     * next plane.
     */
    struct pipe_resource *next;
+   /* The screen pointer should be last for optimal structure packing. */
+   struct pipe_screen *screen; /**< screen that this texture belongs to */
 };
 
 
index 34205853335ca2e430105ea6f3cd20d2462add4f..9a22e47693bcb753ceecf2c23a561f5e57e99225 100644 (file)
@@ -832,6 +832,7 @@ dri2_allocate_textures(struct dri_context *ctx,
             templ.bind = drawable->textures[statt]->bind &
                          ~(PIPE_BIND_SCANOUT | PIPE_BIND_SHARED);
             templ.nr_samples = drawable->stvis.samples;
+            templ.nr_storage_samples = drawable->stvis.samples;
 
             /* Try to reuse the resource.
              * (the other resource parameters should be constant)
@@ -883,10 +884,12 @@ dri2_allocate_textures(struct dri_context *ctx,
 
          if (drawable->stvis.samples > 1) {
             templ.nr_samples = drawable->stvis.samples;
+            templ.nr_storage_samples = drawable->stvis.samples;
             zsbuf = &drawable->msaa_textures[statt];
          }
          else {
             templ.nr_samples = 0;
+            templ.nr_storage_samples = 0;
             zsbuf = &drawable->textures[statt];
          }
 
index 9def70fc7465fc1dd01ffb96c0c2dde8f2901ec3..2fa80f4da2850615950530c113a8a37ae1bdea78 100644 (file)
@@ -136,6 +136,7 @@ xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
    templ.array_size = 1;
    templ.last_level = 0;
    templ.nr_samples = xstfb->stvis.samples;
+   templ.nr_storage_samples = xstfb->stvis.samples;
 
    for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
       enum pipe_format format;
index ca4e4380277a06b46353bfb36437fdf921e7ad39..69b08e8c10e29d6c0ecf64ed476a3cd700f2e947 100644 (file)
@@ -121,6 +121,7 @@ NineBuffer9_ctor( struct NineBuffer9 *This,
     info->array_size = 1;
     info->last_level = 0;
     info->nr_samples = 0;
+    info->nr_storage_samples = 0;
 
     hr = NineResource9_ctor(&This->base, pParams, NULL, TRUE,
                             Type, Pool, Usage);
index 65251ad2b7e2d35c90bb314e0541c0c7bebff719..89821682f8f293c710e698ea4f7026bca9e8ad3e 100644 (file)
@@ -90,6 +90,7 @@ NineCubeTexture9_ctor( struct NineCubeTexture9 *This,
         info->last_level = util_logbase2(EdgeLength);
     info->array_size = 6;
     info->nr_samples = 0;
+    info->nr_storage_samples = 0;
     info->bind = PIPE_BIND_SAMPLER_VIEW;
     info->usage = PIPE_USAGE_DEFAULT;
     info->flags = 0;
index 127f2ae195bd530f080d4feeeabec34a9b9d46e5..c434efb8bc7fce8bf43f5f4b05b64d0704097795 100644 (file)
@@ -3008,7 +3008,7 @@ NineDevice9_ProcessVertices( struct NineDevice9 *This,
         templ.bind = PIPE_BIND_STREAM_OUTPUT;
         templ.usage = PIPE_USAGE_STREAM;
         templ.height0 = templ.depth0 = templ.array_size = 1;
-        templ.last_level = templ.nr_samples = 0;
+        templ.last_level = templ.nr_samples = templ.nr_storage_samples = 0;
 
         resource = screen_sw->resource_create(screen_sw, &templ);
         if (!resource)
index d917fa1f86895062b096f99ac98ab95bddd2ad61..4c6a69577037f9248366a83a29c5b3fb9307af51 100644 (file)
@@ -104,6 +104,7 @@ NineSurface9_ctor( struct NineSurface9 *This,
     This->base.info.last_level = 0;
     This->base.info.array_size = 1;
     This->base.info.nr_samples = multisample_type;
+    This->base.info.nr_storage_samples = multisample_type;
     This->base.info.usage = PIPE_USAGE_DEFAULT;
     This->base.info.bind = PIPE_BIND_SAMPLER_VIEW; /* StretchRect */
 
@@ -803,6 +804,7 @@ NineSurface9_SetResourceResize( struct NineSurface9 *This,
     This->desc.Width = This->base.info.width0 = resource->width0;
     This->desc.Height = This->base.info.height0 = resource->height0;
     This->base.info.nr_samples = resource->nr_samples;
+    This->base.info.nr_storage_samples = resource->nr_storage_samples;
 
     This->stride = nine_format_get_stride(This->base.info.format,
                                           This->desc.Width);
index 7cf5c54bfa89f15a830b25abd9e14c9a47ff17e1..aa485a6268b20954a90df1fb8b7e33e18e87455a 100644 (file)
@@ -307,6 +307,7 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
     for (i = 0; i < newBufferCount; ++i) {
         tmplt.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
         tmplt.nr_samples = multisample_type;
+        tmplt.nr_storage_samples = multisample_type;
         if (!has_present_buffers)
             tmplt.bind |= NINE_BIND_PRESENTBUFFER_FLAGS;
         tmplt.format = d3d9_to_pipe_format_checked(This->screen,
@@ -345,6 +346,7 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
             tmplt.format = PIPE_FORMAT_B8G8R8X8_UNORM;
             tmplt.bind = NINE_BIND_PRESENTBUFFER_FLAGS;
             tmplt.nr_samples = 0;
+            tmplt.nr_storage_samples = 0;
             if (This->actx->linear_framebuffer)
                 tmplt.bind |= PIPE_BIND_LINEAR;
             if (pParams->SwapEffect != D3DSWAPEFFECT_DISCARD)
@@ -361,6 +363,7 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
     if (pParams->EnableAutoDepthStencil) {
         tmplt.bind = d3d9_get_pipe_depth_format_bindings(pParams->AutoDepthStencilFormat);
         tmplt.nr_samples = multisample_type;
+        tmplt.nr_storage_samples = multisample_type;
         tmplt.format = d3d9_to_pipe_format_checked(This->screen,
                                                    pParams->AutoDepthStencilFormat,
                                                    PIPE_TEXTURE_2D,
index 78ca4add4aef88225edfef85068ff9a37339aa3c..fca5e6032307fcd0678602a5153c1b4aefa05551 100644 (file)
@@ -131,6 +131,7 @@ NineTexture9_ctor( struct NineTexture9 *This,
         info->last_level = util_logbase2(MAX2(Width, Height));
     info->array_size = 1;
     info->nr_samples = 0;
+    info->nr_storage_samples = 0;
     info->bind = PIPE_BIND_SAMPLER_VIEW;
     info->usage = PIPE_USAGE_DEFAULT;
     info->flags = 0;
index 62af3e622513f29952a754708f615bdf9d61d01e..ec811aeba13db456f8dccb5a810cfcd5a55b5372 100644 (file)
@@ -92,6 +92,7 @@ NineVolume9_ctor( struct NineVolume9 *This,
     This->info.last_level = 0;
     This->info.array_size = 1;
     This->info.nr_samples = 0;
+    This->info.nr_storage_samples = 0;
     This->info.usage = PIPE_USAGE_DEFAULT;
     This->info.bind = PIPE_BIND_SAMPLER_VIEW;
     This->info.flags = 0;
index c836dd21023f0a1c12ca7555e1603f7987013139..5dec484486435cc2fed7131104f35d241c30dae0 100644 (file)
@@ -88,6 +88,7 @@ NineVolumeTexture9_ctor( struct NineVolumeTexture9 *This,
         info->last_level = util_logbase2(MAX2(MAX2(Width, Height), Depth));
     info->array_size = 1;
     info->nr_samples = 0;
+    info->nr_storage_samples = 0;
     info->bind = PIPE_BIND_SAMPLER_VIEW;
     info->usage = PIPE_USAGE_DEFAULT;
     info->flags = 0;
index 7cf18f0a8b0f31d9db16e488dbeb836939fdad74..2445c33a2931ad96751a09429ffe08a197c83433 100644 (file)
@@ -95,6 +95,7 @@ stw_st_framebuffer_validate_locked(struct st_framebuffer_iface *stfb,
    templ.array_size = 1;
    templ.last_level = 0;
    templ.nr_samples = stwfb->stvis.samples;
+   templ.nr_storage_samples = stwfb->stvis.samples;;
 
    for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
       enum pipe_format format;
index 45b0cc069bdd86e34b7412b6e5133c89a2ac5a64..2a08ae154854e35f15cfd2865c52a5c65f9b6f42 100644 (file)
@@ -73,7 +73,6 @@ static void init( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = (PIPE_BIND_RENDER_TARGET |
                    PIPE_BIND_DISPLAY_TARGET);
    
index d1ade1d2b4bb53f9d551357de364200c3c160332..cc87b02a0a2485baa14cff86aaeac85a3191a150 100644 (file)
@@ -301,7 +301,6 @@ static void init_tex( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = PIPE_BIND_SAMPLER_VIEW;
 
    
@@ -411,7 +410,6 @@ static void init( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = (PIPE_BIND_RENDER_TARGET |
                    PIPE_BIND_DISPLAY_TARGET);
    
index 36064e18a2597bb8591be3d5aa85408466e77098..c919ec77198879fd3782bd2ff462af23c8cd4af2 100644 (file)
@@ -77,7 +77,6 @@ graw_util_create_window(struct graw_info *info,
       resource_temp.depth0 = 1;
       resource_temp.array_size = 1;
       resource_temp.last_level = 0;
-      resource_temp.nr_samples = 1;
       resource_temp.bind = (PIPE_BIND_RENDER_TARGET |
                             PIPE_BIND_DISPLAY_TARGET);
       info->color_buf[i] = info->screen->resource_create(info->screen,
@@ -109,7 +108,6 @@ graw_util_create_window(struct graw_info *info,
    resource_temp.depth0 = 1;
    resource_temp.array_size = 1;
    resource_temp.last_level = 0;
-   resource_temp.nr_samples = 1;
    resource_temp.bind = PIPE_BIND_DEPTH_STENCIL;
    info->zs_buf = info->screen->resource_create(info->screen, &resource_temp);
    if (!info->zs_buf) {
@@ -233,7 +231,6 @@ graw_util_create_tex2d(const struct graw_info *info,
    temp.depth0 = 1;
    temp.last_level = 0;
    temp.array_size = 1;
-   temp.nr_samples = 1;
    temp.bind = PIPE_BIND_SAMPLER_VIEW;
    
    tex = info->screen->resource_create(info->screen, &temp);
index dad3298d159881e58aba14dcba26f3009c607f3a..9c3c29bc3c64158437a9ce23311847b5eea7bd11 100644 (file)
@@ -158,7 +158,6 @@ static void init_fs_constbuf( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = PIPE_BIND_CONSTANT_BUFFER;
 
    constbuf1 = screen->resource_create(screen, &templat);
@@ -392,7 +391,6 @@ static void init_tex( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = PIPE_BIND_SAMPLER_VIEW;
 
    
@@ -502,7 +500,6 @@ static void init( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = (PIPE_BIND_RENDER_TARGET |
                    PIPE_BIND_DISPLAY_TARGET);
    
index 79174204dbbf1e795dcdab5c366d5411d9e5795f..d532e60e1e266295f499f63f1fb0a2c62d67dc88 100644 (file)
@@ -216,7 +216,6 @@ static void init_tex( void )
    templat.height0 = SIZE;
    templat.depth0 = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = PIPE_BIND_SAMPLER_VIEW;
 
    
@@ -326,7 +325,6 @@ static void init( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = (PIPE_BIND_RENDER_TARGET |
                    PIPE_BIND_DISPLAY_TARGET);
    
index fb4344c088eae07b9d3f76bd358bf97fcf1f5679..4178448f768394776e2efe455d5240392ed82931 100644 (file)
@@ -199,7 +199,6 @@ static void init( void )
    templat.height0 = HEIGHT;
    templat.depth0 = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = (PIPE_BIND_RENDER_TARGET |
                    PIPE_BIND_DISPLAY_TARGET);
    
index 2ca36ce91ba7f8edb8c26a3793d8cac24c42f508..5efc9e87c4c44fe62f11caa4da96306a60faf730 100644 (file)
@@ -207,7 +207,6 @@ static void init( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = (PIPE_BIND_RENDER_TARGET |
                    PIPE_BIND_DISPLAY_TARGET);
    
index 6c6783c930cd4cffc2888054ad6683b6497ccc1e..9bd2ff58687607a476c91441819806e92b885c24 100644 (file)
@@ -258,7 +258,6 @@ static void init( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = (PIPE_BIND_RENDER_TARGET |
                    PIPE_BIND_DISPLAY_TARGET);
    
index e3b50ea8f89d48821fb5569c28979238e266d78e..26976f41682b4a01419b13849df21b206a686239 100644 (file)
@@ -90,7 +90,6 @@ static void init_fs_constbuf( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = PIPE_BIND_CONSTANT_BUFFER;
 
    constbuf = screen->resource_create(screen,
@@ -290,7 +289,6 @@ static void init_tex( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = PIPE_BIND_SAMPLER_VIEW;
 
    
@@ -400,7 +398,6 @@ static void init( void )
    templat.depth0 = 1;
    templat.array_size = 1;
    templat.last_level = 0;
-   templat.nr_samples = 1;
    templat.bind = (PIPE_BIND_RENDER_TARGET |
                    PIPE_BIND_DISPLAY_TARGET);
    
index f5d8c0478008a80695165b11abfdb4bd07ce0571..6d3eda014dc7bca7790ff26b847de0f37ed071c1 100644 (file)
@@ -360,7 +360,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 +372,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 +444,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 +469,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,
index 698c7046c1a6c407ede2eb8accb6388d598c5af5..fb41b7b73cfea877c2fd125e04ba88d5b6d82529 100644 (file)
@@ -204,6 +204,8 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
    templ.depth0 = 1;
    templ.array_size = 1;
    templ.nr_samples = rb->NumSamples;
+   templ.nr_storage_samples = rb->NumSamples;
+
    if (util_format_is_depth_or_stencil(format)) {
       templ.bind = PIPE_BIND_DEPTH_STENCIL;
    }
index 56d8c41147245e089dc95d5868bc33c724b40def..d1f060dc9790843ee0829b3793e311d671b59683 100644 (file)
@@ -2791,6 +2791,7 @@ st_texture_create_from_memory(struct st_context *st,
    /* only set this for OpenGL textures, not renderbuffers */
    pt.flags = PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY;
    pt.nr_samples = nr_samples;
+   pt.nr_storage_samples = nr_samples;
 
    newtex = screen->resource_from_memobj(screen, &pt, memObj->memory, offset);
 
@@ -2956,6 +2957,7 @@ st_TestProxyTexImage(struct gl_context *ctx, GLenum target,
       pt.target = gl_target_to_pipe(target);
       pt.format = st_mesa_format_to_pipe_format(st, format);
       pt.nr_samples = numSamples;
+      pt.nr_storage_samples = numSamples;
 
       st_gl_texture_dims_to_pipe_dims(target,
                                       width, height, depth,
index 7d8303615e90fa739d547acd49799f21916b381e..09314519d484e47deb0d2e9eb2b064362f5146dc 100644 (file)
@@ -95,6 +95,7 @@ st_texture_create(struct st_context *st,
    /* only set this for OpenGL textures, not renderbuffers */
    pt.flags = PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY;
    pt.nr_samples = nr_samples;
+   pt.nr_storage_samples = nr_samples;
 
    newtex = screen->resource_create(screen, &pt);