Commit Graph

17 Commits

Author SHA1 Message Date
Jason Ekstrand
b0a6cfb9b4 anv/blit2d: Pass the source pitch into the shader
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:39 -07:00
Jason Ekstrand
e466164c87 anv/blit2d: Break the texelfetch portion of shader building into a helper
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:37 -07:00
Jason Ekstrand
afada45590 anv/blit2d: Fix whitespace
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:35 -07:00
Jason Ekstrand
9553fd2c97 anv/blit2d: Fix a NIR writemask
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:32 -07:00
Jason Ekstrand
b38a0d64ba anv/meta2d: Don't declare an array sampler in the fragment shader
With the new blit framework we aren't using array textures and, from
talking with Nanley, we don't think it's going to be useful in the future
either.  Just get rid of it for now.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:28 -07:00
Jason Ekstrand
dd6f720046 anv/blit2d: Remove the tex_dim parameter from copy_fragment_shader
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:56:52 -07:00
Nanley Chery
0e82896a11 anv/blit2d: Add a function to create an ImageView
This function differs from the open-coded implementation in that the
ImageView's width is determined by the caller and is not unconditionally
set to match the number of texels within the surface's pitch.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-03-25 17:33:50 -07:00
Jason Ekstrand
2c3f95d6aa Merge remote-tracking branch 'public/master' into vulkan 2016-03-24 17:30:14 -07:00
Nanley Chery
5464f0c046 anv/blit: Reduce number of VUE headers being read
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-03-16 10:57:23 -07:00
Nanley Chery
5647de8ba5 anv/blit2d: Only use one extent in meta_emit_blit2d
Since scaling isn't involved, we don't need multiple extents.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-03-16 10:57:14 -07:00
Nanley Chery
92fb65f117 anv/blit2d: Remove sampler from pipeline
Since we're using texelFetch with a sampled image, a sampler is no
longer needed. This agrees with the Vulkan Spec section 13.2.4
Descriptor Set Updates:

sampler is a sampler handle, and is used in descriptor updates for types
VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
if the binding being updated does not use immutable samplers.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-03-16 10:57:00 -07:00
Nanley Chery
f8f9886915 anv/blit2d: Use texel fetch in frag shader
The texelFetch operation requires that the sampled texture coordinates
be unnormalized integers. This will simplify the copy shader for
w-tiled images (stencil buffers).

v2 (Jason):
   Use f2i for texel coords
   Fix num_components indirectly
   Use float inputs for interpolation
   Nest tex_pos functions

Suggested-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-03-16 10:56:51 -07:00
Nanley Chery
997a873f0c anv/blit2d: Customize meta blit structs and functions for blit2d API
* Add fields in meta struct
* Add support in meta init/teardown
* Switch to custom meta_emit_blit2d()

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-03-16 10:56:22 -07:00
Nanley Chery
2d8c632117 anv/blit2d: Copy anv_meta_blit.c functions
These will be customized for blit2d operations.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-03-16 10:56:10 -07:00
Nanley Chery
7fbbad0170 anv/blit2d: Use the tiling enum for simplicity
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-09 10:57:47 -08:00
Nanley Chery
514c055717 anv/meta: Prefix anv_ to meta_emit_blit()
Follow the convention for non-static functions.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-09 10:57:47 -08:00
Nanley Chery
627728cce5 anv/meta: Split anv_meta_blit.c into three files
The new organization is as follows:
* anv_meta_blit.c: Blit and state setup/teardown commands
* anv_meta_copy.c: Copy and update commands
* anv_meta_blit2d.c: 2D Blitter API commands

Also, change the formatting to contain most lines
within 80 columns.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-09 10:57:47 -08:00