mesa.git
9 years agovk: Update generated headers
Kristian Høgsberg Kristensen [Mon, 3 Aug 2015 22:15:17 +0000 (15:15 -0700)]
vk: Update generated headers

This adds zeroing of reserved blocks of dwords and removes an
instruction definition.

9 years agovk/allocator: Solve a data race in anv_block_pool
Jason Ekstrand [Mon, 3 Aug 2015 08:19:34 +0000 (01:19 -0700)]
vk/allocator: Solve a data race in anv_block_pool

The anv_block_pool data structure suffered from the exact same race as the
state pool.  Namely, that the uniqueness of the blocks handed out depends
on the next_block value increasing monotonically.  However, this invariant
did not hold thanks to our block "return" concept.

9 years agovk: Add and use an anv_block_pool_size() helper
Jason Ekstrand [Mon, 3 Aug 2015 08:18:09 +0000 (01:18 -0700)]
vk: Add and use an anv_block_pool_size() helper

9 years agovk/allocator: Make block_pool_grow take and return a size
Jason Ekstrand [Mon, 3 Aug 2015 08:03:53 +0000 (01:03 -0700)]
vk/allocator: Make block_pool_grow take and return a size

It takes the old size as an argument and returns the new size as the return
value.  On error, it returns a size of 0.

9 years agovk/allocator: Fix a data race in the state pool
Jason Ekstrand [Mon, 3 Aug 2015 07:38:48 +0000 (00:38 -0700)]
vk/allocator: Fix a data race in the state pool

The previous algorithm had a race because of the way we were using
__sync_fetch_and_add for everything.  In particular, the concept of
"returning" over-allocated states in the "next > end" case was completely
bogus.  If too many threads were hitting the state pool at the same time,
it was possible to have the following sequence:

A: Get an offset (next == end)
B: Get an offset (next > end)
A: Resize the pool (now next < end by a lot)
C: Get an offset (next < end)
B: Return the over-allocated offset
D: Get an offset

in which case D will get the same offset as C.  The solution to this race
is to get rid of the concept of "returning" over-allocated states.
Instead, the thread that gets a new block simply sets the next and end
offsets directly and threads that over-allocate don't return anything and
just futex-wait.  Since you can only ever hit the over-allocate case if
someone else hit the "next == end" case and hasn't resized yet, you're
guaranteed that the end value will get updated and the futex won't block
forever.

9 years agovk/allocator: Make a few things more consistant
Jason Ekstrand [Mon, 3 Aug 2015 07:35:19 +0000 (00:35 -0700)]
vk/allocator: Make a few things more consistant

9 years agovk/allocator: Use memory pools rather than (MALLOC|FREE)LIKE
Jason Ekstrand [Fri, 31 Jul 2015 17:36:51 +0000 (10:36 -0700)]
vk/allocator: Use memory pools rather than (MALLOC|FREE)LIKE

We have pools, so we should be using them.  Also, I think this will help
keep valgrind from getting confused when we have to end up fighting with
system allocations such as those from malloc/free and mmap/munmap.

9 years agovk/allocator: Add an anv_state_pool_finish function
Jason Ekstrand [Fri, 31 Jul 2015 17:30:57 +0000 (10:30 -0700)]
vk/allocator: Add an anv_state_pool_finish function

Currently this is a no-op but it gives us a place to put finalization
things in the future.

9 years agovk/instance: valgrind-guard client-provided allocations
Jason Ekstrand [Fri, 31 Jul 2015 17:18:00 +0000 (10:18 -0700)]
vk/instance: valgrind-guard client-provided allocations

9 years agovk/device: Add anv_instance_alloc/free helpers
Jason Ekstrand [Fri, 31 Jul 2015 17:13:24 +0000 (10:13 -0700)]
vk/device: Add anv_instance_alloc/free helpers

This way we can more consistently alloc/free the device and it will provide
us a better place to put valgrind hooks in the next patch

9 years agovk/device: Mark newly allocated memory as undefined for valgrind
Jason Ekstrand [Fri, 31 Jul 2015 16:44:40 +0000 (09:44 -0700)]
vk/device: Mark newly allocated memory as undefined for valgrind

This way valgrind still works even if the client gives us memory that has
been initialized or re-uses memory for some reason.

9 years agovk/batch_chain: Decrement num_relocs instead of incrementing it
Jason Ekstrand [Fri, 31 Jul 2015 16:11:47 +0000 (09:11 -0700)]
vk/batch_chain: Decrement num_relocs instead of incrementing it

9 years agovk/batch_chain: Compute secondary exec mode after finishing the bo
Jason Ekstrand [Fri, 31 Jul 2015 15:52:28 +0000 (08:52 -0700)]
vk/batch_chain: Compute secondary exec mode after finishing the bo

Figuring out whether or not to do a copy requires knowing the length of the
final batch_bo.  This gets set by anv_batch_bo_finish so we have to do it
afterwards.  Not sure how this was even working before.

9 years agovk: Re-name command buffer implementation files
Jason Ekstrand [Thu, 30 Jul 2015 21:59:02 +0000 (14:59 -0700)]
vk: Re-name command buffer implementation files

Previously, the command buffer implementation was split between
anv_cmd_buffer.c and anv_cmd_emit.c.  However, this naming convention was
confusing because none of the Vulkan entrypoints for anv_cmd_buffer were
actually in anv_cmd_buffer.c.  This changes it so that anv_cmd_buffer.c is
what you think it is and the internals are in anv_batch_chain.c.

9 years agovk/cmd_buffer: Add a simple command pool implementation
Jason Ekstrand [Thu, 30 Jul 2015 21:55:49 +0000 (14:55 -0700)]
vk/cmd_buffer: Add a simple command pool implementation

9 years agovk/cmd_buffer: Add support for zero-copy batch chaining
Jason Ekstrand [Thu, 30 Jul 2015 21:22:17 +0000 (14:22 -0700)]
vk/cmd_buffer: Add support for zero-copy batch chaining

9 years agovk: Add initial support for secondary command buffers
Jason Ekstrand [Thu, 30 Jul 2015 18:36:48 +0000 (11:36 -0700)]
vk: Add initial support for secondary command buffers

9 years agovk/cmd_buffer: Split batch chaining into a helper function
Jason Ekstrand [Thu, 30 Jul 2015 18:34:58 +0000 (11:34 -0700)]
vk/cmd_buffer: Split batch chaining into a helper function

9 years agovk/device: Make BATCH_SIZE a global #define
Jason Ekstrand [Thu, 30 Jul 2015 18:34:09 +0000 (11:34 -0700)]
vk/device: Make BATCH_SIZE a global #define

9 years agovk/cmd_buffer: Add functions for cloning a list of anv_batch_bo's
Jason Ekstrand [Thu, 30 Jul 2015 18:32:27 +0000 (11:32 -0700)]
vk/cmd_buffer: Add functions for cloning a list of anv_batch_bo's

We'll need this to implement secondary command buffers.

9 years agovk/reloc_list: Actually set the new length in reloc_list_grow
Jason Ekstrand [Thu, 30 Jul 2015 18:29:55 +0000 (11:29 -0700)]
vk/reloc_list: Actually set the new length in reloc_list_grow

9 years agoutil/list: Add list splicing functions
Jason Ekstrand [Thu, 30 Jul 2015 18:28:22 +0000 (11:28 -0700)]
util/list: Add list splicing functions

This adds functions for splicing one list into another.  These have
more-or-less the same API as the kernel list splicing functions.

9 years agoCLONE
Jason Ekstrand [Wed, 29 Jul 2015 21:05:06 +0000 (14:05 -0700)]
CLONE

9 years agovk/cmd_buffer: Invalidate texture cache in emit_state_base_address
Jason Ekstrand [Thu, 30 Jul 2015 04:24:20 +0000 (21:24 -0700)]
vk/cmd_buffer: Invalidate texture cache in emit_state_base_address

Previously, the caller of emit_state_base_address was doing this.  However,
putting it directly in emit_state_base_address means that we'll never
forget the flush at the cost of one PIPE_CONTROL at the top every batch
(that should do nothing since the kernel just flushed for us).

9 years agovk/cmd_buffer: Rename emit_batch_buffer_end to end_batch_buffer
Jason Ekstrand [Thu, 30 Jul 2015 04:22:10 +0000 (21:22 -0700)]
vk/cmd_buffer: Rename emit_batch_buffer_end to end_batch_buffer

This is more generic and doesn't imply that it emits MI_BATCH_BUFFER_END.
While we're at it, we'll move NOOP adding from bo_finish to
end_batch_buffer.

9 years agovk/cmd_buffer: Use an array to track all know anv_batch_bo objects
Jason Ekstrand [Wed, 29 Jul 2015 22:28:51 +0000 (15:28 -0700)]
vk/cmd_buffer: Use an array to track all know anv_batch_bo objects

Instead of walking the list of batch and surface buffers, we simply keep
track of all known batch and surface buffers as we build the command
buffer.  Then we use this new list to construct the validate list.

9 years agovk/cmd_buffer: Rework validate list creation
Jason Ekstrand [Wed, 29 Jul 2015 22:13:21 +0000 (15:13 -0700)]
vk/cmd_buffer: Rework validate list creation

The algorighm we used previously required us to call add_bo in a particular
order in order to guarantee that we get the initial batch buffer as the
last element in the validate list.  The new algorighm does a recursive walk
over the buffers and then re-orders the list.  This should be much more
robust as we start to add circular dependancies in the relocations.

9 years agovk/cmd_buffer: Move emit_batch_buffer_end higher in the file
Jason Ekstrand [Wed, 29 Jul 2015 19:01:02 +0000 (12:01 -0700)]
vk/cmd_buffer: Move emit_batch_buffer_end higher in the file

9 years agovk/cmd_buffer: Store the relocation list in the anv_batch_bo struct
Jason Ekstrand [Wed, 29 Jul 2015 18:57:44 +0000 (11:57 -0700)]
vk/cmd_buffer: Store the relocation list in the anv_batch_bo struct

Before, we were doing this thing where we had one big relocation list for
the whole command buffer and each subbuffer took a chunk out of it.  Now,
we store the actual relocation list in the anv_batch_bo.  This comes at the
cost of more small allocations but makes a lot of things simpler.

9 years agovk/batch: Make relocs a pointer to a relocation list
Jason Ekstrand [Wed, 29 Jul 2015 16:23:11 +0000 (09:23 -0700)]
vk/batch: Make relocs a pointer to a relocation list

Previously anv_batch.relocs was an actual relocation list.  However, this
is limiting if the implementation of the batch wants to change the
relocation list as the batch progresses.

9 years agovk/headers: Update to new generated gen headers
Kristian Høgsberg Kristensen [Tue, 28 Jul 2015 23:32:52 +0000 (16:32 -0700)]
vk/headers: Update to new generated gen headers

This update fixes cases where a 48-bit address field was split into
two parts:

    __gen_address_type                           MemoryAddress;
    uint32_t                                     MemoryAddressHigh;

which cases this pack code to be generated:

   dw[1] =
       __gen_combine_address(data, &dw[1], values->MemoryAddress, dw1);

   dw[2] =
      __gen_field(values->MemoryAddressHigh, 0, 15) |
      0;

which breaks for addresses above 4G.

This update also fixes arrays of structs in commands and structs, for
example, we now have:

   struct GEN8_BLEND_STATE_ENTRY                Entry[8];

and the pack functions now write all dwords in the packet, making
valgrind happy.

Finally, we would try to pack 64 bits of blend state into a uint32_t -
that's also fixed now.

9 years agovk/cmd_buffer: Update a comment
Jason Ekstrand [Wed, 29 Jul 2015 15:33:56 +0000 (08:33 -0700)]
vk/cmd_buffer: Update a comment

9 years agovk/cmd_buffer: Use a doubly-linked list for batch and surface buffers
Jason Ekstrand [Wed, 29 Jul 2015 00:47:04 +0000 (17:47 -0700)]
vk/cmd_buffer: Use a doubly-linked list for batch and surface buffers

This is probably better than hand-rolling the list of buffers.

9 years agovk/aub: Use the data directly from the execbuf2
Jason Ekstrand [Tue, 28 Jul 2015 23:49:19 +0000 (16:49 -0700)]
vk/aub: Use the data directly from the execbuf2

Previously, we were crawling through the anv_cmd_buffer datastructure to
pull out batch buffers and things.  This meant that every time something in
anv_cmd_buffer changed, we broke aub dumping.  However, aub dumping should
just dump the stuff the kernel knows about so we really don't need to be
crawling driver internals.

9 years agovk/cmd_buffer: Pull the execbuf stuff into a substruct
Jason Ekstrand [Mon, 27 Jul 2015 23:37:09 +0000 (16:37 -0700)]
vk/cmd_buffer: Pull the execbuf stuff into a substruct

9 years agovk/cmd_buffer: Move the remaining entrypoints into cmd_emit.c
Jason Ekstrand [Mon, 27 Jul 2015 22:14:31 +0000 (15:14 -0700)]
vk/cmd_buffer: Move the remaining entrypoints into cmd_emit.c

9 years agovk/cmd_buffer: Move the re-emission of STATE_BASE_ADDRESS to the flushing code
Jason Ekstrand [Mon, 27 Jul 2015 22:05:04 +0000 (15:05 -0700)]
vk/cmd_buffer: Move the re-emission of STATE_BASE_ADDRESS to the flushing code

This used to happen magically in cmd_buffer_new_surface_state_bo.  However,
according to Ken, STATE_BASE_ADDRESS is very gen-specific so we really
shouldn't have it in the generic data-structure code.

9 years agovk/cmd_buffer: Factor the guts of CmdBufferEnd into two helpers
Jason Ekstrand [Mon, 27 Jul 2015 21:52:16 +0000 (14:52 -0700)]
vk/cmd_buffer: Factor the guts of CmdBufferEnd into two helpers

9 years agovk/cmd_buffer: Factor the guts of (Create|Reset|Destroy)CmdBuffer into helpers
Jason Ekstrand [Mon, 27 Jul 2015 21:23:56 +0000 (14:23 -0700)]
vk/cmd_buffer: Factor the guts of (Create|Reset|Destroy)CmdBuffer into helpers

9 years agovk/private.h: Re-arrange and better comment anv_cmd_buffer
Jason Ekstrand [Mon, 27 Jul 2015 19:40:43 +0000 (12:40 -0700)]
vk/private.h: Re-arrange and better comment anv_cmd_buffer

9 years agovk: Actually advertise 0.138.1 at runtime
Jason Ekstrand [Thu, 23 Jul 2015 17:44:27 +0000 (10:44 -0700)]
vk: Actually advertise 0.138.1 at runtime

9 years agovk/vulkan.h: Bump to the version 0.138.1 header
Jason Ekstrand [Thu, 23 Jul 2015 00:34:23 +0000 (17:34 -0700)]
vk/vulkan.h: Bump to the version 0.138.1 header

This doesn't actually require any implementation changes but it does change
an enum so it is ABI-incompatable with 0.138.0.

9 years agovk: Add two more valgrind checks
Jason Ekstrand [Thu, 23 Jul 2015 15:57:54 +0000 (08:57 -0700)]
vk: Add two more valgrind checks

9 years agovk/meta: Destroy shader modules
Jason Ekstrand [Thu, 23 Jul 2015 00:51:26 +0000 (17:51 -0700)]
vk/meta: Destroy shader modules

9 years agovk/device: Finish the scratch block pool on device destruction
Jason Ekstrand [Thu, 23 Jul 2015 00:51:14 +0000 (17:51 -0700)]
vk/device: Finish the scratch block pool on device destruction

9 years agovk: Add a FreeDescriptorSets function
Jason Ekstrand [Thu, 23 Jul 2015 00:33:09 +0000 (17:33 -0700)]
vk: Add a FreeDescriptorSets function

9 years agovk/pipeline: Be more sloppy about shader entrypoint names
Jason Ekstrand [Wed, 22 Jul 2015 22:26:53 +0000 (15:26 -0700)]
vk/pipeline: Be more sloppy about shader entrypoint names

The CTS passes in NULL names right now.  It's not too hard to support that
as just "main".  With this, and a patch to vulkancts, we now pass all 6
tests.

9 years agovk: Prefix most filenames with anv
Chad Versace [Fri, 17 Jul 2015 22:04:27 +0000 (15:04 -0700)]
vk: Prefix most filenames with anv

Jason started the task by creating anv_cmd_buffer.c and anv_cmd_emit.c.
This patch finishes the task by renaming all other files except
gen*_pack.h and glsl_scraper.py.

9 years agovk/image: Remove unneeded data from anv_buffer_view
Chad Versace [Fri, 17 Jul 2015 21:48:23 +0000 (14:48 -0700)]
vk/image: Remove unneeded data from anv_buffer_view

This completes the FINISHME to trim unneeded data from anv_buffer_view.

A VkExtent3D doesn't make sense for a VkBufferView.
So remove the member anv_surface_view::extent, and push it up to the two
objects that actually need it, anv_image_view and anv_attachment_view.

9 years agovk: Document members of anv_surface_view
Chad Versace [Fri, 17 Jul 2015 21:39:05 +0000 (14:39 -0700)]
vk: Document members of anv_surface_view

9 years agovk: Remove more raw casts
Chad Versace [Fri, 17 Jul 2015 20:59:48 +0000 (13:59 -0700)]
vk: Remove more raw casts

This removes nearly all the remaining raw Anvil<->Vulkan casts from the
C source files.  (File compiler.cpp still contains many raw casts, and
I plan on ignoring that).

As far as I can tell, the only remaining raw casts are:
    anv_attachment_view -> anv_depth_stencil_view
    anv_attachment_view -> anv_color_attachment_view

9 years agovk/image: Add braces around multi-line ifs
Chad Versace [Fri, 17 Jul 2015 20:38:09 +0000 (13:38 -0700)]
vk/image: Add braces around multi-line ifs

9 years agonir/spirv: don't declare builtin blocks
Connor Abbott [Thu, 16 Jul 2015 18:04:22 +0000 (11:04 -0700)]
nir/spirv: don't declare builtin blocks

They aren't used, and the backend was barfing on them. Also, remove a
hack in in compiler.cpp now that they're gone.

9 years agonir/spirv: add support for loading UBO's
Connor Abbott [Thu, 16 Jul 2015 04:58:57 +0000 (21:58 -0700)]
nir/spirv: add support for loading UBO's

We directly emit ubo load intrinsics based off of the offset information
handed to us from SPIR-V.

9 years agonir/types: add more nir_type_is_xxx() wrappers
Connor Abbott [Thu, 16 Jul 2015 04:58:32 +0000 (21:58 -0700)]
nir/types: add more nir_type_is_xxx() wrappers

9 years agonir: move to two-level binding model for UBO's
Connor Abbott [Wed, 15 Jul 2015 23:47:51 +0000 (16:47 -0700)]
nir: move to two-level binding model for UBO's

The GLSL layer above is still hacky, so we're really just moving the
hack into GLSL-to-NIR. I'd rather not go all the way and make GLSL
support the Vulkan binding model too, since presumably we'll be
switching to SPIR-V exclusively, and so working on proper GLSL support
will be a waste of time. For now, doing this keeps it working as we add
SPIR-V->NIR support though.

9 years agovk: Remove unneeded vulkan-138.h
Chad Versace [Thu, 16 Jul 2015 00:12:22 +0000 (17:12 -0700)]
vk: Remove unneeded vulkan-138.h

9 years agovk: Bump vulkan.h version to 0.138
Chad Versace [Thu, 16 Jul 2015 00:11:49 +0000 (17:11 -0700)]
vk: Bump vulkan.h version to 0.138

9 years agovk/0.138: Update VkResult values
Chad Versace [Thu, 16 Jul 2015 00:10:33 +0000 (17:10 -0700)]
vk/0.138: Update VkResult values

9 years agovk/0.132: Do type-safety
Chad Versace [Wed, 15 Jul 2015 22:48:41 +0000 (15:48 -0700)]
vk/0.132: Do type-safety

9 years agovk/cmd_buffer: Move batch buffer padding to anv_batch_bo_finish()
Jason Ekstrand [Thu, 16 Jul 2015 00:10:58 +0000 (17:10 -0700)]
vk/cmd_buffer: Move batch buffer padding to anv_batch_bo_finish()

9 years agovk/cmd_buffer: Rename bo_count to exec2_bo_count
Jason Ekstrand [Wed, 15 Jul 2015 23:48:13 +0000 (16:48 -0700)]
vk/cmd_buffer: Rename bo_count to exec2_bo_count

9 years agovk/cmd_buffer: Add a helper for allocating dynamic state
Jason Ekstrand [Wed, 15 Jul 2015 23:33:47 +0000 (16:33 -0700)]
vk/cmd_buffer: Add a helper for allocating dynamic state

This matches what we do for surface state and makes the dynamic state pool
more opaque to things that need to get dynamic state.

9 years agovk/private.h: Move cmd_buffer functions to near the cmd_buffer struct
Jason Ekstrand [Wed, 15 Jul 2015 23:29:40 +0000 (16:29 -0700)]
vk/private.h: Move cmd_buffer functions to near the cmd_buffer struct

9 years agovk: Split command buffer state into its own structure
Jason Ekstrand [Wed, 15 Jul 2015 23:22:04 +0000 (16:22 -0700)]
vk: Split command buffer state into its own structure

Everything else in anv_cmd_buffer is the actual guts of the datastructure.

9 years agovk: Move most of the anv_Cmd related stuff to its own file
Jason Ekstrand [Wed, 15 Jul 2015 22:34:41 +0000 (15:34 -0700)]
vk: Move most of the anv_Cmd related stuff to its own file

9 years agovk: Pull the guts of anv_cmd_buffer into its own file
Jason Ekstrand [Wed, 15 Jul 2015 19:09:52 +0000 (12:09 -0700)]
vk: Pull the guts of anv_cmd_buffer into its own file

9 years agovk/glsl: Replace raw casts
Chad Versace [Wed, 15 Jul 2015 22:33:27 +0000 (15:33 -0700)]
vk/glsl: Replace raw casts

Needed for upcoming type-safety changes.

9 years agovk/meta: Remove raw casts
Chad Versace [Wed, 15 Jul 2015 22:33:40 +0000 (15:33 -0700)]
vk/meta: Remove raw casts

Needed for upcoming type-safety changes.

9 years agovk/x11: Remove raw casts
Chad Versace [Wed, 15 Jul 2015 22:33:12 +0000 (15:33 -0700)]
vk/x11: Remove raw casts

The raw casts in the WSI functions will break the build when the
type-safety changes arrive.

9 years agovk: Delete vkDbgSetObjectTag()
Chad Versace [Wed, 15 Jul 2015 22:24:06 +0000 (15:24 -0700)]
vk: Delete vkDbgSetObjectTag()

Because VkObject is going away.

9 years agovk/device: Remove unneeded checks for NULL
Jason Ekstrand [Wed, 15 Jul 2015 22:19:59 +0000 (15:19 -0700)]
vk/device: Remove unneeded checks for NULL

9 years agovk/device: Provide proper NULL handling in anv_device_free
Jason Ekstrand [Wed, 15 Jul 2015 22:15:54 +0000 (15:15 -0700)]
vk/device: Provide proper NULL handling in anv_device_free

The Vulkan spec does not specify that the free function provided to
CreateInstance must handle NULL properly so we do it in the wrapper.  If
this ever changes in the spec, we can delete the extra 2 lines.

9 years agovk: Stop internally calling anv_DestroyObject()
Chad Versace [Wed, 15 Jul 2015 21:01:30 +0000 (14:01 -0700)]
vk: Stop internally calling anv_DestroyObject()

Replace each anv_DestroyObject() with anv_DestroyFoo().

Let vkDestroyObject() live for a while longer for Crucible's sake.

9 years agovk: Fix vkDestroyObject dispatch for VkRenderPass
Chad Versace [Wed, 15 Jul 2015 21:33:10 +0000 (14:33 -0700)]
vk: Fix vkDestroyObject dispatch for VkRenderPass

It called anv_device_free() instead of anv_DestroyRenderPass().

9 years agovk: Fix vkCreate/DestroyRenderPass
Chad Versace [Wed, 15 Jul 2015 22:02:47 +0000 (15:02 -0700)]
vk: Fix vkCreate/DestroyRenderPass

While updating vkDestroyObject, I discovered that vkDestroyPass reliably
crashes. That hasn't been an issue yet, though, because it is never
called.

In vkCreateRenderPass:
    - Don't allocate empty attachment arrays.
    - Ensure that pointers to empty attachment arrays are NULL.
    - Store VkRenderPassCreateInfo::subpassCount as
      anv_render_pass::subpass_count.

In vkDestroyRenderPass:
    - Fix loop bounds: s/attachment_count/subpass_count/
    - Don't call anv_device_free on null pointers.

9 years agovk: Refactor create/destroy code for anv_descriptor_set
Chad Versace [Wed, 15 Jul 2015 21:14:04 +0000 (14:14 -0700)]
vk: Refactor create/destroy code for anv_descriptor_set

Define two new functions:
    anv_descriptor_set_create
    anv_descriptor_set_destroy

9 years agovk: Replace some raw casts with safe casts
Chad Versace [Wed, 15 Jul 2015 21:00:21 +0000 (14:00 -0700)]
vk: Replace some raw casts with safe casts

That is, replace some instances of
    (VkFoo) foo
with
    anv_foo_to_handle(foo)

9 years agovk: Correct anv_CreateShaderModule's prototype
Chad Versace [Wed, 15 Jul 2015 20:55:28 +0000 (13:55 -0700)]
vk: Correct anv_CreateShaderModule's prototype

s/VkShader/VkShaderModule/

:sigh: I look forward to type-safety.

9 years agovk: Define struct anv_image_view, anv_buffer_view
Chad Versace [Wed, 15 Jul 2015 19:00:27 +0000 (12:00 -0700)]
vk: Define struct anv_image_view, anv_buffer_view

Follow the pattern of anv_attachment_view. We need these structs to
implement the type-safety that arrived in the 0.132 header.

9 years agovk/meta: Fix declared type of a shader module
Chad Versace [Wed, 15 Jul 2015 18:49:37 +0000 (11:49 -0700)]
vk/meta: Fix declared type of a shader module

s/VkShader/VkShaderModule/

I'm looking forward to a type-safe vulkan.h ;)

9 years agovk: Remove struct anv_object
Chad Versace [Wed, 15 Jul 2015 18:26:31 +0000 (11:26 -0700)]
vk: Remove struct anv_object

Trivial removal because vkDestroyObject() no longer uses it.

9 years agovk/device: More documentation on surface state flushing
Jason Ekstrand [Wed, 15 Jul 2015 18:09:02 +0000 (11:09 -0700)]
vk/device: More documentation on surface state flushing

9 years agovk/device: explain why a flush is necessary
Connor Abbott [Wed, 15 Jul 2015 05:59:27 +0000 (22:59 -0700)]
vk/device: explain why a flush is necessary

Jason found this from experimenting, but the docs give a reasonable
explanation of why it's necessary.

9 years agovk: Fix indentation of anv_dynamic_cb_state
Chad Versace [Tue, 14 Jul 2015 23:04:56 +0000 (16:04 -0700)]
vk: Fix indentation of anv_dynamic_cb_state

9 years agovk: Add finishmes for VkDescriptorPool
Chad Versace [Tue, 14 Jul 2015 23:01:42 +0000 (16:01 -0700)]
vk: Add finishmes for VkDescriptorPool

VkDescriptorPool is a stub object. As a consequence, it's impossible to
free descriptor set memory.

9 years agovk: Add vulkan-138 and remove vulkan-0.132
Jason Ekstrand [Wed, 15 Jul 2015 00:54:11 +0000 (17:54 -0700)]
vk: Add vulkan-138 and remove vulkan-0.132

Now, 138 is the target and not 132.  Once object destruction is finished,
we can delete 138 as it will be identical to vulkan.h

9 years agovk/device: Add stub support for command pools
Jason Ekstrand [Wed, 15 Jul 2015 00:39:58 +0000 (17:39 -0700)]
vk/device: Add stub support for command pools

Real support isn't really that far away.  We just need a data structure
with a linked list and a few tests.

9 years agovk/vulkan.h: Add the stuff for cross-queue resource sharing
Jason Ekstrand [Wed, 15 Jul 2015 00:20:50 +0000 (17:20 -0700)]
vk/vulkan.h: Add the stuff for cross-queue resource sharing

We only have one queue, so this is currently a no-op on our implementation.

9 years agovk/vulkan.h: Add a couple of size fields for specialization constants
Jason Ekstrand [Wed, 15 Jul 2015 00:12:39 +0000 (17:12 -0700)]
vk/vulkan.h: Add a couple of size fields for specialization constants

9 years agovk/vulkan.h: Move around buffer image granularities
Jason Ekstrand [Wed, 15 Jul 2015 00:10:37 +0000 (17:10 -0700)]
vk/vulkan.h: Move around buffer image granularities

9 years agovk: Add stubs for all the sparse resource stuff
Jason Ekstrand [Wed, 15 Jul 2015 00:06:11 +0000 (17:06 -0700)]
vk: Add stubs for all the sparse resource stuff

9 years agovk/image: Add a stub for the new ImageFormatProperties function
Jason Ekstrand [Wed, 15 Jul 2015 00:05:28 +0000 (17:05 -0700)]
vk/image: Add a stub for the new ImageFormatProperties function

This lets the client query about things like multisample.  We don't do
multisample right now, so I'll let Chad deal with that when he gets to it.

9 years agovk/vulkan.h: Rename FormatInfo to FormatProperties
Jason Ekstrand [Wed, 15 Jul 2015 00:04:46 +0000 (17:04 -0700)]
vk/vulkan.h: Rename FormatInfo to FormatProperties

9 years agovk/vulkan.h: Re-order some #define's
Jason Ekstrand [Tue, 14 Jul 2015 23:41:39 +0000 (16:41 -0700)]
vk/vulkan.h: Re-order some #define's

9 years agovk/vulkan.h: Rename a function parameter
Jason Ekstrand [Tue, 14 Jul 2015 23:39:01 +0000 (16:39 -0700)]
vk/vulkan.h: Rename a function parameter

9 years agovk: Remove abreviations
Jason Ekstrand [Tue, 14 Jul 2015 23:34:31 +0000 (16:34 -0700)]
vk: Remove abreviations

9 years agovk: Add the new extension/layer enumeration entrypoints
Jason Ekstrand [Tue, 14 Jul 2015 23:11:21 +0000 (16:11 -0700)]
vk: Add the new extension/layer enumeration entrypoints

9 years agovk/vulkan.h: Change maxAnisotropy to a float
Jason Ekstrand [Tue, 14 Jul 2015 22:04:11 +0000 (15:04 -0700)]
vk/vulkan.h: Change maxAnisotropy to a float

9 years agovk/vulkan.h: Add the VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT flag
Jason Ekstrand [Tue, 14 Jul 2015 22:03:39 +0000 (15:03 -0700)]
vk/vulkan.h: Add the VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT flag