gallium: add storage_sample_count parameter into is_format_supported
authorMarek Olšák <marek.olsak@amd.com>
Wed, 23 May 2018 22:46:19 +0000 (18:46 -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>
80 files changed:
src/gallium/auxiliary/driver_ddebug/dd_screen.c
src/gallium/auxiliary/driver_noop/noop_pipe.c
src/gallium/auxiliary/driver_rbug/rbug_screen.c
src/gallium/auxiliary/driver_trace/tr_screen.c
src/gallium/auxiliary/hud/font.c
src/gallium/auxiliary/hud/hud_context.c
src/gallium/auxiliary/postprocess/pp_init.c
src/gallium/auxiliary/postprocess/pp_mlaa.c
src/gallium/auxiliary/postprocess/pp_program.c
src/gallium/auxiliary/util/u_blit.c
src/gallium/auxiliary/util/u_blitter.c
src/gallium/auxiliary/util/u_gen_mipmap.c
src/gallium/auxiliary/util/u_threaded_context.c
src/gallium/auxiliary/util/u_vbuf.c
src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
src/gallium/auxiliary/vl/vl_video_buffer.c
src/gallium/docs/source/screen.rst
src/gallium/drivers/etnaviv/etnaviv_screen.c
src/gallium/drivers/freedreno/a2xx/fd2_screen.c
src/gallium/drivers/freedreno/a3xx/fd3_screen.c
src/gallium/drivers/freedreno/a4xx/fd4_screen.c
src/gallium/drivers/freedreno/a5xx/fd5_screen.c
src/gallium/drivers/freedreno/freedreno_resource.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/i915/i915_screen.h
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nouveau/nv30/nv30_screen.c
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/r300/r300_blit.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_texture.c
src/gallium/drivers/radeonsi/si_clear.c
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/svga/svga_format.c
src/gallium/drivers/svga/svga_format.h
src/gallium/drivers/svga/svga_pipe_clear.c
src/gallium/drivers/svga/svga_resource_texture.c
src/gallium/drivers/swr/swr_screen.cpp
src/gallium/drivers/tegra/tegra_screen.c
src/gallium/drivers/v3d/v3d_screen.c
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_screen.h
src/gallium/state_trackers/clover/core/format.cpp
src/gallium/state_trackers/dri/dri2.c
src/gallium/state_trackers/dri/dri_query_renderer.c
src/gallium/state_trackers/dri/dri_screen.c
src/gallium/state_trackers/glx/xlib/xm_api.c
src/gallium/state_trackers/nine/basetexture9.c
src/gallium/state_trackers/nine/device9.c
src/gallium/state_trackers/nine/nine_pipe.h
src/gallium/state_trackers/nine/surface9.c
src/gallium/state_trackers/va/subpicture.c
src/gallium/state_trackers/vdpau/query.c
src/gallium/state_trackers/vdpau/vdpau_private.h
src/gallium/state_trackers/wgl/stw_pixelformat.c
src/gallium/state_trackers/xa/xa_context.c
src/gallium/state_trackers/xa/xa_renderer.c
src/gallium/state_trackers/xa/xa_tracker.c
src/gallium/state_trackers/xvmc/subpicture.c
src/gallium/tests/trivial/compute.c
src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
src/mesa/state_tracker/st_atom_framebuffer.c
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_eglimage.c
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_format.c
src/mesa/state_tracker/st_manager.c
src/mesa/state_tracker/st_texture.c

index 5f922d884fe120a12110288f47f87bd39f097b02..a89af8a8d62663c652ed76c9e9e8ff3fba644aff 100644 (file)
@@ -147,12 +147,13 @@ dd_screen_is_format_supported(struct pipe_screen *_screen,
                               enum pipe_format format,
                               enum pipe_texture_target target,
                               unsigned sample_count,
+                              unsigned storage_sample_count,
                               unsigned tex_usage)
 {
    struct pipe_screen *screen = dd_screen(_screen)->screen;
 
    return screen->is_format_supported(screen, format, target, sample_count,
-                                      tex_usage);
+                                      storage_sample_count, tex_usage);
 }
 
 static boolean
index 9e39e65b4d004087943164041eb6211567fb9318..7de3e8823981cdd992a92427507611b5d3326063 100644 (file)
@@ -420,11 +420,13 @@ static boolean noop_is_format_supported(struct pipe_screen* pscreen,
                                         enum pipe_format format,
                                         enum pipe_texture_target target,
                                         unsigned sample_count,
+                                        unsigned storage_sample_count,
                                         unsigned usage)
 {
    struct pipe_screen *screen = ((struct noop_pipe_screen*)pscreen)->oscreen;
 
-   return screen->is_format_supported(screen, format, target, sample_count, usage);
+   return screen->is_format_supported(screen, format, target, sample_count,
+                                      storage_sample_count, usage);
 }
 
 static uint64_t noop_get_timestamp(struct pipe_screen *pscreen)
index a1a77add7341d7da06c85e9d253918975cefb516..693e7fab912c69da5ed75fc38891d340acba4f53 100644 (file)
@@ -124,6 +124,7 @@ rbug_screen_is_format_supported(struct pipe_screen *_screen,
                                 enum pipe_format format,
                                 enum pipe_texture_target target,
                                 unsigned sample_count,
+                                unsigned storage_sample_count,
                                 unsigned tex_usage)
 {
    struct rbug_screen *rb_screen = rbug_screen(_screen);
@@ -133,6 +134,7 @@ rbug_screen_is_format_supported(struct pipe_screen *_screen,
                                       format,
                                       target,
                                       sample_count,
+                                      storage_sample_count,
                                       tex_usage);
 }
 
index 704b2a3c72de1be6400aac5da4658564064ccbb5..b5bd3e11c465496c5a042ff2a19cae2232ee1506 100644 (file)
@@ -225,6 +225,7 @@ trace_screen_is_format_supported(struct pipe_screen *_screen,
                                  enum pipe_format format,
                                  enum pipe_texture_target target,
                                  unsigned sample_count,
+                                 unsigned storage_sample_count,
                                  unsigned tex_usage)
 {
    struct trace_screen *tr_scr = trace_screen(_screen);
@@ -240,7 +241,7 @@ trace_screen_is_format_supported(struct pipe_screen *_screen,
    trace_dump_arg(uint, tex_usage);
 
    result = screen->is_format_supported(screen, format, target, sample_count,
-                                        tex_usage);
+                                        storage_sample_count, tex_usage);
 
    trace_dump_ret(bool, result);
 
index 9fb9d7e055b2014d0ba7b64c2228e5cde9399fd9..88b0349fda2fd6c64827aec8f93df4f25dcd2749 100644 (file)
@@ -390,7 +390,7 @@ util_font_create_fixed_8x13(struct pipe_context *pipe,
 
    for (i = 0; i < ARRAY_SIZE(formats); i++) {
       if (screen->is_format_supported(screen, formats[i],
-                                   PIPE_TEXTURE_RECT, 0,
+                                   PIPE_TEXTURE_RECT, 0, 0,
                                    PIPE_BIND_SAMPLER_VIEW)) {
          tex_format = formats[i];
          break;
index 233202453ee4af675a99aab561cd9e000d662c76..3dd7c102edbe0fd4673e2bbb2b6b03ab13c6ccb4 100644 (file)
@@ -1842,7 +1842,7 @@ hud_create(struct cso_context *cso, struct hud_context *share)
    hud->refcount = 1;
    hud->has_srgb = screen->is_format_supported(screen,
                                                PIPE_FORMAT_B8G8R8A8_SRGB,
-                                               PIPE_TEXTURE_2D, 0,
+                                               PIPE_TEXTURE_2D, 0, 0,
                                                PIPE_BIND_RENDER_TARGET) != 0;
 
    /* blend state */
index b9eff78bf4f5ccf839b8960b7fef029d8ae242db..2c830e81bd71e3f78a8ef8e69fdeb127d6bf5a32 100644 (file)
@@ -279,7 +279,7 @@ pp_init_fbos(struct pp_queue_t *ppq, unsigned int w,
    tmp_res.bind = PIPE_BIND_RENDER_TARGET;
 
    if (!p->screen->is_format_supported(p->screen, tmp_res.format,
-                                       tmp_res.target, 1, tmp_res.bind))
+                                       tmp_res.target, 1, 1, tmp_res.bind))
       pp_debug("Temp buffers' format fail\n");
 
    for (i = 0; i < ppq->n_tmp; i++) {
@@ -305,12 +305,12 @@ pp_init_fbos(struct pp_queue_t *ppq, unsigned int w,
    tmp_res.format = p->surf.format = PIPE_FORMAT_S8_UINT_Z24_UNORM;
 
    if (!p->screen->is_format_supported(p->screen, tmp_res.format,
-                                       tmp_res.target, 1, tmp_res.bind)) {
+                                       tmp_res.target, 1, 1, tmp_res.bind)) {
 
       tmp_res.format = p->surf.format = PIPE_FORMAT_Z24_UNORM_S8_UINT;
 
       if (!p->screen->is_format_supported(p->screen, tmp_res.format,
-                                          tmp_res.target, 1, tmp_res.bind))
+                                          tmp_res.target, 1, 1, tmp_res.bind))
          pp_debug("Temp Sbuffer format fail\n");
    }
 
index f003ee75fd5f3420b8f07f740930b5542e80cee3..fd5a55dde0a1338a9b1a1069a84ae7b2a5f36b71 100644 (file)
@@ -243,7 +243,7 @@ pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n,
    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))
+                                            res.target, 1, 1, res.bind))
       pp_debug("Areamap format not supported\n");
 
    ppq->areamaptex = ppq->p->screen->resource_create(ppq->p->screen, &res);
index 811f1fb07736a6e9bb37b9037d60e3e29892eb5d..cb06c8d81f31998774686472db89aa5be30dd78b 100644 (file)
@@ -119,7 +119,7 @@ pp_init_prog(struct pp_queue_t *ppq, struct pipe_context *pipe,
 
    if (!p->screen->is_format_supported(p->screen,
                                        PIPE_FORMAT_R32G32B32A32_FLOAT,
-                                       PIPE_BUFFER, 1,
+                                       PIPE_BUFFER, 1, 1,
                                        PIPE_BIND_VERTEX_BUFFER))
       pp_debug("Vertex buf format fail\n");
 
index 9a43c2f655625fa388c368545cab5f045cc9063f..ca3d221ed3679c7638ac9120bb8104c944da9db1 100644 (file)
@@ -551,6 +551,7 @@ util_blit_pixels_tex(struct blit_state *ctx,
    assert(ctx->pipe->screen->is_format_supported(ctx->pipe->screen, dst->format,
                                                  PIPE_TEXTURE_2D,
                                                  dst->texture->nr_samples,
+                                                 dst->texture->nr_storage_samples,
                                                  PIPE_BIND_RENDER_TARGET));
 
    /* save state (restored below) */
index eadb76a109fbf7cf6d90c5f3b97b44ed16d800b5..a9df71108b4390c36f073f4f2518dd6dd3c412b2 100644 (file)
@@ -1182,7 +1182,7 @@ void util_blitter_cache_all_shaders(struct blitter_context *blitter)
             /* MSAA resolve shaders. */
             for (j = 2; j < 32; j++) {
                if (!screen->is_format_supported(screen, PIPE_FORMAT_R32_FLOAT,
-                                                target, j,
+                                                target, j, j,
                                                 PIPE_BIND_SAMPLER_VIEW)) {
                   continue;
                }
@@ -1539,7 +1539,8 @@ static bool is_blit_generic_supported(struct blitter_context *blitter,
          bind = PIPE_BIND_RENDER_TARGET;
 
       if (!screen->is_format_supported(screen, dst_format, dst->target,
-                                       dst->nr_samples, bind)) {
+                                       dst->nr_samples, dst->nr_storage_samples,
+                                       bind)) {
          return false;
       }
    }
@@ -1550,7 +1551,8 @@ static bool is_blit_generic_supported(struct blitter_context *blitter,
       }
 
       if (!screen->is_format_supported(screen, src_format, src->target,
-                                 src->nr_samples, PIPE_BIND_SAMPLER_VIEW)) {
+                                       src->nr_samples, src->nr_storage_samples,
+                                       PIPE_BIND_SAMPLER_VIEW)) {
          return false;
       }
 
@@ -1564,6 +1566,7 @@ static bool is_blit_generic_supported(struct blitter_context *blitter,
             if (stencil_format != src_format &&
                 !screen->is_format_supported(screen, stencil_format,
                                              src->target, src->nr_samples,
+                                             src->nr_storage_samples,
                                              PIPE_BIND_SAMPLER_VIEW)) {
                return false;
             }
index 3c55d9f385c7e96b8f5eb65cf2dced9323483333..06737c58fe87f4931528d432eab3d2b58cbe0090 100644 (file)
@@ -76,7 +76,7 @@ util_gen_mipmap(struct pipe_context *pipe, struct pipe_resource *pt,
       return TRUE;
 
    if (!screen->is_format_supported(screen, format, pt->target,
-                                    pt->nr_samples,
+                                    pt->nr_samples, pt->nr_storage_samples,
                                     PIPE_BIND_SAMPLER_VIEW |
                                     (is_zs ? PIPE_BIND_DEPTH_STENCIL :
                                      PIPE_BIND_RENDER_TARGET))) {
index 28d0f77ebaa0a04c9df28883492c5518ac1290b3..fc7eb1388353f8918a0de21a5f87de153d2c5344 100644 (file)
@@ -2205,7 +2205,8 @@ tc_generate_mipmap(struct pipe_context *_pipe,
       bind = PIPE_BIND_RENDER_TARGET;
 
    if (!screen->is_format_supported(screen, format, res->target,
-                                    res->nr_samples, bind))
+                                    res->nr_samples, res->nr_storage_samples,
+                                    bind))
       return false;
 
    struct tc_generate_mipmap *p =
index 39aeb87003bcc23286b36832d4cfcb9d893eeb01..746ff1085cecf8d7ad8fe3c66872bcb508e79b87 100644 (file)
@@ -269,7 +269,7 @@ boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps,
    for (i = 0; i < ARRAY_SIZE(vbuf_format_fallbacks); i++) {
       enum pipe_format format = vbuf_format_fallbacks[i].from;
 
-      if (!screen->is_format_supported(screen, format, PIPE_BUFFER, 0,
+      if (!screen->is_format_supported(screen, format, PIPE_BUFFER, 0, 0,
                                        PIPE_BIND_VERTEX_BUFFER)) {
          caps->format_translation[format] = vbuf_format_fallbacks[i].to;
          fallback = TRUE;
index 8a2dae34e358cfb3d4da15a268c3c9240f5047ed..9589b1e89e065aaca900ce7748b0fd0e29cea19c 100644 (file)
@@ -908,20 +908,20 @@ find_format_config(struct vl_mpeg12_decoder *dec, const struct format_config con
 
    for (i = 0; i < num_configs; ++i) {
       if (!screen->is_format_supported(screen, configs[i].zscan_source_format, PIPE_TEXTURE_2D,
-                                       1, PIPE_BIND_SAMPLER_VIEW))
+                                       1, 1, PIPE_BIND_SAMPLER_VIEW))
          continue;
 
       if (configs[i].idct_source_format != PIPE_FORMAT_NONE) {
          if (!screen->is_format_supported(screen, configs[i].idct_source_format, PIPE_TEXTURE_2D,
-                                          1, PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET))
+                                          1, 1, PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET))
             continue;
 
          if (!screen->is_format_supported(screen, configs[i].mc_source_format, PIPE_TEXTURE_3D,
-                                          1, PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET))
+                                          1, 1, PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET))
             continue;
       } else {
          if (!screen->is_format_supported(screen, configs[i].mc_source_format, PIPE_TEXTURE_2D,
-                                          1, PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET))
+                                          1, 1, PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET))
             continue;
       }
       return &configs[i];
index 3b97ac81af9fe11f64e4607b8ee54d79dd6b4500..5b54ee1dd685ef60639c9e356626d63189455e26 100644 (file)
@@ -192,11 +192,11 @@ vl_video_buffer_is_format_supported(struct pipe_screen *screen,
          continue;
 
       /* we at least need to sample from it */
-      if (!screen->is_format_supported(screen, format, PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW))
+      if (!screen->is_format_supported(screen, format, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW))
          return false;
 
       format = vl_video_buffer_surface_format(format);
-      if (!screen->is_format_supported(screen, format, PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET))
+      if (!screen->is_format_supported(screen, format, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_RENDER_TARGET))
          return false;
    }
 
index ecff0800bf8a7d3b8ffc702f5c5a12e377c8f1e7..e85246c47786c35b8c2af16ec468adf7f1abc769 100644 (file)
@@ -746,6 +746,9 @@ Determine if a resource in the given format can be used in a specific manner.
 **sample_count** the number of samples. 0 and 1 mean no multisampling,
 the maximum allowed legal value is 32.
 
+**storage_sample_count** the number of storage samples. This must be <=
+sample_count. See the documentation of ``pipe_resource::nr_storage_samples``.
+
 **bindings** is a bitmask of :ref:`PIPE_BIND` flags.
 
 Returns TRUE if all usages can be satisfied.
index d4abf99947e25feb9093d423bc199dc9f11a693a..35707e604458c226420517fe90cd92cc5950f565 100644 (file)
@@ -534,7 +534,9 @@ static boolean
 etna_screen_is_format_supported(struct pipe_screen *pscreen,
                                 enum pipe_format format,
                                 enum pipe_texture_target target,
-                                unsigned sample_count, unsigned usage)
+                                unsigned sample_count,
+                                unsigned storage_sample_count,
+                                unsigned usage)
 {
    struct etna_screen *screen = etna_screen(pscreen);
    unsigned allowed = 0;
@@ -547,6 +549,9 @@ etna_screen_is_format_supported(struct pipe_screen *pscreen,
        target != PIPE_TEXTURE_RECT)
       return FALSE;
 
+   if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+      return false;
+
    if (usage & PIPE_BIND_RENDER_TARGET) {
       /* if render target, must be RS-supported format */
       if (translate_rs_format(format) != ETNA_NO_MATCH) {
index 4fdf6914ab264b0c0a4ad287f5baea0ca2b3755c..2f701ddaa2f8f43da955ab8b9dc54e2492e706ba 100644 (file)
@@ -38,6 +38,7 @@ fd2_screen_is_format_supported(struct pipe_screen *pscreen,
                enum pipe_format format,
                enum pipe_texture_target target,
                unsigned sample_count,
+               unsigned storage_sample_count,
                unsigned usage)
 {
        unsigned retval = 0;
@@ -49,6 +50,9 @@ fd2_screen_is_format_supported(struct pipe_screen *pscreen,
                return FALSE;
        }
 
+       if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+               return false;
+
        /* TODO figure out how to render to other formats.. */
        if ((usage & PIPE_BIND_RENDER_TARGET) &&
                        ((format != PIPE_FORMAT_B5G6R5_UNORM) &&
index 366f07ef34b75d2a81cabd57e276e380fe1fa827..a1c46684d4b3159c5b9ef609571f8a1f93c8433b 100644 (file)
@@ -39,6 +39,7 @@ fd3_screen_is_format_supported(struct pipe_screen *pscreen,
                enum pipe_format format,
                enum pipe_texture_target target,
                unsigned sample_count,
+               unsigned storage_sample_count,
                unsigned usage)
 {
        unsigned retval = 0;
@@ -50,6 +51,9 @@ fd3_screen_is_format_supported(struct pipe_screen *pscreen,
                return FALSE;
        }
 
+       if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+               return false;
+
        if ((usage & PIPE_BIND_VERTEX_BUFFER) &&
                        (fd3_pipe2vtx(format) != (enum a3xx_vtx_fmt)~0)) {
                retval |= PIPE_BIND_VERTEX_BUFFER;
index 30124e4485d6b90abc7673575562340f1331a7a9..bfec76cab62b6cfc1abc237075bf374a0874a261 100644 (file)
@@ -39,6 +39,7 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen,
                enum pipe_format format,
                enum pipe_texture_target target,
                unsigned sample_count,
+               unsigned storage_sample_count,
                unsigned usage)
 {
        unsigned retval = 0;
@@ -50,6 +51,9 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen,
                return FALSE;
        }
 
+       if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+               return false;
+
        if ((usage & PIPE_BIND_VERTEX_BUFFER) &&
                        (fd4_pipe2vtx(format) != (enum a4xx_vtx_fmt)~0)) {
                retval |= PIPE_BIND_VERTEX_BUFFER;
index 37095be75361f3500080775ff85e5a5b2e2b7982..7d8d2b3e5b8dbb683f90bfd9f74260eb98648b6b 100644 (file)
@@ -54,6 +54,7 @@ fd5_screen_is_format_supported(struct pipe_screen *pscreen,
                enum pipe_format format,
                enum pipe_texture_target target,
                unsigned sample_count,
+               unsigned storage_sample_count,
                unsigned usage)
 {
        unsigned retval = 0;
@@ -65,6 +66,9 @@ fd5_screen_is_format_supported(struct pipe_screen *pscreen,
                return FALSE;
        }
 
+       if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+               return false;
+
        if ((usage & PIPE_BIND_VERTEX_BUFFER) &&
                        (fd5_pipe2vtx(format) != (enum a5xx_vtx_fmt)~0)) {
                retval |= PIPE_BIND_VERTEX_BUFFER;
index 8147ff57a990c880303f2c0b804e88fa885ae5c8..3fbf50003e9df2ba700dc704458583692c55c3f0 100644 (file)
@@ -148,6 +148,7 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc,
         */
        if (!pctx->screen->is_format_supported(pctx->screen,
                        prsc->format, prsc->target, prsc->nr_samples,
+                       prsc->nr_storage_samples,
                        PIPE_BIND_RENDER_TARGET))
                fallback = true;
 
index 132a9fce034b43abe993eb377da4634eac0fe76b..dda7c5baee5485226ce05e8a2cc6afcbddadafa5 100644 (file)
@@ -462,6 +462,7 @@ i915_is_format_supported(struct pipe_screen *screen,
                          enum pipe_format format,
                          enum pipe_texture_target target,
                          unsigned sample_count,
+                         unsigned storage_sample_count,
                          unsigned tex_usage)
 {
    static const enum pipe_format tex_supported[] = {
@@ -517,6 +518,9 @@ i915_is_format_supported(struct pipe_screen *screen,
    if (sample_count > 1)
       return FALSE;
 
+   if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+      return false;
+
    if(tex_usage & PIPE_BIND_DEPTH_STENCIL)
       list = depth_supported;
    else if (tex_usage & PIPE_BIND_RENDER_TARGET)
index 3be941a15618bba8a343e525a53a15ecda8f6443..c58055ab836a102d92e5682565d7120acec23da3 100644 (file)
@@ -70,6 +70,7 @@ i915_is_format_supported(struct pipe_screen *screen,
                          enum pipe_format format,
                          enum pipe_texture_target target,
                          unsigned sample_count,
+                         unsigned storage_sample_count,
                          unsigned tex_usage);
 
 #endif /* I915_SCREEN_H */
index 0d0a34543753fd871c008a4886bd4e7e97da0170..261bca907a6321f3c2f0e6888ae5492c37a4df4e 100644 (file)
@@ -455,6 +455,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
                               enum pipe_format format,
                               enum pipe_texture_target target,
                               unsigned sample_count,
+                              unsigned storage_sample_count,
                               unsigned bind)
 {
    struct llvmpipe_screen *screen = llvmpipe_screen(_screen);
@@ -478,6 +479,9 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
    if (sample_count > 1)
       return FALSE;
 
+   if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+      return false;
+
    if (bind & PIPE_BIND_RENDER_TARGET) {
       if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) {
          /* this is a lie actually other formats COULD exist where we would fail */
index bddb2e6a385180cd507400302669b28e17205b21..556bd9bbbbe85d38e3f130eb9a3f4ea9d544bb65 100644 (file)
@@ -415,6 +415,7 @@ nv30_screen_is_format_supported(struct pipe_screen *pscreen,
                                 enum pipe_format format,
                                 enum pipe_texture_target target,
                                 unsigned sample_count,
+                                unsigned storage_sample_count,
                                 unsigned bindings)
 {
    if (sample_count > nv30_screen(pscreen)->max_sample_count)
@@ -423,6 +424,9 @@ nv30_screen_is_format_supported(struct pipe_screen *pscreen,
    if (!(0x00000017 & (1 << sample_count)))
       return false;
 
+   if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+      return false;
+
    /* shared is always supported */
    bindings &= ~PIPE_BIND_SHARED;
 
index 9f8bb46507aa522734c400eaf8642d1d40cb2592..cea6818bc9afdc37f540f17f012cc2e4c0f454d1 100644 (file)
@@ -46,6 +46,7 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
                                 enum pipe_format format,
                                 enum pipe_texture_target target,
                                 unsigned sample_count,
+                                unsigned storage_sample_count,
                                 unsigned bindings)
 {
    if (sample_count > 8)
@@ -55,6 +56,9 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
    if (sample_count == 8 && util_format_get_blocksizebits(format) >= 128)
       return false;
 
+   if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+      return false;
+
    switch (format) {
    case PIPE_FORMAT_Z16_UNORM:
       if (nv50_screen(pscreen)->tesla->oclass < NVA0_3D_CLASS)
index 7f32900a6e96494fe64d31e3dcfb56ea43f9097c..2cbbdc0cc35d6d33f0a4f1862ea5da9146e06571 100644 (file)
@@ -185,6 +185,7 @@ nv50_fragprog_validate(struct nv50_context *nv50)
                fb->cbufs[0]->format,
                fb->cbufs[0]->texture->target,
                fb->cbufs[0]->texture->nr_samples,
+               fb->cbufs[0]->texture->nr_storage_samples,
                PIPE_BIND_BLENDABLE);
       /* If we already have alphatest code, we have to keep updating
        * it. However we only have to have different code if the current RT0 is
index a206db38b322b06d071efdc843528f6058f5473c..daa4edb0dcaa917da39f9e7ddaad25dc6262feec 100644 (file)
@@ -42,6 +42,7 @@ nvc0_screen_is_format_supported(struct pipe_screen *pscreen,
                                 enum pipe_format format,
                                 enum pipe_texture_target target,
                                 unsigned sample_count,
+                                unsigned storage_sample_count,
                                 unsigned bindings)
 {
    const struct util_format_description *desc = util_format_description(format);
@@ -51,6 +52,9 @@ nvc0_screen_is_format_supported(struct pipe_screen *pscreen,
    if (!(0x117 & (1 << sample_count))) /* 0, 1, 2, 4 or 8 */
       return false;
 
+   if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+      return false;
+
    /* Short-circuit the rest of the logic -- this is used by the state tracker
     * to determine valid MS levels in a no-attachments scenario.
     */
index bc497757a93076eb7f61109d969a472555c73f41..01fccfbe7edf523d985e94d375e1cba6ac149eb2 100644 (file)
@@ -574,10 +574,10 @@ static void r300_resource_copy_region(struct pipe_context *pipe,
     /* Handle non-renderable plain formats. */
     if (layout == UTIL_FORMAT_LAYOUT_PLAIN &&
         (!screen->is_format_supported(screen, src_templ.format, src->target,
-                                      src->nr_samples,
+                                      src->nr_samples, src->nr_storage_samples,
                                       PIPE_BIND_SAMPLER_VIEW) ||
          !screen->is_format_supported(screen, dst_templ.format, dst->target,
-                                      dst->nr_samples,
+                                      dst->nr_samples, dst->nr_storage_samples,
                                       PIPE_BIND_RENDER_TARGET))) {
         switch (util_format_get_blocksize(dst_templ.format)) {
             case 1:
@@ -644,9 +644,11 @@ static void r300_resource_copy_region(struct pipe_context *pipe,
     /* Fallback for textures. */
     if (!screen->is_format_supported(screen, dst_templ.format,
                                      dst->target, dst->nr_samples,
+                                     dst->nr_storage_samples,
                                      PIPE_BIND_RENDER_TARGET) ||
        !screen->is_format_supported(screen, src_templ.format,
                                      src->target, src->nr_samples,
+                                     src->nr_storage_samples,
                                      PIPE_BIND_SAMPLER_VIEW)) {
         assert(0 && "this shouldn't happen, update r300_is_blit_supported");
         util_resource_copy_region(pipe, dst, dst_level, dstx, dsty, dstz,
index 06168090829ac6b1eb75777b9ddea645cf5f0efe..046d68c0b5911c2ad3c7461b75142aac0fa902cb 100644 (file)
@@ -591,6 +591,7 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
                                         enum pipe_format format,
                                         enum pipe_texture_target target,
                                         unsigned sample_count,
+                                        unsigned storage_sample_count,
                                         unsigned usage)
 {
     uint32_t retval = 0;
@@ -616,6 +617,9 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
                             format == PIPE_FORMAT_R16G16B16X16_FLOAT;
     const struct util_format_description *desc;
 
+    if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+        return false;
+
     /* Check multisampling support. */
     switch (sample_count) {
         case 0:
index 7f0d451156caca2e4b2f2643b8b65efba9d306a1..57e81e30c271939bf5e42ef98d3adf7017754e82 100644 (file)
@@ -243,6 +243,7 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen,
                                      enum pipe_format format,
                                      enum pipe_texture_target target,
                                      unsigned sample_count,
+                                     unsigned storage_sample_count,
                                      unsigned usage)
 {
        struct r600_screen *rscreen = (struct r600_screen*)screen;
@@ -253,6 +254,9 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen,
                return FALSE;
        }
 
+       if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+               return false;
+
        if (sample_count > 1) {
                if (!rscreen->has_msaa)
                        return FALSE;
index 08d9e6b0264865ec7375a1d148f29bebdf069ed9..6204e3c557b8ea34b3ef2f25f8dcc3f8aacd32dd 100644 (file)
@@ -706,6 +706,7 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen,
                                      enum pipe_format format,
                                      enum pipe_texture_target target,
                                      unsigned sample_count,
+                                     unsigned storage_sample_count,
                                      unsigned usage);
 void evergreen_init_color_surface(struct r600_context *rctx,
                                  struct r600_surface *surf);
@@ -762,6 +763,7 @@ boolean r600_is_format_supported(struct pipe_screen *screen,
                                 enum pipe_format format,
                                 enum pipe_texture_target target,
                                 unsigned sample_count,
+                                unsigned storage_sample_count,
                                 unsigned usage);
 void r600_update_db_shader_control(struct r600_context * rctx);
 void r600_setup_scratch_buffers(struct r600_context *rctx);
index 6af1fc4b8e43ea63de1f208954cfa7e67b6db68b..c26a38d92647fca5834003616a7ba45b79e6d398 100644 (file)
@@ -162,6 +162,7 @@ boolean r600_is_format_supported(struct pipe_screen *screen,
                                 enum pipe_format format,
                                 enum pipe_texture_target target,
                                 unsigned sample_count,
+                                unsigned storage_sample_count,
                                 unsigned usage)
 {
        struct r600_screen *rscreen = (struct r600_screen*)screen;
@@ -172,6 +173,9 @@ boolean r600_is_format_supported(struct pipe_screen *screen,
                return FALSE;
        }
 
+       if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+               return false;
+
        if (sample_count > 1) {
                if (!rscreen->has_msaa)
                        return FALSE;
index f3b9eb1115967da4de8737314c32bf70ac4a21da..9e2d5c7fc9e396bb3f9732c497fd0af2488be358 100644 (file)
@@ -1636,7 +1636,7 @@ static void r600_clear_texture(struct pipe_context *pipe,
                        desc->unpack_rgba_float(color.f, 0, data, 0, 1, 1);
 
                if (screen->is_format_supported(screen, tex->format,
-                                               tex->target, 0,
+                                               tex->target, 0, 0,
                                                PIPE_BIND_RENDER_TARGET)) {
                        pipe->clear_render_target(pipe, sf, &color,
                                                  box->x, box->y,
index 23c9962408cf5ba90d8fbe5674a8c8362523d8e5..e614ab5242374f784b94c5d176e6d8c69dbf2755 100644 (file)
@@ -736,7 +736,7 @@ static void si_clear_texture(struct pipe_context *pipe,
                        desc->unpack_rgba_float(color.f, 0, data, 0, 1, 1);
 
                if (screen->is_format_supported(screen, tex->format,
-                                               tex->target, 0,
+                                               tex->target, 0, 0,
                                                PIPE_BIND_RENDER_TARGET)) {
                        si_clear_render_target(pipe, sf, &color,
                                               box->x, box->y,
index 7bbb1f63280bef9dffba02b246f45a5ec6c26cc0..fc5d63f02d3c018cb51a8d58327f6fb9856fbd5e 100644 (file)
@@ -2132,6 +2132,7 @@ static boolean si_is_format_supported(struct pipe_screen *screen,
                                      enum pipe_format format,
                                      enum pipe_texture_target target,
                                      unsigned sample_count,
+                                     unsigned storage_sample_count,
                                      unsigned usage)
 {
        struct si_screen *sscreen = (struct si_screen *)screen;
@@ -2149,6 +2150,9 @@ static boolean si_is_format_supported(struct pipe_screen *screen,
                if (usage & PIPE_BIND_SHADER_IMAGE)
                        return false;
 
+               if (sample_count != storage_sample_count)
+                       return false;
+
                switch (sample_count) {
                case 2:
                case 4:
index 207ecc755bb5f52dce9803824f3b10f2eae9cd12..302bebfc39607eba72e92bbaba5efe547307ec9a 100644 (file)
@@ -394,6 +394,7 @@ softpipe_is_format_supported( struct pipe_screen *screen,
                               enum pipe_format format,
                               enum pipe_texture_target target,
                               unsigned sample_count,
+                              unsigned storage_sample_count,
                               unsigned bind)
 {
    struct sw_winsys *winsys = softpipe_screen(screen)->winsys;
@@ -409,6 +410,9 @@ softpipe_is_format_supported( struct pipe_screen *screen,
           target == PIPE_TEXTURE_CUBE ||
           target == PIPE_TEXTURE_CUBE_ARRAY);
 
+   if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+      return false;
+
    format_desc = util_format_description(format);
    if (!format_desc)
       return FALSE;
index c9adee11afb650a077a637de8c52c21d82965d81..0b202600c20333764d4c46ff24b4346910866a9b 100644 (file)
@@ -2082,6 +2082,7 @@ svga_is_format_supported(struct pipe_screen *screen,
                          enum pipe_format format,
                          enum pipe_texture_target target,
                          unsigned sample_count,
+                         unsigned storage_sample_count,
                          unsigned bindings)
 {
    struct svga_screen *ss = svga_screen(screen);
@@ -2091,6 +2092,9 @@ svga_is_format_supported(struct pipe_screen *screen,
 
    assert(bindings);
 
+   if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+      return false;
+
    if (sample_count > 1) {
       /* In ms_samples, if bit N is set it means that we support
        * multisample with N+1 samples per pixel.
index c063589cafe325af402436dc76a2bb9dd1576c42..11e7e41e506882b119a492490947260347de8d08 100644 (file)
@@ -127,6 +127,7 @@ svga_is_format_supported(struct pipe_screen *screen,
                          enum pipe_format format,
                          enum pipe_texture_target target,
                          unsigned sample_count,
+                         unsigned storage_sample_count,
                          unsigned bindings);
 
 
index e234ef58715907c7600b9b155e7568eb09979071..d1287178c56a1dd251b6208b550e51c70c947dce 100644 (file)
@@ -422,6 +422,7 @@ svga_clear_texture(struct pipe_context *pipe,
              pipe->screen->is_format_supported(pipe->screen, rtv->format,
                                                rtv->texture->target,
                                                rtv->texture->nr_samples,
+                                               rtv->texture->nr_storage_samples,
                                                PIPE_BIND_RENDER_TARGET)) {
             /* clear with quad drawing */
             util_blitter_save_framebuffer(svga->blitter,
index 71b8ebe7d4253b7fc87d1dc11018630c9993601d..068862bb78039950d51379775f7ea0868c91b52f 100644 (file)
@@ -1040,6 +1040,7 @@ svga_texture_create(struct pipe_screen *screen,
       if (screen->is_format_supported(screen, template->format,
                                       template->target,
                                       template->nr_samples,
+                                      template->nr_storage_samples,
                                       PIPE_BIND_SAMPLER_VIEW)) {
          bindings |= PIPE_BIND_SAMPLER_VIEW;
       }
@@ -1054,6 +1055,7 @@ svga_texture_create(struct pipe_screen *screen,
          if (screen->is_format_supported(screen, template->format,
                                          template->target,
                                          template->nr_samples,
+                                         template->nr_storage_samples,
                                          PIPE_BIND_RENDER_TARGET)) {
             bindings |= PIPE_BIND_RENDER_TARGET;
          }
@@ -1064,6 +1066,7 @@ svga_texture_create(struct pipe_screen *screen,
          if (screen->is_format_supported(screen, template->format,
                                          template->target,
                                          template->nr_samples,
+                                         template->nr_storage_samples,
                                          PIPE_BIND_DEPTH_STENCIL)) {
             bindings |= PIPE_BIND_DEPTH_STENCIL;
          }
index 19d6f442c53a4f8a8c404932ecc3d54b4b979ef0..fa232b6838bb401b9c22362b9845ef8337a3fc81 100644 (file)
@@ -85,6 +85,7 @@ swr_is_format_supported(struct pipe_screen *_screen,
                         enum pipe_format format,
                         enum pipe_texture_target target,
                         unsigned sample_count,
+                        unsigned storage_sample_count,
                         unsigned bind)
 {
    struct swr_screen *screen = swr_screen(_screen);
@@ -100,6 +101,9 @@ swr_is_format_supported(struct pipe_screen *_screen,
           || target == PIPE_TEXTURE_CUBE
           || target == PIPE_TEXTURE_CUBE_ARRAY);
 
+   if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+      return false;
+
    format_desc = util_format_description(format);
    if (!format_desc)
       return FALSE;
index 138060a249d006746244cb2702f2b24d6040f9d6..034ea271eecaead92b26ce37d10c9b0654b64714 100644 (file)
@@ -132,12 +132,14 @@ tegra_screen_is_format_supported(struct pipe_screen *pscreen,
                                  enum pipe_format format,
                                  enum pipe_texture_target target,
                                  unsigned sample_count,
+                                 unsigned storage_sample_count,
                                  unsigned usage)
 {
    struct tegra_screen *screen = to_tegra_screen(pscreen);
 
    return screen->gpu->is_format_supported(screen->gpu, format, target,
-                                           sample_count, usage);
+                                           sample_count, storage_sample_count,
+                                           usage);
 }
 
 static boolean
index b274f2de5a8210d755b0cd498c29192b8ed4609f..2e743851bea62c4d3bb56c814fae92a680164020 100644 (file)
@@ -441,10 +441,14 @@ v3d_screen_is_format_supported(struct pipe_screen *pscreen,
                                enum pipe_format format,
                                enum pipe_texture_target target,
                                unsigned sample_count,
+                               unsigned storage_sample_count,
                                unsigned usage)
 {
         struct v3d_screen *screen = v3d_screen(pscreen);
 
+        if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+                return false;
+
         if (sample_count > 1 && sample_count != VC5_MAX_SAMPLES)
                 return FALSE;
 
index 1bd60d1084248eff28f0b9012b6bba4ea83a7666..646e7fa723196e673e8a50d33783bb02a000d7ad 100644 (file)
@@ -480,10 +480,14 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen,
                                enum pipe_format format,
                                enum pipe_texture_target target,
                                unsigned sample_count,
+                               unsigned storage_sample_count,
                                unsigned usage)
 {
         struct vc4_screen *screen = vc4_screen(pscreen);
 
+        if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+                return false;
+
         if (sample_count > 1 && sample_count != VC4_MAX_SAMPLES)
                 return FALSE;
 
index cfa0e8ba7d4bb0ff5718e227736eddd7cc416496..1947c6e4880a4949354afea7b3d11844d453f407 100644 (file)
@@ -475,12 +475,16 @@ virgl_is_format_supported( struct pipe_screen *screen,
                                  enum pipe_format format,
                                  enum pipe_texture_target target,
                                  unsigned sample_count,
+                                 unsigned storage_sample_count,
                                  unsigned bind)
 {
    struct virgl_screen *vscreen = virgl_screen(screen);
    const struct util_format_description *format_desc;
    int i;
 
+   if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
+      return false;
+
    assert(target == PIPE_BUFFER ||
           target == PIPE_TEXTURE_1D ||
           target == PIPE_TEXTURE_1D_ARRAY ||
index 0439060b60623a2bb957bad0b5f631060492905a..c4d6e1cc94f2434aa5ecd9eeca4049cf689e26fd 100644 (file)
@@ -168,6 +168,7 @@ struct pipe_screen {
                                    enum pipe_format format,
                                    enum pipe_texture_target target,
                                    unsigned sample_count,
+                                   unsigned storage_sample_count,
                                    unsigned bindings );
 
    /**
index 5701292409817d173a113ac57bf09cbabf4e8c3c..dee1872c829c112a449a1696a87c5198208e536f 100644 (file)
@@ -152,7 +152,7 @@ namespace clover {
       for (auto f : formats) {
          if (all_of([=](const device &dev) {
                   return dev.pipe->is_format_supported(
-                     dev.pipe, f.second, target, 1, bindings);
+                     dev.pipe, f.second, target, 1, 1, bindings);
                }, ctx.devices()))
             s.insert(f.first);
       }
index 9a22e47693bcb753ceecf2c23a561f5e57e99225..2ac32205d9ac0cee954a7a724fa9633e88a10a97 100644 (file)
@@ -1489,7 +1489,7 @@ dri2_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats,
                                        fourcc_to_pipe_format(
                                           fourcc_formats[i]),
                                        screen->target,
-                                       0, bind)) {
+                                       0, 0, bind)) {
          if (j < max)
             formats[j] = fourcc_formats[i];
          j++;
@@ -1510,7 +1510,8 @@ dri2_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
    const unsigned usage = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
 
    if (pscreen->query_dmabuf_modifiers != NULL &&
-       pscreen->is_format_supported(pscreen, format, screen->target, 0, usage)) {
+       pscreen->is_format_supported(pscreen, format, screen->target, 0, 0,
+                                    usage)) {
       pscreen->query_dmabuf_modifiers(pscreen, format, max, modifiers,
                                       external_only, count);
       return true;
index 80847e3d3149c4208c1189f371755e4de8a9353b..2417f40a6add7832ee6aba186478a65ed7b43cbe 100644 (file)
@@ -52,7 +52,7 @@ dri2_query_renderer_integer(__DRIscreen *_screen, int param,
       value[0] =
          screen->base.screen->is_format_supported(screen->base.screen,
                                                   PIPE_FORMAT_B8G8R8A8_SRGB,
-                                                  PIPE_TEXTURE_2D, 0,
+                                                  PIPE_TEXTURE_2D, 0, 0,
                                                   PIPE_BIND_RENDER_TARGET);
       return 0;
    case __DRI2_RENDERER_HAS_CONTEXT_PRIORITY:
index 87729c190a890b12ab5b0b86f0e5cc916f54aacd..fe4e39b3f931febcafbb5454b95ee31ded32e1ba 100644 (file)
@@ -189,22 +189,22 @@ dri_fill_in_modes(struct dri_screen *screen)
       ? MSAA_VISUAL_MAX_SAMPLES : 1;
 
    pf_x8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24X8_UNORM,
-                                           PIPE_TEXTURE_2D, 0,
+                                           PIPE_TEXTURE_2D, 0, 0,
                                             PIPE_BIND_DEPTH_STENCIL);
    pf_z24x8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_X8Z24_UNORM,
-                                           PIPE_TEXTURE_2D, 0,
+                                           PIPE_TEXTURE_2D, 0, 0,
                                             PIPE_BIND_DEPTH_STENCIL);
    pf_s8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24_UNORM_S8_UINT,
-                                           PIPE_TEXTURE_2D, 0,
+                                           PIPE_TEXTURE_2D, 0, 0,
                                             PIPE_BIND_DEPTH_STENCIL);
    pf_z24s8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_S8_UINT_Z24_UNORM,
-                                           PIPE_TEXTURE_2D, 0,
+                                           PIPE_TEXTURE_2D, 0, 0,
                                             PIPE_BIND_DEPTH_STENCIL);
    pf_z16 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z16_UNORM,
-                                          PIPE_TEXTURE_2D, 0,
+                                          PIPE_TEXTURE_2D, 0, 0,
                                           PIPE_BIND_DEPTH_STENCIL);
    pf_z32 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z32_UNORM,
-                                          PIPE_TEXTURE_2D, 0,
+                                          PIPE_TEXTURE_2D, 0, 0,
                                           PIPE_BIND_DEPTH_STENCIL);
 
    if (pf_z16) {
@@ -252,7 +252,7 @@ dri_fill_in_modes(struct dri_screen *screen)
          continue;
 
       if (!p_screen->is_format_supported(p_screen, pipe_formats[format],
-                                         PIPE_TEXTURE_2D, 0,
+                                         PIPE_TEXTURE_2D, 0, 0,
                                          PIPE_BIND_RENDER_TARGET |
                                          PIPE_BIND_DISPLAY_TARGET))
          continue;
@@ -261,7 +261,7 @@ dri_fill_in_modes(struct dri_screen *screen)
          int samples = i > 1 ? i : 0;
 
          if (p_screen->is_format_supported(p_screen, pipe_formats[format],
-                                           PIPE_TEXTURE_2D, samples,
+                                           PIPE_TEXTURE_2D, samples, samples,
                                            PIPE_BIND_RENDER_TARGET)) {
             msaa_modes[num_msaa_modes++] = samples;
          }
index e4c9408d0db0d66109b1705926540924a097b1df..b560ffca9b6a60acbf08348a60171be27ab972e0 100644 (file)
@@ -489,7 +489,7 @@ choose_depth_stencil_format(XMesaDisplay xmdpy, int depth, int stencil,
    for (i = 0; i < count; i++) {
       if (xmdpy->screen->is_format_supported(xmdpy->screen, formats[i],
                                              target, sample_count,
-                                             tex_usage)) {
+                                             sample_count, tex_usage)) {
          fmt = formats[i];
          break;
       }
@@ -892,6 +892,7 @@ XMesaVisual XMesaCreateVisual( Display *display,
    if (!xmdpy->screen->is_format_supported(xmdpy->screen,
                                            v->stvis.color_format,
                                            PIPE_TEXTURE_2D, num_samples,
+                                           num_samples,
                                            PIPE_BIND_RENDER_TARGET))
       v->stvis.color_format = PIPE_FORMAT_NONE;
 
index 0a9034c949d6dd4df49d604575eb73bee3178ea3..911eee6da205a8af6d550334fcb84ce3810559d8 100644 (file)
@@ -557,7 +557,7 @@ NineBaseTexture9_UpdateSamplerView( struct NineBaseTexture9 *This,
     srgb_format = util_format_srgb(resource->format);
     if (sRGB && srgb_format != PIPE_FORMAT_NONE &&
         screen->is_format_supported(screen, srgb_format,
-                                    resource->target, 0, resource->bind))
+                                    resource->target, 0, 0, resource->bind))
         templ.format = srgb_format;
     else
         templ.format = resource->format;
index c434efb8bc7fce8bf43f5f4b05b64d0704097795..150f5e3e05e66a7c254f30f3463254376aa38d12 100644 (file)
@@ -1580,6 +1580,7 @@ NineDevice9_StretchRect( struct NineDevice9 *This,
     user_assert(screen->is_format_supported(screen, src_res->format,
                                             src_res->target,
                                             src_res->nr_samples,
+                                            src_res->nr_storage_samples,
                                             PIPE_BIND_SAMPLER_VIEW),
                 D3DERR_INVALIDCALL);
 
@@ -1705,6 +1706,7 @@ NineDevice9_StretchRect( struct NineDevice9 *This,
         user_assert(screen->is_format_supported(screen, dst_res->format,
                                                 dst_res->target,
                                                 dst_res->nr_samples,
+                                                dst_res->nr_storage_samples,
                                                 zs ? PIPE_BIND_DEPTH_STENCIL :
                                                 PIPE_BIND_RENDER_TARGET),
                     D3DERR_INVALIDCALL);
index c8fef62827691b01501473a3aab1bd449323bd7d..7b68c09c47a241a9151b9a5ea32ac29dfb865b76 100644 (file)
@@ -288,7 +288,7 @@ d3d9_to_pipe_format_internal(D3DFORMAT format)
 
 #define format_check_internal(pipe_format) \
     screen->is_format_supported(screen, pipe_format, target, \
-                                sample_count, bindings)
+                                sample_count, sample_count, bindings)
 
 static inline enum pipe_format
 d3d9_to_pipe_format_checked(struct pipe_screen *screen,
index 4c6a69577037f9248366a83a29c5b3fb9307af51..71aa4f46ffd1022c2f51e0913c10686221a56123 100644 (file)
@@ -243,7 +243,7 @@ NineSurface9_CreatePipeSurfaces( struct NineSurface9 *This )
     srgb_format = util_format_srgb(resource->format);
     if (srgb_format == PIPE_FORMAT_NONE ||
         !screen->is_format_supported(screen, srgb_format,
-                                     resource->target, 0, resource->bind))
+                                     resource->target, 0, 0, resource->bind))
         srgb_format = resource->format;
 
     memset(&templ, 0, sizeof(templ));
index 981a99cec538778c78014d12483bf70bf75742c5..b213e9abb7d62b8289de266109cafd634356e6e0 100644 (file)
@@ -218,7 +218,7 @@ vlVaAssociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture,
    tex_temp.flags = 0;
    if (!drv->pipe->screen->is_format_supported(
           drv->pipe->screen, tex_temp.format, tex_temp.target,
-          tex_temp.nr_samples, tex_temp.bind)) {
+          tex_temp.nr_samples, tex_temp.nr_storage_samples, tex_temp.bind)) {
       mtx_unlock(&drv->mutex);
       return VA_STATUS_ERROR_ALLOCATION_FAILED;
    }
index 6b8b5a6b5d3e0eb8bec82aca2435c3c6793c4f65..2c4ebe62e19563904adfa379ef7fa9c1008c6ccd 100644 (file)
@@ -247,7 +247,7 @@ vlVdpOutputSurfaceQueryCapabilities(VdpDevice device, VdpRGBAFormat surface_rgba
    mtx_lock(&dev->mutex);
    *is_supported = pscreen->is_format_supported
    (
-      pscreen, format, PIPE_TEXTURE_3D, 1,
+      pscreen, format, PIPE_TEXTURE_3D, 1, 1,
       PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET
    );
    if (*is_supported) {
@@ -299,7 +299,7 @@ vlVdpOutputSurfaceQueryGetPutBitsNativeCapabilities(VdpDevice device, VdpRGBAFor
    mtx_lock(&dev->mutex);
    *is_supported = pscreen->is_format_supported
    (
-      pscreen, format, PIPE_TEXTURE_2D, 1,
+      pscreen, format, PIPE_TEXTURE_2D, 1, 1,
       PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET
    );
    mtx_unlock(&dev->mutex);
@@ -348,19 +348,19 @@ vlVdpOutputSurfaceQueryPutBitsIndexedCapabilities(VdpDevice device,
    mtx_lock(&dev->mutex);
    *is_supported = pscreen->is_format_supported
    (
-      pscreen, rgba_format, PIPE_TEXTURE_2D, 1,
+      pscreen, rgba_format, PIPE_TEXTURE_2D, 1, 1,
       PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET
    );
 
    *is_supported &= pscreen->is_format_supported
    (
-      pscreen, index_format, PIPE_TEXTURE_2D, 1,
+      pscreen, index_format, PIPE_TEXTURE_2D, 1, 1,
       PIPE_BIND_SAMPLER_VIEW
    );
 
    *is_supported &= pscreen->is_format_supported
    (
-      pscreen, colortbl_format, PIPE_TEXTURE_1D, 1,
+      pscreen, colortbl_format, PIPE_TEXTURE_1D, 1, 1,
       PIPE_BIND_SAMPLER_VIEW
    );
    mtx_unlock(&dev->mutex);
@@ -403,7 +403,7 @@ vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities(VdpDevice device, VdpRGBAFormat
    mtx_lock(&dev->mutex);
    *is_supported = pscreen->is_format_supported
    (
-      pscreen, rgba_format, PIPE_TEXTURE_2D, 1,
+      pscreen, rgba_format, PIPE_TEXTURE_2D, 1, 1,
       PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET
    );
 
@@ -447,7 +447,7 @@ vlVdpBitmapSurfaceQueryCapabilities(VdpDevice device, VdpRGBAFormat surface_rgba
    mtx_lock(&dev->mutex);
    *is_supported = pscreen->is_format_supported
    (
-      pscreen, format, PIPE_TEXTURE_3D, 1,
+      pscreen, format, PIPE_TEXTURE_3D, 1, 1,
       PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET
    );
    if (*is_supported) {
index b36c0c4aec260f1f156594c7535d4a5baf4ad5a7..420573b57ad49d78da18dac527eea52dc3b2a8e0 100644 (file)
@@ -343,8 +343,9 @@ static inline bool
 CheckSurfaceParams(struct pipe_screen *screen,
                    const struct pipe_resource *templ)
 {
-   return screen->is_format_supported(
-         screen, templ->format, templ->target, templ->nr_samples, templ->bind);
+   return screen->is_format_supported(screen, templ->format, templ->target,
+                                      templ->nr_samples,
+                                      templ->nr_storage_samples, templ->bind);
 }
 
 typedef struct
index 833308d964c35518785da6814be2331bb9389656..d4e7a94f36d64cb3c116541d3874f4271a76b735 100644 (file)
@@ -254,7 +254,7 @@ add_color_format_variants(const struct stw_pf_color_info *color_formats,
 
       for (cfmt = 0; cfmt < num_color_formats; cfmt++) {
          if (!screen->is_format_supported(screen, color_formats[cfmt].format,
-                                          PIPE_TEXTURE_2D, samples,
+                                          PIPE_TEXTURE_2D, samples, samples,
                                           bind_flags)) {
             continue;
          }
@@ -267,6 +267,7 @@ add_color_format_variants(const struct stw_pf_color_info *color_formats,
 
                if (!screen->is_format_supported(screen, depth->format,
                                                 PIPE_TEXTURE_2D, samples,
+                                                samples,
                                                 PIPE_BIND_DEPTH_STENCIL)) {
                   continue;
                }
index 1f4717056a9a2c31bdc593ea20fbf8486d84463f..ba220877c8431b8555f13d96e659dbec13e008a7 100644 (file)
@@ -201,7 +201,7 @@ xa_ctx_srf_create(struct xa_context *ctx, struct xa_surface *dst)
     }
 
     if (!screen->is_format_supported(screen,  dst->tex->format,
-                                    PIPE_TEXTURE_2D, 0,
+                                    PIPE_TEXTURE_2D, 0, 0,
                                     PIPE_BIND_RENDER_TARGET))
        return -XA_ERR_INVAL;
 
index 27497d3d659f3695655f0e9d18f8b56850b2ad79..e3311232e77db86d021d66852c1a84cebbaac3ed 100644 (file)
@@ -417,7 +417,7 @@ renderer_copy_prepare(struct xa_context *r,
     uint32_t fs_traits = FS_COMPOSITE;
 
     assert(screen->is_format_supported(screen, dst_surface->format,
-                                      PIPE_TEXTURE_2D, 0,
+                                      PIPE_TEXTURE_2D, 0, 0,
                                       PIPE_BIND_RENDER_TARGET));
     (void)screen;
 
index 3d268a17750ca6842765dd9754e0bb13539e103b..c046a3a7097c576eb13aec7ca66c8c7c1a23de96 100644 (file)
@@ -104,7 +104,7 @@ xa_get_pipe_format(struct xa_tracker *xa, enum xa_formats xa_format)
        break;
     case xa_format_a8:
         if (xa->screen->is_format_supported(xa->screen, PIPE_FORMAT_R8_UNORM,
-                                            PIPE_TEXTURE_2D, 0,
+                                            PIPE_TEXTURE_2D, 0, 0,
                                             stype_bind[xa_type_a] |
                                             PIPE_BIND_RENDER_TARGET))
             fdesc.format = PIPE_FORMAT_R8_UNORM;
@@ -134,7 +134,7 @@ xa_get_pipe_format(struct xa_tracker *xa, enum xa_formats xa_format)
        break;
     case xa_format_yuv8:
         if (xa->screen->is_format_supported(xa->screen, PIPE_FORMAT_R8_UNORM,
-                                            PIPE_TEXTURE_2D, 0,
+                                            PIPE_TEXTURE_2D, 0, 0,
                                             stype_bind[xa_type_yuv_component]))
             fdesc.format = PIPE_FORMAT_R8_UNORM;
         else
@@ -196,7 +196,7 @@ xa_tracker_create(int drm_fd)
                 xa_get_pipe_format(xa, xa_format);
 
            if (xa->screen->is_format_supported(xa->screen, fdesc.format,
-                                               PIPE_TEXTURE_2D, 0, bind)) {
+                                               PIPE_TEXTURE_2D, 0, 0, bind)) {
                if (xa->format_map[stype][0] == 0)
                    xa->format_map[stype][0] = num_formats;
                xa->format_map[stype][1] = num_formats;
@@ -300,7 +300,7 @@ xa_format_check_supported(struct xa_tracker *xa,
        bind |= PIPE_BIND_SCANOUT;
 
     if (!xa->screen->is_format_supported(xa->screen, fdesc.format,
-                                        PIPE_TEXTURE_2D, 0, bind))
+                                        PIPE_TEXTURE_2D, 0, 0, bind))
        return -XA_ERR_INVAL;
 
     return XA_ERR_NONE;
@@ -470,7 +470,7 @@ xa_surface_redefine(struct xa_surface *srf,
            return -XA_ERR_INVAL;
 
        if (!xa->screen->is_format_supported(xa->screen, fdesc.format,
-                                            PIPE_TEXTURE_2D, 0,
+                                            PIPE_TEXTURE_2D, 0, 0,
                                             template->bind |
                                             PIPE_BIND_RENDER_TARGET))
            return -XA_ERR_INVAL;
index bc26976e282283bddad842bc904053fecaaedfbc..7a6dc89d8d8685df3d68e9917c933e57ff3534fa 100644 (file)
@@ -62,14 +62,14 @@ static enum pipe_format XvIDToPipe(struct pipe_screen *screen,
    case FOURCC_AI44:
       ret = PIPE_FORMAT_R4A4_UNORM;
       if (!screen->is_format_supported(
-                screen, ret, PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW))
+                screen, ret, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW))
          ret = PIPE_FORMAT_B4G4R4A4_UNORM;
       break;
 
    case FOURCC_IA44:
       ret = PIPE_FORMAT_A4R4_UNORM;
       if (!screen->is_format_supported(
-                screen, ret, PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW))
+                screen, ret, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW))
          ret = PIPE_FORMAT_B4G4R4A4_UNORM;
       break;
 
@@ -79,7 +79,7 @@ static enum pipe_format XvIDToPipe(struct pipe_screen *screen,
    }
 
    if (!screen->is_format_supported(
-             screen, ret, PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW)) {
+             screen, ret, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW)) {
       XVMC_MSG(XVMC_ERR, "[XvMC] Unsupported 2D format %s for Xv image ID 0x%08X.\n", util_format_name(ret), xvimage_id);
       ret = PIPE_FORMAT_NONE;
    }
@@ -125,7 +125,7 @@ static int PipeToComponentOrder(struct pipe_screen *screen,
       component_order[2] = 'V';
       component_order[3] = 'A';
       if (!screen->is_format_supported(
-                screen, *palette_format, PIPE_TEXTURE_1D, 0,
+                screen, *palette_format, PIPE_TEXTURE_1D, 0, 0,
                 PIPE_BIND_SAMPLER_VIEW)) {
          /* One of these formats better be supported... */
          *palette_format = PIPE_FORMAT_B8G8R8X8_UNORM;
index 443451e13d2417a64df36e6b3a14df9075b62259..afe5d3e9f2be62e988ab5b6b06d1341a28cb6ac4 100644 (file)
@@ -1131,7 +1131,7 @@ static void test_surface_ld(struct context *ctx)
                 printf("   - %s\n", util_format_name(surface_fmts[i]));
 
                 if (!ctx->screen->is_format_supported(ctx->screen,
-                       surface_fmts[i], PIPE_TEXTURE_2D, 1,
+                       surface_fmts[i], PIPE_TEXTURE_2D, 1, 1,
                        PIPE_BIND_COMPUTE_RESOURCE)) {
                    printf("(unsupported)\n");
                    continue;
@@ -1251,7 +1251,7 @@ static void test_surface_st(struct context *ctx)
                 printf("   - %s\n", util_format_name(surface_fmts[i]));
 
                 if (!ctx->screen->is_format_supported(ctx->screen,
-                       surface_fmts[i], PIPE_TEXTURE_2D, 1,
+                       surface_fmts[i], PIPE_TEXTURE_2D, 1, 1,
                        PIPE_BIND_COMPUTE_RESOURCE)) {
                    printf("(unsupported)\n");
                    continue;
index 47cf7f028705c9c05e0841252b27adb41027861b..c5370c7a1b2641fb5ace8c63e919781c57ddb9ae 100644 (file)
@@ -92,7 +92,7 @@ wsw_is_dt_format_supported(struct sw_winsys *ws,
    struct wrapper_sw_winsys *wsw = wrapper_sw_winsys(ws);
 
    return wsw->screen->is_format_supported(wsw->screen, format,
-                                           PIPE_TEXTURE_2D, 0,
+                                           PIPE_TEXTURE_2D, 0, 0,
                                            PIPE_BIND_RENDER_TARGET |
                                            PIPE_BIND_DISPLAY_TARGET);
 }
index 3ef3ff34a97c64057c8e4ab45fa39fafad436818..807c312a5dbd74128d8c57dc1dd6dd385a7deda8 100644 (file)
@@ -95,7 +95,7 @@ framebuffer_quantize_num_samples(struct st_context *st, unsigned num_samples)
        * drivers callback must be adjusted for this.
        */
       if (screen->is_format_supported(screen, PIPE_FORMAT_NONE,
-                                      PIPE_TEXTURE_2D, msaa_mode,
+                                      PIPE_TEXTURE_2D, msaa_mode, msaa_mode,
                                       PIPE_BIND_RENDER_TARGET))
          quantized_samples = msaa_mode;
    }
index 1bfc82db43e920c2b805ad4adcbfb1a00b03aa05..babb00178ae2cd8d76c1da6d8718cefac9b3924b 100644 (file)
@@ -564,17 +564,17 @@ init_bitmap_state(struct st_context *st)
 
    /* find a usable texture format */
    if (screen->is_format_supported(screen, PIPE_FORMAT_I8_UNORM,
-                                   st->internal_target, 0,
+                                   st->internal_target, 0, 0,
                                    PIPE_BIND_SAMPLER_VIEW)) {
       st->bitmap.tex_format = PIPE_FORMAT_I8_UNORM;
    }
    else if (screen->is_format_supported(screen, PIPE_FORMAT_A8_UNORM,
-                                        st->internal_target, 0,
+                                        st->internal_target, 0, 0,
                                         PIPE_BIND_SAMPLER_VIEW)) {
       st->bitmap.tex_format = PIPE_FORMAT_A8_UNORM;
    }
    else if (screen->is_format_supported(screen, PIPE_FORMAT_L8_UNORM,
-                                        st->internal_target, 0,
+                                        st->internal_target, 0, 0,
                                         PIPE_BIND_SAMPLER_VIEW)) {
       st->bitmap.tex_format = PIPE_FORMAT_L8_UNORM;
    }
index bb73644753a098907038dde626762e87370270f0..5a331f841de7fe428b85097ba8a454bd70349388 100644 (file)
@@ -1475,10 +1475,12 @@ blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
          if (screen->is_format_supported(screen, blit.src.format,
                                          blit.src.resource->target,
                                          blit.src.resource->nr_samples,
+                                         blit.src.resource->nr_storage_samples,
                                          PIPE_BIND_SAMPLER_VIEW) &&
              screen->is_format_supported(screen, blit.dst.format,
                                          blit.dst.resource->target,
                                          blit.dst.resource->nr_samples,
+                                         blit.dst.resource->nr_storage_samples,
                                          PIPE_BIND_RENDER_TARGET)) {
             pipe->blit(pipe, &blit);
             return GL_TRUE;
@@ -1578,7 +1580,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
       (type == GL_COLOR ? PIPE_BIND_RENDER_TARGET : PIPE_BIND_DEPTH_STENCIL);
 
    if (!screen->is_format_supported(screen, srcFormat, st->internal_target, 0,
-                                    srcBind)) {
+                                    0, srcBind)) {
       /* srcFormat is non-renderable. Find a compatible renderable format. */
       if (type == GL_DEPTH) {
          srcFormat = st_choose_format(st, GL_DEPTH_COMPONENT, GL_NONE,
index 0db2efc01cf2281126a5abc769c3c10e5d86a497..d6b93c3dbe8bdba18f161ff8f9c0140f81e7f48e 100644 (file)
 
 static bool
 is_format_supported(struct pipe_screen *screen, enum pipe_format format,
-                    unsigned nr_samples, unsigned usage)
+                    unsigned nr_samples, unsigned nr_storage_samples,
+                    unsigned usage)
 {
    bool supported = screen->is_format_supported(screen, format, PIPE_TEXTURE_2D,
-                                                nr_samples, usage);
+                                                nr_samples, nr_storage_samples,
+                                                usage);
 
    /* for sampling, some formats can be emulated.. it doesn't matter that
     * the surface will have a format that the driver can't cope with because
@@ -55,14 +57,14 @@ is_format_supported(struct pipe_screen *screen, enum pipe_format format,
       if (format == PIPE_FORMAT_IYUV) {
          supported = screen->is_format_supported(screen, PIPE_FORMAT_R8_UNORM,
                                                  PIPE_TEXTURE_2D, nr_samples,
-                                                 usage);
+                                                 nr_storage_samples, usage);
       } else if (format == PIPE_FORMAT_NV12) {
          supported = screen->is_format_supported(screen, PIPE_FORMAT_R8_UNORM,
                                                  PIPE_TEXTURE_2D, nr_samples,
-                                                 usage) &&
+                                                 nr_storage_samples, usage) &&
                      screen->is_format_supported(screen, PIPE_FORMAT_R8G8_UNORM,
                                                  PIPE_TEXTURE_2D, nr_samples,
-                                                 usage);
+                                                 nr_storage_samples, usage);
       }
    }
 
@@ -91,7 +93,8 @@ st_get_egl_image(struct gl_context *ctx, GLeglImageOES image_handle,
       return false;
    }
 
-   if (!is_format_supported(screen, out->format, out->texture->nr_samples, usage)) {
+   if (!is_format_supported(screen, out->format, out->texture->nr_samples,
+                            out->texture->nr_storage_samples, usage)) {
       /* unable to specify a texture object using the specified EGL image */
       pipe_resource_reference(&out->texture, NULL);
       _mesa_error(ctx, GL_INVALID_OPERATION, "%s(format not supported)", error);
index fb41b7b73cfea877c2fd125e04ba88d5b6d82529..73414fdfa15f97bbd2d2d5c9efa741682c689318 100644 (file)
@@ -616,8 +616,10 @@ st_validate_attachment(struct gl_context *ctx,
    }
 
    valid = screen->is_format_supported(screen, format,
-                                      PIPE_TEXTURE_2D,
-                                      stObj->pt->nr_samples, bindings);
+                                       PIPE_TEXTURE_2D,
+                                       stObj->pt->nr_samples,
+                                       stObj->pt->nr_storage_samples,
+                                       bindings);
    if (!valid) {
       st_fbo_invalid("Invalid format");
    }
index 291812160717ca6f7a081cb49bedf0ec448b2f6e..3e008904eff160fe5e30b7c71111d6a4f85610f9 100644 (file)
@@ -112,7 +112,7 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb,
    if (texture->nr_samples > 1)
       return false;
 
-   if (!screen->is_format_supported(screen, dst_format, PIPE_BUFFER, 0,
+   if (!screen->is_format_supported(screen, dst_format, PIPE_BUFFER, 0, 0,
                                     PIPE_BIND_SHADER_IMAGE))
       return false;
 
@@ -449,7 +449,7 @@ st_ReadPixels(struct gl_context *ctx, GLint x, GLint y,
 
    if (!src_format ||
        !screen->is_format_supported(screen, src_format, src->target,
-                                    src->nr_samples,
+                                    src->nr_samples, src->nr_storage_samples,
                                     PIPE_BIND_SAMPLER_VIEW)) {
       goto fallback;
    }
index d1f060dc9790843ee0829b3793e311d671b59683..93b6b32b7e27ed1654b786c21fccdbef710ae244 100644 (file)
@@ -382,13 +382,13 @@ default_bindings(struct st_context *st, enum pipe_format format)
    else
       bindings = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
 
-   if (screen->is_format_supported(screen, format, target, 0, bindings))
+   if (screen->is_format_supported(screen, format, target, 0, 0, bindings))
       return bindings;
    else {
       /* Try non-sRGB. */
       format = util_format_linear(format);
 
-      if (screen->is_format_supported(screen, format, target, 0, bindings))
+      if (screen->is_format_supported(screen, format, target, 0, 0, bindings))
          return bindings;
       else
          return PIPE_BIND_SAMPLER_VIEW;
@@ -1343,13 +1343,13 @@ try_pbo_upload(struct gl_context *ctx, GLuint dims,
 
       if (dst_format != orig_dst_format &&
           !screen->is_format_supported(screen, dst_format, PIPE_TEXTURE_2D, 0,
-                                       PIPE_BIND_RENDER_TARGET)) {
+                                       0, PIPE_BIND_RENDER_TARGET)) {
          return false;
       }
    }
 
    if (!src_format ||
-       !screen->is_format_supported(screen, src_format, PIPE_BUFFER, 0,
+       !screen->is_format_supported(screen, src_format, PIPE_BUFFER, 0, 0,
                                     PIPE_BIND_SAMPLER_VIEW)) {
       return false;
    }
@@ -1494,7 +1494,8 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
 
    if (!dst_format ||
        !screen->is_format_supported(screen, dst_format, dst->target,
-                                    dst->nr_samples, bind)) {
+                                    dst->nr_samples, dst->nr_storage_samples,
+                                    bind)) {
       goto fallback;
    }
 
@@ -1738,13 +1739,14 @@ st_CompressedTexSubImage(struct gl_context *ctx, GLuint dims,
       goto fallback;
    }
 
-   if (!screen->is_format_supported(screen, copy_format, PIPE_BUFFER, 0,
+   if (!screen->is_format_supported(screen, copy_format, PIPE_BUFFER, 0, 0,
                                     PIPE_BIND_SAMPLER_VIEW)) {
       goto fallback;
    }
 
    if (!screen->is_format_supported(screen, copy_format, dst->target,
-                                    dst->nr_samples, PIPE_BIND_RENDER_TARGET)) {
+                                    dst->nr_samples, dst->nr_storage_samples,
+                                    PIPE_BIND_RENDER_TARGET)) {
       goto fallback;
    }
 
@@ -1939,7 +1941,7 @@ st_GetTexSubImage(struct gl_context * ctx,
 
    if (!src_format ||
        !screen->is_format_supported(screen, src_format, src->target,
-                                    src->nr_samples,
+                                    src->nr_samples, src->nr_storage_samples,
                                     PIPE_BIND_SAMPLER_VIEW)) {
       goto fallback;
    }
@@ -2013,25 +2015,25 @@ st_GetTexSubImage(struct gl_context * ctx,
          break;
       case PIPE_FORMAT_ETC2_R11_UNORM:
          if (!screen->is_format_supported(screen, PIPE_FORMAT_R16_UNORM,
-                                          pipe_target, 0, bind))
+                                          pipe_target, 0, 0, bind))
             goto fallback;
          dst_glformat = GL_R16;
          break;
       case PIPE_FORMAT_ETC2_R11_SNORM:
          if (!screen->is_format_supported(screen, PIPE_FORMAT_R16_SNORM,
-                                          pipe_target, 0, bind))
+                                          pipe_target, 0, 0, bind))
             goto fallback;
          dst_glformat = GL_R16_SNORM;
          break;
       case PIPE_FORMAT_ETC2_RG11_UNORM:
          if (!screen->is_format_supported(screen, PIPE_FORMAT_R16G16_UNORM,
-                                          pipe_target, 0, bind))
+                                          pipe_target, 0, 0, bind))
             goto fallback;
          dst_glformat = GL_RG16;
          break;
       case PIPE_FORMAT_ETC2_RG11_SNORM:
          if (!screen->is_format_supported(screen, PIPE_FORMAT_R16G16_SNORM,
-                                          pipe_target, 0, bind))
+                                          pipe_target, 0, 0, bind))
             goto fallback;
          dst_glformat = GL_RG16_SNORM;
          break;
@@ -2437,7 +2439,8 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
 
    if (!dst_format ||
        !screen->is_format_supported(screen, dst_format, stImage->pt->target,
-                                    stImage->pt->nr_samples, bind)) {
+                                    stImage->pt->nr_samples,
+                                    stImage->pt->nr_storage_samples, bind)) {
       goto fallback;
    }
 
@@ -2775,7 +2778,7 @@ st_texture_create_from_memory(struct st_context *st,
        (int) target, util_format_name(format), last_level);
 
    assert(format);
-   assert(screen->is_format_supported(screen, format, target, 0,
+   assert(screen->is_format_supported(screen, format, target, 0, 0,
                                       PIPE_BIND_SAMPLER_VIEW));
 
    memset(&pt, 0, sizeof(pt));
@@ -2848,7 +2851,7 @@ st_texture_storage(struct gl_context *ctx,
 
       for (; num_samples <= ctx->Const.MaxSamples; num_samples++) {
          if (screen->is_format_supported(screen, fmt, ptarget,
-                                         num_samples,
+                                         num_samples, num_samples,
                                          PIPE_BIND_SAMPLER_VIEW)) {
             /* Update the sample count in gl_texture_image as well. */
             texImage->NumSamples = num_samples;
index c124793fa400b06c61744a81d3701f5cb61946b8..34bfb845bb0208add6aceedec1f9f1b64ee605da 100644 (file)
@@ -433,14 +433,14 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
       screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT);
    st->has_shader_model3 = screen->get_param(screen, PIPE_CAP_SM3);
    st->has_etc1 = screen->is_format_supported(screen, PIPE_FORMAT_ETC1_RGB8,
-                                              PIPE_TEXTURE_2D, 0,
+                                              PIPE_TEXTURE_2D, 0, 0,
                                               PIPE_BIND_SAMPLER_VIEW);
    st->has_etc2 = screen->is_format_supported(screen, PIPE_FORMAT_ETC2_RGB8,
-                                              PIPE_TEXTURE_2D, 0,
+                                              PIPE_TEXTURE_2D, 0, 0,
                                               PIPE_BIND_SAMPLER_VIEW);
    st->has_astc_2d_ldr =
       screen->is_format_supported(screen, PIPE_FORMAT_ASTC_4x4_SRGB,
-                                  PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW);
+                                  PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW);
    st->prefer_blit_based_texture_transfer = screen->get_param(screen,
                               PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER);
    st->force_persample_in_shader =
index 2ec47581c50058c6c7bf0a6c06b2db1582783fcb..dbaf7f6f8fe5bf7bccd114d8d9b595cf04fd756c 100644 (file)
@@ -559,7 +559,7 @@ init_format_extensions(struct pipe_screen *screen,
       /* Examine each format in the list. */
       for (j = 0; j < num_formats && mapping[i].format[j]; j++) {
          if (screen->is_format_supported(screen, mapping[i].format[j],
-                                         target, 0, bind_flags)) {
+                                         target, 0, 0, bind_flags)) {
             num_supported++;
          }
       }
@@ -592,7 +592,7 @@ get_max_samples_for_formats(struct pipe_screen *screen,
    for (i = max_samples; i > 0; --i) {
       for (f = 0; f < num_formats; f++) {
          if (screen->is_format_supported(screen, formats[f],
-                                         PIPE_TEXTURE_2D, i, bind)) {
+                                         PIPE_TEXTURE_2D, i, i, bind)) {
             return i;
          }
       }
@@ -1227,22 +1227,22 @@ void st_init_extensions(struct pipe_screen *screen,
                                 PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS) >= 16 &&
        /* Requirements for ETC2 emulation. */
        screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_UNORM,
-                                   PIPE_TEXTURE_2D, 0,
+                                   PIPE_TEXTURE_2D, 0, 0,
                                    PIPE_BIND_SAMPLER_VIEW) &&
        screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB,
-                                   PIPE_TEXTURE_2D, 0,
+                                   PIPE_TEXTURE_2D, 0, 0,
                                    PIPE_BIND_SAMPLER_VIEW) &&
        screen->is_format_supported(screen, PIPE_FORMAT_R16_UNORM,
-                                   PIPE_TEXTURE_2D, 0,
+                                   PIPE_TEXTURE_2D, 0, 0,
                                    PIPE_BIND_SAMPLER_VIEW) &&
        screen->is_format_supported(screen, PIPE_FORMAT_R16G16_UNORM,
-                                   PIPE_TEXTURE_2D, 0,
+                                   PIPE_TEXTURE_2D, 0, 0,
                                    PIPE_BIND_SAMPLER_VIEW) &&
        screen->is_format_supported(screen, PIPE_FORMAT_R16_SNORM,
-                                   PIPE_TEXTURE_2D, 0,
+                                   PIPE_TEXTURE_2D, 0, 0,
                                    PIPE_BIND_SAMPLER_VIEW) &&
        screen->is_format_supported(screen, PIPE_FORMAT_R16G16_SNORM,
-                                   PIPE_TEXTURE_2D, 0,
+                                   PIPE_TEXTURE_2D, 0, 0,
                                    PIPE_BIND_SAMPLER_VIEW)) {
       extensions->ARB_ES3_compatibility = GL_TRUE;
    }
index afe810f4d1563c2052baea4a5e96696c19ca1a92..c2535e85324fe4f97cfe15cbfd38de9e16315264 100644 (file)
@@ -65,7 +65,7 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
    struct pipe_screen *screen = st->pipe->screen;
    bool has_bgra_srgb = screen->is_format_supported(screen,
                                                    PIPE_FORMAT_B8G8R8A8_SRGB,
-                                                   PIPE_TEXTURE_2D, 0,
+                                                   PIPE_TEXTURE_2D, 0, 0,
                                                    PIPE_BIND_SAMPLER_VIEW);
 
    switch (mesaFormat) {
@@ -2059,7 +2059,7 @@ find_supported_format(struct pipe_screen *screen,
    uint i;
    for (i = 0; formats[i]; i++) {
       if (screen->is_format_supported(screen, formats[i], target,
-                                      sample_count, bindings)) {
+                                      sample_count, sample_count, bindings)) {
          if (!allow_dxt && util_format_is_s3tc(formats[i])) {
             /* we can't return a dxt format, continue searching */
             continue;
@@ -2192,8 +2192,8 @@ st_choose_format(struct st_context *st, GLenum internalFormat,
    /* search for exact matches */
    pf = find_exact_format(internalFormat, format, type);
    if (pf != PIPE_FORMAT_NONE &&
-       screen->is_format_supported(screen, pf,
-                                   target, sample_count, bindings)) {
+       screen->is_format_supported(screen, pf, target, sample_count,
+                                   sample_count, bindings)) {
       goto success;
    }
 
@@ -2290,8 +2290,8 @@ st_choose_matching_format(struct st_context *st, unsigned bind,
             st_mesa_format_to_pipe_format(st, mesa_format);
 
          if (format &&
-             screen->is_format_supported(screen, format, PIPE_TEXTURE_2D, 0,
-                                         bind)) {
+             screen->is_format_supported(screen, format, PIPE_TEXTURE_2D,
+                                         0, 0, bind)) {
             return format;
          }
          /* It's unlikely to find 2 matching Mesa formats. */
index d6901c96eb096331194883257fa527ceaadcda15..69286b57916e14e94b0ed7559859416c480391a0 100644 (file)
@@ -472,6 +472,7 @@ st_framebuffer_create(struct st_context *st,
           st_pipe_format_to_mesa_format(srgb_format) != MESA_FORMAT_NONE &&
           screen->is_format_supported(screen, srgb_format,
                                       PIPE_TEXTURE_2D, stfbi->visual->samples,
+                                      stfbi->visual->samples,
                                       (PIPE_BIND_DISPLAY_TARGET |
                                        PIPE_BIND_RENDER_TARGET)))
          mode.sRGBCapable = GL_TRUE;
index 09314519d484e47deb0d2e9eb2b064362f5146dc..5da98bd338f47e73db3e3ec725e87ccecd691640 100644 (file)
@@ -79,7 +79,7 @@ st_texture_create(struct st_context *st,
        (int) target, util_format_name(format), last_level);
 
    assert(format);
-   assert(screen->is_format_supported(screen, format, target, 0,
+   assert(screen->is_format_supported(screen, format, target, 0, 0,
                                       PIPE_BIND_SAMPLER_VIEW));
 
    memset(&pt, 0, sizeof(pt));