Connor Abbott
bf5a615659
composites composites composites
2015-06-17 16:25:38 -07:00
Connor Abbott
47bd462b0c
awesome control flow bugfixes/clarifications
2015-06-03 14:10:28 -04: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
Kenneth Graunke
d6fb155f30
nir: Fix aggressive typos in nir_from_ssa.c.
...
s/agressive/aggressive/g
Trivial.
2015-05-08 19:38:14 -07:00
Jason Ekstrand
fb5f411248
nir/search: Save/restore the variables_seen bitmask when matching
...
Shader-db results on Broadwell:
total instructions in shared programs: 7152330 -> 7137006 (-0.21%)
instructions in affected programs: 1330548 -> 1315224 (-1.15%)
helped: 5797
HURT: 76
GAINED: 0
LOST: 8
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-05-08 17:29:15 -07:00
Jason Ekstrand
e0cfe59c37
nir/search: Assert that variable id's are in range
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-05-08 17:29:15 -07:00
Jason Ekstrand
13facfbd5b
nir/search: handle explicitly sized sources in match_value
...
Previously, this case was being handled in match_expression prior to
calling match_value. However, there is really no good reason for this
given that match_value has all of the information it needs. Also, they
weren't being handled properly in the commutative case and putting it in
match_value gives us that for free.
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-05-08 17:29:14 -07:00