aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_clip.c
Commit message (Collapse)AuthorAgeFilesLines
* nir: fix 5 warningsMarek Olšák2020-02-271-1/+1
| | | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3970>
* nir/lower_clip: Fix incorrect driver loc for clipdist outputsRob Clark2019-12-041-0/+11
| | | | | | | | | | | Somehow adjusting maxloc based on existing outputs got lost, resulting in the clipdist varying clobbering the position varying. Causing a shader that had no position output in freedreno/ir3, which triggers GPU hangs in neverball. Fixes: d0f746b6458 ("nir: Save nir_variable pointers in nir_lower_clip_vs rather than locs.") Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* nir: patch up deref-vars when lowering clip-planesErik Faye-Lund2019-11-121-0/+1
| | | | | | | | Otherwise, we fail validation and potentially generate invalid code. Let's fix up the mode of the accesses to the variable. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* nir: support feeding state to nir_lower_clip_[vg]sErik Faye-Lund2019-10-171-8/+36
| | | | Reviewed-by: Marek Olšák <[email protected]>
* nir: support lowering clipdist to arraysErik Faye-Lund2019-10-171-31/+68
| | | | | | | | This allows us to make sure clipdist is emitted as a scalar array rather than two vec4s. This matches SPIR-V semantics, and will be useful for Zink. Reviewed-by: Marek Olšák <[email protected]>
* nir/lower_clip: add support for geometry shadersTimothy Arceri2019-07-191-0/+57
| | | | | | | This will be used to enabled compat profile support for geometry shaders. Reviewed-by: Kenneth Graunke <[email protected]>
* nir/lower_clip: add lower_clip_outputs() helperTimothy Arceri2019-07-191-42/+51
| | | | | | | This will be reused in the following patch to add support for clip vertex lowering in geometry shaders. Reviewed-by: Kenneth Graunke <[email protected]>
* nir/lower_clip: add create_clipdist_vars() helperTimothy Arceri2019-07-191-16/+18
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* nir/lower_clip: add a find_clipvertex_and_position_outputs() helperTimothy Arceri2019-07-191-24/+35
| | | | | | | | This will allow code sharing in a following patch that adds support for lowering in geometry shaders. It also allows us to exit early if there is no lowering to do which allows a small code tidy up. Reviewed-by: Kenneth Graunke <[email protected]>
* nir: rename nir_var_private to nir_var_shader_tempKarol Herbst2019-01-191-1/+1
| | | | | | | | Signed-off-by: Karol Herbst <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* nir: rename global/local to private/function memoryKarol Herbst2019-01-081-1/+1
| | | | | | | | | | | | | | | | | | the naming is a bit confusing no matter how you look at it. Within SPIR-V "global" memory is memory accessible from all threads. glsl "global" memory normally refers to shader thread private memory declared at global scope. As we already use "shared" for memory shared across all thrads of a work group the solution where everybody could be happy with is to rename "global" to "private" and use "global" later for memory usually stored within system accessible memory (be it VRAM or system RAM if keeping SVM in mind). glsl "local" memory is memory only accessible within a function, while SPIR-V "local" memory is memory accessible within the same workgroup. v2: rename local to function as well v3: rename vtn_variable_mode_local as well Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Make nir_lower_clip_vs optionally work with variables.Kenneth Graunke2018-11-191-11/+34
| | | | | | | | | | | | The way nir_lower_clip_vs() works with store_output intrinsics makes a ton of assumptions about the driver_location field. In i965 and iris, I'd rather do this lowering early and work with variables. v3d may want to switch to that as well, and ir3 could too, but I'm not sure exactly what would need updating. For now, handle both methods. Reviewed-by: Eric Anholt <[email protected]>
* nir: Save nir_variable pointers in nir_lower_clip_vs rather than locs.Kenneth Graunke2018-11-191-16/+8
| | | | | | I'll want the variables in the next patch. Reviewed-by: Eric Anholt <[email protected]>
* nir: Inline lower_clip_vs() into nir_lower_clip_vs().Kenneth Graunke2018-11-191-41/+32
| | | | | | It's now called exactly once, and there's not really any distinction. Reviewed-by: Eric Anholt <[email protected]>
* nir: Use nir_shader_get_entrypoint in nir_lower_clip_vs().Kenneth Graunke2018-11-191-4/+2
| | | | Reviewed-by: Eric Anholt <[email protected]>
* nir: replace nir_load_system_value calls with appropiate builder functionsKarol Herbst2018-11-141-2/+1
| | | | | | | | | this helps reduce the overall code changes when a bit_size parameter is added to nir_load_system_value Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Karol Herbst <[email protected]>
* nir: Use nir_src_is_const and nir_src_as_* in core codeJason Ekstrand2018-10-221-1/+1
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* nir: Embed the shader_info in the nir_shader againJason Ekstrand2017-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e1af20f18a86f52a9640faf2d4ff8a71b0a4fa9b changed the shader_info from being embedded into being just a pointer. The idea was that sharing the shader_info between NIR and GLSL would be easier if it were a pointer pointing to the same shader_info struct. This, however, has caused a few problems: 1) There are many things which generate NIR without GLSL. This means we have to support both NIR shaders which come from GLSL and ones that don't and need to have an info elsewhere. 2) The solution to (1) raises all sorts of ownership issues which have to be resolved with ralloc_parent checks. 3) Ever since 00620782c92100d77c660f9783504c6d80fa1d58, we've been using nir_gather_info to fill out the final shader_info. Thanks to cloning and the above ownership issues, the nir_shader::info may not point back to the gl_shader anymore and so we have to do a copy of the shader_info from NIR back to GLSL anyway. All of these issues go away if we just embed the shader_info in the nir_shader. There's a little downside of having to copy it back after calling nir_gather_info but, as explained above, we have to do that anyway. Acked-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Return progress from nir_lower_clip_fs().Matt Turner2017-03-231-2/+6
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_clip_vs().Matt Turner2017-03-231-4/+6
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Stop using apostrophes to pluralize.Matt Turner2017-03-231-3/+3
| | | | | Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir/i965/anv/radv/gallium: make shader info a pointerTimothy Arceri2016-10-261-1/+1
| | | | | | | | | | When restoring something from shader cache we won't have and don't want to create a nir_shader this change detaches the two. There are other advantages such as being able to reuse the shader info populated by GLSL IR. Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Update shader info when adding discardsEric Anholt2016-08-291-0/+2
| | | | | | | vc4 is about to start using the shader info field to set up discard handling. Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Switch the arguments to nir_foreach_functionJason Ekstrand2016-04-281-3/+3
| | | | | | | | | This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_function(\([^,]*\),\s*\([^,]*\))/nir_foreach_function(\2, \1)/ Reviewed-by: Ian Romanick <[email protected]>
* nir: Switch the arguments to nir_foreach_instrJason Ekstrand2016-04-281-1/+1
| | | | | | | | | | | This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_instr(\([^,]*\),\s*\([^,]*\))/nir_foreach_instr(\2, \1)/ and similar expressions for nir_foreach_instr_safe etc. Reviewed-by: Ian Romanick <[email protected]>
* nir/lower_clip: fixup for new foreach_block()Connor Abbott2016-04-281-29/+21
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: rename nir_foreach_block*() to nir_foreach_block*_call()Connor Abbott2016-04-201-1/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: add a bit_size parameter to nir_ssa_dest_initConnor Abbott2016-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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: use const_index helpersRob Clark2016-02-091-4/+4
| | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: move to compiler/Emil Velikov2016-01-261-0/+339
Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Jose Fonseca <[email protected]>