Commit Graph

76565 Commits

Author SHA1 Message Date
Jason Ekstrand 95990c96cc nir: Create the params array in function_impl_create 2015-12-23 13:49:56 -08:00
Jason Ekstrand a7f3e113ad i965/nir: Remove return handling
This was added because we were getting spurrious returns coming out of
SPIR-V.  Now that we're calling lower_returns, we don't need this.
2015-12-23 13:49:56 -08:00
Jason Ekstrand ac975b73cf anv/pipeline: Run lower_returns and inline_functions after spirv_to_nir 2015-12-23 13:49:56 -08:00
Jason Ekstrand 8fba4bf79f nir: Add a function inlining pass 2015-12-23 13:49:56 -08:00
Jason Ekstrand b21db9cea5 nir/builder: Add a copy_deref_var helper 2015-12-23 13:49:56 -08:00
Jason Ekstrand 23cfa683d5 nir: move nir_copy_var from anv_nir_builder to nir_builder 2015-12-23 13:49:56 -08:00
Jason Ekstrand 4aac03fe61 nir/clone: Add support for cloning a single function_impl
This will be useful for things such as function inlining.
2015-12-23 13:49:56 -08:00
Jason Ekstrand 98291b8f2c nir: Add a helper for creating a "bare" nir_function_impl
This is useful if you want to clone a single function_impl if, for
instance, you wanted to do function inlining.
2015-12-23 13:49:56 -08:00
Jason Ekstrand 86772c2488 nir/control_flow: Handle relinking top-level blocks
This can happen if a function ends in a return instruction and you remove
the return.
2015-12-23 13:49:56 -08:00
Jason Ekstrand 1749e667ea nir: Add a stub function inlining pass
All it does is remove the return at the end, but it's good enough for
simple functions.
2015-12-23 13:49:56 -08:00
Jason Ekstrand 413a9d3517 nir/print: Factor variable name lookup into a helper
Otherwise, we have a problem when we go to print functions with arguments
because their names get added to the hash table during declaration which
happens after we print the prototype.
2015-12-23 13:49:56 -08:00
Kristian Høgsberg Kristensen 220ac9337b vk: Only require wc bo mmap for !llc GPUs 2015-12-19 22:25: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
Kristian Høgsberg Kristensen 8ac46d84ff vk: Fix check for I915_PARAM_MMAP_VERSION
Comparing the wrong thing for < 1.
2015-12-18 17:24: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 d7f66f9f6f nir/spirv: Array lengths are constants not literals 2015-12-17 16:36:29 -08:00
Jason Ekstrand 1473a8dc6f anv/formats: Add more 64-bit formats 2015-12-17 13:51:09 -08:00
Jason Ekstrand 167809365b anv/formats: Add more PACK32 formats 2015-12-17 13:44:50 -08:00
Jason Ekstrand 952bf05897 anv/image: Properly report buffer features 2015-12-17 11:52:31 -08:00
Jason Ekstrand 3395ca17d1 isl: Add a is_storage_image_format helper 2015-12-17 11:45:04 -08:00
Jason Ekstrand b1325404c5 anv/device: Handle zero-sized memory allocations 2015-12-17 11:00:38 -08:00
Jason Ekstrand c643e9cea8 anv/state: Allow levelCount to be 0
This can happen if the client is creating an image view of a textureable
surface and they only ever intend to render to that view.
2015-12-16 17:34:57 -08:00
Jason Ekstrand b2fe8b4673 nir/spirv: Add a missing break statement 2015-12-15 17:24:18 -08:00
Jason Ekstrand 1c51d91bfe anv/pipeline: Allow the user to pass a null MultisampleCreateInfo
According to section 5.2 of the Vulkan spec, this is allowed for color-only
rendering pipelines.
2015-12-15 16:26:10 -08:00
Jason Ekstrand d61ff1ed08 anv/descriptor_set: Initialize immutable_samplers to NULL
Previously this wasn't a problem.  However, with the new API update,
descriptor sets can now be sparse so the client doesn't have to provide an
entry for every binding.  This means that it's possible for a binding to be
uninitialized other than the memset.  In that case, we want to have a null
array of immutable samplers.
2015-12-15 16:24:22 -08:00
Jason Ekstrand 28c4ef9d6c anv/device: Bump the size of the instruction block pool
Some CTS test shaders were failing to compile.  At some point soon, we
really need to make a real pipeline cache and stop using a block pool for
this.
2015-12-15 11:49:28 -08:00
Jason Ekstrand 306abbead3 anv/pipeline: Properly set IncludeVertexHandles in 3DSTATE_GS 2015-12-15 11:37:18 -08:00
Jason Ekstrand 2d4b7eda23 nir/spirv: Add support for more CS intrinsics 2015-12-15 10:20:23 -08:00
Jason Ekstrand 1035108a7f nir/lower_system_values: Add support for computed builtins.
In particular, this commit adds support for computing gl_GlobalInvocationID
and gl_LocalInvocationIndex from other intrinsics.
2015-12-15 10:20:23 -08:00
Jason Ekstrand 630b9528b3 shader_enums: Add enums for gl_GlobalInvocationID and gl_LocalInvocationIndex 2015-12-15 10:20:23 -08:00
Jason Ekstrand 7ebd84fa4b nir/lower_system_values: Refactor and use the builder.
Now that we have a helper in the builder for system values and a helper in
core NIR to get the intrinsic opcode, there's really no point in having
things split out into a helper function.  This commit "modernizes" this
pass to use helpers better and look more like newer passes.
2015-12-15 10:20:23 -08:00
Jason Ekstrand c26e889a44 nir/builder: Add a load_system_value helper
While we're at it, go ahead and make nir_lower_clip use it.

Cc: Rob Clark <robclark@gmail.com>
2015-12-15 10:20:23 -08:00
Jason Ekstrand de67456d6d nir/lower_system_values: Stop supporting non-SSA
The one user of this (i965) only ever calls it while in SSA form.
2015-12-15 10:20:23 -08:00
Chad Versace 64f0ee73e0 isl: Add func isl_surf_get_image_offset_sa
The function calculates the offset to a subimage within the surface, in
units of surface samples.

All unit tests pass with `make check`. (Admittedly, though, there are
too few unit tests).
2015-12-15 08:46:09 -08:00
Chad Versace 53504b884e isl: Fix calculation of array pitch for layout GEN4_2D
The height of the miptree's right half was not large enough.

Found by `make check` in test_isl_surf_get_offset, which is added in the
next commit.
2015-12-15 08:46:09 -08:00
Chad Versace f7e36f9f66 isl: Move it a standalone directory
The plan all along was to eventualyl move isl out of the Vulkan
directory, because I intended i965 and anvil to share it.

A small problem I encountered when attempting to write unit tests for
isl precipitated the move.  I discovered that it's easier to get isl
unit tests to build if I remove the extra, unneeded dependencies
injected by src/vulkan/Makefile.am. And the easiest way to remove those
unneeded dependencies is to move isl out of src/vulkan. (Unit tests come
in subsequent commits).
2015-12-15 08:45:49 -08:00
Jason Ekstrand 8224571ef8 vec4/generator: Actually pass the sampler into generate_tex
This is an artifact of the way the separate samplers/textures series ended
up getting sent out and rebased.  This should fix a number of CTS tests
involving geometry shaders.
2015-12-14 21:13:52 -08:00
Jordan Justen 7edcc59a7b anv: Rename gs_vec4 to gs_kernel
The code generated may be vec4 or simd8 depending on how we start the
compiler.

To run the GS in SIMD8, set the INTEL_SCALAR_GS environment variable.
This was added in:

    commit 36fd653817
    Author: Kenneth Graunke <kenneth@whitecape.org>
    Date:   Wed Mar 11 23:14:31 2015 -0700

        i965: Add scalar geometry shader support.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2015-12-14 18:23:14 -08:00
Jordan Justen a3c5c339a8 nir/spirv_to_nir: Use a minimum of 1 for GS invocations
glslang is giving us 0, which causes the SIMD8 GS compile to hit an
assert.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2015-12-14 18:23:14 -08:00
Jason Ekstrand f46544dea1 anv: Fix CUBE storage images 2015-12-14 16:59:59 -08:00
Jason Ekstrand 783a21192c anv: Add support for storage texel buffers 2015-12-14 16:51:12 -08:00
Jason Ekstrand 1f98bf8da0 anv: Pass an isl_format into fill_buffer_surface_state 2015-12-14 16:14:20 -08:00
Jordan Justen c4219bc6ff anv/cmd_buffer: Gen 8 requires 64 byte alignment for push constant data
See MEDIA_CURBE_LOAD, CURBE Data Start Address & CURBE Total Data Length

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2015-12-14 15:39:07 -08:00
Jason Ekstrand f0313a5569 anv: Add initial support for cube maps
This fixes 486 cubemap CTS tests.
2015-12-14 15:36:30 -08:00
Jason Ekstrand dba28da075 anv/buffer_view: Store a bo + offset instead of buffer pointer
This is what image_view does.  Also, we really need to do this so that we
can properly handle the combined offsets from the buffer and from
pCreateInfo.

This fixes some of the nonzero offset buffer view CTS tests.
2015-12-14 14:10:40 -08:00
Chad Versace ee57062e1e anv: Remove anv_image::surface_type
When building RENDER_SURFACE_STATE, the driver set
SurfaceType = anv_image::surface_type, which was calculated during
anv_image_init(). This was bad because the value of
anv_image::surface_type was taken from a gen-specific header,
gen8_pack.h, even though the anv_image structure is used for all gens.

Replace anv_image::surface_type with a gen-specific lookup function,
anv_surftype(), defined in gen${x}_state.c.

The lookup function contains some useful asserts that caught some nasty
bugs in anv meta, which were fixed in the previous commit.
2015-12-14 10:46:27 -08:00
Chad Versace f0d11d5a81 anv/meta: Fix VkImageViewType
Meta unconditionally used VK_IMAGE_VIEW_TYPE_2D in the functions below.
This caused some out-of-bound memory accesses.
  anv_CmdCopyImage
  anv_CmdBlitImage
  anv_CmdCopyBufferToImage
  anv_CmdClearColorImage

Fix it by adding a new function, anv_meta_get_view_type().
2015-12-14 09:03:58 -08:00
Chad Versace 0bebaeacd7 isl: Rename s/lod_align/image_align/ for consistency
Regarding the subimages within a surface, sometimes isl called them
"images" and sometimes "LODs". This patch make isl consistently refer to
them as "images".  I choose the term "image" over "LOD" because LOD is
an misnomer when applied to 3D surfaces. The alignment applies to each
individual 2D subimage, not to the LOD as a whole.

This patch changes no behavior. It's just a manually performed,
case-insensitive, replacement s/lod/image/ that maintains correct
indentation.  any behavior.
2015-12-14 09:01:51 -08:00
Chad Versace 85a6384014 anv/tests: gitignore block_pool_no_free 2015-12-14 09:00:28 -08:00