Commit graph

74 commits

Author SHA1 Message Date
Kristian Høgsberg Kristensen
51c01e292c anv: Generate pack headers from XML definition
This huge commit switches us over to using a simple xml format (genxml)
for defining our command streamer commands and a python script for
generating the pack headers we use in the driver.
2016-02-10 14:31:26 -08:00
Chad Versace
e6d3432c81 anv: Replace anv_format::depth_format with ::has_depth
isl now understands depth formats. We no longer need depth formats in
the anv_format table.
2016-02-09 10:02:50 -08:00
Kristian Høgsberg Kristensen
6c4c04690f anv: Deduplicate dispatch calls
This can all be shared between gen8+ and pre-gen8.
2016-02-05 22:36:53 -08:00
Kristian Høgsberg Kristensen
bdefaae2b9 anv: Deduplicate anv_CmdDraw calls
These were all duplicated between gen7_cmd_buffer.c and
gen8_cmd_buffer.c. This commit consolidates both copies in
genX_cmd_buffer.c.
2016-02-05 16:41:56 -08:00
Ben Widawsky
89ec36f221 anv/cmd_buffer: Emit gen9 style SF state for CHV
The state for line width changes on Cherryview to use the GEN9 bits (for extra
precision).
2016-01-29 14:12:32 -08:00
Ben Widawsky
31508bd0ce anv/gen8: Extract SF state
For upcoming patch to address difference in Cherryview.
2016-01-29 14:11:53 -08:00
Chad Versace
f8a4abcd15 anv: Do resolves at end of subpass 2016-01-28 10:49:50 -08:00
Ben Widawsky
2af3281fee anv/push constants: Use constant buffer #2
SKL has a workaround which requires either some weird programming of buffer 3,
OR, just never using buffer 0. Since we don't actually use multiple constant
buffers, it's easier to just not use 0.

Only SKL requires this workaround, but there is no harm in applying it to all
platforms. The big change here is that buffer #0 is relative to dynamic state
base normally (depending upon ISTPM), where buffer 1-3 is a GPU virtual address.
2016-01-27 17:09:36 -08:00
Jason Ekstrand
7ef0d39cb2 anv/cmd_buffer: Put base_instance in the second component 2016-01-26 15:44:02 -08:00
Jason Ekstrand
4bf3cadb66 gen8: Add support for base vertex/instance 2016-01-26 14:56:37 -08:00
Jordan Justen
bc035db3c8 anv/gen8: Set SLM size in interface descriptor
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-01-21 00:31:29 -08:00
Jordan Justen
819cb69434 anv/gen8+9: Invalidate color calc state when switching to the GPGPU pipeline
Port 044acb9256 to anv.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-01-21 00:31:29 -08:00
Jordan Justen
19830031cb anv/gen8: Enable SLM in L3 cache control register
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-01-21 00:31:29 -08:00
Chad Versace
1afe33f8b3 anv/gen8: Fix SF_CLIP_VIEWPORT's Z elements
SF_CLIP_VIEWPORT does not clamp Z values. It only scales and shifts
them. Clamping to VkViewport::minDepth,maxDepth is instead handled by
CC_VIEWPORT.

Fixes dEQP-VK.renderpass.simple.depth on Broadwell.
2016-01-14 22:53:05 -08:00
Chad Versace
11f5433715 anv: Distinguish between subpass setup and subpass start
vkCmdBeginRenderPass, vkCmdNextSubpass, and vkBeginCommandBuffer with
VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, all *setup* the
command buffer for recording commands for some subpass.  But only the
first two, vkCmdBeginRenderPass and vkCmdNextSubpass, can *start*
a subpass.

Therefore, calling anv_cmd_buffer_begin_subpass() inside
vkCmdBeginCommandBuffer is misleading. Clarify its purpose by renaming
it to anv_cmd_buffer_set_subpass() and adding comments.
2016-01-14 22:53:05 -08:00
Chad Versace
deb8dd89b5 anv: Emit load clears at start of each subpass
This should improve cache residency for render targets.

Pre-patch, vkCmdBeginRenderPass emitted all the meta clears for
VK_ATTACHMENT_LOAD_OP_CLEAR before any subpass began. Post-patch,
vCmdBeginRenderPass and vkCmdNextSubpass emit only the clears needed for
that current subpass.
2016-01-14 22:53:05 -08:00
Chad Versace
356f952f87 anv/meta: Use anv_cmd_state::attachments for clears
Rewrite anv_cmd_buffer_clear_attachments, which emits the top-of-pass
clears, to use the data provided in anv_cmd_state::attachments. This
prepares for deferring each attachment clear to the first subpass that
uses the attachment.
2016-01-14 22:53:05 -08:00
Chad Versace
a4b045ca44 anv: Add anv_cmd_state::attachments
This array contains attachment state when recording a renderpass instance.
It's populated on each call to anv_cmd_buffer_set_pass.

The data is currently set but unused. We'll use it later to defer each
attachment clear to the subpass that first uses the attachment.
2016-01-14 22:53:05 -08:00
Jason Ekstrand
c310fb032d vulkan-1.0.0: Rework memory barriers 2016-01-14 08:09:39 -08:00
Jason Ekstrand
aab9517f3d vulkan-1.0.0: Misc. field and argument renames 2016-01-14 07:41:45 -08:00
BogDan Vatra
102c74277f WIP: Partially upgrade to vulkan v0.221.0
TODO, make use of:
- VkPhysicalDeviceFeatures.drawIndirectFirstInstance,
- VkPhysicalDeviceFeatures.inheritedQueries
- VkPhysicalDeviceLimits.timestampComputeAndGraphics
- VkSubmitInfo.pWaitDstStageMask
- VkSubresourceLayout.arrayPitch
- VkSamplerCreateInfo.anisotropyEnable
2016-01-14 07:30:46 -08:00
Kristian Høgsberg Kristensen
d7a193327b vk: Implement workaround for occlusion queries
We have an issue with occlusion queries (PIPE_CONTROL depth writes)
after using the pipeline with the VS disabled. We work around it by
using a depth cache flush PIPE_CONTROL before doing a depth write.

Fixes dEQP-VK.query_pool.*
2016-01-12 11:50:36 -08:00
Kristian Høgsberg Kristensen
2b4bacb84b vk: Use the correct stride for CC_VIEWPORT structs 2016-01-12 10:53:59 -08:00
Kristian Høgsberg Kristensen
1b1dca75a4 vk: Make sure we emit binding table pointers after push constants
SKL needs this to make sure we flush the push constants. It gets a
little tricky, since we also need to emit binding tables before push
constants, since that may affect the push constants (dynamic buffer
offsets and storage image parameters).  This patch splits emitting
binding tables from emitting the pointers so that we can emit push
constants after binding tables but before emitting binding table
pointers.
2016-01-07 16:31:57 -08:00
Kristian Høgsberg Kristensen
a18b5e642c vk: Implement VK_QUERY_RESULT_WITH_AVAILABILITY_BIT 2016-01-07 16:31:57 -08:00
Kristian Høgsberg Kristensen
bbf3fc815b vk: Add missing DepthStallEnable to OQ pipe control 2016-01-07 16:31:57 -08:00
Kristian Høgsberg Kristensen
067dbd7a17 vk: Issue PIPELINE_SELECT before setting up render pass
We need to make sure we're selected the 3D pipeline before we start
setting up depth and stencil buffers.
2016-01-07 16:31:57 -08:00
Jordan Justen
36a2304686 anv/gen8: Setup state to enable barrier() function
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-01-07 17:11:46 -08:00
Jason Ekstrand
f665fdf0e7 anv/image_view: Separate vulkan and isl formats
Previously, anv_image_view had a anv_format pointer that we used for
everything.  This commit replaces that pointer with a VkFormat enum copied
from the API and an isl_format.  In order to implement RGB formats, we have
to use a different isl_format for the actual surface state than the obvious
one from the VkFormat.  Separating the two helps us keep things streight.
2016-01-04 16:08:05 -08:00
Jason Ekstrand
28243b2fba gen7/8/cmd_buffer: Allocate the correct ammount for COLOR_CALC_STATE
We were allocating 6 bytes when we should have been allocating 6 dwords.
2015-12-30 10:37:57 -08:00
Kristian Høgsberg Kristensen
b49aaf5de0 vk: Remove stale 48 bit addresses FIXMEs
This has worked fine for a long time.
2015-12-19 22:20:45 -08:00
Kristian Høgsberg Kristensen
c4802bc44c vk/gen8: Implement VkEvent for gen8
We use PIPE_CONTROL for setting and resetting the event from cmd buffers
and MI_SEMAPHORE_WAIT in polling mode for waiting on an event.
2015-12-19 22:17:19 -08:00
Jordan Justen
5e82a91324 anv/gen8: Add support for gl_NumWorkGroups
Co-authored-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2015-12-18 01:45:11 -08:00
Jason Ekstrand
21cf55ab54 gen8/cmd_buffer: Don't push CS constants if there aren't any
Issuing MEDIA_CURB_LOAD with a size of zero causes GPU hangs on BDW.
2015-12-10 18:56:27 -08:00
Jason Ekstrand
3893e11f4b anv: Use 4 instead of sizeof(gl_constant_value)
We no longer have access to gl_constant_value and, really, it's 4 because
our uniform layout code works entirely in dwords.
2015-12-10 18:55:16 -08:00
Jason Ekstrand
d5c9955d3e Merge remote-tracking branch 'mesa-public/master' into vulkan
This pulls in nir_intrinsic_load/store changes and the switch of all
uniforms in i965 to bytes.  This accounts for the Vulkan changes.
2015-12-10 18:29:36 -08:00
Jordan Justen
47e5fb52f4 gen8/compute: Setup push constants and local ids
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2015-12-09 11:04:30 -08:00
Jordan Justen
d28df86c87 anv/compute: Fix thread width max off by 1
See cooresponding code in:

commit 8d87070af2
Author: Jordan Justen <jordan.l.justen@intel.com>
Date:   Thu Aug 28 14:47:19 2014 -0700

    i965/cs: Implement brw_emit_gpgpu_walker

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2015-12-08 18:09:31 -08:00
Jason Ekstrand
f4aee5d82f gen8/cmd_buffer: Flush push constants after descriptor sets
This is because, if storage images are used, flushing descriptor sets can
cause push constants to become dirty.
2015-12-07 21:45:43 -08:00
Kristian Høgsberg
773592051b vk: clflush all state for non-LLC GPUs 2015-12-04 09:51:47 -08:00
Chad Versace
981ef2f02d anv: Embed isl_surf into anv_surface
This reduces struct anv_surface to just two members: an offset and the
embedded isl_surf.
2015-12-03 15:31:00 -08:00
Jason Ekstrand
888744cabf vk/0.210.0: Update queries to the new API 2015-12-03 13:44:02 -08:00
Jason Ekstrand
a5f19f64c3 vk/0.210.0: Remove the VkShaderStage enum
This made for an unfortunately large amount of work since we were using it
fairly heavily internally.  However, gl_shader_stage does basically the
same things, so it's not too bad.
2015-12-03 13:43:54 -08:00
Jason Ekstrand
5f348bd0e5 vk/0.210.0: Rename origin fields of VkViewport 2015-12-03 13:43:52 -08:00
Jason Ekstrand
2e10ca5748 vk/0.210.0: Misc. function argument renames 2015-12-03 13:43:51 -08:00
Jason Ekstrand
4ab9391fbb vk/0.210.0: Rework dynamic states 2015-11-30 14:19:41 -08:00
Jason Ekstrand
a89a485e79 vk/0.210.0: Rename CmdBuffer to CommandBuffer 2015-11-30 11:48:08 -08:00
Kristian Høgsberg Kristensen
d6d82f1ab3 vk: Fix 3DSTATE_WM_DEPTH_STENCIL for gen8
This packet is a different size on gen8 and we hit an assertion when we
try to merge a gen9 size dword array from the pipeline with the gen8
sized array we create from dynamic state.

Use a static assert in the merge macro and fix this issue by using different
wm_depth_stencil arrays on gen8 and gen9.
2015-11-26 10:11:52 -08:00
Kristian Høgsberg Kristensen
cd4721c062 vk: Add SKL support
Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-11-25 22:34:10 -08:00
Jason Ekstrand
6f613abc2b anv/cmd_buffer: Add a new genX_cmd_buffer file for shared code
This file contains code that can be shared across gens modulo recompiling.
In particular, we can share STATE_BASE_ADDRESS setup and handling of the
vkPipelineBarrier call.  Not sharing STATE_BASE_ADDRESS setup has already
been a source of bugs and the gen7 and gen8 implementations of
PipelineBarrier were line-for-line identical.

Incidentally, this should fix MOCS settings for dynamic and surface state
on Haswell.
2015-11-18 12:26:57 -08:00