Jason Ekstrand
5644b1cece
nir/spirv: Handle LogicalNot
2015-12-23 13:49:56 -08:00
Jason Ekstrand
6219a69589
nir/spirv: Handle derefs in vtn_ssa_value
...
This is kind of a hack, but it makes vtn_ssa_value insert a load if the
value requested is actually a deref. This shouldn't happen normally but,
thanks to the impedence mismatch of the NIR function parameter model vs.
the SPIR-V model, this can happen for function arguments.
2015-12-23 13:49:56 -08:00
Jason Ekstrand
3ab1b7afa8
nir/spirv: Do boolean fixup on block loads
...
We used to do it for variable loads on things of type "uniform" but that
never got ported to block loads.
2015-12-23 13:49:56 -08:00
Jason Ekstrand
af74ce5a19
spirv/nir: Handle non-vector extractions in vtn_composite_extract
2015-12-23 13:49:56 -08:00
Jason Ekstrand
79b8b42081
nir/spirv: Handle function calls
2015-12-23 13:49:56 -08:00
Jason Ekstrand
d7f66f9f6f
nir/spirv: Array lengths are constants not literals
2015-12-17 16:36:29 -08:00
Jason Ekstrand
b2fe8b4673
nir/spirv: Add a missing break statement
2015-12-15 17:24:18 -08:00
Jason Ekstrand
2d4b7eda23
nir/spirv: Add support for more CS intrinsics
2015-12-15 10:20:23 -08:00
Jordan Justen
a3c5c339a8
nir/spirv_to_nir: Use a minimum of 1 for GS invocations
...
glslang is giving us 0, which causes the SIMD8 GS compile to hit an
assert.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2015-12-14 18:23:14 -08:00
Jason Ekstrand
13d1dd465c
nir/spirv: Put SSBO store writemasks in the right index
...
It moved with the nir_intrinsic_load/store update.
2015-12-10 18:54:44 -08:00
Jason Ekstrand
d5c9955d3e
Merge remote-tracking branch 'mesa-public/master' into vulkan
...
This pulls in nir_intrinsic_load/store changes and the switch of all
uniforms in i965 to bytes. This accounts for the Vulkan changes.
2015-12-10 18:29:36 -08:00
Jason Ekstrand
cb2382882e
nir/spirv: Update to SPIR-V version 1.0
2015-12-03 18:28:10 -08:00
Jason Ekstrand
179fc4aae8
Merge remote-tracking branch 'mesa-public/master' into vulkan
...
This pulls in nir cloning and some much-needed upstream refactors.
2015-11-23 14:03:47 -08:00
Jason Ekstrand
1157b0360d
nir/spirv: Rework decoration iteration
...
The old code didn't work correctly if you had member decorations after
non-member decorations. Since glslang never gave us any of those, it
wasn't properly tested.
2015-11-20 15:15:40 -08:00
Jason Ekstrand
cff74d6fb8
nir/spirv: Handle OpNop
2015-11-20 15:02:45 -08:00
Jason Ekstrand
48228c114e
nir/spirv: Add support for runtime arrays
2015-11-20 12:49:20 -08:00
Jason Ekstrand
22d024e031
nir/spirv: Add support for separate samplers and textures
...
This gets tricky in a few places because we have to pass vtn_sampled_image
values through OpAccessChain, but it works ok. At some point, it probably
needs to be cleaned up but it doesn't occur to me exactly how to do that at
the moment. We'll see how this approach goes.
2015-11-14 22:32:54 -08:00
Jason Ekstrand
1469ccb746
Merge remote-tracking branch 'mesa-public/master' into vulkan
...
This pulls in Matt's big compiler refactor.
2015-11-14 07:56:10 -08:00
Jason Ekstrand
c1733886a6
nir/spirv: Add support for SSBO stores
...
This only handles vector stores, not component-of-a-vector stores.
2015-11-13 21:41:52 -08:00
Jason Ekstrand
c68e28d766
nir/spirv: Refactor vtn_block_load
...
We pull the offset calculations out into their own function so we can
re-use it for stores.
2015-11-13 21:32:00 -08:00
Jason Ekstrand
99494b96f0
nir/spirv: Add support for image_load_store
2015-11-13 17:54:43 -08:00
Jason Ekstrand
ffbc31d13b
nir/spirv: Add support for creating image variables
2015-11-13 17:54:43 -08:00
Jason Ekstrand
453239f6a5
nir/spirv: Add support for image types
2015-11-13 17:54:43 -08:00
Jason Ekstrand
17fa3d3572
nir/spirv: Give both block and buffer_block types an interface type
2015-11-07 08:03:25 -08:00
Jason Ekstrand
a10d59c09a
nir/spirv: Increment num_ubos/ssbos when creating variables
2015-11-06 16:53:27 -08:00
Jason Ekstrand
5ba281e794
nir/spirv: Add a helper for determining if a block is externally visable
2015-11-06 15:09:57 -08:00
Jason Ekstrand
1f2624e6dd
nir/spirv: Add support for push constants
2015-10-29 22:26:00 -07:00
Jason Ekstrand
f2a8c9db24
nir/spirv: Rework the way we handle interface types
2015-10-29 22:26:00 -07:00
Jason Ekstrand
3d44b3aaa6
nir/spirv: Use the new vulkan_resource_index intrinsic
...
This is instead of using the _vk versions of UBO/SSBO load/store intrinsics
2015-10-27 13:41:59 -07:00
Jason Ekstrand
ee8c67abe8
nir/spirv: Add support for builtins in arrays
2015-10-22 17:58:20 -07:00
Jason Ekstrand
9fe907ec79
nir/spirv: Make the builtins array distinguish between in and out
2015-10-22 17:54:24 -07:00
Jason Ekstrand
d11ea76168
nir/spirv: Make vtn_get_builtin_location smarter
...
Instead of just stomping on the mode, it now validates asserts that the
previously set mode is correct and only changes it if needed. We need to
do this because, in geometry shaders, there are some builtins that can be
either an input or an output depending on context. We can get that
information from the SPIR-V source but we can't throw it away.
2015-10-22 17:45:41 -07:00
Jason Ekstrand
9abef3e817
nir/spirv: Make get_builtin_variable take a nir_variable_mode
...
We'll want this in a moment for validation but, for now, it just gets
stompped by get_builtin_variable.
2015-10-22 17:28:25 -07:00
Jason Ekstrand
2ce6636c75
nir/spirv: Remove the vtn_type argument from _vtn_variable_load/store
...
Now that builtins are handled in deref chains, we don't really need this
anymore.
2015-10-22 16:56:42 -07:00
Jason Ekstrand
0329a252bd
nir/spirv: Add defaults for GS input/output primitive types
...
These are supposed to be specified in the SPIR-V source as SpvExecutionMode
enums but glslang isn't giving them to us. A bug has been filed:
https://github.com/KhronosGroup/glslang/issues/84
2015-10-21 21:46:22 -07:00
Jason Ekstrand
ea23cb3543
nir/spirv: Add capabilities and decorations for basic geometry shaders
2015-10-21 20:36:25 -07:00
Jason Ekstrand
164abff0c0
nir/spirv: Add support for more CS system values
2015-10-21 18:39:06 -07:00
Jason Ekstrand
5790ee2bbb
nir/spirv: Add support for various barrier type instructions
2015-10-21 18:17:11 -07:00
Jason Ekstrand
3d35e4361f
Fix a couple of dereferences
2015-10-21 18:16:50 -07:00
Jason Ekstrand
55a7ee730c
spirv/nir: Add more stage asserts
2015-10-21 18:00:05 -07:00
Jason Ekstrand
27393c8630
nir/spirv: Add support for GS metadata
2015-10-21 17:58:34 -07:00
Jason Ekstrand
59bae36ffb
nir/spirv: Fix a typo
2015-10-20 15:35:13 -07:00
Jason Ekstrand
44b22ca441
nir/spirv: Handle SpvExecutionMode
2015-10-20 15:23:56 -07:00
Jason Ekstrand
12c30c9498
nir/spirv: Use the new nir_variable helpers
2015-10-19 16:08:23 -07:00
Jason Ekstrand
7e6959402d
nir/spirv: Handle builtins in OpAccessChain
...
Previously, we were trying to handle them later when loading. However, at
that point, you've already lost information and it's harder to handle
certain corner-cases. In particular, if you have a shader that does
gl_PerVertex.gl_Position.x = foo
we have trouble because we see the .x and we don't know that we're in
gl_Position. If we, instead, handle it in OpAccessChain, we have all the
information we need and we can silently re-direct it to the appropreate
variable. This also lets us delete some code which is a nice side-effect.
2015-10-19 15:50:45 -07:00
Jason Ekstrand
8ed23654c9
nir/spirv: Fix handling of vector component selects via OpAccessChain
...
When we get to the end of the _vtn_load/store_varaible recursion, we may
have one link left in the deref chain if there is a vector component select
on the end. In this case, we need to truncate the deref chain early so
that, when we make the copy for the load, we don't get the extra deref.
The final deref will be handled by the vector extract/insert that comes
later.
2015-10-15 21:18:57 -07:00
Jason Ekstrand
de608153fb
nir/spirv: Use the Vulkan ubo intrinsics
2015-10-14 18:38:33 -07:00
Jason Ekstrand
d2d8945eb8
nir/spirv: Fix a bug in indirect OpAccessChain handling
2015-10-13 20:00:18 -07:00
Jason Ekstrand
c272bb58f5
nir/spirv: Better texture handling
2015-10-06 15:10:45 -07:00
Jason Ekstrand
ccea9cc332
nir/spirv: Update to SPIR-V Rev. 32
2015-10-06 14:52:35 -07:00