Commit graph

250 commits

Author SHA1 Message Date
Jason Ekstrand
93db828e42 anv/device: Images are only enabled in scalar stages
Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-04-15 16:40:56 -07:00
Jason Ekstrand
5ec4ecce44 anv: Advertise vertexPipelineStoresAndAtomics based on scalar stages
Previously, we just looked at the hardware generation but this meant that
if you did INTEL_DEBUG=vec4 on BDW or SKL, you would have advertised but
non-working features.
2016-04-15 14:53:16 -07:00
Jason Ekstrand
48cc8c284a anv: Install the installable ICD 2016-04-14 15:15:00 -07:00
Jason Ekstrand
e40b867145 anv/intel_icd: Don't provide an absolute path
The driver will be installed to $(libdir)/libvulkan_intel.so and just
providing a driver name is enough for the loader.  This also ensures that
multi-arch systems work ok.
2016-04-14 15:15:00 -07:00
Jason Ekstrand
ca16373a2b configure: Add initial support for enabling Vulkan drivers 2016-04-14 15:15:00 -07:00
Jason Ekstrand
e61c812f76 anv/pipeline: Use the right mask for lower_indirect_derefs 2016-04-14 15:13:29 -07:00
Jason Ekstrand
c34be07230 spirv: Move to compiler/
While it does rely on NIR, it's not really part of the NIR core.  At the
moment, it still builds as part of libnir but that can be changed later if
desired.
2016-04-14 10:28:47 -07:00
Jason Ekstrand
12f88ba32a Merge remote-tracking branch 'public/master' into vulkan 2016-04-13 20:25:39 -07:00
Nanley Chery
79fbec30fc anv: Remove default scissor and viewport concepts
Users should never provide a scissor or viewport count of 0 because
they are required to set such state in a graphics pipeline. This
behavior was previously only used in Meta, which actually just
disables those hardware operations at pipeline creation time.

Kristian noticed that the current assignment of viewport count
reduces the number of viewport uploads, so it is not removed.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2016-04-13 18:02:38 -07:00
Nanley Chery
1949e502bc anv: Replace ::disable_scissor with ::use_rectlists
Meta currently uses screenspace RECTLIST primitives that lie within
the framebuffer rectangle. Since this behavior shouldn't change in the
future, disable the scissor operation whenever rectlists are used.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2016-04-13 18:00:41 -07:00
Nanley Chery
9f72466e9f anv: Delete anv_graphics_pipeline_create_info::disable_viewport
There are no users of this field.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2016-04-13 18:00:41 -07:00
Nanley Chery
cff0f6b027 gen{7,8}_pipeline: Always set ViewportXYClipTestEnable
For the following reasons, there is no behavioural change with this
commit: the ViewportXYClipTest function of the CLIP stage will continue
to be enabled outside of Meta (where disable_viewport is always false),
and the CLIP stage is turned off within Meta, so this function will
continue to be disabled in that case.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2016-04-13 18:00:41 -07:00
Nanley Chery
992bbed98d gen{7,8}_pipeline: Apply 3DPRIM_RECTLIST restrictions
According to 3D Primitives Overview in the Bspec, when the RECTLIST
primitive is in use, the CLIP stage should be disabled or set to have
a different Clip Mode, and Viewport Mapping must be disabled:

   Clipping: Must not require clipping or rely on the CLIP unit’s
   ClipTest logic to determine if clipping is required. Either the CLIP
   unit should be DISABLED, or the CLIP unit’s Clip Mode should be set
   to a value other than CLIPMODE_NORMAL.

   Viewport Mapping must be DISABLED (as is typical with the use of
   screen-space coordinates).

We swap out ::disable_viewport for ::use_rectlist, because we currently
always use the RECTLIST primitive when we disable viewport mapping, and
we'll likely continue to use this primitive.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2016-04-13 17:53:38 -07:00
Nanley Chery
88d1c19c9d anv_cmd_buffer: Don't make the initial state dirty
Avoid excessive state emission. Relevant state for an action command
will get set by the user:

From Chapter 5. Command Buffers,
 When a command buffer begins recording, all state in that command
 buffer is undefined.
 [...]
 Whenever the state of a command buffer is undefined, the application
 must set all relevant state on the command buffer before any state
 dependent commands such as draws and dispatches are recorded, otherwise
 the behavior of executing that command buffer is undefined.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2016-04-13 17:52:24 -07:00
Nanley Chery
9fae6ee026 anv/meta: Don't set the dynamic state for disabled operations
CmdSet* functions dirty the CommandBuffer's dynamic state. This causes
the new state to be emitted when CmdDraw is called. Since we don't need
the state that would be emitted, don't call the CmdSet* functions.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2016-04-13 17:52:20 -07:00
Nanley Chery
76b0ba087c anv/clear: Disable the scissor operation
Since the scissor rectangle always matches that of the framebuffer,
this operation isn't needed.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2016-04-13 17:45:18 -07:00
Jason Ekstrand
bff7a8c4f3 anv/pipeline: Set up flat enables correctly 2016-04-09 17:06:59 -07:00
Jason Ekstrand
1275c7c744 genxml: Fix the name of a 3DSTATE_SF/SBE field on gen6-7.5 2016-04-09 17:02:21 -07:00
Jason Ekstrand
aa6f9a4e1e genxml: Break output detail of 3DSTATE_SF on gen7 into a struct
This makes it work like 3DSTATE_SBE[_SWIZ] on gen7+
2016-04-09 17:00:22 -07:00
Jason Ekstrand
ddae342618 genxml: Fix up MOCS in RENDER_SURFACE_STATE on gen6 to match gen7 2016-04-09 16:59:04 -07:00
Jason Ekstrand
d4a28ae52a anv/meta: Make clflushes conditional on !devinfo->has_llc 2016-04-08 17:07:49 -07:00
Jason Ekstrand
c226e72a39 anv/formats: Advertise blit support for stencil
Thanks to advances in the blit code, we can do this now.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:59:29 -07:00
Jason Ekstrand
e3312644cb anv/blit2d: Add support for W-tiled destinations
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2016-04-08 15:59:26 -07:00
Jason Ekstrand
0a6842c1bd isl/surface_state: Set the correct pitch for W-tiled surfaces
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:58:52 -07:00
Jason Ekstrand
2e827816fa anv/blit2d: Add another passthrough varying to the VS
We need the VS to provide some setup data for other stages.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:58:49 -07:00
Jason Ekstrand
b377c1d08e anv/image: Remove the offset parameter from image_view_init
The only place we were using this was in meta_blit2d which always creates a
new image anyway so we can just use the image offset.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:58:45 -07:00
Jason Ekstrand
f9a2570a06 anv/blit2d: Add a bind_dst helper function
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:58:42 -07:00
Jason Ekstrand
15a9468d85 anv/blit2d: Simplify create_iview
Now it just creates the image and view.  The caller is responsible for
handling the offset calculations.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:58:40 -07:00
Jason Ekstrand
819d0e1a7c anv/meta2d: Add support for blitting from W-tiled sources on gen7
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2016-04-08 15:58:03 -07:00
Jason Ekstrand
b0a5ca5cfc isl: Remove surf_get_intratile_offset_el
The intratile offset may not be a multiple of the element size so this
calculation is invalid.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:58:01 -07:00
Jason Ekstrand
b37502b983 isl: Rework the get_intratile_offset function
The old function tried to work in elements which isn't, strictly speaking,
a valid thing to do.  In the case of a non-power-of-two format, there is no
guarantee that the x offset into the tile is a multiple of the format
block size.  This commit refactors it to work entirely in terms of a tiling
(not a surface) and bytes/rows.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:58 -07:00
Jason Ekstrand
4caba94086 anv/image: Expose the guts of CreateBufferView for meta
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:55 -07:00
Jason Ekstrand
4ee80e8816 anv/blit2d: Refactor in preparation for different src/dst types
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:52 -07:00
Jason Ekstrand
85b9a007ac anv/blit2d: Add layouts for using a texel buffer source
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:49 -07:00
Jason Ekstrand
28eb02e345 anv/blit2d: Rename the descriptor set and pipeline layouts
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:47 -07:00
Jason Ekstrand
00e70868ee anv/blit2d: Enhance teardown and clean up init error paths
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:45 -07:00
Jason Ekstrand
43fbdd7156 anv/blit2d: Factor binding the source image into a helper
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:43 -07:00
Jason Ekstrand
5187ab05b8 anv/blit2d: Inline meta_emit_blit2d
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:41 -07:00
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
Kristian Høgsberg Kristensen
068935844c genxml: Add GEN6 genxml
Not used yet, but let's put it here for now.
2016-04-06 21:08:34 -07:00
Jordan Justen
f56f538ce4 anv/gen7: Fix command parser version test with indirect dispatch
Caught-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-28 22:30:33 -07:00
Jordan Justen
8dbfa265a4 anv/gen7: DispatchIndirect requires cmd parser 5
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-28 17:01:35 -07:00
Jordan Justen
1a3adae84a anv/gen7: Save kernel command parser version
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-28 17:01:35 -07:00
Jordan Justen
f60683b32a anv: Invalidate state cache before L3 partitioning set-up.
Port 10d84ba9f0 to anv.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-28 17:01:35 -07:00
Jordan Justen
5879cb0251 anv: Fix cache pollution race during L3 partitioning set-up.
Port 0aa4f99f56 to anv.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-28 17:01:35 -07:00