mesa.git
8 years agoanv/batch_chain: Add a _alloc_binding_table function
Jason Ekstrand [Tue, 22 Sep 2015 00:05:51 +0000 (17:05 -0700)]
anv/batch_chain: Add a _alloc_binding_table function

8 years agoanv: Make anv_state.offset an int32_t
Jason Ekstrand [Mon, 21 Sep 2015 23:59:21 +0000 (16:59 -0700)]
anv: Make anv_state.offset an int32_t

Binding tables will have a negative offset and we need a way to express
that.  Besides, the chances of a state offset being larger than 2 GB is so
remote it's not worth thinking about.

8 years agoanv/wsi_wayland: Fix FIFO mode
Jason Ekstrand [Mon, 28 Sep 2015 22:56:14 +0000 (15:56 -0700)]
anv/wsi_wayland: Fix FIFO mode

Previously, there were a number of things we were doing wrong:

 1) We weren't flushing the wl_display so dead-looping clients weren't
    guaranteed to work.
 2) We were sending the frame event after calling wl_surface.commit() so it
    wasn't getting assigned to the correct frame
 3) We weren't actually setting fifo_ready to false.

Unfortunately, we never noticed because (3) was hiding the other two.  This
commit fixes all three and clients that use FIFO mode are now properly
refresh-rate limited.

8 years agovk: Implement vkGetPhysicalDeviceImageFormatProperties()
Chad Versace [Mon, 28 Sep 2015 18:46:38 +0000 (11:46 -0700)]
vk: Implement vkGetPhysicalDeviceImageFormatProperties()

The implementation is incomplete because we lie about
VkImageFormatProperties::maxResourceSize, hardcoding it to UINT32_MAX
for all supported cases.

8 years agovk: Refactor anv_GetPhysicalDeviceFormatProperties()
Chad Versace [Mon, 28 Sep 2015 18:02:53 +0000 (11:02 -0700)]
vk: Refactor anv_GetPhysicalDeviceFormatProperties()

Move the bulk of the function body to a new function
anv_physical_device_get_format_properties(). This allows us to reuse the
function when implementing anv_GetPhysicalDeviceImageFormatProperties()
without calling into the public entry point.

8 years agovk: Advertise that depthstencil formats support sampling
Chad Versace [Mon, 28 Sep 2015 17:52:11 +0000 (10:52 -0700)]
vk: Advertise that depthstencil formats support sampling

Let vkGetPhysicalDeviceFormatProperties() set
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT for tiled depthstencil images.

8 years agoanv/device: Wrap a couple valgrind calls in the VG macro
Jason Ekstrand [Mon, 28 Sep 2015 18:08:50 +0000 (11:08 -0700)]
anv/device: Wrap a couple valgrind calls in the VG macro

This fixes the build for systems that don't have valgrind devel packages
installed.

8 years agovk: Fix vkGetPhysicalDeviceSparseImageFormatProperties()
Chad Versace [Mon, 28 Sep 2015 17:16:03 +0000 (10:16 -0700)]
vk: Fix vkGetPhysicalDeviceSparseImageFormatProperties()

The driver does not yet support sparse images, so return zero properties for
all formats.

8 years agovk: Add anv_icd.json to .gitignore
Kristian Høgsberg Kristensen [Fri, 25 Sep 2015 22:16:56 +0000 (15:16 -0700)]
vk: Add anv_icd.json to .gitignore

8 years agovk: Also define vk_errorf in non-debug builds
Kristian Høgsberg Kristensen [Fri, 25 Sep 2015 22:15:37 +0000 (15:15 -0700)]
vk: Also define vk_errorf in non-debug builds

8 years agovk: Roll back GLSL parser support for vulkan
Kristian Høgsberg Kristensen [Fri, 25 Sep 2015 17:42:07 +0000 (10:42 -0700)]
vk: Roll back GLSL parser support for vulkan

In the interest of reducing our delta to mesa master, let's undo these
changes now that we only support SPIR-V.

8 years agovk: Add an ICD declaration file
Jason Ekstrand [Thu, 24 Sep 2015 18:47:19 +0000 (11:47 -0700)]
vk: Add an ICD declaration file

8 years agoanv: Add support for the ICD loader
Jason Ekstrand [Thu, 24 Sep 2015 20:51:40 +0000 (13:51 -0700)]
anv: Add support for the ICD loader

8 years agoanv: Add a global dispatch table for use in meta operations
Jason Ekstrand [Thu, 24 Sep 2015 21:20:35 +0000 (14:20 -0700)]
anv: Add a global dispatch table for use in meta operations

8 years agoanv/entrypoints: Expose the anv_resolve_entrypoint function
Jason Ekstrand [Thu, 24 Sep 2015 21:20:07 +0000 (14:20 -0700)]
anv/entrypoints: Expose the anv_resolve_entrypoint function

8 years agoanv/entrypoints: Rename anv_layer to anv_dispatch_table
Jason Ekstrand [Thu, 24 Sep 2015 20:51:54 +0000 (13:51 -0700)]
anv/entrypoints: Rename anv_layer to anv_dispatch_table

8 years agoanv/batch_chain: Remove the current_surface_bo helper
Jason Ekstrand [Thu, 24 Sep 2015 15:46:39 +0000 (08:46 -0700)]
anv/batch_chain: Remove the current_surface_bo helper

It's no longer used outside anv_batch_chain so we certainly don't need to
be exporting.  Inside anv_batch_chain, it's only used twice and it can be
replaced by a single line so there's really no point.

8 years agoanv/cmd_buffer: Add a helper for getting the surface state base address
Jason Ekstrand [Tue, 22 Sep 2015 17:58:34 +0000 (10:58 -0700)]
anv/cmd_buffer: Add a helper for getting the surface state base address

8 years agoanv/allocator: Don't ever call mremap
Jason Ekstrand [Wed, 23 Sep 2015 21:20:23 +0000 (14:20 -0700)]
anv/allocator: Don't ever call mremap

This has always been a bit sketchy and neither Kristian nor I have ever
really liked it.

8 years agoanv/allocator: Delete the unused center_fd_offset from anv_block_pool
Jason Ekstrand [Wed, 23 Sep 2015 21:21:16 +0000 (14:21 -0700)]
anv/allocator: Delete the unused center_fd_offset from anv_block_pool

8 years agoanv/allocator: Do a better job of centering bi-directional block pools
Jason Ekstrand [Wed, 23 Sep 2015 21:20:04 +0000 (14:20 -0700)]
anv/allocator: Do a better job of centering bi-directional block pools

8 years agoanv/batch_chain: Clean up the reloc list swapping code
Jason Ekstrand [Thu, 24 Sep 2015 00:16:40 +0000 (17:16 -0700)]
anv/batch_chain: Clean up the reloc list swapping code

8 years agoanv/meta: Add location specifiers to meta shaders
Jason Ekstrand [Mon, 21 Sep 2015 23:21:56 +0000 (16:21 -0700)]
anv/meta: Add location specifiers to meta shaders

8 years agoMerge branch 'nir-spirv' into vulkan
Jason Ekstrand [Fri, 18 Sep 2015 03:03:40 +0000 (20:03 -0700)]
Merge branch 'nir-spirv' into vulkan

8 years agonir/spirv: Add better location handling
Jason Ekstrand [Fri, 18 Sep 2015 02:54:18 +0000 (19:54 -0700)]
nir/spirv: Add better location handling

Previously, our location handling was focussed on either no location
(usually implicit 0) or a builting.  Unfortunately, if you gave it a
location, it would blow it away and just not care.  This worked fine with
crucible and our meta shaders but didn't work with the CTS.  The new code
uses the "data.explicit_location" field to denote that it has a "final"
location (usually from a builtin) and, otherwise, the location is
considered to be relative to the base for that shader stage.

8 years agoanv/device: Move mutex initialization to befor block pools
Jason Ekstrand [Fri, 18 Sep 2015 01:23:21 +0000 (18:23 -0700)]
anv/device: Move mutex initialization to befor block pools

8 years agometa: Initial support for packing parameters
Jason Ekstrand [Thu, 17 Sep 2015 21:24:50 +0000 (14:24 -0700)]
meta: Initial support for packing parameters

Probably incomplete but it should do for now

8 years agoanv/meta: Pass the depth through the clear vertex shader
Jason Ekstrand [Thu, 17 Sep 2015 23:28:42 +0000 (16:28 -0700)]
anv/meta: Pass the depth through the clear vertex shader

It shouldn't matter since we shut off the VS but it's at least clearer.

8 years agoanv/formats: Properly report depth-stencil formats
Jason Ekstrand [Thu, 17 Sep 2015 19:36:23 +0000 (12:36 -0700)]
anv/formats: Properly report depth-stencil formats

8 years agovk/device: Don't allow device or instance creation with invalid extensions
Jason Ekstrand [Thu, 17 Sep 2015 18:19:16 +0000 (11:19 -0700)]
vk/device: Don't allow device or instance creation with invalid extensions

8 years agoanv/tests: Add some asserts for data integrity in block_pool_no_free
Jason Ekstrand [Wed, 16 Sep 2015 04:37:01 +0000 (21:37 -0700)]
anv/tests: Add some asserts for data integrity in block_pool_no_free

8 years agoanv/allocator: Make the block pool double-ended
Jason Ekstrand [Wed, 16 Sep 2015 00:46:09 +0000 (17:46 -0700)]
anv/allocator: Make the block pool double-ended

This allows us to allocate from either side of the block pool in a
consistent way.  If you use the previous block_pool_alloc function, you
will get offsets from the start of the pool as normal.  If you use the new
block_pool_alloc_back function, you will get a negative index that
corresponds to something in the "back" of the pool.

8 years agoanv/tests: Refactor the block_pool_no_free test
Jason Ekstrand [Wed, 16 Sep 2015 00:57:40 +0000 (17:57 -0700)]
anv/tests: Refactor the block_pool_no_free test

This simply breaks the monotonicity check out into its own function

8 years agovk/allocator: Split block_pool_alloc into two functions
Jason Ekstrand [Wed, 16 Sep 2015 00:43:47 +0000 (17:43 -0700)]
vk/allocator: Split block_pool_alloc into two functions

8 years agoanv/allocator: Use a signed 32-bit offset for the free list
Jason Ekstrand [Tue, 15 Sep 2015 22:00:43 +0000 (15:00 -0700)]
anv/allocator: Use a signed 32-bit offset for the free list

This has the unfortunate side-effect of making it so that we can't have a
block pool bigger than 1GB.  However, that's unlikely to happen and, for
the sake of bi-directional block pools, we need to negative offsets.

8 years agoanv/allocator: Create 2GB memfd up-front for the block pool
Jason Ekstrand [Tue, 15 Sep 2015 23:54:56 +0000 (16:54 -0700)]
anv/allocator: Create 2GB memfd up-front for the block pool

8 years agoanv/allocator: Take the device mutex when growing a block pool
Jason Ekstrand [Tue, 15 Sep 2015 21:52:26 +0000 (14:52 -0700)]
anv/allocator: Take the device mutex when growing a block pool

We don't have any locking issues yet because we use the pool size itself as
a mutex in block_pool_alloc to guarantee that only one thread is resizing
at a time.  However, we are about to add support for growing the block pool
at both ends.  This introduces two potential races:

 1) You could have two block_pool_alloc() calls that both try to grow the
    block pool, one from each end.

 2) The relocation handling code will now have to think about not only the
    bo that we use for the block pool but also the offset from the start of
    that bo to the center of the block pool.  It's possible that the block
    pool growing code could race with the relocation handling code and get
    a bo and offset out of sync.

Grabbing the device mutex solves both of these problems.  Thanks to (2), we
can't really do anything more granular.

8 years agoanv: Document the index and offset parameters of anv_bo
Jason Ekstrand [Tue, 15 Sep 2015 22:59:23 +0000 (15:59 -0700)]
anv: Document the index and offset parameters of anv_bo

8 years agovk/image: Remove stale FINISHME for non-2D image views
Chad Versace [Mon, 14 Sep 2015 22:16:57 +0000 (15:16 -0700)]
vk/image: Remove stale FINISHME for non-2D image views

gen8_image_view_init() now supports 1D, 2D, and 3D image views.

8 years agovk/image: Teach vkCreateImage about layout of 1D surfaces
Chad Versace [Mon, 14 Sep 2015 21:37:09 +0000 (14:37 -0700)]
vk/image: Teach vkCreateImage about layout of 1D surfaces

Calling vkCreateImage() with VK_IMAGE_TYPE_1D now succeeds and computes
the surface layout correctly.

8 years agovk/meta: Partially implement vkCmdCopy*, vkCmdBlit* for 3D images
Chad Versace [Mon, 14 Sep 2015 18:45:35 +0000 (11:45 -0700)]
vk/meta: Partially implement vkCmdCopy*, vkCmdBlit* for 3D images

Partially implement the below functions for 3D images:
    vkCmdCopyBufferToImage
    vkCmdCopyImageToBuffer
    vkCmdCopyImage
    vkCmdBlitImage

Not all features work, and there is much for performance improvement.
Beware that vkCmdCopyImage and vkCmdBlitImage are untested.  Crucible
proves that vkCmdCopyBufferToImage and vkCmdCopyImageToBuffer works,
though.

Supported:
    - copy regions with z offset

Unsupported:
    - copy regions with extent.depth > 1

Crucible test results on master@d452d2b are:
    pass: func.miptree.r8g8b8a8-unorm.*.view-3d.*
    pass: func.miptree.d32-sfloat.*.view-3d.*
    fail: func.miptree.s8-uint.*.view-3d.*

8 years agovk/meta: Rename meta_emit_blit() params
Chad Versace [Mon, 14 Sep 2015 18:42:46 +0000 (11:42 -0700)]
vk/meta: Rename meta_emit_blit() params

Rename src -> src_view and dest -> dest_view. This reduces noise in the next
patch's diff, which adds new params to the function.

8 years agovk/gen8: Set RENDER_SURFACE_STATE::RenderTargetViewExtent
Chad Versace [Mon, 14 Sep 2015 18:20:25 +0000 (11:20 -0700)]
vk/gen8: Set RENDER_SURFACE_STATE::RenderTargetViewExtent

8 years agovk/gen8: Refactor setting of SURFACE_STATE::Depth
Chad Versace [Mon, 14 Sep 2015 18:14:21 +0000 (11:14 -0700)]
vk/gen8: Refactor setting of SURFACE_STATE::Depth

The field's meaning depends on SURFACE_STATE::SurfaceType.
Make that correlation explicit by switching on VkImageType.
For good measure, add some PRM quotes too.

8 years agovk: Teach vkCreateImage about layout of 3D surfaces
Chad Versace [Mon, 14 Sep 2015 18:04:08 +0000 (11:04 -0700)]
vk: Teach vkCreateImage about layout of 3D surfaces

Calling vkCreateImage() with VK_IMAGE_TYPE_3D now succeeds and computes
the surface layout correctly. However, 3D images do not yet work for
many other Vulkan entrypoints.

8 years agovk: Refactor anv_image_make_surface()
Chad Versace [Mon, 14 Sep 2015 17:58:43 +0000 (10:58 -0700)]
vk: Refactor anv_image_make_surface()

Move the code that calculates the layout of 2D surfaces into a switch case.

8 years agovk: Use push constants for dynamic buffers
Jason Ekstrand [Fri, 11 Sep 2015 22:56:19 +0000 (15:56 -0700)]
vk: Use push constants for dynamic buffers

8 years agovk/compiler: Rework create_params_array
Jason Ekstrand [Fri, 11 Sep 2015 22:55:54 +0000 (15:55 -0700)]
vk/compiler: Rework create_params_array

8 years agovk/compiler: Add a NIR pass for pushing dynamic buffer offset
Jason Ekstrand [Fri, 11 Sep 2015 22:53:53 +0000 (15:53 -0700)]
vk/compiler: Add a NIR pass for pushing dynamic buffer offset

This commit just adds the NIR pass but does none of the uniform setup

8 years agovk/pipeline_layout: Add dynamic_offset_start and has_dynamic_offsets fields
Jason Ekstrand [Fri, 11 Sep 2015 22:52:43 +0000 (15:52 -0700)]
vk/pipeline_layout: Add dynamic_offset_start and has_dynamic_offsets fields

8 years agovk/pipeline_layout: Move surface/sampler start from SoA to AoS
Jason Ekstrand [Fri, 11 Sep 2015 17:41:57 +0000 (10:41 -0700)]
vk/pipeline_layout: Move surface/sampler start from SoA to AoS

This makes more sense to me and it's more consistent with
anv_descriptor_set_layout.

8 years agovk: Rework the push constants data structure
Jason Ekstrand [Fri, 11 Sep 2015 17:25:21 +0000 (10:25 -0700)]
vk: Rework the push constants data structure

Previously, we simply had a big blob of stuff for "driver constants".  Now,
we have a very specific data structure that contains the driver constants
that we care about.

8 years agoAdd the wayland protocol files to .gitignire
Jason Ekstrand [Fri, 11 Sep 2015 16:29:40 +0000 (09:29 -0700)]
Add the wayland protocol files to .gitignire

8 years agovk/error: Handle ERROR_OUT_OF_DATE_WSI
Jason Ekstrand [Tue, 8 Sep 2015 19:13:07 +0000 (12:13 -0700)]
vk/error: Handle ERROR_OUT_OF_DATE_WSI

8 years agovk/wsi/x11: Actually block on X so we don't re-use busy buffers
Jason Ekstrand [Tue, 8 Sep 2015 18:51:47 +0000 (11:51 -0700)]
vk/wsi/x11: Actually block on X so we don't re-use busy buffers

8 years agovk: Add the WSI header files
Jason Ekstrand [Tue, 8 Sep 2015 17:33:46 +0000 (10:33 -0700)]
vk: Add the WSI header files

8 years agoMerge branch 'nir-spirv' into vulkan
Jason Ekstrand [Sat, 5 Sep 2015 21:12:59 +0000 (14:12 -0700)]
Merge branch 'nir-spirv' into vulkan

8 years agonir/spirv.h: Remove some cruft missed while merging
Jason Ekstrand [Sat, 5 Sep 2015 21:11:40 +0000 (14:11 -0700)]
nir/spirv.h: Remove some cruft missed while merging

There were merge conflicts in spirv.h that got missed because they were in
a comment and so it still compiled.  This gets rid of them and we should be
on-par with upstream spirv->nir.

8 years agonir/spirv: Add support for most of the rest of texturing
Jason Ekstrand [Sat, 5 Sep 2015 21:09:15 +0000 (14:09 -0700)]
nir/spirv: Add support for most of the rest of texturing

Assuming this all works, about the only thing left should be some
corner-cases for tg4

8 years agoMerge branch 'nir-spirv' into vulkan
Jason Ekstrand [Sat, 5 Sep 2015 20:17:53 +0000 (13:17 -0700)]
Merge branch 'nir-spirv' into vulkan

8 years agonir/spirv: Handle decorations after assigning variable locations
Jason Ekstrand [Sat, 5 Sep 2015 20:16:49 +0000 (13:16 -0700)]
nir/spirv: Handle decorations after assigning variable locations

8 years agoMerge branch 'nir-spirv' into vulkan
Jason Ekstrand [Sat, 5 Sep 2015 16:48:15 +0000 (09:48 -0700)]
Merge branch 'nir-spirv' into vulkan

8 years agonir/spirv: Handle the MatrixStride member decoration
Jason Ekstrand [Sat, 5 Sep 2015 16:47:11 +0000 (09:47 -0700)]
nir/spirv: Handle the MatrixStride member decoration

8 years agovk: Actually link in wayland libraries
Jason Ekstrand [Sat, 5 Sep 2015 03:02:36 +0000 (20:02 -0700)]
vk: Actually link in wayland libraries

Turns out this was why I had accidentally broken the universe.  Oops...

8 years agovk: Conditionally compile Wayland support
Jason Ekstrand [Sat, 5 Sep 2015 02:18:50 +0000 (19:18 -0700)]
vk: Conditionally compile Wayland support

Pulling in libwayland causes undefined symbols in applications that are
linked against vulkan alone.  Ideally, we would like to dlopen a platform
support library or something like that.  For now, this works and should get
crucible running again.

8 years agovk: Fix size return value handling in a couple plces
Jason Ekstrand [Sat, 5 Sep 2015 02:05:51 +0000 (19:05 -0700)]
vk: Fix size return value handling in a couple plces

8 years agoMerge branch 'nir-spirv' into vulkan
Jason Ekstrand [Sat, 5 Sep 2015 01:54:15 +0000 (18:54 -0700)]
Merge branch 'nir-spirv' into vulkan

8 years agonir/spirv/glsl450: Use the correct write mask
Jason Ekstrand [Sat, 5 Sep 2015 01:47:56 +0000 (18:47 -0700)]
nir/spirv/glsl450: Use the correct write mask

8 years agonir: Add a lower_fdiv option and use it in i965
Jason Ekstrand [Sat, 5 Sep 2015 01:47:42 +0000 (18:47 -0700)]
nir: Add a lower_fdiv option and use it in i965

8 years agonir/spirv: Use the actual GLSL 450 extension header from Khronos
Jason Ekstrand [Sat, 5 Sep 2015 01:39:57 +0000 (18:39 -0700)]
nir/spirv: Use the actual GLSL 450 extension header from Khronos

8 years agonir/spirv: Add support for SpvDecorationColMajor
Jason Ekstrand [Sat, 5 Sep 2015 01:26:32 +0000 (18:26 -0700)]
nir/spirv: Add support for SpvDecorationColMajor

8 years agonir/types: Allow single-column matrices
Jason Ekstrand [Sat, 5 Sep 2015 01:26:05 +0000 (18:26 -0700)]
nir/types: Allow single-column matrices

This can sometimes be a convenient way to build vectors.

8 years agovk/wsi: Add Wayland WSI support
Jason Ekstrand [Sat, 5 Sep 2015 00:50:32 +0000 (17:50 -0700)]
vk/wsi: Add Wayland WSI support

8 years agovk/wsi: Move to a clallback system for the entire WSI implementation
Jason Ekstrand [Fri, 4 Sep 2015 18:14:45 +0000 (11:14 -0700)]
vk/wsi: Move to a clallback system for the entire WSI implementation

We do this for two reasons: First, because it allows us to simplify WSI and
compiling in/out support for a particular platform is as simple as calling
or not calling the platform-specific init function.  Second, the
implementation gives us a place for a given chunk of the WSI to stash
stuff in the instance.

8 years agovk/instance: Expose anv_instance_alloc/free
Jason Ekstrand [Fri, 4 Sep 2015 18:14:03 +0000 (11:14 -0700)]
vk/instance: Expose anv_instance_alloc/free

8 years agovk/WSI: Use a callback mechanism instead of explicit switching
Jason Ekstrand [Fri, 4 Sep 2015 17:28:26 +0000 (10:28 -0700)]
vk/WSI: Use a callback mechanism instead of explicit switching

8 years agovk: Add an initial implementation of the actual Khronos WSI extension
Jason Ekstrand [Wed, 2 Sep 2015 01:59:06 +0000 (18:59 -0700)]
vk: Add an initial implementation of the actual Khronos WSI extension

Unfortunately, this is a very large commit and removes the old LunarG WSI
extension.  This is because there are a couple of entrypoints that have the
same name between the two extensions so implementing them both is
impractiacl.

Support is still incomplete, but this is enough to get vkcube up and going
again.

8 years agovk: Add initial support for VK_WSI_swapchain
Jason Ekstrand [Wed, 2 Sep 2015 00:00:10 +0000 (17:00 -0700)]
vk: Add initial support for VK_WSI_swapchain

8 years agovk: Move anv_x11.c to anv_wsi_x11.c
Jason Ekstrand [Tue, 1 Sep 2015 23:46:20 +0000 (16:46 -0700)]
vk: Move anv_x11.c to anv_wsi_x11.c

8 years agovk/device: Use an array for device extensions
Jason Ekstrand [Tue, 1 Sep 2015 23:44:42 +0000 (16:44 -0700)]
vk/device: Use an array for device extensions

8 years agovk: Further reduce diff to master
Kristian Høgsberg Kristensen [Fri, 4 Sep 2015 18:46:43 +0000 (11:46 -0700)]
vk: Further reduce diff to master

Now that we don't compile GLSL, we can roll back a few more hacks and
unexport some things from the backend compiler.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agovk: Drop GLSL code from anv_compiler.cpp
Kristian Høgsberg Kristensen [Thu, 3 Sep 2015 21:02:11 +0000 (14:02 -0700)]
vk: Drop GLSL code from anv_compiler.cpp

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agovk: Assert that the SPIR-V module has the magic number
Kristian Høgsberg Kristensen [Thu, 3 Sep 2015 19:27:28 +0000 (12:27 -0700)]
vk: Assert that the SPIR-V module has the magic number

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agovk: Remove various hacks/scaffolding code
Kristian Høgsberg Kristensen [Thu, 3 Sep 2015 19:04:03 +0000 (12:04 -0700)]
vk: Remove various hacks/scaffolding code

Since we switched away from calling brwCreateContext() there's a bit of
hacky support we can now delete.  This reduces our diff to upstream master.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agovk: Fall back to previous gens in entry point resolver
Kristian Høgsberg Kristensen [Wed, 26 Aug 2015 11:10:58 +0000 (04:10 -0700)]
vk: Fall back to previous gens in entry point resolver

We used to always just do a one-level fallback from genX_* to anv_*
entry points. That worked for gen7 and gen8 where all entry points were
either different or could be made anv_* entry points (eg
anv_CreateDynamicViewportState). We're about to add gen9 and now need to
be able to fall back to gen8 entry points for most things.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agovk: Drop redundant gen7_CreateGraphicsPipelines
Kristian Høgsberg Kristensen [Thu, 27 Aug 2015 19:04:41 +0000 (12:04 -0700)]
vk: Drop redundant gen7_CreateGraphicsPipelines

This is handled by anv_CreateGraphicsPipelines().

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agovk: Use vk* entrypoints in meta, not driver_layer pointers
Kristian Høgsberg Kristensen [Wed, 26 Aug 2015 11:08:51 +0000 (04:08 -0700)]
vk: Use vk* entrypoints in meta, not driver_layer pointers

We'll change the dispatch mechanism again in a later commit. Stop using
the driver_layer function pointers and just use the public entry points.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agovk: Drop check for I915_PARAM_HAS_EXEC_CONSTANTS
Kristian Høgsberg Kristensen [Wed, 26 Aug 2015 11:04:36 +0000 (04:04 -0700)]
vk: Drop check for I915_PARAM_HAS_EXEC_CONSTANTS

We don't use this kernel feature.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agovk: Add new vk_errorf that takes a format string
Kristian Høgsberg Kristensen [Wed, 26 Aug 2015 11:03:38 +0000 (04:03 -0700)]
vk: Add new vk_errorf that takes a format string

This allows us to annotate error cases in debug builds.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agovk: Make vk_error a little more helpful
Kristian Høgsberg Kristensen [Wed, 26 Aug 2015 10:41:37 +0000 (03:41 -0700)]
vk: Make vk_error a little more helpful

Print out file and line number and translate the error code to the
symbolic name.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agovk/image: Add PRM reference for QPitch equation
Chad Versace [Thu, 3 Sep 2015 18:03:28 +0000 (11:03 -0700)]
vk/image: Add PRM reference for QPitch equation

Suggested-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agovk/meta: Partially fix vkCmdCopyBufferToImage for S8_UINT
Chad Versace [Tue, 1 Sep 2015 00:44:08 +0000 (17:44 -0700)]
vk/meta: Partially fix vkCmdCopyBufferToImage for S8_UINT

Create R8_UINT VkAttachmentView and VkImageView for the stencil data.

This fixes a crash, but the pixels in the destination image are still
incorrect. They are not properly tiled.

Fixes crashes in Crucible tests func.miptree.s8-uint.aspect-stencil.* as
of crucible-7471449. Test results improve 'lost' -> 'fail'.

8 years agovk/meta: Use SPIR-V for shaders
Jason Ekstrand [Tue, 1 Sep 2015 22:16:06 +0000 (15:16 -0700)]
vk/meta: Use SPIR-V for shaders

We are also now using glslc for compiling the Vulkan driver like we do in
curcible.

8 years agovk/compiler: Handle interpolation qualifiers for SPIR-V shaders
Jason Ekstrand [Tue, 1 Sep 2015 22:15:04 +0000 (15:15 -0700)]
vk/compiler: Handle interpolation qualifiers for SPIR-V shaders

8 years agovk/extensions: count needs to be <= number of extensions
Jason Ekstrand [Tue, 1 Sep 2015 19:23:48 +0000 (12:23 -0700)]
vk/extensions: count needs to be <= number of extensions

8 years agovk/compiler: Properly reference/delete programs when using SPIR-V
Jason Ekstrand [Tue, 1 Sep 2015 18:57:28 +0000 (11:57 -0700)]
vk/compiler: Properly reference/delete programs when using SPIR-V

8 years agovk/meta: Add a helper for making an image from a buffer
Jason Ekstrand [Tue, 1 Sep 2015 04:12:59 +0000 (21:12 -0700)]
vk/meta: Add a helper for making an image from a buffer

8 years agonir/spirv: Use VERTEX_ID_ZERO_BASE for VertexId
Jason Ekstrand [Tue, 1 Sep 2015 00:16:01 +0000 (17:16 -0700)]
nir/spirv: Use VERTEX_ID_ZERO_BASE for VertexId

In Vulkan, VertexId and InstanceId will be zero-based and new intrinsics,
VertexIndex and InstanceIndex, will be added for non-zer-based.  See also,
Khronos bug #14255

8 years agoMerge remote-tracking branch 'fdo-personal/nir-spirv' into vulkan
Jason Ekstrand [Tue, 1 Sep 2015 00:14:47 +0000 (17:14 -0700)]
Merge remote-tracking branch 'fdo-personal/nir-spirv' into vulkan

From now on, the majority of SPIR-V improvements should happen on the spirv
branch which will also be public.  It will be frequently merged into the
vulkan driver.

8 years agonir/spirv: Update to the latest revision
Jason Ekstrand [Mon, 31 Aug 2015 19:48:04 +0000 (12:48 -0700)]
nir/spirv: Update to the latest revision