st: Pass TextureTiling option from texture to memory obj
authorEduardo Lima Mitev <elima@igalia.com>
Thu, 7 May 2020 15:28:44 +0000 (17:28 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 18 Aug 2020 20:40:40 +0000 (20:40 +0000)
commite48f27ee6454db2856ee24be78873513867c11a0
tree98f563186bb6e496d3507f9b4ebda96571d1466c
parentb479de8537ad34ec56d61f87d53a327a175eab36
st: Pass TextureTiling option from texture to memory obj

If tiling is linear, also adds the corresponding pipe bind flag
to the resource template when creating a new resource from the
memory object.

Modified TexParameteri to update the TextureTiling option only when the
texObj is not immutable (before TexStorageMem*DEXT is called to create
the texture from external memory).

v2: Ensure that memory object is not NULL before setting the
TextureTiling option (fixes TexStorage*D).

v3: Also add flag PIPE_SHARED to bindings (needed for some gallium
drivers).

v4: Use PIPE_BIND_LINEAR instead of adding a new PIPE_RESOURCE_FLAG
(Marek Olšák)

Co-authored-by: Eduardo Lima Mitev <elima@igalia.com>
Co-authored-by: Eleni Maria Stea <estea@igalia.com>
Co-authored-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4565>
src/mesa/main/texparam.c
src/mesa/state_tracker/st_cb_memoryobjects.h
src/mesa/state_tracker/st_cb_texture.c