diff options
author | Marek Olšák <[email protected]> | 2018-05-23 18:46:19 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-07-31 18:28:41 -0400 |
commit | 966f155623e5a626f1d788af7e0f602cdcee6993 (patch) | |
tree | c3ae4f7021a386abcf2c04cba7ca7ac9cca582bc /src/gallium/state_trackers | |
parent | 8632626c81a09315276d7defa63092247d7fd308 (diff) |
gallium: add storage_sample_count parameter into is_format_supported
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/clover/core/format.cpp | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/dri2.c | 5 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/dri_query_renderer.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/dri_screen.c | 16 | ||||
-rw-r--r-- | src/gallium/state_trackers/glx/xlib/xm_api.c | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/basetexture9.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/nine_pipe.h | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/surface9.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/va/subpicture.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/vdpau/query.c | 14 | ||||
-rw-r--r-- | src/gallium/state_trackers/vdpau/vdpau_private.h | 5 | ||||
-rw-r--r-- | src/gallium/state_trackers/wgl/stw_pixelformat.c | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/xa/xa_context.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/xa/xa_renderer.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/xa/xa_tracker.c | 10 | ||||
-rw-r--r-- | src/gallium/state_trackers/xvmc/subpicture.c | 8 |
17 files changed, 44 insertions, 38 deletions
diff --git a/src/gallium/state_trackers/clover/core/format.cpp b/src/gallium/state_trackers/clover/core/format.cpp index 57012924098..dee1872c829 100644 --- a/src/gallium/state_trackers/clover/core/format.cpp +++ b/src/gallium/state_trackers/clover/core/format.cpp @@ -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); } diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c index 9a22e47693b..2ac32205d9a 100644 --- a/src/gallium/state_trackers/dri/dri2.c +++ b/src/gallium/state_trackers/dri/dri2.c @@ -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; diff --git a/src/gallium/state_trackers/dri/dri_query_renderer.c b/src/gallium/state_trackers/dri/dri_query_renderer.c index 80847e3d314..2417f40a6ad 100644 --- a/src/gallium/state_trackers/dri/dri_query_renderer.c +++ b/src/gallium/state_trackers/dri/dri_query_renderer.c @@ -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: diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 87729c190a8..fe4e39b3f93 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -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; } diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index e4c9408d0db..b560ffca9b6 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -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; diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_trackers/nine/basetexture9.c index 0a9034c949d..911eee6da20 100644 --- a/src/gallium/state_trackers/nine/basetexture9.c +++ b/src/gallium/state_trackers/nine/basetexture9.c @@ -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; diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index c434efb8bc7..150f5e3e05e 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -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); diff --git a/src/gallium/state_trackers/nine/nine_pipe.h b/src/gallium/state_trackers/nine/nine_pipe.h index c8fef628276..7b68c09c47a 100644 --- a/src/gallium/state_trackers/nine/nine_pipe.h +++ b/src/gallium/state_trackers/nine/nine_pipe.h @@ -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, diff --git a/src/gallium/state_trackers/nine/surface9.c b/src/gallium/state_trackers/nine/surface9.c index 4c6a6957703..71aa4f46ffd 100644 --- a/src/gallium/state_trackers/nine/surface9.c +++ b/src/gallium/state_trackers/nine/surface9.c @@ -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)); diff --git a/src/gallium/state_trackers/va/subpicture.c b/src/gallium/state_trackers/va/subpicture.c index 981a99cec53..b213e9abb7d 100644 --- a/src/gallium/state_trackers/va/subpicture.c +++ b/src/gallium/state_trackers/va/subpicture.c @@ -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; } diff --git a/src/gallium/state_trackers/vdpau/query.c b/src/gallium/state_trackers/vdpau/query.c index 6b8b5a6b5d3..2c4ebe62e19 100644 --- a/src/gallium/state_trackers/vdpau/query.c +++ b/src/gallium/state_trackers/vdpau/query.c @@ -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) { diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h index b36c0c4aec2..420573b57ad 100644 --- a/src/gallium/state_trackers/vdpau/vdpau_private.h +++ b/src/gallium/state_trackers/vdpau/vdpau_private.h @@ -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 diff --git a/src/gallium/state_trackers/wgl/stw_pixelformat.c b/src/gallium/state_trackers/wgl/stw_pixelformat.c index 833308d964c..d4e7a94f36d 100644 --- a/src/gallium/state_trackers/wgl/stw_pixelformat.c +++ b/src/gallium/state_trackers/wgl/stw_pixelformat.c @@ -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; } diff --git a/src/gallium/state_trackers/xa/xa_context.c b/src/gallium/state_trackers/xa/xa_context.c index 1f4717056a9..ba220877c84 100644 --- a/src/gallium/state_trackers/xa/xa_context.c +++ b/src/gallium/state_trackers/xa/xa_context.c @@ -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; diff --git a/src/gallium/state_trackers/xa/xa_renderer.c b/src/gallium/state_trackers/xa/xa_renderer.c index 27497d3d659..e3311232e77 100644 --- a/src/gallium/state_trackers/xa/xa_renderer.c +++ b/src/gallium/state_trackers/xa/xa_renderer.c @@ -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; diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c index 3d268a17750..c046a3a7097 100644 --- a/src/gallium/state_trackers/xa/xa_tracker.c +++ b/src/gallium/state_trackers/xa/xa_tracker.c @@ -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; diff --git a/src/gallium/state_trackers/xvmc/subpicture.c b/src/gallium/state_trackers/xvmc/subpicture.c index bc26976e282..7a6dc89d8d8 100644 --- a/src/gallium/state_trackers/xvmc/subpicture.c +++ b/src/gallium/state_trackers/xvmc/subpicture.c @@ -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; |