Commit graph

76927 commits

Author SHA1 Message Date
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
Chad Versace
a50c78a5cf isl: Add missing break statement in array pitch calculation
Fixes regression in ed98c374bd3f1952fbab3031afaf5ff4d178ef41.
2016-01-07 11:08:12 -08:00
Chad Versace
d1e6c1b29b isl/gen9: Fix array pitch of 3d surfaces
For tiled 3D surfaces, the array pitch must aligned to the tile height.

From the Skylake BSpec >> RENDER_SURFACE_STATE >> Surface QPitch:

   Tile Mode != Linear: This field must be set to an integer multiple of
   the tile height

Fixes CTS tests 'dEQP-VK.pipeline.image.view_type.3d.format.r8g8b8a8_unorm.*'.
Fixes Crucible tests 'func.miptree.r8g8b8a8-unorm.aspect-color.view-3d.*'.
2016-01-07 11:04:17 -08:00
Chad Versace
0af77fe5b6 isl: Refactor func isl_calc_array_pitch_sa_rows
Update the function to calculate the array pitch is *element rows*, and
it rename it accordingly to isl_calc_array_pitch_el_rows.
2016-01-07 11:04:17 -08:00
Jordan Justen
2f0a10149c isl: Assert that alignments are not 0 for isl_align
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-01-07 10:37:35 -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
Jordan Justen
be91f23e3b isl: Fix image alignment calculation
The previous code was resulting in an alignment of 0.

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
Jason Ekstrand
195c60deb4 nir/spirv: Wrap borrow/carry ops in b2i
NIR specifies them as booleans but SPIR-V wants ints.
2016-01-06 17:13:06 -08:00
Jason Ekstrand
000eb00862 nir/spirv/cfg: Only set fall to true at the start of a case
Previously, we were setting it to true at the top of the switch statement.
However, this causes all of the cases to get executed until you hit a
break.  Instead, you want to be not executing at the start, start executing
when you hit your case, and end at a break.
2016-01-06 17:00:55 -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
Jason Ekstrand
5bbf060ece i965/compiler: Enable more lowering in NIR
We don't need these for GLSL or ARB, but we need them for SPIR-V
2016-01-06 15:30:53 -08:00
Jason Ekstrand
573351cb0f nir/algebraic: Add more lowering
This commit adds lowering options for the following opcodes:

 - nir_op_fmod
 - nir_op_bitfield_insert
 - nir_op_uadd_carry
 - nir_op_usub_borrow
2016-01-06 15:30:53 -08:00
Jason Ekstrand
1f503603d3 nir/opcodes: Fix the folding expression for usub_borrow 2016-01-06 15:30:53 -08:00
Jason Ekstrand
22804de110 nir/spirv: Properly implement Modf 2016-01-06 15:30:53 -08:00
Jason Ekstrand
1f3593d8a1 nir/builder: Add a helper for storing to a deref 2016-01-06 15:30:53 -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
e05b307942 isl: Add isl_surf_get_array_pitch_el()
Will be needed to program SurfaceQPitch for Skylake 1D arrays.
2016-01-06 09:38:57 -08:00
Chad Versace
c1e890541e isl/gen9: Support ISL_DIM_LAYOUT_GEN9_1D 2016-01-06 09:38:57 -08:00
Chad Versace
eea2d4d059 isl: Don't align phys_slice0_sa.width twice
It's already aligned to the format's block width. Don't align it again
in isl_calc_row_pitch().
2016-01-06 09:38:57 -08:00
Chad Versace
39d043f94a isl: Fix the documented units of isl_surf::row_pitch
It's the pitch between surface elements, not between surface samples.
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
7a069bea5d nir/spirv: Fix switch statements with duplicate cases 2016-01-05 16:18:01 -08:00
Jason Ekstrand
506a467f16 nir/spirv/cfg: Assert that blocks only ever get added once
This effectively prevents infinite loops in cfg_walk_blocks.
2016-01-05 15:56:59 -08:00
Jason Ekstrand
71a25a0b07 nir/spirv: Simplify phi node handling
Instead of trying to crawl through predecessor chains and build phi nodes,
we just do a poor-man's out-of-ssa on the spot.  The into-SSA pass will
deal with putting the actual phi nodes in for us.
2016-01-05 14:59:40 -08:00
Jason Ekstrand
ec899f6b42 anv/pipeline: Lower indirect temporaries and inputs 2016-01-05 13:42:52 -08:00
Jason Ekstrand
bff45dc44e nir: Add an indirect deref lowering pass 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
8d6f0a1b80 isl: Don't force linear for 1d surfaces in gen7_filter_tiling()
gen7_filter_tiling() should filter out only tiling flags that are
incompatible with the surface. It shouldn't make performance decisions,
such as forcing linear for 1D; that's the role of the caller.
2016-01-05 11:37:32 -08:00
Chad Versace
8135786605 isl: Document gen7_filter_tiling() 2016-01-05 11:35:13 -08:00
Chad Versace
33f06842be isl: Prefer linear tiling for 1D surfaces 2016-01-05 11:35:13 -08:00
Chad Versace
98af1cc6d7 isl: Remove isl_format_layout::bpb
struct isl_format_layout contained two near-redundant members: bpb (bits
per block) and bs (block size). There do exist some hardware formats for
which bpb != 8 * bs, but Vulkan does not use them. Therefore we don't
need bpb.
2016-01-05 10:00:39 -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
Chad Versace
a1d64ae561 isl: Align isl_surf::phys_level0_sa to the format's compression block 2016-01-05 09:52:07 -08:00
Chad Versace
2172f0e9bb isl: Fix mis-documented units of isl_surf::phys_level_sa
It's in physical surface samples. Hence the _sa suffix.
2016-01-05 09:52:07 -08:00
Jason Ekstrand
8b403d599b nir/spirv: Add support for the ControlBarrier instruction 2016-01-04 22:08:24 -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
b8f0bea07a nir/spirv: Implement extended add, sub, and mul 2016-01-04 20:59:16 -08:00
Jason Ekstrand
3a3c4aecf1 nir/spirv: Add support for bitfield operations 2016-01-04 17:37:10 -08:00
Jason Ekstrand
01ba96e059 nir/spirv: Add support for msb/lsb opcodes 2016-01-04 17:37:10 -08:00
Jason Ekstrand
f32370a536 nir/spirv: Add a documenting assert for OpConstantSampler 2016-01-04 17:37:10 -08:00
Jason Ekstrand
0309199802 nir/spirv: Add initial support for ConstantNull 2016-01-04 17:37:10 -08:00
Chad Versace
8cc21d3aea isl: Align single-level 2D surfaces to compression block
This fixes an assertion failure at isl.c:1003.

Reported-by: Nanley Chery <nanley.g.chery@intel.com>
2016-01-04 16:48:58 -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