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.
Jason Ekstrand [Mon, 27 Jul 2015 21:52:16 +0000 (14:52 -0700)]
vk/cmd_buffer: Factor the guts of CmdBufferEnd into two 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
Jason Ekstrand [Mon, 27 Jul 2015 19:40:43 +0000 (12:40 -0700)]
vk/private.h: Re-arrange and better comment anv_cmd_buffer
Jason Ekstrand [Thu, 23 Jul 2015 17:44:27 +0000 (10:44 -0700)]
vk: Actually advertise 0.138.1 at runtime
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.
Jason Ekstrand [Thu, 23 Jul 2015 15:57:54 +0000 (08:57 -0700)]
vk: Add two more valgrind checks
Jason Ekstrand [Thu, 23 Jul 2015 00:51:26 +0000 (17:51 -0700)]
vk/meta: Destroy shader modules
Jason Ekstrand [Thu, 23 Jul 2015 00:51:14 +0000 (17:51 -0700)]
vk/device: Finish the scratch block pool on device destruction
Jason Ekstrand [Thu, 23 Jul 2015 00:33:09 +0000 (17:33 -0700)]
vk: Add a FreeDescriptorSets function
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.
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.
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.
Chad Versace [Fri, 17 Jul 2015 21:39:05 +0000 (14:39 -0700)]
vk: Document members of anv_surface_view
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
Chad Versace [Fri, 17 Jul 2015 20:38:09 +0000 (13:38 -0700)]
vk/image: Add braces around multi-line ifs
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.
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.
Connor Abbott [Thu, 16 Jul 2015 04:58:32 +0000 (21:58 -0700)]
nir/types: add more nir_type_is_xxx() wrappers
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.
Chad Versace [Thu, 16 Jul 2015 00:12:22 +0000 (17:12 -0700)]
vk: Remove unneeded vulkan-138.h
Chad Versace [Thu, 16 Jul 2015 00:11:49 +0000 (17:11 -0700)]
vk: Bump vulkan.h version to 0.138
Chad Versace [Thu, 16 Jul 2015 00:10:33 +0000 (17:10 -0700)]
vk/0.138: Update VkResult values
Chad Versace [Wed, 15 Jul 2015 22:48:41 +0000 (15:48 -0700)]
vk/0.132: Do type-safety
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()
Jason Ekstrand [Wed, 15 Jul 2015 23:48:13 +0000 (16:48 -0700)]
vk/cmd_buffer: Rename bo_count to exec2_bo_count
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.
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
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.
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
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
Chad Versace [Wed, 15 Jul 2015 22:33:27 +0000 (15:33 -0700)]
vk/glsl: Replace raw casts
Needed for upcoming type-safety changes.
Chad Versace [Wed, 15 Jul 2015 22:33:40 +0000 (15:33 -0700)]
vk/meta: Remove raw casts
Needed for upcoming type-safety changes.
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.
Chad Versace [Wed, 15 Jul 2015 22:24:06 +0000 (15:24 -0700)]
vk: Delete vkDbgSetObjectTag()
Because VkObject is going away.
Jason Ekstrand [Wed, 15 Jul 2015 22:19:59 +0000 (15:19 -0700)]
vk/device: Remove unneeded checks for NULL
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.
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.
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().
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.
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
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)
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.
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.
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 ;)
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.
Jason Ekstrand [Wed, 15 Jul 2015 18:09:02 +0000 (11:09 -0700)]
vk/device: More documentation on surface state flushing
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.
Chad Versace [Tue, 14 Jul 2015 23:04:56 +0000 (16:04 -0700)]
vk: Fix indentation of anv_dynamic_cb_state
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.
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
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.
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.
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
Jason Ekstrand [Wed, 15 Jul 2015 00:10:37 +0000 (17:10 -0700)]
vk/vulkan.h: Move around buffer image granularities
Jason Ekstrand [Wed, 15 Jul 2015 00:06:11 +0000 (17:06 -0700)]
vk: Add stubs for all the sparse resource stuff
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.
Jason Ekstrand [Wed, 15 Jul 2015 00:04:46 +0000 (17:04 -0700)]
vk/vulkan.h: Rename FormatInfo to FormatProperties
Jason Ekstrand [Tue, 14 Jul 2015 23:41:39 +0000 (16:41 -0700)]
vk/vulkan.h: Re-order some #define's
Jason Ekstrand [Tue, 14 Jul 2015 23:39:01 +0000 (16:39 -0700)]
vk/vulkan.h: Rename a function parameter
Jason Ekstrand [Tue, 14 Jul 2015 23:34:31 +0000 (16:34 -0700)]
vk: Remove abreviations
Jason Ekstrand [Tue, 14 Jul 2015 23:11:21 +0000 (16:11 -0700)]
vk: Add the new extension/layer enumeration entrypoints
Jason Ekstrand [Tue, 14 Jul 2015 22:04:11 +0000 (15:04 -0700)]
vk/vulkan.h: Change maxAnisotropy to a float
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
Jason Ekstrand [Tue, 14 Jul 2015 22:02:59 +0000 (15:02 -0700)]
vk/vulkan.h: Rename a couple of function parameters
No functional change.
Jason Ekstrand [Tue, 14 Jul 2015 21:59:39 +0000 (14:59 -0700)]
vk: Split the memory requirements/binding functions
Jason Ekstrand [Tue, 14 Jul 2015 21:50:35 +0000 (14:50 -0700)]
vk: Make barriers more precise (rev. 133)
Jason Ekstrand [Tue, 14 Jul 2015 21:26:10 +0000 (14:26 -0700)]
vk: Split the dynamic state binding function into one per state
Jason Ekstrand [Tue, 14 Jul 2015 21:11:04 +0000 (14:11 -0700)]
vk/vulkan.h: Rename a function parameter to match 132
Jason Ekstrand [Sat, 11 Jul 2015 03:18:52 +0000 (20:18 -0700)]
vk: Implement Multipass
Jason Ekstrand [Fri, 10 Jul 2015 19:04:00 +0000 (12:04 -0700)]
vk/vulkan.h: Re-arrange some enums and definitions in preparation for 131
Chad Versace [Tue, 14 Jul 2015 18:21:01 +0000 (11:21 -0700)]
vk/0.132: Add vkDestroyRenderPass()
Chad Versace [Tue, 14 Jul 2015 18:15:39 +0000 (11:15 -0700)]
vk/0.132: Add vkDestroy*View()
vkDestroyColorAttachmentView
vkDestroyDepthStencilView
These functions are not in the 0.132 header, but adding them will help
us attain the type-safety API updates more quickly.
Chad Versace [Tue, 14 Jul 2015 18:06:14 +0000 (11:06 -0700)]
vk/0.132: Add vkDestroyCommandBuffer()
Chad Versace [Tue, 14 Jul 2015 18:02:33 +0000 (11:02 -0700)]
vk/0.132: Add vkDestroyImageView()
Just declare it in vulkan.h. Jason defined the function earlier
in image.c.
Chad Versace [Tue, 14 Jul 2015 18:01:38 +0000 (11:01 -0700)]
vk/0.132: Add vkDestroyBufferView()
Just declare it in vulkan.h. Jason already defined the function
earlier in vulkan.c.
Chad Versace [Tue, 14 Jul 2015 17:59:30 +0000 (10:59 -0700)]
vk/0.132: Add vkDestroyFramebuffer()
Chad Versace [Tue, 14 Jul 2015 17:54:16 +0000 (10:54 -0700)]
vk/0.132: Add vkDestroyDynamicDepthStencilState()
Chad Versace [Tue, 14 Jul 2015 17:52:45 +0000 (10:52 -0700)]
vk/0.132: Add vkDestroyDynamicColorBlendState()
Chad Versace [Tue, 14 Jul 2015 17:51:08 +0000 (10:51 -0700)]
vk/0.132: Add vkDestroyDynamicRasterState()
Chad Versace [Tue, 14 Jul 2015 17:42:45 +0000 (10:42 -0700)]
vk/0.132: Add vkDestroyDynamicViewportState()
Chad Versace [Tue, 14 Jul 2015 17:38:22 +0000 (10:38 -0700)]
vk/0.132: Add vkDestroyDescriptorPool()
Chad Versace [Tue, 14 Jul 2015 17:36:49 +0000 (10:36 -0700)]
vk/0.132: Add vkDestroyDescriptorSetLayout()
Chad Versace [Tue, 14 Jul 2015 17:34:00 +0000 (10:34 -0700)]
vk/0.132: Add vkDestroySampler()
Chad Versace [Tue, 14 Jul 2015 17:28:41 +0000 (10:28 -0700)]
vk/0.132: Add vkDestroyPipelineLayout()
Chad Versace [Tue, 14 Jul 2015 17:26:17 +0000 (10:26 -0700)]
vk/0.132: Add vkDestroyPipeline()
Chad Versace [Tue, 14 Jul 2015 17:19:27 +0000 (10:19 -0700)]
vk/0.132: Add vkDestroyPipelineCache()
Chad Versace [Tue, 14 Jul 2015 17:16:22 +0000 (10:16 -0700)]
vk/0.132: Add vkDestroyShader()
Chad Versace [Tue, 14 Jul 2015 17:12:10 +0000 (10:12 -0700)]
vk/0.132: Add vkDestroyShaderModule()
Chad Versace [Tue, 14 Jul 2015 17:08:04 +0000 (10:08 -0700)]
vk/0.132: Add vkDestroyImage()
We only need to add it to vulkan.h because Jason defined the function
earlier in image.c.
Chad Versace [Tue, 14 Jul 2015 16:56:48 +0000 (09:56 -0700)]
vk/0.132: Dispatch vkDestroyObject to new destructors
Oops. My recent commits added new destructors, but forgot to teach
vkDestroyObject about them. They are:
vkDestroyFence
vkDestroyEvent
vkDestroySemaphore
vkDestroyQueryPool
vkDestroyBuffer
Chad Versace [Tue, 14 Jul 2015 16:47:45 +0000 (09:47 -0700)]
vk/0.132: Add vkDestroyBuffer()
Chad Versace [Tue, 14 Jul 2015 16:44:58 +0000 (09:44 -0700)]
vk/0.132: Add vkDestroyQueryPool()
Chad Versace [Tue, 14 Jul 2015 16:33:47 +0000 (09:33 -0700)]
vk/0.132: Add vkDestroyEvent()
Chad Versace [Tue, 14 Jul 2015 16:31:34 +0000 (09:31 -0700)]
vk/0.132: Add vkDestroySemaphore()
Chad Versace [Tue, 14 Jul 2015 16:29:35 +0000 (09:29 -0700)]
vk/0.132: Add vkDestroyFence()
Chad Versace [Mon, 13 Jul 2015 20:19:33 +0000 (13:19 -0700)]
vk/0.132: Rename VkDynamic*State types
sed -i -e 's/VkDynamicVpState/VkDynamicViewportState/g' \
-e 's/VkDynamicRsState/VkDynamicRasterState/g' \
-e 's/VkDynamicCbState/VkDynamicColorBlendState/g' \
-e 's/VkDynamicDsState/VkDynamicDepthStencilState/g' \
$(git ls-files include/vulkan src/vulkan)
Connor Abbott [Mon, 13 Jul 2015 17:19:32 +0000 (10:19 -0700)]
nir/spirv: update to SPIR-V revision 31
This means that now the internal version of glslangValidator is
required. This includes some changes due to the sampler/texture rework,
but doesn't actually enable anything more yet. We also don't yet handle
UBO's correctly, and don't handle matrix stride and row major/column
major yet.
Chad Versace [Mon, 13 Jul 2015 20:09:32 +0000 (13:09 -0700)]
vk/0.132: Move VkQueryControlFlags
Chad Versace [Mon, 13 Jul 2015 20:08:56 +0000 (13:08 -0700)]
vk/0.132: Move VkImageAspectFlags