Commit graph

1274 commits

Author SHA1 Message Date
Jordan Justen
b1158ced45 anv/genX: Add genX_pipeline.c for compute_pipeline_create
Adds initial compute_pipeline_create implementation for gen7.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-01-30 08:58:11 -08:00
Jason Ekstrand
1a442a7923 Merge branch 'vulkan' into 'vulkan'
Vulkan WSI Wayland fixes

Two small fixes to make mailbox mode actually work again.

See merge request !4
2016-01-30 10:28:12 -05:00
Jason Ekstrand
c668dc9f75 anv/pass: Initialize has_resolve 2016-01-30 07:16:33 -08:00
Jason Ekstrand
ad813b072a anv/wsi: Set the platform field of VkIcdSurfaceBase 2016-01-30 07:05:53 -08:00
Jason Ekstrand
5acc4e2ebf anv/wsi/x11: Actually pull information from the window's visual 2016-01-30 03:51:47 -08:00
Jason Ekstrand
66e8b5cf2b anv/wsi/x11: Actually check for DRI3 2016-01-30 03:50:31 -08:00
Jason Ekstrand
44ec860cd6 anv/WSI: Support more usage bits
They're just images and we have no intention of stompping alpha channels
(at least not yet), so there's no reason why you can't sample.
2016-01-29 20:52:44 -08:00
Jason Ekstrand
337c1e0871 anv/formats: Add more compressed formats
This adds support for the DX compression formats.  Given that ETC and EAC
are working fine, these should be ok too.
2016-01-29 20:46:31 -08:00
Jason Ekstrand
c688e4db11 anv/wsi: Rework to be compatable with the loader 2016-01-29 20:39:21 -08:00
Jason Ekstrand
d4953fb340 vulkan: Import vk_icd.h 2016-01-29 20:37:45 -08:00
Jason Ekstrand
a19ceee46c anv/device: Fix version check
The bottom-end check was wrong so it was only working on <= 1.0.0.  Oops.
2016-01-29 20:36:58 -08:00
Kristian Høgsberg Kristensen
f28645f71c anv: Don't disable snooping for mempools
There's an intermittent flushing problem with VkEvent that we need to
root cause. For now, using the snooping feature keeps the memory pools
up to date with GPU writes and fixes the problem.
2016-01-29 17:19:51 -08:00
Kristian Høgsberg Kristensen
0c4ef36360 anv: clflush is only orderered against mfence
We can't use the more fine-grained load and store fence commands (lfence
and mfence), since clflush is only guaranteed to be ordered with respect
to mfence.
2016-01-29 14:56:41 -08:00
Kristian Høgsberg Kristensen
31d3486bd2 anv: Limit flushing to the range of mapped memory 2016-01-29 14:56:41 -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
Chad Versace
bef8456ede anv/meta: Remove unneeded resolve pipeline
Vulkan does not allow resolving a single-sample image. So remove that
pipeline from anv_meta_state::resolve::pipelines.
2016-01-28 10:45:11 -08:00
Chad Versace
ac5594fa71 anv/meta_resolve: Remove redundant initialization params 2016-01-28 10:14:39 -08:00
Chad Versace
142da00486 anv: Drop const on anv_framebuffer::attachments
The attachments should be const, but the driver's function signatures
are generally not const-friendly.

Drop the const because it conflicts with upcoming
anv_cmd_buffer_resolve_subpass().
2016-01-28 10:03:00 -08:00
Chad Versace
22258e279d anv: Add anv_subpass::has_resolve
Indicates that the subpass has at least one resolve attachment.
2016-01-28 10:03:00 -08:00
Chad Versace
3d863e8dad anv/meta_resolve: Save/Restore viewport and scissor 2016-01-28 10:03:00 -08:00
Chad Versace
8487569fa7 anv/meta_resolve: Begin pass outside emit_resolve()
This refactor is preparation for handling subpass resolve attachments.
2016-01-28 10:03:00 -08:00
Chad Versace
2bab3cd681 anv/image: Update usage flags for multisample images
Meta resolves multisample images by binding them as textures. Therefore
we must add VK_IMAGE_USAGE_SAMPLED_BIT.
2016-01-28 10:03:00 -08:00
Jason Ekstrand
608b411e9f anv/device: Add a better version check.
We now check that the requested version is precicely within the range of
versions that we support.
2016-01-28 08:19:40 -08:00
Jason Ekstrand
6286a74f6b anv/device: Advertise 1.0.2 2016-01-27 22:02:51 -08:00
Jason Ekstrand
ec80d6388a anv/formats: Properly set FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
This was added last minute and the API bumped to 1.0.2.
2016-01-27 22:02:06 -08:00
Jason Ekstrand
c64bc5463d anv/device: Improve the api version check to allow 1.0.X 2016-01-27 21:56:46 -08:00
Jason Ekstrand
983db2b804 anv/meta_resolve: Fix a bug in the meta pipeline destroy path 2016-01-27 19:48:43 -08:00
Chad Versace
9b240a1e3d anv/skl: Fix crash in 16x multisampling
We built meta clear and resolve pipelines for only up to 8x samples.
There were no 16x pipelines.
2016-01-27 18:38:15 -08:00
Chad Versace
61d3d49820 anv: Fix comment for anv_meta_state arrays
Array element i is for 2^i samples, not log2(i) samples.
2016-01-27 18:32:05 -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
Chad Versace
5d4f3298ae anv/meta: Implement multisample clears 2016-01-27 17:01:59 -08:00
Chad Versace
eb6fb65fd1 anv/meta: Simplify failure handling during clear init
Remove all the fine-grained cleanup in
anv_device_init_meta_clear_state(). Instead, if anything fails during
initialization, simply call anv_device_finish_meta_clear_state() and let
it clean up the partially initialized anv_meta_state::clear.
2016-01-27 17:01:56 -08:00
Chad Versace
4085f1f230 anv/meta: Implement vkCmdResolveImage
This handles multisample color images that have a floating-point or
normalized format and have a single array layer.

This does not yet handle integer formats nor multisample array images.
2016-01-27 16:55:59 -08:00
Chad Versace
8cc1e59d61 anv/meta: Add func anv_meta_get_iview_layer()
This function is just meta_blit_get_dest_view_base_array_slice(), but
moved to the shared header anv_meta.h.

Will be needed by anv_meta_resolve.c.
2016-01-27 16:52:30 -08:00
Chad Versace
8cc6f058ce anv/gen8: Begin enabling pipeline multisample state
As far as I can tell, this patch sets all pipeline multisample state
except:
    - alpha to coverage
    - alpha to one
    - the dispatch count for per-sample dispatch
2016-01-27 16:52:27 -08:00
Chad Versace
57e4a5ea99 anv/gen8: Set multisample surface state 2016-01-27 16:48:20 -08:00
Chad Versace
9b3d660878 anv/meta: Merge anv_meta_clear.h into anv_meta.h
The header was too small.
2016-01-27 16:48:20 -08:00
Jason Ekstrand
f7d6b8ccfe gen8/state: Fix QPitch for compressed textures on Broadwell 2016-01-27 15:12:42 -08:00
Jason Ekstrand
162c662585 anv/image: Use the entire image height for compressed meta blits 2016-01-27 15:12:42 -08:00
Nanley Chery
235abfb7e6 anv/image: Enlarge the image level 0 extent
The extent previously was supposed to match the mip at a given level
under the assumption that the base address would be that of the mip
as well.

Now however, the base address only matches the offset of the
containing tile. Therefore, enlarge the extent to match that of
phys_slice0, so that we don't draw/fetch in out of bounds territory.

This solution isn't perfect because the base adress isn't always at
the first tile, therefore the assumed valid memory region by the HW
contains some number of invalid tiles on two edges.
2016-01-27 15:12:42 -08:00
Jason Ekstrand
96cf5cfee1 anv/image: Minify before dividing by block dimensions 2016-01-27 15:12:42 -08:00
Jason Ekstrand
1bea1eff38 anv/meta: Don't double-call choose_buffer_format
This fixes all the renderpass tests
2016-01-27 15:12:42 -08:00
Nanley Chery
dd22b5c914 anv/meta: Modify make_image_for_buffer()'s image
Always use a valid buffer format and convert the extent to units of
elements with respect to original image format.
2016-01-27 15:12:42 -08:00
Nanley Chery
d3c1fd53e2 anv/image: Use custom VkBufferImageCopy for iview initialization
Use a custom VkBufferImageCopy with the user-provided struct as
the base. A few fields are modified when the iview is uncompressed
and the underlying image is compressed.
2016-01-27 15:12:42 -08:00
Nanley Chery
6a579ded87 anv: Add offset parameter to anv_image_view_init()
This is the offset of the tile that contains the mip specified by
isl_surf_get_image_intratile_offset_el(). Used to draw to/from the
specified mip.
2016-01-27 15:12:42 -08:00
Nanley Chery
4a0075feeb anv/meta: Calculate mip offset for compressed texture
This value will be used in a later commit.
2016-01-27 15:12:42 -08:00
Nanley Chery
1c87cb51be anv/meta: Disambiguate slice variable value
This will simplify the usage of
isl_surf_get_image_intratile_offset_el().
2016-01-27 15:12:42 -08:00
Nanley Chery
8c0c25abde gen8_state: use iview extent to program RENDER_SURFACE_STATE
When creating an uncompressed ImageView on an compressed Image, the
SurfaceFormat is updated to match the ImageView's. The surface
dimensions must also change so that the HW sees the same size image
instead of a 4x larger one.

Fixes the following error which results from running many VulkanCTS
compressed tests in one shot:
  ResourceError (vk.queueSubmit(queue, 1, &submitInfo, *m_fence):
  VK_ERROR_OUT_OF_DEVICE_MEMORY at
  vktPipelineImageSamplingInstance.cpp:921)

Makes all compressed format tests with a height > 1 pass.
2016-01-27 15:12:42 -08:00