Kristian Høgsberg
b9eb56a404
vk: Add function pointer typedef for intel extension
...
Also guard function prototype by VK_PROTOTYPES.
2015-05-17 21:08:30 -07:00
Kristian Høgsberg
75cb85c56a
vk: Add missing VKAPI for vkQueueRemoveMemReferences
2015-05-17 21:08:30 -07:00
Jason Ekstrand
a924ea0c75
Merge remote-tracking branch 'fdo-personal/wip/nir-vtn' into vulkan
...
This adds the SPIR-V -> NIR translator.
2015-05-16 12:43:16 -07:00
Jason Ekstrand
a63952510d
nir/spirv: Don't assert that the current block is empty
...
It's possible that someone will give us SPIR-V code in which someone
needlessly branches to new blocks. We should handle that ok now.
2015-05-16 12:34:34 -07:00
Jason Ekstrand
4e44dcc312
nir/spirv: Add initial support for samplers
2015-05-16 12:34:15 -07:00
Jason Ekstrand
d6f52dfb3e
nir/spirv: Move Exp and Log to the list of currently unhandled ALU ops
...
NIR doesn't have the native opcodes for them anymore
2015-05-16 12:33:32 -07:00
Jason Ekstrand
a53e795524
nir/types: Add support for sampler types
2015-05-16 12:32:58 -07:00
Jason Ekstrand
0fa9211d7f
nir/spirv: Make the global constants in spirv.h static
...
I've been promissed in a bug that this will be fixed in a future version of
the header. However, in the interest of my branch building, I'm adding
these changes in myself for the moment.
2015-05-16 11:16:34 -07:00
Jason Ekstrand
036a4b1855
nir/spirv: Handle jump-to-loop in a more general way
2015-05-16 11:16:34 -07:00
Jason Ekstrand
56f533b3a0
nir/spirv: Handle boolean uniforms correctly
2015-05-16 11:16:34 -07:00
Jason Ekstrand
64bc58a88e
nir/spirv: Handle control-flow with loops
2015-05-16 11:16:34 -07:00
Jason Ekstrand
3a2db9207d
nir/spirv: Set a name on temporary variables
2015-05-16 11:16:34 -07:00
Jason Ekstrand
a28f8ad9f1
nir/spirv: Use the correct length for copying string literals
2015-05-16 11:16:34 -07:00
Jason Ekstrand
7b9c29e440
nir/spirv: Make vtn_ssa_value handle constants as well as ssa values
2015-05-16 11:16:33 -07:00
Jason Ekstrand
b0d1854efc
nir/spirv: Add initial support for GLSL 4.50 builtins
2015-05-16 11:16:33 -07:00
Jason Ekstrand
1da9876486
nir/spirv: Split the core datastructures into a header file
2015-05-16 11:16:33 -07:00
Jason Ekstrand
98d78856f6
nir/spirv: Use the builder for all instructions
...
We don't actually use it to create all the instructions but we do use it
for insertion always. This should make things far more consistent for
implementing extended instructions.
2015-05-16 11:16:33 -07:00
Jason Ekstrand
ff828749ea
nir/spirv: Add support for a bunch of ALU operations
2015-05-16 11:16:33 -07:00
Jason Ekstrand
d2a7972557
nir/spirv: Add support for indirect array accesses
2015-05-16 11:16:33 -07:00
Jason Ekstrand
683c99908a
nir/spirv: Explicitly type constants and SSA values
2015-05-16 11:16:33 -07:00
Jason Ekstrand
c5650148a9
nir/spirv: Handle OpBranchConditional
...
We do control-flow handling as a two-step process. The first step is to
walk the instructions list and record various information about blocks and
functions. This is where the acutal nir_function_overload objects get
created. We also record the start/stop instruction for each block. Then
a second pass walks over each of the functions and over the blocks in each
function in a way that's NIR-friendly and actually parses the instructions.
2015-05-16 11:16:33 -07:00
Jason Ekstrand
ebc152e4c9
nir/spirv: Add a helper for getting a value as an SSA value
2015-05-16 11:16:33 -07:00
Jason Ekstrand
f23afc549b
nir/spirv: Split instruction handling into preamble and body sections
2015-05-16 11:16:33 -07:00
Jason Ekstrand
ae6d32c635
nir/spirv: Implement load/store instructiosn
2015-05-16 11:16:33 -07:00
Jason Ekstrand
88f6fbc897
nir: Add a helper for getting the tail of a deref chain
2015-05-16 11:16:33 -07:00
Jason Ekstrand
06acd174f3
nir/spirv: Actaully add variables to the funciton or shader
2015-05-16 11:16:33 -07:00
Jason Ekstrand
5045efa4aa
nir/spirv: Add a vtn_untyped_value helper
2015-05-16 11:16:33 -07:00
Jason Ekstrand
01f3aa9c51
nir/spirv: Use vtn_value in the types code and fix a off-by-one error
2015-05-16 11:16:33 -07:00
Jason Ekstrand
6ff0830d64
nir/types: Add an is_vector_or_scalar helper
2015-05-16 11:16:33 -07:00
Jason Ekstrand
5acd472271
nir/spirv: Add support for deref chains
2015-05-16 11:16:33 -07:00
Jason Ekstrand
7182597e50
nir/types: Add a scalar type constructor
2015-05-16 11:16:32 -07:00
Jason Ekstrand
eccd798cc2
nir/spirv: Add support for OpLabel
2015-05-16 11:16:32 -07:00
Jason Ekstrand
a6cb9d9222
nir/spirv: Add support for declaring functions
2015-05-16 11:16:32 -07:00
Jason Ekstrand
8ee23dab04
nir/types: Add accessors for function parameter/return types
2015-05-16 11:16:32 -07:00
Jason Ekstrand
707b706d18
nir/spirv: Add support for declaring variables
...
Deref chains and variable load/store operations are still missing.
2015-05-16 11:16:32 -07:00
Jason Ekstrand
b2db85d8e4
nir/spirv: Add support for constants
2015-05-16 11:16:32 -07:00
Jason Ekstrand
3f83579664
nir/spirv: Add basic support for types
2015-05-16 11:16:32 -07:00
Jason Ekstrand
e9d3b1e694
nir/types: Add more helpers for creating types
2015-05-16 11:16:32 -07:00
Jason Ekstrand
fe550f0738
glsl/types: Expose the function_param and struct_field structs to C
...
Previously, they were hidden behind a #ifdef __cplusplus so C wouldn't find
them. This commit simpliy moves the ifdef.
2015-05-16 11:16:32 -07:00
Jason Ekstrand
053778c493
glsl/types: Add support for function types
2015-05-16 11:16:32 -07:00
Jason Ekstrand
7b63b3de93
glsl: Add GLSL_TYPE_FUNCTION to the base types enums
2015-05-16 11:16:32 -07:00
Jason Ekstrand
2b570a49a9
nir/spirv: Rework the way values are added
...
Instead of having functions to add values and set various things, we just
have a function that does a few asserts and then returns the value. The
caller is then responsible for setting the various fields.
2015-05-16 11:16:32 -07:00
Jason Ekstrand
f9a31ba044
nir/spirv: Add stub support for extension instructions
2015-05-16 11:16:32 -07:00
Jason Ekstrand
4763a13b07
REVERT: Add a simple helper program for testing SPIR-V -> NIR translation
2015-05-16 11:16:32 -07:00
Jason Ekstrand
cae8db6b7e
glsl/compiler: Move the error_no_memory stub to standalone_scaffolding.cpp
2015-05-16 11:16:32 -07:00
Jason Ekstrand
98452cd8ae
nir: Add the start of a SPIR-V to NIR translator
...
At the moment, it can handle the very basics of strings and can ignore
debug instructions. It also has basic support for decorations.
2015-05-16 11:16:32 -07:00
Jason Ekstrand
573ca4a4a7
nir: Import the revision 30 SPIR-V header from Khronos
2015-05-16 11:16:31 -07:00
Jason Ekstrand
057bef8a84
vk/device: Use bias rather than layers for computing binding table size
...
Because we statically use the first 8 binding table entries for render
targets, we need to create a table of size 8 + surfaces.
2015-05-16 10:42:53 -07:00
Jason Ekstrand
22e61c9da4
vk/meta: Make clear a no-op if no layers need clearing
...
Among other things, this prevents recursive meta.
2015-05-16 10:30:05 -07:00
Jason Ekstrand
120394ac92
vk/meta: Save and restore the old bindings pointer
...
If we don't do this then recursive meta is completely broken. What happens
is that the outer meta call may change the bindings pointer and the inner
meta call will change it again and, when it exits set it back to the
default. However, the outer meta call may be relying on it being left
alone so it uses the non-meta descriptor sets instead of its own.
2015-05-16 10:28:04 -07:00