summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_meta_blit2d.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-05-02 16:29:05 -0700
committerJason Ekstrand <[email protected]>2016-05-14 13:34:40 -0700
commit87a41e862b5344da6271d533552a890d59f07a4b (patch)
treeaeb344b6b75a3dda917b0621797e6f45ab5a5e09 /src/intel/vulkan/anv_meta_blit2d.c
parentfc58cb543fe2430576216680c4f6a55ec22b937e (diff)
nir/builder: Add a helper for grabbing multiple channels from an ssa def
This is similar to nir_channel except that it lets you grab more than one channel by providing a mask. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_meta_blit2d.c')
-rw-r--r--src/intel/vulkan/anv_meta_blit2d.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_meta_blit2d.c b/src/intel/vulkan/anv_meta_blit2d.c
index 577eeaea104..06e10432952 100644
--- a/src/intel/vulkan/anv_meta_blit2d.c
+++ b/src/intel/vulkan/anv_meta_blit2d.c
@@ -1010,9 +1010,7 @@ build_nir_w_tiled_fragment_shader(struct anv_device *device,
discard->src[0] = nir_src_for_ssa(oob);
nir_builder_instr_insert(&b, &discard->instr);
- unsigned swiz[4] = { 0, 1, 0, 0 };
- nir_ssa_def *tex_off =
- nir_swizzle(&b, nir_load_var(&b, tex_off_in), swiz, 2, false);
+ nir_ssa_def *tex_off = nir_channels(&b, nir_load_var(&b, tex_off_in), 0x3);
nir_ssa_def *tex_pos = nir_iadd(&b, nir_vec2(&b, x_W, y_W), tex_off);
nir_ssa_def *tex_pitch = nir_channel(&b, nir_load_var(&b, tex_off_in), 2);