mesa.git
8 years agovk: Implement scratch buffers to make spilling work
Kristian Høgsberg Kristensen [Fri, 19 Jun 2015 22:41:30 +0000 (15:41 -0700)]
vk: Implement scratch buffers to make spilling work

8 years agovk: Undo relocs for scratch bos
Kristian Høgsberg Kristensen [Thu, 18 Jun 2015 23:17:58 +0000 (16:17 -0700)]
vk: Undo relocs for scratch bos

8 years agovk/allocator: Get rid of non-memfd path
Kristian Høgsberg Kristensen [Thu, 18 Jun 2015 22:50:47 +0000 (15:50 -0700)]
vk/allocator: Get rid of non-memfd path

We can just use modern valgrind now.

8 years agovk/headers: Make General State offsets relocations
Kristian Høgsberg Kristensen [Thu, 18 Jun 2015 18:12:36 +0000 (11:12 -0700)]
vk/headers: Make General State offsets relocations

8 years agovk: Add missing gen7 RENDER_SURFACE_STATE struct
Kristian Høgsberg Kristensen [Sun, 14 Jun 2015 06:12:58 +0000 (23:12 -0700)]
vk: Add missing gen7 RENDER_SURFACE_STATE struct

8 years agovk: Compute CS exec mask and thread width max in pipeline
Kristian Høgsberg Kristensen [Sat, 13 Jun 2015 00:21:01 +0000 (17:21 -0700)]
vk: Compute CS exec mask and thread width max in pipeline

We compute the right mask and thread width max parameters as part of
pipeline creation and set them accordingly at vkCmdDispatch() and
vkCmdDispatchIndirect() time. These parameters depend only on the local
group size and the dispatch width of the program so we can figure this
out at pipeline create time.

8 years agovk: Set binding table layout for CS
Kristian Høgsberg Kristensen [Sat, 13 Jun 2015 00:17:43 +0000 (17:17 -0700)]
vk: Set binding table layout for CS

We weren't setting the binding table layout for the backend compiler.

8 years agovk: Generate CS prog_data into the pipeline instance
Kristian Høgsberg Kristensen [Sat, 13 Jun 2015 00:17:01 +0000 (17:17 -0700)]
vk: Generate CS prog_data into the pipeline instance

We were generating the prog_data into a local variable and never
initializing the pipeline->cs_prog_data one.

8 years agovk: Document how depth/stencil formats work in anv_image_create()
Kristian Høgsberg Kristensen [Fri, 12 Jun 2015 05:07:16 +0000 (22:07 -0700)]
vk: Document how depth/stencil formats work in anv_image_create()

This reverts commits

  e17ed04 * vk/image: Don't double-allocate stencil buffers
  1ee2d1c * vk/image: Teach anv_image_choose_tile_mode about WMAJOR

and instead adds a comment to describe the subtlety of how we create
images for stencil only formats.

8 years agovk: Use compute pipeline layout when binding compute sets
Kristian Høgsberg Kristensen [Fri, 12 Jun 2015 04:57:43 +0000 (21:57 -0700)]
vk: Use compute pipeline layout when binding compute sets

8 years agovk: Implement basic compute shader support
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 22:31:42 +0000 (15:31 -0700)]
vk: Implement basic compute shader support

8 years agovk: Emit PIPELINE_SELECT on demand
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 22:21:49 +0000 (15:21 -0700)]
vk: Emit PIPELINE_SELECT on demand

8 years agovk: Stop asserting we have a fragment shader
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 22:07:38 +0000 (15:07 -0700)]
vk: Stop asserting we have a fragment shader

Even for graphics, this is not a requirement, we can have a depth-only output pipeline.

8 years agovk: Defer setting viewport dynamic state
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 22:04:09 +0000 (15:04 -0700)]
vk: Defer setting viewport dynamic state

We can't emit this until we've done a 3D pipeline select.

8 years agovk: Disable shader stages in the graphics pipeline batch
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 21:58:31 +0000 (14:58 -0700)]
vk: Disable shader stages in the graphics pipeline batch

We need to move this into the graphics pipeline batch so we don't  emit it
for compute pipelines.

8 years agovk: Don't emit STATE_SIP
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 21:56:29 +0000 (14:56 -0700)]
vk: Don't emit STATE_SIP

We don't have a SIP kernel and don't enable exceptions.

8 years agovk: Compile fragment shader after VS and GS
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 21:55:50 +0000 (14:55 -0700)]
vk: Compile fragment shader after VS and GS

Just moving code around to do shader stages in the natual order.

8 years agovk/entrypoints: Don't print every single function call
Jason Ekstrand [Thu, 11 Jun 2015 17:09:58 +0000 (10:09 -0700)]
vk/entrypoints: Don't print every single function call

8 years agovk: Remove left-over trp call
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 16:16:46 +0000 (09:16 -0700)]
vk: Remove left-over trp call

8 years agovk: Set maximum point size range
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 06:13:24 +0000 (23:13 -0700)]
vk: Set maximum point size range

We set both minimum and maximum point size to 0 in 3DSTATE_CLIP, which
will clip away all points.

8 years agovk: Use generated headers with fixed point support
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 06:11:37 +0000 (23:11 -0700)]
vk: Use generated headers with fixed point support

The generated headers now convert float in the template struct to the
correct fixed point format.

8 years agovk: Regenerate headers with __gen_validate_value()
Kristian Høgsberg Kristensen [Thu, 11 Jun 2015 05:06:46 +0000 (22:06 -0700)]
vk: Regenerate headers with __gen_validate_value()

8 years agovk/formats: Refactor format properties code
Jason Ekstrand [Thu, 11 Jun 2015 16:11:14 +0000 (09:11 -0700)]
vk/formats: Refactor format properties code

Along with the refactor, we now do the right thing when we hit an
unsupported format: Set the flags to 0 and return VK_SUCCESS.

8 years agovk/image: Add a bunch of asserts
Jason Ekstrand [Thu, 11 Jun 2015 04:04:51 +0000 (21:04 -0700)]
vk/image: Add a bunch of asserts

8 years agovk: Add a couple vk_error calls
Jason Ekstrand [Thu, 11 Jun 2015 04:04:13 +0000 (21:04 -0700)]
vk: Add a couple vk_error calls

8 years agovk/private: Add a non-fatal assert
Jason Ekstrand [Thu, 11 Jun 2015 04:03:50 +0000 (21:03 -0700)]
vk/private: Add a non-fatal assert

8 years agovk/cmd: Add an initial implementation of PipelineBarrier
Jason Ekstrand [Wed, 10 Jun 2015 23:37:31 +0000 (16:37 -0700)]
vk/cmd: Add an initial implementation of PipelineBarrier

We may want to do something more inteligent here later such as actually
handling image layout transitions.  However, this should do for now.

8 years agovk/emit: Use valgrind to validate every packed field
Jason Ekstrand [Wed, 10 Jun 2015 19:43:02 +0000 (12:43 -0700)]
vk/emit: Use valgrind to validate every packed field

8 years agovk: Add valgrind checks in various emit functions
Jason Ekstrand [Wed, 10 Jun 2015 04:36:12 +0000 (21:36 -0700)]
vk: Add valgrind checks in various emit functions

The check in batch_bo_finish should catch any undefined values in the batch
but isn't that great for debugging.  The checks in the various emit
functions will help get better granularity.

8 years agovk: Move the valgrind include and VG() macro to private.h
Jason Ekstrand [Wed, 10 Jun 2015 04:13:36 +0000 (21:13 -0700)]
vk: Move the valgrind include and VG() macro to private.h

8 years agovk/image: Don't double-allocate stencil buffers
Chad Versace [Tue, 9 Jun 2015 22:01:18 +0000 (15:01 -0700)]
vk/image: Don't double-allocate stencil buffers

If the main surface has format S8_UINT, then don't allocate the
auxiliary stencil surface.

8 years agovk/image: Teach anv_image_choose_tile_mode about WMAJOR
Chad Versace [Tue, 9 Jun 2015 21:56:58 +0000 (14:56 -0700)]
vk/image: Teach anv_image_choose_tile_mode about WMAJOR

8 years agovk/util: Add anv_abortf(), anv_abortfv()
Chad Versace [Tue, 9 Jun 2015 21:54:53 +0000 (14:54 -0700)]
vk/util: Add anv_abortf(), anv_abortfv()

Convenience functions to print an error message then abort.

8 years agovk: Define anv_noreturn macro
Chad Versace [Tue, 9 Jun 2015 21:54:40 +0000 (14:54 -0700)]
vk: Define anv_noreturn macro

8 years agovk/image: Factor tile mode selection into separate function
Chad Versace [Tue, 9 Jun 2015 21:33:05 +0000 (14:33 -0700)]
vk/image: Factor tile mode selection into separate function

Because it will eventually need to get smarter.

8 years agovk/device: Actually allow destruction
Jason Ekstrand [Tue, 9 Jun 2015 23:28:46 +0000 (16:28 -0700)]
vk/device: Actually allow destruction

8 years agovk/cmd_buffer: Properly initialize/reset dynamic states
Jason Ekstrand [Tue, 9 Jun 2015 23:27:55 +0000 (16:27 -0700)]
vk/cmd_buffer: Properly initialize/reset dynamic states

8 years agovk/pipeline: Zero out the depth-stencil state when not in use
Jason Ekstrand [Tue, 9 Jun 2015 23:26:55 +0000 (16:26 -0700)]
vk/pipeline: Zero out the depth-stencil state when not in use

8 years agovk/device: Use anv_CreateDynamicViewportState instead of the vk one
Jason Ekstrand [Tue, 9 Jun 2015 23:01:56 +0000 (16:01 -0700)]
vk/device: Use anv_CreateDynamicViewportState instead of the vk one

8 years agovk/device: Dedent the vkCreateDynamicViewportState call
Jason Ekstrand [Tue, 9 Jun 2015 22:53:10 +0000 (15:53 -0700)]
vk/device: Dedent the vkCreateDynamicViewportState call

8 years agovk/util: Annotate anv_finishme() as printflike
Chad Versace [Tue, 9 Jun 2015 21:46:18 +0000 (14:46 -0700)]
vk/util: Annotate anv_finishme() as printflike

8 years agovk: Define anv_printflike() macro
Chad Versace [Tue, 9 Jun 2015 21:45:58 +0000 (14:45 -0700)]
vk: Define anv_printflike() macro

8 years agovk/image: Stop hardcoding alignment of stencil surfaces
Chad Versace [Tue, 9 Jun 2015 21:03:44 +0000 (14:03 -0700)]
vk/image: Stop hardcoding alignment of stencil surfaces

Look up the alignment from anv_tile_info_table.

8 years agovk/image: Rewrite tile info table
Chad Versace [Tue, 9 Jun 2015 20:29:08 +0000 (13:29 -0700)]
vk/image: Rewrite tile info table

- Reduce the number of table lookups in anv_image_create from 4 to 1.
- Add field for surface alignment.
- Shorten field names tile_width, tile_height -> width, height.

8 years agovk/image: Delete an old comment
Chad Versace [Tue, 9 Jun 2015 20:13:32 +0000 (13:13 -0700)]
vk/image: Delete an old comment

8 years agovk/compiler: Free the GL errors data
Jason Ekstrand [Tue, 9 Jun 2015 19:35:21 +0000 (12:35 -0700)]
vk/compiler: Free the GL errors data

8 years agovk/compiler: Free more of prog_data when tearing down a pipeline
Jason Ekstrand [Tue, 9 Jun 2015 19:29:37 +0000 (12:29 -0700)]
vk/compiler: Free more of prog_data when tearing down a pipeline

8 years agovk/queue: Embed the queue in and allocate it with the device
Jason Ekstrand [Tue, 9 Jun 2015 19:28:58 +0000 (12:28 -0700)]
vk/queue: Embed the queue in and allocate it with the device

8 years agovk/device: Free border color states when we have valgrind
Jason Ekstrand [Tue, 9 Jun 2015 18:41:31 +0000 (11:41 -0700)]
vk/device: Free border color states when we have valgrind

8 years agovk/device: Destroy all batch buffers
Jason Ekstrand [Tue, 9 Jun 2015 18:40:22 +0000 (11:40 -0700)]
vk/device: Destroy all batch buffers

Due to a copy+paste error, we were destroying all but the first batch or
surface state buffer.  Now we destroy them all.

8 years agovk/meta: Clean up temporary objects
Jason Ekstrand [Tue, 9 Jun 2015 18:08:51 +0000 (11:08 -0700)]
vk/meta: Clean up temporary objects

8 years agovk/surface_view: Add a destructor
Jason Ekstrand [Tue, 9 Jun 2015 18:08:03 +0000 (11:08 -0700)]
vk/surface_view: Add a destructor

8 years agovk/image: Add anv_image::h_align,v_align
Chad Versace [Tue, 9 Jun 2015 19:11:46 +0000 (12:11 -0700)]
vk/image: Add anv_image::h_align,v_align

Use the new fields to compute RENDER_SURFACE_STATE.Surface*Alignment.
We still hardcode them to 4, though.

8 years agovk/allocator: Remove the concept of a slave block pool
Jason Ekstrand [Tue, 9 Jun 2015 00:46:32 +0000 (17:46 -0700)]
vk/allocator: Remove the concept of a slave block pool

This reverts commit d24f8245db3418d8d146f373e085780d2217335c.

8 years agovk/device: Remove the binding table pools/streams
Jason Ekstrand [Tue, 9 Jun 2015 00:45:57 +0000 (17:45 -0700)]
vk/device: Remove the binding table pools/streams

8 years agovk/pipeline: Move freeing the program stream to pipeline.c
Jason Ekstrand [Mon, 8 Jun 2015 21:27:02 +0000 (14:27 -0700)]
vk/pipeline: Move freeing the program stream to pipeline.c

It's created in pipeline.c so we should free it there.

8 years agovk/pipeline: Don't destroy the program stream
Jason Ekstrand [Mon, 8 Jun 2015 20:52:34 +0000 (13:52 -0700)]
vk/pipeline: Don't destroy the program stream

It's freed in compiler.cpp and we don't want to free it twice.

8 years agovk/allocator: Make the use of NULL_BLOCK in state_stream_finish explicit
Jason Ekstrand [Mon, 8 Jun 2015 20:50:52 +0000 (13:50 -0700)]
vk/allocator: Make the use of NULL_BLOCK in state_stream_finish explicit

8 years agovk: Quiet a few warnings
Kristian Høgsberg Kristensen [Fri, 5 Jun 2015 18:51:30 +0000 (11:51 -0700)]
vk: Quiet a few warnings

8 years agovk: Create a minimal context for the compiler
Kristian Høgsberg Kristensen [Thu, 4 Jun 2015 06:03:29 +0000 (23:03 -0700)]
vk: Create a minimal context for the compiler

This avoids the full brw context initialization and just sets up context
constants, initializes extensions and sets a few driver vfuncs for the
front-end GLSL compiler.

8 years agovk/cmd_buffer: Use the dynamic state stream in emit_dynamic and merge_dynamic
Jason Ekstrand [Sat, 6 Jun 2015 00:14:41 +0000 (17:14 -0700)]
vk/cmd_buffer: Use the dynamic state stream in emit_dynamic and merge_dynamic

8 years agovk/device: Use a 64-byte alignment for CC state
Jason Ekstrand [Sat, 6 Jun 2015 00:26:01 +0000 (17:26 -0700)]
vk/device: Use a 64-byte alignment for CC state

8 years agovk/pipeline: Actually free the program stream and dynamic pool
Jason Ekstrand [Sat, 6 Jun 2015 00:14:57 +0000 (17:14 -0700)]
vk/pipeline: Actually free the program stream and dynamic pool

8 years agovk/allocator: Avoid double-free in the bo pool
Jason Ekstrand [Sat, 6 Jun 2015 00:11:49 +0000 (17:11 -0700)]
vk/allocator: Avoid double-free in the bo pool

8 years agovk/gem: Call VALGRIND_FREELIKE_BLOCK before unmapping
Jason Ekstrand [Fri, 5 Jun 2015 23:41:49 +0000 (16:41 -0700)]
vk/gem: Call VALGRIND_FREELIKE_BLOCK before unmapping

9 years agovk: Fix 2 incorrect typecasts
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.

9 years agovk: Make `make clean` remove generated spirv headers
Chad Versace [Thu, 4 Jun 2015 21:26:03 +0000 (14:26 -0700)]
vk: Make `make clean` remove generated spirv headers

9 years agovk/allocator: Remove an unneeded VG() wrapper
Jason Ekstrand [Thu, 4 Jun 2015 16:12:37 +0000 (09:12 -0700)]
vk/allocator: Remove an unneeded VG() wrapper

9 years agovk/device: Dissalow device destruction
Jason Ekstrand [Thu, 4 Jun 2015 16:06:59 +0000 (09:06 -0700)]
vk/device: Dissalow device destruction

9 years agovk: Fix build
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.

9 years agovk/DS: Mask stencil masks to 8 bits
Jason Ekstrand [Wed, 3 Jun 2015 23:59:13 +0000 (16:59 -0700)]
vk/DS: Mask stencil masks to 8 bits

9 years agovk: Set color/blend state in meta clear if not set yet
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

9 years agovk: Delete vk.c test case
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.

9 years agovk: Update generated headers with support for 64 bit fields
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

9 years agovk: Set cb_state to NULL at cmd buffer create time
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.

9 years agovk: Implement vertexOffset parameter of vkCmdDrawIndexed()
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.

9 years agovk/formats: Add a name to the metadata and better logging
Jason Ekstrand [Tue, 2 Jun 2015 18:03:22 +0000 (11:03 -0700)]
vk/formats: Add a name to the metadata and better logging

9 years agovk/formats: Rework the formats table
Jason Ekstrand [Tue, 2 Jun 2015 18:01:41 +0000 (11:01 -0700)]
vk/formats: Rework the formats table

9 years agovk: Move query related functionality to new file query.c
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

9 years agoi965: Use NIR by default for vertex shaders on GEN8+
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>
9 years agovk/compiler: Add an index_count to the bind map and check for OOB
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

9 years agovk/HACK: Plumb real descriptor set/index into textures
Jason Ekstrand [Mon, 1 Jun 2015 17:01:23 +0000 (10:01 -0700)]
vk/HACK: Plumb real descriptor set/index into textures

9 years agoNIR: Add a helper for doing sampler lowering for vulkan
Jason Ekstrand [Mon, 1 Jun 2015 17:00:44 +0000 (10:00 -0700)]
NIR: Add a helper for doing sampler lowering for vulkan

9 years agovk: Indent tables to align '=' at column 48
Kristian Høgsberg Kristensen [Mon, 1 Jun 2015 05:35:11 +0000 (22:35 -0700)]
vk: Indent tables to align '=' at column 48

9 years agovk: Add support for anisotropic bits
Kristian Høgsberg Kristensen [Mon, 1 Jun 2015 05:15:34 +0000 (22:15 -0700)]
vk: Add support for anisotropic bits

9 years agovk: Implement support for sampler border colors
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.

9 years agovk/device: Only flush the texture cache when setting state base address
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.

9 years agovk/cmd_buffer: Track descriptor set dirtying per-stage
Jason Ekstrand [Sat, 30 May 2015 17:07:29 +0000 (10:07 -0700)]
vk/cmd_buffer: Track descriptor set dirtying per-stage

9 years agovk/device: Emit PIPE_CONTROL flushes surrounding new STATE_BASE_ADDRESS
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.

9 years agovk/allocator: Don't call VALGRIND_MALLOCLIKE_BLOCK on fresh gem_mmap's
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

9 years agovk: Don't crash on partial descriptor sets
Jason Ekstrand [Sat, 30 May 2015 03:43:10 +0000 (20:43 -0700)]
vk: Don't crash on partial descriptor sets

9 years agovk/device: Allow for starting a new surface state buffer
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.

9 years agovk/device: Do lazy surface state emission for binding tables
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.

9 years agovk: Store dynamic slot index with struct anv_descriptor_slot
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.

9 years agovk: Implement dynamic buffer offsets
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.

9 years agovk/device: Split state base address emit into its own function
Jason Ekstrand [Thu, 28 May 2015 22:34:08 +0000 (15:34 -0700)]
vk/device: Split state base address emit into its own function

9 years agovk/device: Use anv_batch_emit for MI_BATCH_BUFFER_START
Jason Ekstrand [Thu, 28 May 2015 22:25:02 +0000 (15:25 -0700)]
vk/device: Use anv_batch_emit for MI_BATCH_BUFFER_START

9 years agovk/device: Actually destroy batch buffers
Jason Ekstrand [Thu, 28 May 2015 20:08:21 +0000 (13:08 -0700)]
vk/device: Actually destroy batch buffers

9 years agovk/query: Don't emit a CS stall by itself
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.

9 years agovk/device: Fixups for batch buffer chaining
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.