Jason Ekstrand
35fcd37fcf
nir/spirv: Handle decorations after assigning variable locations
2015-09-05 13:17:21 -07:00
Jason Ekstrand
87d02f515b
Merge branch 'nir-spirv' into vulkan
2015-09-05 09:48:33 -07:00
Jason Ekstrand
9be43ef99c
nir/spirv: Handle the MatrixStride member decoration
2015-09-05 09:47:45 -07:00
Jason Ekstrand
9a95d08ed6
Merge branch 'nir-spirv' into vulkan
2015-09-04 18:54:15 -07:00
Jason Ekstrand
9e2c13350e
nir/spirv: Add support for SpvDecorationColMajor
2015-09-04 18:50:14 -07:00
Jason Ekstrand
86c3476668
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
2015-08-31 17:16:49 -07:00
Jason Ekstrand
22fdb2f855
nir/spirv: Update to the latest revision
2015-08-31 17:05:23 -07:00
Jason Ekstrand
756b00389c
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-08-31 16:58:20 -07:00
Jason Ekstrand
fe220ebd37
nir/spirv: Add initial support for samplers
2015-08-31 16:58:20 -07:00
Jason Ekstrand
62b094a81c
nir/spirv: Handle jump-to-loop in a more general way
2015-08-31 16:58:20 -07:00
Jason Ekstrand
ca51d926fd
nir/spirv: Handle boolean uniforms correctly
2015-08-31 16:58:20 -07:00
Jason Ekstrand
b6562bbc30
nir/spirv: Handle control-flow with loops
2015-08-31 16:58:20 -07:00
Jason Ekstrand
4a63761e1d
nir/spirv: Set a name on temporary variables
2015-08-31 16:58:20 -07:00
Jason Ekstrand
6fc7911d15
nir/spirv: Use the correct length for copying string literals
2015-08-31 16:58:20 -07:00
Jason Ekstrand
9da6d808be
nir/spirv: Make vtn_ssa_value handle constants as well as ssa values
2015-08-31 16:58:20 -07:00
Jason Ekstrand
1feeee9cf4
nir/spirv: Add initial support for GLSL 4.50 builtins
2015-08-31 16:58:20 -07:00
Jason Ekstrand
577c09fdad
nir/spirv: Split the core datastructures into a header file
2015-08-31 16:58:20 -07:00
Jason Ekstrand
66fc7f252f
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-08-31 16:58:20 -07:00
Jason Ekstrand
9e03b6724c
nir/spirv: Add support for a bunch of ALU operations
2015-08-31 16:58:20 -07:00
Jason Ekstrand
91b3b46d8b
nir/spirv: Add support for indirect array accesses
2015-08-31 16:58:20 -07:00
Jason Ekstrand
9197e3b9fc
nir/spirv: Explicitly type constants and SSA values
2015-08-31 16:58:20 -07:00
Jason Ekstrand
b7904b8281
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-08-31 16:58:20 -07:00
Jason Ekstrand
d216dcee94
nir/spirv: Add a helper for getting a value as an SSA value
2015-08-31 16:58:20 -07:00
Jason Ekstrand
f36fabb736
nir/spirv: Split instruction handling into preamble and body sections
2015-08-31 16:58:20 -07:00
Jason Ekstrand
7bf4b53f1c
nir/spirv: Implement load/store instructiosn
2015-08-31 16:58:20 -07:00
Jason Ekstrand
112c607216
nir/spirv: Actaully add variables to the funciton or shader
2015-08-31 16:58:20 -07:00
Jason Ekstrand
4fa1366392
nir/spirv: Add a vtn_untyped_value helper
2015-08-31 16:58:20 -07:00
Jason Ekstrand
e709a4ebb8
nir/spirv: Use vtn_value in the types code and fix a off-by-one error
2015-08-31 16:58:20 -07:00
Jason Ekstrand
5e6c5e3c8e
nir/spirv: Add support for deref chains
2015-08-31 16:58:20 -07:00
Jason Ekstrand
befecb3c55
nir/spirv: Add support for OpLabel
2015-08-31 16:58:20 -07:00
Jason Ekstrand
399e962d25
nir/spirv: Add support for declaring functions
2015-08-31 16:58:20 -07:00
Jason Ekstrand
3a266a18ae
nir/spirv: Add support for declaring variables
...
Deref chains and variable load/store operations are still missing.
2015-08-31 16:58:20 -07:00
Jason Ekstrand
2494055631
nir/spirv: Add support for constants
2015-08-31 16:58:20 -07:00
Jason Ekstrand
2a023f30a6
nir/spirv: Add basic support for types
2015-08-31 16:58:20 -07:00
Jason Ekstrand
b79916dacc
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-08-31 16:58:20 -07:00
Jason Ekstrand
ac60aba351
nir/spirv: Add stub support for extension instructions
2015-08-31 16:58:20 -07:00
Jason Ekstrand
b20d9f5643
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-08-31 16:58:20 -07:00