Commit Graph

1096 Commits

Author SHA1 Message Date
Jason Ekstrand 9b7e08118b anv/pipeline: Pass through specialization constants 2016-01-13 15:18:36 -08:00
Jason Ekstrand c95c3b2c21 nir/spirv: Add initial support for specialization constants 2016-01-13 15:18:36 -08:00
Jason Ekstrand aee970c844 anv/device: Bump the max program size again
No one will ever need more than 128K, right?
2016-01-12 13:49:05 -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
Jason Ekstrand 6fc278ae4f anv/UpdateDescriptorSets: Respect write.dstArrayElement 2016-01-12 11:45:12 -08:00
Kristian Høgsberg Kristensen 2b4bacb84b vk: Use the correct stride for CC_VIEWPORT structs 2016-01-12 10:53:59 -08:00
Chad Versace 52d4af6a3c anv/gen7: Remove unheeded helper begin_render_pass()
The helper didn't help much. It looks like a leftover from past
code-reuse.  Now it's called from exactly one location,
gen7_CmdBeginRenderPass(). So fold it into its caller.
2016-01-11 14:08:30 -08:00
Jason Ekstrand 790565b06e anv/pipeline: Handle output lowering in anv_pipeline instead of spirv_to_nir
While we're at it, we delete any unused variables.  This allows us to prune
variables that are not used in the current stage from the shader.
2016-01-11 11:06:06 -08:00
Jason Ekstrand b8ec48ee76 anv/pipeline: Only delete functions for SPIR-V shaders
We can assume that direct NIR shaders only have one entrypoint
2016-01-11 11:06:06 -08:00
Jason Ekstrand 9f4ba499d1 nir/spirv: Take an entrypoint stage as well as a name 2016-01-11 11:06:06 -08:00
Kristian Høgsberg Kristensen a9c0e8f00f vk: Handle uninitialized FS inputs and gl_PrimitiveID
These show up as varying_to_slot[attr] == -1. Instead of storing -1 - 2
in swiz.Attribute[input_index].SourceAttribute, handle it correctly.
2016-01-09 01:03:20 -08:00
Kristian Høgsberg Kristensen b538ec5409 vk: Support reseting timestamp query pools 2016-01-09 00:51:50 -08:00
Kristian Høgsberg Kristensen 925ad84700 vk: Advertise number of timestamp bits
We have 36 bits.
2016-01-09 00:51:14 -08:00
Kristian Høgsberg Kristensen dae800daa8 vk: Expose correct timestampPeriod for SKL
Skylake uses 83.333ms per tick.
2016-01-09 00:50:04 -08:00
Kristian Høgsberg Kristensen bbb2a85c81 vk: Assert on use of uninitialized surface state
This exposes a case where we want to anv_CmdCopyBufferToImage() on an
image that wasn't created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT and
end up using uninitialized color_rt_surface_state from the meta image
view.
2016-01-08 23:51:11 -08:00
Kristian Høgsberg Kristensen a8cdef3dce vk: Only begin subpass if we're continuing a render pass
If VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT is not set in
pBeginInfo->flags, we don't have a render pass or framebuffer. Change
the condition that guard looking up render pass and framebuffer to test
for VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT instead of
VK_COMMAND_BUFFER_LEVEL_SECONDARY.

Fixes all remaining crashes in dEQP-VK.api.command_buffers.*.
2016-01-08 23:02:46 -08:00
Kristian Høgsberg Kristensen 7c5e1fd998 vk: Remove unsupported warnings for Skylake and Broxton
These are working as well as Broadwell and Cherryiew. The recent merge
from mesa master brings in Kabylake device info and that should be all
we need to enable that.
2016-01-08 22:29:06 -08:00
Jason Ekstrand cfdc955fd5 anv/reloc_list: Make valgrind explicitly check relocation data 2016-01-08 16:44:54 -08:00
Jordan Justen c7f6e42a7d anv: Increate dynamic pool block size from 2k to 16k
This is needed because compute push constant data is replicated per
invocation. For gen7, this can be up to 64. With a push constant data
max of 128 bytes, this is 8k of data. We need additional space for
local-id payloads, so we are going with 16k for now.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-01-08 13:03:30 -08:00
Chad Versace 1818463733 anv/gen9: Fix cube surface state
For gen9 SURFTYPE_CUBE, the RENDER_SURFACE_STATE's Depth,
MinimumArrayElement, and RenderTargetViewExtent is in units of full
cubes and so must be divided by 6.

Fixes 'dEQP-VK.pipeline.image.view_type.cube_array.cube_array.*'.

Now all of 'dEQP-VK.pipeline.image.*' passes.
2016-01-07 17:20:25 -08:00
Chad Versace 24d82a3f79 anv/gen8: Refactor genX_image_view_init()
Drop the temporary variables for RENDER_SURFACE_STATE's Depth and
RenderTargetViewExtent. Instead, assign them in-place.

This simplifies the next commit, which fixes gen9 cube surfaces.
2016-01-07 17:20:25 -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 d24e88b98e anv/gen7: Setup state to enable barrier() function
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-01-07 17:11:46 -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
Chad Versace 4c7f4c25d0 anv/meta: Fix hardcoded format size in anv_CmdCopy*
When looping through VkBufferImageCopy regions, for each region we
incremented the offset into the VkBuffer assuming the format size was 4.

Fixes CTS tests dEQP-VK.pipeline.image.view_type.cube_array.3d.* on
Skylake.
2016-01-07 13:56:58 -08:00
Jordan Justen 4d68c477ad anv: Assert that alignments are not 0 for align_*
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-01-07 10:37:35 -08:00
Jason Ekstrand d8cd5e333e anv/state: Pull sampler vk-to-gen maps into genX_state_util.h 2016-01-06 19:53:45 -08:00
Jordan Justen de65d4dcaf anv: Fix build without VALGRIND
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-01-06 15:54:51 -08:00
Chad Versace 8284786c5d anv/gen9: Teach gen9_image_view_init() about 1D surface qpitch
QPitch is usually expressed as rows of surface elements (where a surface
element is an compression block or a single surface sample. Skylake 1D
is an outlier; there QPitch is expressed as individual surface
elements.
2016-01-06 09:38:57 -08:00
Chad Versace dcb9c11dc7 anv/gen9: Fix oob lookup of surface halign, valign
For 1D surfaces and for surfaces with Yf or Ys tiling, the hardware
ignores SurfaceVerticalAlignment and SurfaceHorizontalAlignment.
Moreover, the anv_halign[] and anv_valign[] lookup tables may not even
contain the surface's actual alignment values. So don't do the lookup
for those surfaces.
2016-01-06 09:38:57 -08:00
Chad Versace 94566d9b68 anv/meta: Teach meta how to blit from a 1D image
Meta needed a VkShader with a 1D sampler type.
2016-01-06 09:38:57 -08:00
Jason Ekstrand ec899f6b42 anv/pipeline: Lower indirect temporaries and inputs 2016-01-05 13:42:52 -08:00
Kristian Høgsberg Kristensen 30521fb19e vk: Implement a basic pipeline cache
This is not really a cache yet, but it allows us to share one state
stream for all pipelines, which means we can bump the block size without
wasting a lot of memory.
2016-01-05 12:03:21 -08:00
Kristian Høgsberg Kristensen f551047751 vk: Destroy device->mutex when destroying the device 2016-01-05 12:03:21 -08:00
Chad Versace 89b68dc8d0 anv: Use isl_format_layout::bs instead of ::bpb
For all formats used by Vulkan, 8 * bs == bpb.
(bs=block_size_in_bytes, bpb=bits_per_block)
2016-01-05 10:00:39 -08:00
Jason Ekstrand ba7b5edc26 anv/UpdateDescriptorSets: Use the correct index for the buffer view 2016-01-04 21:36:11 -08:00
Jason Ekstrand 151694228d anv/formats: Hand out different formats based on tiled vs. linear 2016-01-04 16:08:05 -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 ceb05131da anv_get_isl_format: Support depth+stencil aspect value
You just get the depth format in this case.
2016-01-04 16:08:05 -08:00
Jason Ekstrand a7cc12910d anv/image: Do more work in anv_image_view_init
There was a bunch of common code in gen7/8_image_view_init that we really
should be sharing.
2016-01-04 16:08:05 -08:00
Jason Ekstrand 87dd59e578 anv/formats: Rework GetPhysicalDeviceFormatProperties
It now calls get_isl_format to get both linear and tiled views of the
format and determines linear/tiled properties from that.  Buffer properties
are determined from the linear format.
2016-01-04 16:08:05 -08:00
Jason Ekstrand 2712c0cca3 anv/formats: Add a tiling parameter to get_isl_format
Currently, this parameter does nothing.
2016-01-04 16:08:05 -08:00
Jason Ekstrand 5f5fc23e7c genX/state: Pull some generic helpers into a shared header 2016-01-04 16:08:05 -08:00
Jason Ekstrand ad9ff4f2b2 meta/blit: Rework how format and aspect choices are made
This commit does two things.  First, it introduces choose_* functions for
chosing formats and aspects.  Second, it changes the copy (not blit) code
to use appropreately sized UINT formats for everything except depth.  There
are two main reasons for this:  First, it means that compressed and other
non-renderable texture upload should "just work" because it won't be
tripping over non-renderable formats.  Second, it allows us to easly copy
an RGB buffer to and from an RGBX image because the formats will get
switched over to their UINT variants and the shader will deal with the
extra channel for us.
2016-01-04 16:08:05 -08:00
Jason Ekstrand 3200a81a55 anv/image: Add a vk_format field
We've been trying to move away from anv_format for a while and this should
help with the transition.  There are cases (mostly in meta) where we need
the original format for the image and not the isl_format.  These will be
moved over to the new vk_format and everythign else will use the isl_format
from the particular anv_surface.
2016-01-04 16:08:05 -08:00
Kristian Høgsberg Kristensen abc1c9878f vk: Don't leak pipeline if initialization fails 2016-01-04 10:42:50 -08:00
Kristian Høgsberg Kristensen fca1c08e34 vk: Allocate subpass attachment in one big block
This avoids making a lot of small allocations and handles allocation
failure correctly.

Fixes dEQP-VK.api.object_management.alloc_callback_fail.* failures.
2016-01-04 10:07:10 -08:00