Commit Graph

32 Commits

Author SHA1 Message Date
Nanley Chery
1949e502bc anv: Replace ::disable_scissor with ::use_rectlists
Meta currently uses screenspace RECTLIST primitives that lie within
the framebuffer rectangle. Since this behavior shouldn't change in the
future, disable the scissor operation whenever rectlists are used.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2016-04-13 18:00:41 -07:00
Nanley Chery
9f72466e9f anv: Delete anv_graphics_pipeline_create_info::disable_viewport
There are no users of this field.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2016-04-13 18:00:41 -07:00
Jason Ekstrand
b377c1d08e anv/image: Remove the offset parameter from image_view_init
The only place we were using this was in meta_blit2d which always creates a
new image anyway so we can just use the image offset.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:58:45 -07:00
Jason Ekstrand
4caba94086 anv/image: Expose the guts of CreateBufferView for meta
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:55 -07:00
Jason Ekstrand
4ee80e8816 anv/blit2d: Refactor in preparation for different src/dst types
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:52 -07:00
Jason Ekstrand
85b9a007ac anv/blit2d: Add layouts for using a texel buffer source
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:49 -07:00
Jason Ekstrand
28eb02e345 anv/blit2d: Rename the descriptor set and pipeline layouts
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-04-08 15:57:47 -07:00
Jordan Justen
1a3adae84a anv/gen7: Save kernel command parser version
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-28 17:01:35 -07:00
Jordan Justen
d353ba8f5f anv: Add genxml register support
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-24 23:49:53 -07:00
Nanley Chery
a5dc3c0f02 anv: Sanitize Image extents and offsets
Prepare Image extents and offsets for internal consumption by assigning
the default values implicitly defned by the spec. Fixes textures on
several Vulkan demos in which the VkImageCopy depth is set to zero when
copying a 2D image.

v2 (Jason Ekstrand):
   Replace "prep" with "sanitize"
   Make function static inline
   Pass structs instead of pointers

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
2016-03-24 16:15:00 -07:00
Jason Ekstrand
869e393eb3 anv/batch_chain: Fall back to growing batches when chaining isn't available 2016-03-21 15:29:30 -07:00
Jason Ekstrand
ecfb074276 anv/allocator: Make the bo_pool dynamically sized 2016-03-18 17:25:58 -07:00
Jason Ekstrand
b1c5d45872 anv/allocator: Add a size field to bo_pool_alloc 2016-03-18 11:50:53 -07:00
Nanley Chery
997a873f0c anv/blit2d: Customize meta blit structs and functions for blit2d API
* Add fields in meta struct
* Add support in meta init/teardown
* Switch to custom meta_emit_blit2d()

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-03-16 10:56:22 -07: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
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
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
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
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
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
7363024cbd anv: Fill out image_param structs at view creation time 2016-02-27 10:26:14 -08:00
Jason Ekstrand
e9d126f23b anv/image: Add a ussage_mask field to image_view_init
This allows us to avoid doing some unneeded work on the meta paths where we
know that the image view will be used for exactly one thing.  The meta
paths also sometimes do things that aren't quite valid like setting the
array slice on a 3-D texture and we want to limit the number of paths that
need to be able to sensibly handle the lies.
2016-02-27 10:26:14 -08:00
Jason Ekstrand
9d5b8f7709 anv: Remove unneeded fiels from anv_image_view 2016-02-27 10:26:14 -08:00
Jason Ekstrand
4a9b805ce5 anv/device: Store the default MOCS in the device 2016-02-27 10:26:13 -08:00
Kenneth Graunke
7f9b03cc8b anv: Emit 3DSTATE_PUSH_CONSTANT_ALLOC_* via a loop.
Now we're emitting HS and DS packets as well.
2016-02-24 11:13:08 -08:00
Kenneth Graunke
1024a66fc4 anv: Emit 3DSTATE_URB_* via a loop.
Rather than keeping separate {vs,hs,ds,gs}_start fields, we now store an
array indexed by the shader stage (MESA_SHADER_*).  The 3DSTATE_URB_*
commands are also sequentially numbered.  This makes it easy to just
emit them in a loop.

This simplifies the code a little, and also will make it easier to add
more credible HS and DS code later.
2016-02-24 11:13:02 -08:00
Jason Ekstrand
bd3db3d665 anv/meta: Allocate descriptor pools on-the-fly
We can't use a global descriptor pool like we were because it's not
thread-safe.  For now, we'll allocate them on-the-fly and that should work
fine.  At some point in the future, we could do something where we
stack-allocate them or allocate them out of one of the state streams.
2016-02-23 17:04:19 -08:00
Kristian Høgsberg Kristensen
2570a58bcd anv: Implement descriptor pools
Descriptor pools are an optimization that lets applications allocate
descriptor sets through an externally synchronized object (that is,
unlocked).  In our case it's also plugging a memory leak, since we
didn't track all allocated sets and failed to free them in
vkResetDescriptorPool() and vkDestroyDescriptorPool().
2016-02-22 17:13:51 -08:00
Jason Ekstrand
371b4a5b33 anv: Switch over to the macros in genxml 2016-02-20 09:09:28 -08:00
Jason Ekstrand
9851c8285f Move the intel vulkan driver to src/intel/vulkan 2016-02-18 10:37:59 -08:00