Commit Graph

81585 Commits

Author SHA1 Message Date
Connor Abbott a1e136711b nir/types: add a helper to transpose a matrix type 2015-08-31 16:58:20 -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 a992909aae 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-08-31 16:58:20 -07:00
Jason Ekstrand 45963c9c64 nir/types: Add support for sampler types 2015-08-31 16:58:20 -07:00
Jason Ekstrand 2887e68f36 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-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 7d64741a5e nir: Add a helper for getting the tail of a deref chain 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 67af6c59f2 nir/types: Add an is_vector_or_scalar helper 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 366366c7f7 nir/types: Add a scalar type constructor 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 ac4d459aa2 nir/types: Add accessors for function parameter/return types 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 5bb94c9b12 nir/types: Add more helpers for creating types 2015-08-31 16:58:20 -07:00
Jason Ekstrand 53bff3e445 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 and adds #ifdef's around
constructors.
2015-08-31 16:58:20 -07:00
Jason Ekstrand 0db3e4dd72 glsl/types: Add support for function types 2015-08-31 16:58:20 -07:00
Jason Ekstrand 1169fcdb05 glsl: Add GLSL_TYPE_FUNCTION to the base types enums 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 78eabc6153 REVERT: Add a simple helper program for testing SPIR-V -> NIR translation 2015-08-31 16:58:20 -07:00
Jason Ekstrand 2c585a722d glsl/compiler: Move the error_no_memory stub to standalone_scaffolding.cpp 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
Jason Ekstrand 9d92b4fd0e nir: Import the revision 30 SPIR-V header from Khronos 2015-08-31 16:58:20 -07:00
Jason Ekstrand 0af4bf4d4b Merge remote-tracking branch 'mesa-public/master' into vulkan 2015-08-31 16:30:07 -07:00
Nanley Chery 76f17266ec mesa/texformat: use format conversion function in _mesa_choose_tex_format
This function's cases for non-generic compressed formats duplicate
the GL to MESA translation in _mesa_glenum_to_compressed_format().
This patch replaces the switch cases with a call to the translation
function. This change teaches this function about ASTC, thus enabling
ASTC for glTex*Storage*() calls.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
2015-08-31 15:03:21 -07:00
Nanley Chery 01024ded1e mesa/texcompress: correct mapping of S3TC formats in conversion function
MESA_FORMAT_RGBA_DXT5 should actually be reserved for GL_RGBA[4]_DXT5_S3TC.
Also, Gallium and other dri drivers (radeon and nouveau) follow this mapping
scheme.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
2015-08-31 15:03:08 -07:00
Dave Airlie 3063913f77 r600/sb: update last_cf for finalize if.
As Glenn did for finalize_loop we need to update_cf when we
add a POP at the end of a shader.

I think this fixes one of the earlier shader going off end
of memory problems we've stopped.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.6" "11.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-09-01 07:39:24 +10:00
Matt Turner a4ba41638d i965/fs: Use greater-equal cmod to implement maximum.
The docs specifically call out SEL with .l and .ge as the
implementations of MIN and MAX respectively. Among other things,
SEL with these conditional mods are commutative.

See commit 3b7f683f.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-08-31 11:51:59 -07:00