Chad Versace [Thu, 4 Jun 2015 21:31:53 +0000 (14:31 -0700)]
vk: Fix 2 incorrect typecasts
The compiler didn't find the cast errors because all Vulkan types are
just integers.
Chad Versace [Thu, 4 Jun 2015 21:26:03 +0000 (14:26 -0700)]
vk: Make `make clean` remove generated spirv headers
Jason Ekstrand [Thu, 4 Jun 2015 16:12:37 +0000 (09:12 -0700)]
vk/allocator: Remove an unneeded VG() wrapper
Jason Ekstrand [Thu, 4 Jun 2015 16:06:59 +0000 (09:06 -0700)]
vk/device: Dissalow device destruction
Chad Versace [Thu, 4 Jun 2015 16:01:30 +0000 (09:01 -0700)]
vk: Fix build
Commit 1286bd, which deleted vk.c, broke the build. Update the Makefile
to fix it.
Jason Ekstrand [Wed, 3 Jun 2015 23:59:13 +0000 (16:59 -0700)]
vk/DS: Mask stencil masks to 8 bits
Kristian Høgsberg Kristensen [Wed, 3 Jun 2015 06:08:05 +0000 (23:08 -0700)]
vk: Set color/blend state in meta clear if not set yet
Kristian Høgsberg Kristensen [Wed, 3 Jun 2015 05:56:39 +0000 (22:56 -0700)]
vk: Delete vk.c test case
We now have crucible up and running and all vk sub-cases have been moved
over. Delete this crufty old hack of a test case.
Kristian Høgsberg Kristensen [Wed, 3 Jun 2015 05:53:43 +0000 (22:53 -0700)]
vk: Update generated headers with support for 64 bit fields
Kristian Høgsberg Kristensen [Wed, 3 Jun 2015 05:51:42 +0000 (22:51 -0700)]
vk: Set cb_state to NULL at cmd buffer create time
Dynamic color/blend state can be NULL in case we're not rendering to
color targets (only output to depth and/or stencil). Initialize
cmd_buffer->cb_state to NULL so we can reliably detect whether it's been
set or not.
Kristian Høgsberg Kristensen [Wed, 3 Jun 2015 05:35:47 +0000 (22:35 -0700)]
vk: Implement vertexOffset parameter of vkCmdDrawIndexed()
As exposed by the func.draw_indexed test, we were ignoring the argument
and hardcoding 0.
Jason Ekstrand [Tue, 2 Jun 2015 18:03:22 +0000 (11:03 -0700)]
vk/formats: Add a name to the metadata and better logging
Jason Ekstrand [Tue, 2 Jun 2015 18:01:41 +0000 (11:01 -0700)]
vk/formats: Rework the formats table
Kristian Høgsberg Kristensen [Tue, 2 Jun 2015 04:52:45 +0000 (21:52 -0700)]
vk: Move query related functionality to new file query.c
Jason Ekstrand [Thu, 7 May 2015 22:07:49 +0000 (15:07 -0700)]
i965: Use NIR by default for vertex shaders on GEN8+
GLSL IR vs. NIR shader-db results for SIMD8 vertex shaders on Broadwell:
total instructions in shared programs:
2742062 ->
2681339 (-2.21%)
instructions in affected programs:
1514770 ->
1454047 (-4.01%)
helped: 5813
HURT: 1120
The gained programs are ARB vertext programs that were previously going
through the vec4 backend. Now that we have prog_to_nir, ARB vertex
programs can go through the scalar backend so they show up as "gained" in
the shader-db results.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Jason Ekstrand [Mon, 1 Jun 2015 19:24:31 +0000 (12:24 -0700)]
vk/compiler: Add an index_count to the bind map and check for OOB
Jason Ekstrand [Mon, 1 Jun 2015 17:01:23 +0000 (10:01 -0700)]
vk/HACK: Plumb real descriptor set/index into textures
Jason Ekstrand [Mon, 1 Jun 2015 17:00:44 +0000 (10:00 -0700)]
NIR: Add a helper for doing sampler lowering for vulkan
Kristian Høgsberg Kristensen [Mon, 1 Jun 2015 05:35:11 +0000 (22:35 -0700)]
vk: Indent tables to align '=' at column 48
Kristian Høgsberg Kristensen [Mon, 1 Jun 2015 05:15:34 +0000 (22:15 -0700)]
vk: Add support for anisotropic bits
Kristian Høgsberg Kristensen [Fri, 29 May 2015 23:06:06 +0000 (16:06 -0700)]
vk: Implement support for sampler border colors
This supports the three Vulkan border color types for float color
formats. The support for integer formats is a little trickier, as we
don't know the format of the texture at this time.
Jason Ekstrand [Sun, 31 May 2015 01:04:48 +0000 (18:04 -0700)]
vk/device: Only flush the texture cache when setting state base address
After further examination, it appears that the other flushes and stalls
weren't actually needed.
Jason Ekstrand [Sat, 30 May 2015 17:07:29 +0000 (10:07 -0700)]
vk/cmd_buffer: Track descriptor set dirtying per-stage
Jason Ekstrand [Sat, 30 May 2015 15:02:52 +0000 (08:02 -0700)]
vk/device: Emit PIPE_CONTROL flushes surrounding new STATE_BASE_ADDRESS
According to the bspec, you're supposed to emit a PIPE_CONTROL with a CS
stall and a render target flush prior to chainging STATE_BASE_ADDRESS. A
little experimentation, however, shows that this is not enough. It also
appears as if you have to flush the texture cache after chainging base
address or things won't propagate properly.
Jason Ekstrand [Sat, 30 May 2015 04:15:47 +0000 (21:15 -0700)]
vk/allocator: Don't call VALGRIND_MALLOCLIKE_BLOCK on fresh gem_mmap's
Jason Ekstrand [Sat, 30 May 2015 03:43:10 +0000 (20:43 -0700)]
vk: Don't crash on partial descriptor sets
Jason Ekstrand [Fri, 29 May 2015 16:40:03 +0000 (09:40 -0700)]
vk/device: Allow for starting a new surface state buffer
This commit allows for us to create a whole new surface state buffer when
the old one runs out of room. We simply re-emit the state base address for
the new state, re-emit binding tables, and keep going.
Jason Ekstrand [Fri, 29 May 2015 22:16:58 +0000 (15:16 -0700)]
vk/device: Do lazy surface state emission for binding tables
Before, we were emitting surface states up-front when binding tables were
updated. Now, we wait to emit the surface states until we emit the binding
table. This makes meta simpler and should make it easier to deal with
swapping out the surface state buffer.
Kristian Høgsberg Kristensen [Fri, 29 May 2015 18:32:53 +0000 (11:32 -0700)]
vk: Store dynamic slot index with struct anv_descriptor_slot
We need to make sure we use the right index into dynamic offset
array. Dynamic descriptors can be present or not in different stages and
to get the right offset, we need to compute the index at
vkCreateDescriptorSetLayout time.
Kristian Høgsberg Kristensen [Wed, 27 May 2015 21:05:50 +0000 (14:05 -0700)]
vk: Implement dynamic buffer offsets
We do this by creating a surface state on the fly that incorporates the
dynamic offset. This patch also refactor the descriptor set layout
constructor a bit to be less clever with switch statement fall
through. Instead of duplicating the subtle code to update the sampler
and surface slot map, we just use two switch statements.
Jason Ekstrand [Thu, 28 May 2015 22:34:08 +0000 (15:34 -0700)]
vk/device: Split state base address emit into its own function
Jason Ekstrand [Thu, 28 May 2015 22:25:02 +0000 (15:25 -0700)]
vk/device: Use anv_batch_emit for MI_BATCH_BUFFER_START
Jason Ekstrand [Thu, 28 May 2015 20:08:21 +0000 (13:08 -0700)]
vk/device: Actually destroy batch buffers
Jason Ekstrand [Thu, 28 May 2015 17:27:50 +0000 (10:27 -0700)]
vk/query: Don't emit a CS stall by itself
Both the bspec and the simulator don't like this. I'm not sure if stalling
at the scoreboard is right but it at least shuts up the simulator.
Jason Ekstrand [Thu, 28 May 2015 17:20:18 +0000 (10:20 -0700)]
vk/device: Fixups for batch buffer chaining
Some how these didn't get merged with the other batch buffer chaining
stuff. Oh well, it's here now.
Jason Ekstrand [Thu, 28 May 2015 17:06:45 +0000 (10:06 -0700)]
meta: Add a default ds_state and use it when no ds state is set
Jason Ekstrand [Thu, 28 May 2015 17:00:38 +0000 (10:00 -0700)]
vk/meta: Share the dummy RS and CB state between clear and blit
Kristian Høgsberg Kristensen [Thu, 28 May 2015 04:45:23 +0000 (21:45 -0700)]
vk: Initialize dynamic state binding points to NULL
We rely on these being initialized to NULL so meta can reliably detect
whether or not they've been set. ds_state is also allowed to not be
present so we need a well-defined value for that.
Chad Versace [Thu, 28 May 2015 00:01:09 +0000 (17:01 -0700)]
.gitignore: Ignore spirv2nir binary
Chad Versace [Wed, 27 May 2015 23:59:53 +0000 (16:59 -0700)]
.gitignore: Scope Vulkan's generated source files
Don't ignore any file named entrypoints.{c,h}. Ignore it only if it's in
src/vulkan.
Chad Versace [Wed, 27 May 2015 23:57:31 +0000 (16:57 -0700)]
vk: gitignore generated source files
Chad Versace [Wed, 27 May 2015 23:52:29 +0000 (16:52 -0700)]
vk/glsl_scraper: Replace adhoc arg parsing with argparse
Chad Versace [Wed, 27 May 2015 23:21:04 +0000 (16:21 -0700)]
vk/image: Assert that VkImageTiling is valid
Chad Versace [Wed, 27 May 2015 23:15:47 +0000 (16:15 -0700)]
vk/image: Remove trailing whitespace
Chad Versace [Wed, 27 May 2015 23:14:26 +0000 (16:14 -0700)]
vk/glsl: Reject invalid options
The script incorrectly interpreted --blah as the input filename.
Chad Versace [Wed, 27 May 2015 23:09:26 +0000 (16:09 -0700)]
vk/glsl_scraper: Indent large text blocks
Indent them to the same level as if the text was code.
No changes in entrypoints.{c,h} after a clean build.
Chad Versace [Wed, 27 May 2015 23:02:50 +0000 (16:02 -0700)]
vk/glsl_scraper: Fix code style for imports
Python style is one module imported per line, and imports are at the top
of the file.
Jason Ekstrand [Wed, 27 May 2015 19:06:30 +0000 (12:06 -0700)]
vk/meta: Actually create the CB state for blits
Jason Ekstrand [Wed, 27 May 2015 18:42:55 +0000 (11:42 -0700)]
vk: Rework anv_batch and use chaining batch buffers
This mega-commit primarily does two things. First, is to turn anv_batch
into a better abstraction of a batch. Instead of actually having a BO, it
now has a few pointers to some piece of memory that are used to add data to
the "batch". If it gets to the end, there is a function pointer that it
can call to attempt to grow the batch.
The second change is to start using chained batch buffers. When the end of
the current batch BO is reached, it automatically creates a new one and
ineserts an MI_BATCH_BUFFER_START command to chain to it. In this way, our
batch buffers are effectively infinite in length.
Jason Ekstrand [Wed, 27 May 2015 18:41:28 +0000 (11:41 -0700)]
Fixup for growable reloc lists
Jason Ekstrand [Tue, 26 May 2015 01:27:43 +0000 (18:27 -0700)]
vk/cmd_buffer: Allocate the surface_bo from device->batch_bo_pool
Jason Ekstrand [Tue, 26 May 2015 00:38:15 +0000 (17:38 -0700)]
vk/device: Make reloc lists growable
Jason Ekstrand [Mon, 25 May 2015 22:46:48 +0000 (15:46 -0700)]
vk/device: Use a bo pool for batch buffers
Jason Ekstrand [Mon, 25 May 2015 22:29:27 +0000 (15:29 -0700)]
vk/allocator: Add a BO pool
Jason Ekstrand [Mon, 25 May 2015 22:29:10 +0000 (15:29 -0700)]
vk/allocator: Add a free list that acts on pointers instead of offsets
Kristian Høgsberg [Wed, 27 May 2015 00:12:18 +0000 (17:12 -0700)]
vk: Add support for dynamic and pipeline color blend state
Kristian Høgsberg [Tue, 26 May 2015 23:48:21 +0000 (16:48 -0700)]
vk/test: Create and use color/blend dynamic and pipeline state
Kristian Høgsberg [Tue, 26 May 2015 21:47:06 +0000 (14:47 -0700)]
vk/meta: Allocate and set color/blend state
For color blend, we have to set our own state to avoid inheriting bogus
blend state.
Kristian Høgsberg [Tue, 26 May 2015 18:50:34 +0000 (11:50 -0700)]
vk: Allocate samplers from dynamic stream
Kristian Høgsberg [Tue, 26 May 2015 18:22:12 +0000 (11:22 -0700)]
vk: Emit color calc state
This involves pulling stencil ref values out of DS dynamic state and the
blend constant out of CB dynamic state.
Kristian Høgsberg [Tue, 26 May 2015 18:02:28 +0000 (11:02 -0700)]
vk/pack: Generate length macros for structs
Kristian Høgsberg [Tue, 26 May 2015 16:40:10 +0000 (09:40 -0700)]
vk: Program depth bias
This makes 3DSTATE_RASTER a split state command.
Kristian Høgsberg [Tue, 26 May 2015 05:12:24 +0000 (22:12 -0700)]
vk: Add support for texture component swizzle
This also drops the share create_surface_state helper and moves filling
out SURFACE_STATE directly into anv_image_view_init() and
anv_color_attachment_view_init().
Kristian Høgsberg [Mon, 25 May 2015 04:19:26 +0000 (21:19 -0700)]
vk: Implement dynamic and pipeline ds state
Kristian Høgsberg [Sat, 23 May 2015 05:59:12 +0000 (22:59 -0700)]
vk: Set up depth and stencil buffers
Kristian Høgsberg [Fri, 22 May 2015 22:18:37 +0000 (15:18 -0700)]
vk/test: Add new depth-stencil test
Not yet a depth stencil test, but will become one.
Kristian Høgsberg [Thu, 21 May 2015 21:35:34 +0000 (14:35 -0700)]
vk: Add basic MOCS settings
This matches what we do for GL.
Kristian Høgsberg [Thu, 21 May 2015 21:34:55 +0000 (14:34 -0700)]
vk: Update to header files with nested struct support
This will let us do MOCS settings right.
Jason Ekstrand [Tue, 26 May 2015 00:08:11 +0000 (17:08 -0700)]
vk/cmd_buffer: Initialize the pipeline pointer to NULL
If a meta operation is called before the pipeline is set, this can cause
uses of undefined values. They *should* be harmless, but we might as well
shut up valgrind on this one too.
Jason Ekstrand [Tue, 26 May 2015 00:03:57 +0000 (17:03 -0700)]
vk/device: Use the correct number of viewports when creating default VP state
Fixes valgrind uninitialized value errors
Jason Ekstrand [Mon, 25 May 2015 23:59:24 +0000 (16:59 -0700)]
vk/compiler: Zero out the vs_prog_data struct when VS is disabled
Prevents uninitialized value errors
Jason Ekstrand [Mon, 25 May 2015 19:42:59 +0000 (12:42 -0700)]
vk/compiler: Fix up the binding hack and make it work in NIR
Jason Ekstrand [Fri, 22 May 2015 22:15:08 +0000 (15:15 -0700)]
vk: Actually implement some sort of destructor for all object types
Jason Ekstrand [Thu, 21 May 2015 23:49:55 +0000 (16:49 -0700)]
vk/pipeline: Track VB's that are actually used by the pipeline
Previously, we just blasted out whatever VB's we had marked as "dirty"
regardless of which ones were used by the pipeline. Given that the stride
of the VB is embedded in the pipeline this can cause problems. One problem
is if the pipeline doesn't use the given VB binding we emit a bogus stride.
Another problem is that we weren't properly resetting the dirty bits when
the pipeline changed.
Jason Ekstrand [Thu, 21 May 2015 23:33:04 +0000 (16:33 -0700)]
vk/device: Memset descriptor sets to 0 and handle descriptor set holes
Jason Ekstrand [Thu, 21 May 2015 22:55:27 +0000 (15:55 -0700)]
vk: Do relocations in surface states when they are created
Previously, we waited until later and did a pass through the used surfaces
and did the relocations then. This lead to doing double-relocations which
was causing us to get bogus surface offsets.
Jason Ekstrand [Thu, 21 May 2015 18:59:29 +0000 (11:59 -0700)]
vk/test: Use the glsl_scraper for building shaders
Jason Ekstrand [Thu, 21 May 2015 19:19:24 +0000 (12:19 -0700)]
vk/glsl_scraper: Use the LunarG back-door for GLSL source
Jason Ekstrand [Thu, 21 May 2015 18:40:24 +0000 (11:40 -0700)]
vk/glsl_scraper: Use a fake GLSL version that glslang will accept
Jason Ekstrand [Thu, 21 May 2015 18:31:43 +0000 (11:31 -0700)]
vk: Bake the GLSL_VK_SHADER macro into the scraper output file
Jason Ekstrand [Tue, 19 May 2015 18:28:08 +0000 (11:28 -0700)]
vk/meta: Use glsl_scraper for our GLSL source
We are not yet using SPIR-V for meta but this is a first step.
Jason Ekstrand [Thu, 21 May 2015 18:28:40 +0000 (11:28 -0700)]
vk: More out-of-tree build fixes
Jason Ekstrand [Thu, 21 May 2015 17:23:18 +0000 (10:23 -0700)]
vk: Fix for out-of-tree builds
Kristian Høgsberg [Wed, 20 May 2015 23:42:11 +0000 (16:42 -0700)]
vk: Remove render pass stub call
This isn't really a stub.
Kristian Høgsberg [Sat, 16 May 2015 05:04:52 +0000 (22:04 -0700)]
vk: Add WSI implementation
Kristian Høgsberg [Sat, 16 May 2015 05:04:15 +0000 (22:04 -0700)]
vk: Add debug stubs
Kristian Høgsberg [Wed, 20 May 2015 21:38:11 +0000 (14:38 -0700)]
vk: Mark remaining unsupported formats as such
Kristian Høgsberg [Wed, 20 May 2015 21:36:11 +0000 (14:36 -0700)]
vk: Mark VK_FORMAT_UNDEFINED as 1 cpp, 1 channel
Kristian Høgsberg [Tue, 19 May 2015 21:14:24 +0000 (14:14 -0700)]
vk: Stream surface state instead of using the surface pool
Since the binding table pointer is only 16 bits, we can only have 64kb
of binding table state allocated at any given time. With a block size of
1kb, that amounts to just 64 command buffers, which is not enough.
Kristian Høgsberg [Tue, 19 May 2015 05:08:55 +0000 (22:08 -0700)]
vk: Use surface_format_info from dri driver for vkGetFormatInfo
Chad Versace [Thu, 21 May 2015 02:51:10 +0000 (19:51 -0700)]
vk: Fix result of vkCreateInstance
When fill_physical_device() fails, don't return VK_SUCCESS.
Jason Ekstrand [Thu, 21 May 2015 00:05:38 +0000 (17:05 -0700)]
vk/compiler: Add shader language detection
This commit adds support for the LunarG GLSL back-door as well as detecting
regular GLSL and SPIR-V. The SPIR-V path doesn't exist yet, so that will
cause an assert-fail.
Jason Ekstrand [Wed, 20 May 2015 22:11:08 +0000 (15:11 -0700)]
vk/test: Add a test for testing buffer copies
Jason Ekstrand [Wed, 20 May 2015 23:17:59 +0000 (16:17 -0700)]
vk/meta: Add support for copying arbitrary size buffers
Jason Ekstrand [Wed, 20 May 2015 22:38:11 +0000 (15:38 -0700)]
vk/meta: Use the biggest format possible for buffer copies
This should substantially improve throughput of buffer copies.
Jason Ekstrand [Wed, 20 May 2015 22:11:21 +0000 (15:11 -0700)]
vk/meta: Fix buffer copy extents
Jason Ekstrand [Tue, 19 May 2015 19:43:13 +0000 (12:43 -0700)]
vk/meta: Use texture() instead of texture2D()
Jason Ekstrand [Tue, 19 May 2015 19:42:21 +0000 (12:42 -0700)]
vk: Use binding instead of index in uniform layout qualifiers
This more closely matches what the Vulkan docs say to do.
Jason Ekstrand [Tue, 19 May 2015 18:27:20 +0000 (11:27 -0700)]
vk/glsl_scraper: Add a --glsl-only option
Jason Ekstrand [Tue, 19 May 2015 18:26:35 +0000 (11:26 -0700)]
vk/glsl_scraper: Use the line number from the end of the macro
We used to use the line number from the start of the macro but this doesn't
seem to match the c preprocessor