Commit Graph

78904 Commits

Author SHA1 Message Date
Jason Ekstrand b0e423cc4f isl: Remove redundant check
The green channel was checked twice.
2016-03-10 10:41:52 -08:00
Nanley Chery 7fbbad0170 anv/blit2d: Use the tiling enum for simplicity
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-09 10:57:47 -08:00
Nanley Chery 514c055717 anv/meta: Prefix anv_ to meta_emit_blit()
Follow the convention for non-static functions.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-09 10:57:47 -08:00
Nanley Chery 627728cce5 anv/meta: Split anv_meta_blit.c into three files
The new organization is as follows:
* anv_meta_blit.c: Blit and state setup/teardown commands
* anv_meta_copy.c: Copy and update commands
* anv_meta_blit2d.c: 2D Blitter API commands

Also, change the formatting to contain most lines
within 80 columns.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-09 10:57:47 -08:00
Nanley Chery f391683922 anv/meta: Make meta_emit_blit() public
This can be reverted if the only other consumer, anv_meta_blit2d(),
uses a different method.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-09 10:57:47 -08:00
Nanley Chery ddbc645846 anv/meta: Store src and dst usage flags in a variable
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-09 10:57:47 -08:00
Nanley Chery 7ebbc3946a anv/meta: Minimize height of images used for copies
In addition to demystifying the value being added to the height,
this future-proofs the code for new tiling modes and keeps the
image height as small as possible.

v2: Actually use the smallest height possible.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-09 10:57:47 -08:00
Jason Ekstrand 248ab61740 anv/cmd_buffer: Pull the core of flush_state into genX_cmd_buffer 2016-03-08 17:10:05 -08:00
Jason Ekstrand 28cbc45b3c anv/cmd_buffer: Split flush_state into two functions 2016-03-08 16:54:07 -08:00
Jason Ekstrand 42b4c0fa6e anv: Pull all of the genX_foo functions into anv_genX.h
This way we only have to declare them each once and we get it for all gens
at a single go.
2016-03-08 16:49:08 -08:00
Jason Ekstrand bbbdd32c19 anv/meta_clear: Use repclear again 2016-03-08 15:40:11 -08:00
Jason Ekstrand dc504a51fb anv/pipeline: Unconditionally emit PS_BLEND on gen8+
Special-casing the PS_BLEND packet wasn't really gaining us anything.  It's
defined to be more-or-less the contents of blend state entry 0 only without
the indirection.  We can just copy-and-paste the contents.  If there are no
valid color targets, then blend state 0 will be 0-initialized anyway so
it's basically the same as the special case we had before.
2016-03-08 15:40:11 -08:00
Jason Ekstrand cce65471b8 anv: Compact render targets
Previously, we would always emit all of the render targets in the subpass.
This commit changes it so that we compact render targets just like we do
with other resources.  Render targets are represented in the surface map by
using a descriptor set index of UINT16_MAX.
2016-03-08 15:40:11 -08:00
Jason Ekstrand 75af420cb1 anv/pipeline: Move binding table setup to its own helper 2016-03-07 22:24:31 -08:00
Jason Ekstrand 2308891ede anv: Store CPU-side fence information in the BO
This reduces the number of allocations a bit and cuts back on memory usage.
Kind-of a micro-optimization but it also makes the error handling a bit
simpler so it seems like a win.
2016-03-07 22:23:44 -08:00
Jason Ekstrand f61d40adc2 anv/allocator: Better casting in PFL macros
We cast he constant 0xfff values to a uintptr_t before applying a bitwise
negate to ensure that they are actually 64-bit when needed.  Also, the
count variable doesn't need to be explicitly cast, it will get upcast as
needed by the "|" operation.
2016-03-07 22:23:44 -08:00
Jason Ekstrand 3d4f2b0927 anv/allocator: Move the alignment assert for the pointer free list
Previously we asserted every time you tried to pack a pointer and a counter
together.  However, this wasn't really correct.  In the case where you try
to grab the last element of the list, the "next elemnet" value you get may
be bogus if someonoe else got there first.  This was leading to assertion
failures even though the allocator would safely fall through to the failure
case below.
2016-03-07 22:23:44 -08:00
Jason Ekstrand 8c2b9d1529 anv/bo_pool: Allow freeing BOs where the anv_bo is in the BO itself 2016-03-07 22:23:44 -08:00
Nanley Chery 181b142fbd anv/device: Up device limits for 3D and array texture dimensions
The limit for these textures is 2048 not 1024.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-07 15:21:50 -08:00
Jason Ekstrand 428ffc9c13 anv/device: Actually free the CPU-side fence struct again
In 23de78768, when we switched from allocating individual BOs to using the
pool for fences, we accidentally deleted the free.
2016-03-07 14:50:52 -08:00
Kristian Høgsberg Kristensen 32aa01663f anv: Quiet pTessellationState warning
Some application pass a dummy for pTessellationState which results in a
lot of noise. Only warn if we're actually given tessellation shadear
stages.
2016-03-06 22:06:24 -08:00
Jason Ekstrand 23de78768b anv: Create fences from the batch BO pool
Applications may create a *lot* of fences, perhaps as much as one per
vkQueueSubmit.  Really, they're supposed to use ResetFence, but it's easy
enough for us to make them crazy-cheap so we might as well.
2016-03-06 14:26:52 -08:00
Jason Ekstrand 21ee5fd326 anv: Emit null render targets
v2 (Francisco Jerez): Add the state_offset to the surface state offset
2016-03-05 20:47:10 -08:00
Jason Ekstrand 8502794c12 anv/pipeline: Handle null wm_prog_data in 3DSTATE_CLIP 2016-03-05 14:42:16 -08:00
Kristian Høgsberg Kristensen 7b348ab8a0 anv: Fix rebase error 2016-03-05 14:33:50 -08:00
Kristian Høgsberg Kristensen 34326f46df anv: Turn pipeline cache on by default
Move the environment variable check to cache creation time so we block
both lookups and uploads if it's turned off.
2016-03-05 13:54:24 -08:00
Kristian Høgsberg Kristensen f2b37132cb anv: Check if shader if present before uploading to cache
Between the initial check the returns NO_KERNEL and compiling the
shader, other threads may have added the shader to the cache. Before
uploading the kernel, check again (under the mutex) that the compiled
shader still isn't present.
2016-03-05 13:54:24 -08:00
Kristian Høgsberg Kristensen 30bbe28b7e anv: Always use point size from the shader
There is no API for setting the point size and the shader is always
required to set it. Section 24.4:

   "If the value written to PointSize is less than or equal to zero, or
    if no value was written to PointSize, results are undefined."

As such, we can just always program PointWidthSource to Vertex. This
simplifies anv_pipeline a bit and avoids trouble when we enable the
pipeline cache and don't have writes_point_size in the prog_data.
2016-03-05 13:54:24 -08:00
Kristian Høgsberg Kristensen 6139fe9a77 anv: Also cache the struct anv_pipeline_binding maps
This is state the we generate when compiling the shaders and we need it
for mapping resources from descriptor sets to binding table indices.
2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen 584f39c65e anv: Don't re-upload shaders when merging
Using anv_pipeline_cache_upload_kernel() will re-upload the kernel and
prog_data when we merge caches. Since the kernel and prog_data is
already in the program_stream, use anv_pipeline_cache_add_entry()
instead to only add the entry to the hash table.
2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen 626559ed37 anv: Add anv_pipeline_cache_add_entry()
This function will grow the cache to make room and then add the entry.
2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen 07441c344c anv: Rename anv_pipeline_cache_add_entry() to 'set'
This function is a helper that unconditionally sets a hash table entry
and expects the cache to have enough room. Calling it 'add_entry'
suggests it will grow the cache as needed.
2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen 87967a2c85 anv: Simplify pipeline cache control flow a bit
No functional change, but the control flow around searching the cache
and falling back to compiling is a bit simpler.
2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen 2b29342fae anv: Store prog data in pipeline cache stream
We have to keep it there for the cache to work, so let's not have an
extra copy in struct anv_pipeline too.
2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen 37c5e70253 anv: Rename 'table' to 'hash_table' in anv_pipeline_cache
A little less ambiguous.
2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen c028ffea70 anv: Serialize as much pipeline cache as we can
We can serialize as much as the application asks for and just stop once
we run out of memory. This lets applications use a fixed amount of
space for caching and still get some benefit.
2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen cd812f086e anv: Use 1.0 pipeline cache header
The final version of the pipeline cache header adds a few more fields.
2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen 26ed943eb9 anv: Fix shader key hashing
This was copied from inline code to a helper and wasn't updated to hash
a pointer instead.
2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen 3baf8af947 anv: Remove excess whitespace 2016-03-05 13:50:07 -08:00
Kristian Høgsberg Kristensen ab36eae5e7 anv: Remove left-over bits of sparse-descriptor code 2016-03-05 13:50:07 -08:00
Jason Ekstrand 1afdfc3e6e anv/pipeline: Implement the depth compare EQUAL workaround on gen8+ 2016-03-05 09:59:28 -08:00
Jason Ekstrand 7c1660aa14 anv: Don't allow D16_UNORM to be combined with stencil
Among other things, this can cause the depth or stencil test to spurriously
fail when the fragment shader uses discard.
2016-03-05 09:59:28 -08:00
Jason Ekstrand 9a90176d48 anv/pipeline: Calculate the correct max_source_attr for 3DSTATE_SBE 2016-03-05 09:59:28 -08:00
Jordan Justen 81f30e2f50 anv/hsw: Move query code to genX file for Haswell
This fixes many CTS cases, but will require an update to the kernel
command parser register whitelist. (The CS GPRs and TIMESTAMP
registers need to be whitelisted.)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-05 01:08:07 -08:00
Nanley Chery 4e75f9b219 anv: Implement VK_REMAINING_{MIP_LEVELS,ARRAY_LAYERS}
v2: Subtract the baseMipLevel and baseArrayLayer (Jason)

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-03-04 21:25:23 -08:00
Jason Ekstrand c1436e80ef anv/meta_clear: Set the right number of dynamic states 2016-03-04 19:18:20 -08:00
Jason Ekstrand cc57efc67a anv/pipeline: Fix depthBiasEnable on gen7
The first time I tried to fix this, I set the wrong fields.
2016-03-04 17:56:12 -08:00
Jason Ekstrand 653261285e anv/cmd_buffer: Reset the state streams when resetting the command buffer 2016-03-04 17:54:29 -08:00
Jason Ekstrand f700d16a89 anv/cmd_buffer: Include Haswell in set_subpass 2016-03-04 17:54:29 -08:00
Nanley Chery a6fb62a864 isl: Fix RenderTargetViewExtent for mipmapped 3D surfaces
Match the comment stated above the assignment.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-03-04 13:20:44 -08:00