diff options
author | Jason Ekstrand <[email protected]> | 2019-05-17 10:04:58 -0500 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2019-05-21 08:42:32 +0000 |
commit | 5d05324e658dc29e742a02fe5508622fc5e2733c (patch) | |
tree | b3bf8f35cc012f683c8ad6c0e57a9c72b2cf4e4f /src/intel/vulkan/anv_private.h | |
parent | 8dbdeb27f33fede754ba77ce546eed123635ae24 (diff) |
anv: Emulate texture swizzle in the shader when needed
Now that we have the descriptor buffer mechanism, emulated texture
swizzle can be implemented in a very non-invasive way. Previous
attempts all tried to extend the push constant based image param
mechanism which was gross. This could, in theory, be done much faster
with a magic back-end instruction which does indirect MOVs but Vulkan on
IVB is already so slow this isn't going to matter much.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104355
Cc: "19.1" <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
(cherry picked from commit d2aa65eb1892f7b300ac24560f9dbda6b600b5a7)
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r-- | src/intel/vulkan/anv_private.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 2d3abe3961b..7501188903c 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1548,6 +1548,17 @@ struct anv_sampled_image_descriptor { uint32_t sampler; }; +struct anv_texture_swizzle_descriptor { + /** Texture swizzle + * + * See also nir_intrinsic_channel_select_intel + */ + uint8_t swizzle[4]; + + /** Unused padding to ensure the struct is a multiple of 64 bits */ + uint32_t _pad; +}; + /** Struct representing a storage image descriptor */ struct anv_storage_image_descriptor { /** Bindless image handles @@ -1589,6 +1600,8 @@ enum anv_descriptor_data { ANV_DESCRIPTOR_SAMPLED_IMAGE = (1 << 6), /** Storage image handles */ ANV_DESCRIPTOR_STORAGE_IMAGE = (1 << 7), + /** Storage image handles */ + ANV_DESCRIPTOR_TEXTURE_SWIZZLE = (1 << 8), }; struct anv_descriptor_set_binding_layout { |