Commit Graph

4 Commits

Author SHA1 Message Date
Alejandro Piñeiro 0a50330c3d broadcom/compiler: make several passes to return a progress
Two advantages:
   * When using NIR_DEBUG=nir_print_xx, will print outcome only if
     there is a change
   * We can use NIR_PASS(_, ...) instead of NIR_PASS_V, that has
     slightly more validation checks.

This includes:
  * v3d_nir_lower_image_load_store
  * v3d_nir_lower_io
  * v3d_nir_lower_line_smooth
  * v3d_nir_lower_load_store_bitsize
  * v3d_nir_lower_robust_buffer_access
  * v3d_nir_lower_scratch
  * v3d_nir_lower_txf_ms

As we are here we also simplify some of them by using the
nir_shader_instructions_pass helper.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17609>
2022-07-20 11:35:25 +00:00
Jose Maria Casanova Crespo 90f966e05f v3dv/v3d: Fix copyright holder to Raspberry Pi Ltd
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15057>
2022-02-18 11:50:07 +01:00
Christian Gmeiner 66d51965af v3d: use intrinsic builders
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>
2021-01-06 14:34:41 +00:00
Neil Roberts ee4d51f8b2 v3d: Add a lowering pass for line smoothing
When line smoothing is enabled, the driver now increases the width of
the line so that it can add some semi-transparent pixels to either side
of the line. A lowering pass is added which modifies the alpha component
of every write to fragment output 0 so that if the fragment is outside
the width of the line then the alpha is reduced. It additionally
discards fragments that are completely invisible. It might seem bad to
use discard on a tiled renderer but the assumption is that any bad
effects from using discard will also happen anyway because of enabling
alpha blending.

v2: Disable the line smoothing pass entirely when the framebuffer
    contains an integer colour output or one with no alpha channel.
    Calculate the coverage once upfront and store in a global variable
    instead of calculating each time an output write is modified. Also
    do the conditional discard once upfront.
v3: Don’t check whether the output buffer has an alpha channel. Only
    look at output 0. Use aa_line_width intrinsic instead of calculating
    the real line width in the shader. Clamp the coverage as part of the
    global variable, not per output write.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5624>
2020-07-06 21:59:16 +00:00