summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_lower_system_values.c
Commit message (Collapse)AuthorAgeFilesLines
* nir: move to compiler/Emil Velikov2016-01-261-98/+0
| | | | | | Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Matt Turner <mattst88@gmail.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
* nir: Get rid of function overloadsJason Ekstrand2015-12-281-3/+3
| | | | | | | | | | | | | | | | | When Connor originally drafted NIR, he copied the same function+overload system that GLSL IR had with a few names changed. However, this double-indirection is not really needed and has only served to confuse people. Instead, let's just have functions which may not have unique names and may or may not have an implementation. If someone wants to do overload resolving, they can hav a hash table based function+overload system in the overload resolving pass. There's no good reason to keep it in core NIR. Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org> ir3 bits are Reviewed-by: Rob Clark <robclark@gmail.com>
* nir/lower_system_values: Refactor and use the builder.Jason Ekstrand2015-12-151-29/+31
| | | | | | | | | Now that we have a helper in the builder for system values and a helper in core NIR to get the intrinsic opcode, there's really no point in having things split out into a helper function. This commit "modernizes" this pass to use helpers better and look more like newer passes. Reviewed-by: Eric Anholt <eric@anholt.net>
* nir/lower_system_values: Stop supporting non-SSAJason Ekstrand2015-12-151-8/+6
| | | | | | The one user of this (i965) only ever calls it while in SSA form. Reviewed-by: Eric Anholt <eric@anholt.net>
* nir: Fix uninitialized 'progress' variable in nir_lower_system_values.Chris Wilson2015-10-021-1/+1
| | | | | | | | | | | | | | | | | | Commit 0a1adaf11d051b71b4c46aabee2e5342f2d6aef3 (nir: Report progress from nir_lower_system_values().) introduced a bug caught by Valgrind: ==823== Conditional jump or move depends on uninitialised value(s) ==823== at 0xB09020C: convert_block (nir_lower_system_values.c:68) ==823== by 0xB079FB8: foreach_cf_node (nir.c:1310) ==823== by 0xB07A0AF: nir_foreach_block (nir.c:1336) ==823== by 0xB09026B: convert_impl (nir_lower_system_values.c:79) ... ==823== Uninitialised value was created by a stack allocation ==823== at 0xB090249: convert_impl (nir_lower_system_values.c:76) which is trivially fixed by initializing progress. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* nir: Report progress from nir_lower_system_values().Kenneth Graunke2015-09-211-9/+18
| | | | | Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
* nir: Move system value -> intrinsic mapping into nir.cJason Ekstrand2015-09-211-40/+1
| | | | | | This way they're right next to the map going the other direction. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* nir: Add gl_WorkGroupID system variableJordan Justen2015-09-131-0/+3
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
* nir: Add gl_LocalInvocationID variableJordan Justen2015-09-131-0/+3
| | | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
* nir: Remove the mem_ctx parameter from ssa_def_rewrite_usesJason Ekstrand2015-09-111-2/+1
| | | | Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
* nir: Add intrinsics for SYSTEM_VALUE_BASE_VERTEX and VERTEX_ID_ZERO_BASEKenneth Graunke2015-03-121-0/+6
| | | | | | | | | Ian and I added these around the time Connor was developing NIR. Now that both exist, we should make them work together! Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
* nir: Drop dependency on mtypes.h for core NIR.Eric Anholt2015-02-201-0/+1
| | | | | | | | One less new directory necessary for gallium code that wants to interact with NIR. Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* nir: Use pointers for nir_src_copy and nir_dest_copyJason Ekstrand2015-01-261-1/+1
| | | | | | | | This avoids the overhead of copying structures and better matches the newly added nir_alu_src_copy and nir_alu_dest_copy. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Make an easier helper for setting up SSA defs.Eric Anholt2015-01-221-3/+2
| | | | | | | | Almost all instructions we nir_ssa_def_init() for are nir_dests, and you have to keep from forgetting to set is_ssa when you do. Just provide the simpler helper, instead. Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
* nir: Replace assert(0) with unreachable().Matt Turner2015-01-211-2/+1
| | | | | | Fixes a couple of warnings in the process. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Stop using designated initializersJason Ekstrand2015-01-211-5/+3
| | | | | | | | | Designated initializers with anonymous unions don't work in MSVC or GCC < 4.6. With a couple of constructor methods, we don't need them any more and the code is actually cleaner. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88467 Reviewed-by: Connor Abbot <cwabbott0@gmail.com>
* nir/lower_system_values: Handle SSA destinationsJason Ekstrand2015-01-151-1/+14
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Call nir_metadata_preserve more placesJason Ekstrand2015-01-151-0/+2
| | | | Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: Vectorize intrinsicsJason Ekstrand2015-01-151-2/+1
| | | | | | | | | | We used to have the number of components built into the intrinsic. This meant that all of our load/store intrinsics had vec1, vec2, vec3, and vec4 variants. This lead to piles of switch statements to generate the correct intrinsic names, and introspection to figure out the number of components. We can make things much nicer by allowing "vectorized" intrinsics. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* nir: add a pass to lower system value readsConnor Abbott2015-01-151-0/+106
v2: Jason Ekstrand <jason.ekstrand@intel.com>: whitespace fixes