summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_image.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-05-17 10:04:58 -0500
committerJason Ekstrand <[email protected]>2019-05-17 12:25:58 -0500
commitd2aa65eb1892f7b300ac24560f9dbda6b600b5a7 (patch)
tree0877c1d5ce4d5d739049ddfce097c07aff6e6351 /src/intel/vulkan/anv_image.c
parentea479fdc1d04f8548fb6628f5d5bda83324a76da (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]>
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r--src/intel/vulkan/anv_image.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 3841234df14..8e45803a7bc 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -1278,6 +1278,10 @@ anv_image_fill_surface_state(struct anv_device *device,
if (view_usage == ISL_SURF_USAGE_RENDER_TARGET_BIT)
view.swizzle = anv_swizzle_for_render(view.swizzle);
+ /* On Ivy Bridge and Bay Trail we do the swizzle in the shader */
+ if (device->info.gen == 7 && !device->info.is_haswell)
+ view.swizzle = ISL_SWIZZLE_IDENTITY;
+
/* If this is a HiZ buffer we can sample from with a programmable clear
* value (SKL+), define the clear value to the optimal constant.
*/