summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir.h
Commit message (Collapse)AuthorAgeFilesLines
* nir: Add a helper for figuring out what channels of an SSA def are readJason Ekstrand2016-04-261-0/+2
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* nir: rename nir_foreach_block*() to nir_foreach_block*_call()Connor Abbott2016-04-201-3/+3
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/lower-tex: add srgb->linear loweringRob Clark2016-04-191-0/+7
| | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir/intrinsics: Add a vulkan_resource_index intrinsicJason Ekstrand2016-04-141-0/+12
| | | | | | | This is used to facilitate the Vulkan binding model where each resource is described by a (descriptor set, binding, array index) tuple. Reviewed-by: Rob Clark <[email protected]>
* nir: Add a descriptor_set field to nir_variableJason Ekstrand2016-04-141-0/+5
| | | | | | This is needed for supporting the Vulkan binding model Reviewed-by: Rob Clark <[email protected]>
* nir: Add another index to load_uniform to specify the range readJason Ekstrand2016-04-141-0/+7
| | | | | Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Avoid structure initalization expressions.Jose Fonseca2016-04-141-2/+16
| | | | | | | | | | | Not supported by MSVC, and completely unnecessary -- inline functions work just as well. NIR_SRC_INIT/NIR_DEST_INIT could and probably should be replaced by the inline functions. Acked-by: Jason Ekstrand <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* nir/dead_variables: Configurably work with any variable modeJason Ekstrand2016-04-131-1/+1
| | | | | | | The old version of the pass only worked on globals and locals and always left inputs, outputs, uniforms, etc. alone. Reviewed-by: Kenneth Graunke <[email protected]>
* nir/lower_io: Allow for a full bitmask of modesJason Ekstrand2016-04-131-1/+1
| | | | | | Acked-by: Eric Anholt <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir/lower_indirect: nir_variable_mode is now a bitfieldJason Ekstrand2016-04-131-1/+1
| | | | | | Acked-by: Eric Anholt <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: Convert nir_variable_mode to a bitfieldJason Ekstrand2016-04-131-17/+16
| | | | | | | | | There are several passes where we need to specify some set of variable modes that the pass needs top operate on. This lets us easily do that. Acked-by: Eric Anholt <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir/lower_system_values: Add support for several computed valuesJason Ekstrand2016-04-111-0/+3
| | | | Reviewed-by: Rob Clark <[email protected]>
* nir: add a pass for lowering (un)pack_double_2x32Connor Abbott2016-04-111-0/+2
| | | | | | | | | | | | | | | | | | | v2: Undo unintended change to the signature of nir_normalize_cubemap_coords (Iago). v3: Move to compiler/nir (Iago) v4: Remove Authors from copyright header (Michael Schellenberger) v5 (Sam): - Use nir_channel() and nir_ssa_for_alu_src() helpers (Jason) - Inline lower_double_pack_instr() code into lower_double_pack_block() (Jason). - Initialize nir_builder at lower_double_pack_impl() (Jason). Signed-off-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: add bit_size info to nir_load_const_instr_create()Samuel Iglesias Gonsálvez2016-04-111-1/+2
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: add bit_size info to nir_ssa_undef_instr_create()Samuel Iglesias Gonsálvez2016-04-111-1/+2
| | | | | | | | v2: - Make the users to give the right bit_sizes as arguments (Jason). Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Add a pass for gathering various bits of shader infoJason Ekstrand2016-04-101-0/+1
| | | | | Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Add a helper for getting the current block from a cursorJason Ekstrand2016-03-281-0/+11
| | | | Reviewed-by: Rob Clark <[email protected]>
* nir/lower_out_to_temp: Add an "entrypoint" parameterJason Ekstrand2016-03-281-1/+2
| | | | | | | | Previously, the pass assumed that the entrypoint would be whatever function happened to have the name "main". We really shouldn't trust in the function names. Reviewed-by: Rob Clark <[email protected]>
* nir: Add a helper for getting the unique function in a shaderJason Ekstrand2016-03-281-0/+11
| | | | Reviewed-by: Rob Clark <[email protected]>
* nir: Add a variable_foreach_safe helperJason Ekstrand2016-03-281-0/+3
| | | | Reviewed-by: Rob Clark <[email protected]>
* nir: Add a pass to inline functionsJason Ekstrand2016-03-241-0/+2
| | | | | | | This commit adds a new NIR pass that lowers all function calls away by inlining the functions. Reviewed-by: Jordan Justen <[email protected]>
* nir: Add return lowering passJason Ekstrand2016-03-241-0/+3
| | | | | | | | This commit adds a NIR pass for lowering away returns in functions. If the return is in a loop, it is lowered to a break. If it is not in a loop, it's lowered away by moving/deleting code as needed. Reviewed-by: Jordan Justen <[email protected]>
* nir: Add a cursor helper for getting a cursor after any phi nodesJason Ekstrand2016-03-241-0/+16
| | | | Reviewed-by: Jordan Justen <[email protected]>
* nir: Add a function for comparing cursorsJason Ekstrand2016-03-241-0/+2
| | | | Reviewed-by: Jordan Justen <[email protected]>
* nir: Add a pass to repair SSA formJason Ekstrand2016-03-241-0/+3
| | | | Reviewed-by: Jordan Justen <[email protected]>
* nir: Add an "exact" bit to nir_alu_instrJason Ekstrand2016-03-231-0/+11
| | | | Reviewed-by: Francisco Jerez <[email protected]>
* nir/clone: Export nir_variable_cloneJason Ekstrand2016-03-231-0/+1
| | | | Reviewed-by: Rob Clark <[email protected]>
* nir/clone: Expose nir_constant_cloneJason Ekstrand2016-03-231-0/+1
| | | | Reviewed-by: Rob Clark <[email protected]>
* nir: Fix whitespaceJason Ekstrand2016-03-231-1/+1
| | | | Reviewed-by: Rob Clark <[email protected]>
* nir: add a bit_size parameter to nir_ssa_dest_initConnor Abbott2016-03-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | v2: Squash multiple commits addressing the new parameter in different files so we don't break the build (Iago) v3: Fix tgsi (Samuel) v4: Fix nir_clone.c (Samuel) v5: Fix vc4 and freedreno (Iago) v6 (Sam) - Fix build errors in nir_lower_indirect_derefs - Use helper to get type size from nir_alu_type. Signed-off-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Tested-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: rename nir_const_value fields to include bitsize informationIago Toral Quiroga2016-03-171-6/+6
| | | | | Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* nir: update opcode definitions for different bit sizesConnor Abbott2016-03-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some opcodes need explicit bitsizes, and sometimes we need to use the double version when constant folding. v2: fix output type for u2f (Iago) v3: do not change vecN opcodes to be float. The next commit will add infrastructure to enable 64-bit integer constant folding so this is isn't really necessary. Also, that created problems with source modifiers in some cases (Iago) v4 (Jason): - do not change bcsel to work in terms of floats - leave ldexp generic Squashed changes to handle different bit sizes when constant folding since otherwise we would break the build. v2: - Use the bit-size information from the opcode information if defined (Iago) - Use helpers to get type size and base type of nir_alu_type enum (Sam) - Do not fallback to sized types to guess bit-size information. (Jason) Squashed changes in i965 and gallium/nir drivers to support sized types. These functions should only see sized types, but we can't make that change until we make sure that nir uses the sized versions in all the relevant places. A later commit will address this. Signed-off-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: add nir_{src,dest}_bit_size() helpersConnor Abbott2016-03-171-0/+12
| | | | | | | | v2: use a ternary (Jason) Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: Add a bit_size to nir_register and nir_ssa_defJason Ekstrand2016-03-171-0/+6
| | | | | | | | | | | | | | | | | | | | | This really hacky commit adds a bit size to registers and SSA values. It also adds rules in the validator to validate that they do the right things. It's still an open question as to whether or not we want a bit_size in nir_alu_instr or if we just want to let it inherit from the destination. I'm inclined to just let it inherit from the destination. A similar question needs to be asked about intrinsics. v2 (Connor): - Relax validation: comparisons have explicit destination sizes and implicit source sizes. v3 (Sam): - Use helpers to get size and base types of nir_alu_type enum. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: Add explicitly sized typesJason Ekstrand2016-03-171-1/+28
| | | | | | | | | | | | v2: Fix size/type mask to properly handle 8-bit types. v3: Add helpers to get the bitsize and base type of a nir_alu_type enum. Signed-off-by: Juan A. Suarez Romero <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: Add support for lowering load/stores of shared variablesJordan Justen2016-03-171-1/+1
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Add compute shader shared variable storage classJordan Justen2016-03-171-1/+5
| | | | | | | | | Previously we were receiving shared variable accesses via a lowered intrinsic function from glsl. This change allows us to send in variables instead. For example, when converting from SPIR-V. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir/clone: Add support for cloning a single function_implJason Ekstrand2016-03-121-0/+1
| | | | Reviewed-by: Jordan Justen <[email protected]>
* nir: Add a helper for creating a "bare" nir_function_implJason Ekstrand2016-03-121-0/+2
| | | | Reviewed-by: Jordan Justen <[email protected]>
* nir: Add a new "param" variable mode for parameters and return variablesJason Ekstrand2016-03-121-1/+8
| | | | Reviewed-by: Jordan Justen <[email protected]>
* nir: Add a pass for lower indirect variable dereferencesJason Ekstrand2016-03-081-0/+2
| | | | | | | | This new pass lowers load/store_var intrinsics that act on indirect derefs to if-ladder of direct load/store_var intrinsics. The if-ladders perform a simple binary search on the indirect. Reviewed-by: Connor Abbott <[email protected]>
* nir: Remove the const_offset from nir_tex_instrJason Ekstrand2016-02-101-3/+0
| | | | | | | | | | | When NIR was originally drafted, there was no easy way to determine if something was constant or not. The result was that we had lots of special-casing for constant values such as this. Now that load_const instructions are SSA-only, it's really easy to find constants and this isn't really needed anymore. Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* nir: Separate texture from sampler in nir_tex_instrJason Ekstrand2016-02-091-1/+30
| | | | | | | | | | | | | This commit adds the capability to NIR to support separate textures and samplers. As it currently stands, glsl_to_nir only sets the texture deref and leaves the sampler deref alone as it did before and nir_lower_samplers assumes this. Backends can still assume that they are combined and only look at only at the texture index. Or, if they wish, they can assume that they are separate because nir_lower_samplers, tgsi_to_nir, and prog_to_nir all set both texture and sampler index whenever a sampler is required (the two indices are the same in this case). Reviewed-by: Kenneth Graunke <[email protected]>
* nir/tex_instr: Rename sampler to textureJason Ekstrand2016-02-091-12/+12
| | | | | | | | | We're about to separate the two concepts. When we do, the sampler will become optional. Doing a rename first makes the separation a bit more safe because drivers that depend on GLSL or TGSI behaviour will be fine to just use the texture index all the time. Reviewed-by: Kenneth Graunke <[email protected]>
* nir: const_index helpersRob Clark2016-02-091-2/+62
| | | | | | | | | | | | | | Direct access to intr->const_index[n], where different slots have different meanings, is somewhat confusing. Instead, let's put some extra info in nir_intrinsic_infos[] about which slots map to what, and add some get/set helpers. The helpers validate that the field being accessed (base/writemask/etc) is applicable for the intrinsic opc, for some extra safety. And nir_print can use this to dump out decoded const_index fields. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: remove unused nir_variable fieldsTimothy Arceri2016-02-091-18/+0
| | | | | | | These are used in GLSL IR to removed unused varyings and match transform feedback variables. There is no need to use these in NIR. Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Add lowering support for unpacking opcodes.Matt Turner2016-02-011-0/+4
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: Add lowering support for packing opcodes.Matt Turner2016-02-011-0/+4
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: Add opcodes to extract bytes or words.Matt Turner2016-02-011-0/+3
| | | | | | The uint versions zero extend while the int versions sign extend. Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: Add lowering of nir_op_unpack_half_2x16.Matt Turner2016-02-011-0/+3
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>