summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
Commit message (Collapse)AuthorAgeFilesLines
* nir: Add a helper for figuring out what channels of an SSA def are readJason Ekstrand2016-04-262-0/+27
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* nir: Add missing break into switch in construct_value()Juha-Pekka Heikkila2016-04-261-0/+1
| | | | | | | | There seemed to be missing one break in nested switchcases. Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Antia Puentes <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir: rename nir_foreach_block*() to nir_foreach_block*_call()Connor Abbott2016-04-2045-70/+70
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir/lower-tex: add srgb->linear loweringRob Clark2016-04-192-0/+53
| | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir/builder: const'ify swiz paramRob Clark2016-04-191-1/+1
| | | | | | | | No need for it not to be const, and lets caller declare it const if desired. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* nir/lower-tex: make options a local varRob Clark2016-04-191-8/+8
| | | | Signed-off-by: Rob Clark <[email protected]>
* nir: only dereference undef after NULL check. (v2)Dave Airlie2016-04-181-1/+0
| | | | | | | Pointed out by coverity. v2: nuke line, Jason pointed out the constructor does it. Signed-off-by: Dave Airlie <[email protected]>
* Merge remote-tracking branch 'public/master' into vulkanJason Ekstrand2016-04-151-7/+27
|\
| * nir/print: Fix printing variable modeEduardo Lima Mitev2016-04-151-7/+27
| | | | | | | | | | | | | | nir_variable_mode is currently a bitflag enum, while nir_print::print_var_decl() assumes is still a numbered list. Reviewed-by: Jason Ekstrand <[email protected]>
* | Merge remote-tracking branch 'public/master' into vulkanJason Ekstrand2016-04-142-1/+3
|\|
| * nir/lower_io: Add UBOs and SSBOs to get_io_offset_srcJason Ekstrand2016-04-141-0/+3
| | | | | | | | Reviewed-by: Kenneth Graunke <[email protected]>
| * nir/intrinsics: Add a vulkan_resource_index intrinsicJason Ekstrand2016-04-143-0/+34
| | | | | | | | | | | | | | 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]>
* | Merge remote-tracking branch 'public/master' into vulkanJason Ekstrand2016-04-145-23/+38
|\|
| * nir: Add another index to load_uniform to specify the range readJason Ekstrand2016-04-144-1/+18
| | | | | | | | | | Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
| * nir: Use _snprintf on Windows.Jose Fonseca2016-04-141-0/+4
| | | | | | | | | | Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Jose Fonseca <[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: Remove unistd.h include.Jose Fonseca2016-04-141-1/+0
| | | | | | | | | | | | | | It doesn't seem needed, and is not available on MSVC. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
| * nir: Avoid empty {} struct initializer.Jose Fonseca2016-04-141-10/+10
| | | | | | | | | | | | | | | | | | Not supported by MSVC and consistent through NIR. [Emil Velikov: rebase] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* | nir/opt_algebraic: Remove the encoding lineJason Ekstrand2016-04-141-1/+0
| | | | | | | | This is an unneeded diff between the vulkan and master branches
* | spirv: Move to compiler/Jason Ekstrand2016-04-149-7568/+0
| | | | | | | | | | | | While it does rely on NIR, it's not really part of the NIR core. At the moment, it still builds as part of libnir but that can be changed later if desired.
* | nir: Remove some pointless delta between vulkan and masterJason Ekstrand2016-04-142-3/+0
| |
* | Merge remote-tracking branch 'public/master' into vulkanJason Ekstrand2016-04-1332-219/+414
|\|
| * nir/dead_variables: Configurably work with any variable modeJason Ekstrand2016-04-132-10/+25
| | | | | | | | | | | | | | 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/algebraic: Add lowering for ldexpJason Ekstrand2016-04-131-0/+31
| | | | | | | | | | | | | | | | | | The algorithm used is different from both the naive suggestion from the GLSL spec and the one used in GLSL IR today. Unfortunately, the GLSL IR implementation that we have today doesn't handle denormals (for those that care) or the case where the float source is +-inf. Reviewed-by: Matt Turner <[email protected]>
| * nir: Add more modulus opcodesJason Ekstrand2016-04-132-1/+16
| | | | | | | | | | | | | | These are all needed for SPIR-V Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Matt Turner <[email protected]>
| * nir/lower_io: Allow for a full bitmask of modesJason Ekstrand2016-04-132-7/+7
| | | | | | | | | | | | 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-132-7/+7
| | | | | | | | | | | | 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-132-17/+19
| | | | | | | | | | | | | | | | | | 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/clone: Copy bit size when cloning registersJason Ekstrand2016-04-121-0/+1
| | | | | | | | | | Reported-by: Mark Janes <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
| * nir: Fix typo in commentIan Romanick2016-04-111-1/+1
| | | | | | | | | | | | Trivial. Signed-off-by: Ian Romanick <[email protected]>
| * nir: Merge redudant integer clamping.Markus Wick2016-04-111-1/+4
| | | | | | | | | | | | | | | | | | Dolphin uses them a lot. Range tracking would be better in the long term, but this two lines works fine for now. Signed-off-by: Markus Wick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: Silence unused "options" warning in algebraic passes.Kenneth Graunke2016-04-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | Some passes may not refer to options->..., at which point the compiler will warn about an unused variable. Just cast to void unconditionally to shut it up. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]>
| * nir: Do basic constant reassociation.Kenneth Graunke2016-04-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many shaders contain expression trees of the form: const_1 * (value * const_2) Reorganizing these to (const_1 * const_2) * value will allow constant folding to combine the constants. Sometimes, these constants are 2 and 0.5, so we can remove a multiply altogether. Other times, it can create more immediate constants, which can actually hurt. Finding a good balance here is tricky. While much more could be done, this simple patch seems to have a lot of positive benefit while having a low downside. shader-db results on Broadwell: total instructions in shared programs: 8963768 -> 8961369 (-0.03%) instructions in affected programs: 438318 -> 435919 (-0.55%) helped: 1502 HURT: 245 total cycles in shared programs: 71527354 -> 71421516 (-0.15%) cycles in affected programs: 11541788 -> 11435950 (-0.92%) helped: 3445 HURT: 1224 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]>
| * nir/lower_system_values: Add support for several computed valuesJason Ekstrand2016-04-112-3/+73
| | | | | | | | Reviewed-by: Rob Clark <[email protected]>
| * compiler: remove {glsl,nir}/Makefile.sourcesEmil Velikov2016-04-111-79/+0
| | | | | | | | | | | | | | | | | | No longer used as of last commit. v2: Rebase. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Jason Ekstrand <[email protected]> (v1)
| * nir: add a pass for lowering (un)pack_double_2x32Connor Abbott2016-04-113-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 split versions of (un)pack_double_2x32Connor Abbott2016-04-111-0/+36
| | | | | | | | | | | | | | | | v2 (Sam): - Use uint64 instead of float64 for sources and destinations. (Connor) Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: don't try to scalarize unpack_double_2x32Connor Abbott2016-04-111-0/+3
| | | | | | | | Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: add support for (un)pack_double_2x32Connor Abbott2016-04-112-0/+35
| | | | | | | | | | | | | | | | v2 (Sam): - Use uint64 instead of float64 for sources and destinations. (Connor) Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: add i2d and u2d opcodesIago Toral Quiroga2016-04-112-0/+10
| | | | | | | | | | | | | | v2: - Assert supports_int and don't fallback to nir_fmov (Jason) Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: add d2i, d2u, d2b opcodesIago Toral Quiroga2016-04-112-0/+6
| | | | | | | | Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: add support for d2f and f2dConnor Abbott2016-04-112-0/+5
| | | | | | | | Reviewed-by: Jason Ekstrand <[email protected]>
| * nir/glsl_to_nir: set bit_size on ssbo_load resultIago Toral Quiroga2016-04-111-2/+3
| | | | | | | | | | | | | | v2 (Sam): - Add missing bit_size assignment when ssbo_load destination is a boolean. Reviewed-by: Jason Ekstrand <[email protected]>
| * nir/glsl_to_nir: add bit-size info to add_instr()Samuel Iglesias Gonsálvez2016-04-111-10/+14
| | | | | | | | | | Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * nir/split_var_copies: handle doublesConnor Abbott2016-04-111-0/+2
| | | | | | | | Reviewed-by: Jason Ekstrand <[email protected]>
| * nir/instr_set: handle 64-bit bit-sizesConnor Abbott2016-04-111-5/+17
| | | | | | | | | | | | | | v2: Revert spurious change in nir_opt_cse.c (Iago) Signed-off-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: handle doubles in nir_deref_get_const_initializer_load()Connor Abbott2016-04-111-1/+5
| | | | | | | | | | | | | | | | v2 (Sam): - Use proper bitsize value when calling to nir_load_const_instr_create() (Jason). Reviewed-by: Jason Ekstrand <[email protected]>
| * nir/print: add support for printing doubles and bitsizeConnor Abbott2016-04-111-3/+16
| | | | | | | | | | | | | | | | | | | | | | v2: - Squash the printing doubles related patches into one patch (Sam). v3: - Print using PRIx64 format: long is 32-bit on some 32-bit platforms but long long is basically always 64-bit (Jason). Reviewed-by: Jason Ekstrand <[email protected]>
| * nir/glsl_to_nir: support doublesConnor Abbott2016-04-111-26/+38
| | | | | | | | | | | | | | | | v2: - Don't set sized types to the destination of texture related opcodes. (Jason) Reviewed-by: Jason Ekstrand <[email protected]>