Commit graph

170350 commits

Author SHA1 Message Date
antonino
bdb3daab7c zink: fix exit condition on pv emulation loop
The exit condition was not correct causing the pv emulation lowering
pass to emit garbage for incomplete primitives.

Fixes: 5a4083349f ("zink: add provoking vertex mode lowering")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22599>
2023-04-24 08:59:20 +00:00
antonino
89077b866c zink: use ring buffer to preserve last element
Previously, whenever a vertex was emitted immediately after emitting a
primitive, that vertex would not use the attributes that where assigned
last because the position variable got set.

Now the temporary attributes array is treated as a ring buffer and
whenever the position is set to 0 it's previous value is used as an
offset when accessing it. This way when a new primitive is created the
attributes at index 0 correspond to the last attributes written.

Fixes: 5a4083349f ("zink: add provoking vertex mode lowering")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22599>
2023-04-24 08:59:19 +00:00
antonino
436dacf754 zink: fix pv mode lowring index calculation
The provoking vertex mode pass was calculating an offset and then using
it directly instead of adding it to the base index.

Fixes: 5a4083349f ("zink: add provoking vertex mode lowering")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22599>
2023-04-24 08:59:19 +00:00
Marcin Ślusarz
aa45b13398 anv: move nir_shader_gather_info to anv_pipeline_nir_preprocess
Fixes dEQP-VK.mesh_shader.ext.misc.custom_attributes*.

Fixes: 16c7c37718 ("anv: move preprocessing of NIR right before compilation")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22629>
2023-04-24 08:43:51 +00:00
SoroushIMG
3291050cc1 zink: refcount the correct query pool
otherwise the pool is freed before the query and zink will
give the vulkan driver NULL query pool which can make it crash.

this was seen when running the following cases with
primitivesGeneratedQueryWithRasterizerDiscard and color write
features disabled:
dEQP-GL45.functional.tessellation.invariance.outer_triangle_set.triangles_fractional_odd_spacing
dEQP-GL45.functional.tessellation.invariance.outer_triangle_set.triangles_fractional_even_spacing
dEQP-GL45.functional.tessellation.invariance.outer_triangle_set.quads_equal_spacing
dEQP-GL45.functional.tessellation.invariance.outer_triangle_set.quads_fractional_odd_spacing
dEQP-GL45.functional.tessellation.invariance.outer_triangle_set.quads_fractional_even_spacing
dEQP-GL45.functional.tessellation.invariance.tess_coord_component_range.triangles_equal_spacing_ccw
dEQP-GL45.functional.tessellation.invariance.tess_coord_component_range.triangles_equal_spacing_ccw_point_mode
dEQP-GL45.functional.tessellation.invariance.tess_coord_component_range.triangles_equal_spacing_cw
dEQP-GL45.functional.tessellation.invariance.tess_coord_component_range.triangles_equal_spacing_cw_point_mode
dEQP-GL45.functional.tessellation.invariance.tess_coord_component_range.triangles_fractional_odd_spacing_ccw
dEQP-GL45.functional.tessellation.invariance.tess_coord_component_range.triangles_fractional_odd_spacing_ccw_point_mode
dEQP-GL45.functional.tessellation.invariance.tess_coord_component_range.triangles_fractional_odd_spacing_cw
dEQP-GL45.functional.tessellation.invariance.tess_coord_component_range.triangles_fractional_odd_spacing_cw_point_mode
dEQP-GL45.functional.tessellation.invariance.tess_coord_component_range.triangles_fractional_even_spacing_ccw
dEQP-GL45.functional.tessellation.invariance.tess_coord_component_range.triangles_fractional_even_spacing_ccw_point_mode

Fixes: e5d517f362 ("zink: rework query pool overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22575>
2023-04-24 08:28:25 +00:00
SoroushIMG
f6b5e128c1 zink: fix incorrect line mode check for bresenham
the line requirement check logic was assuming mode index 0
is bresenhamLines, but it is actually rectangularLines.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22575>
2023-04-24 08:28:25 +00:00
SoroushIMG
8ca13afe15 zink: take location_frac into account in lower_line_smooth_gs
blender-demo-cube_diorama trace in traces-db hits this.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22575>
2023-04-24 08:28:25 +00:00
SoroushIMG
657fc39b09 zink: do not emit line stipple dynamic state when emulating
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22575>
2023-04-24 08:28:25 +00:00
Samuel Pitoiset
16d0b868c6 radv: add the perf counters BO to the preambles BO list
If the submission isn't chained for any reasons, we might end by
submitting the performance counter preambles without a command
buffer that added this BO to its list.

Found by inspection.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22627>
2023-04-24 06:45:23 +00:00
Sergi Blanch Torne
ea5535090a ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

    Start: 2023-04-24 08:00 GMT
    End: 2023-04-24 12:00 GMT

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22181>
2023-04-24 06:01:28 +00:00
Mike Blumenkrantz
483639d738 zink: add validation exceptions for shader object extension enable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:19 +00:00
Mike Blumenkrantz
cd6625c6eb zink: use EXT_shader_object to (re)implement separate shaders
this reimplements the same functionality that exists already, but
using shader object instead of GPL

it must be disabled by default, as this extension is not (currently)
compatible with feedback loops

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:19 +00:00
Mike Blumenkrantz
3baa9ed6d8 zink: remove redundant compute program batch ref
this is already handled in the function above

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:19 +00:00
Mike Blumenkrantz
a76bdcd34c zink: run bo lowering passes for separate shader compile with uniform inlining
this is otherwise unable to pass ntv

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:19 +00:00
Mike Blumenkrantz
3e5e5e58af zink: add a 'separate' flag to shader module compile to indicate separate shaders
not used yet

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:19 +00:00
Mike Blumenkrantz
82abbe19c9 zink: move separate shader dsl creation to compiler function
no functional changes, just reordering

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:19 +00:00
Mike Blumenkrantz
7f7b229c89 zink: minor whitespace cleanup
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:19 +00:00
Mike Blumenkrantz
535a8f0e96 zink: use zink_shader_object for precompiled separate shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:18 +00:00
Mike Blumenkrantz
d733e24648 zink: more zink_shader_object conversion
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:18 +00:00
Mike Blumenkrantz
76f477e8d5 zink: make zink_shader_spirv_compile static
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:18 +00:00
Mike Blumenkrantz
a1c994d60d zink: wrap return of compile_module()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:18 +00:00
Mike Blumenkrantz
aa2cf4d7f3 zink: wrap zink_shader_compile_separate() return
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:18 +00:00
Mike Blumenkrantz
5383bb4315 zink: hook up EXT_shader_object
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:18 +00:00
Mike Blumenkrantz
9c0497275f zink: use tes to generate tcs
this makes more sense considering the tcs will be stored onto the tes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22612>
2023-04-24 02:49:18 +00:00
Mike Blumenkrantz
bba644ce82 draw: fix viewmask iterating
the frontend has to be flushed and setup again if only
the viewmask has changed since the last draw

Fixes: 03cbb7b104 ("draw: add view_mask rendering support")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22628>
2023-04-24 02:20:05 +00:00
Thomas H.P. Andersen
a18a51a708 nir/nir_lower_vec3_to_vec4: Use the nir_shader_instructions_pass() helper
Extracts some per-impl code to nir_lower_vec3_to_vec4 and then
converts to use the nir_shader_instructions_pass helper.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11683>
2023-04-22 23:35:37 +00:00
Thomas H.P. Andersen
e86c28a78b nir/nir_lower_to_source_mods: Use the nir_shader_instructions_pass() helper
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11683>
2023-04-22 23:35:37 +00:00
Thomas H.P. Andersen
0ddf98e85d nir/nir_lower_two_sided_color: Use the nir_shader_instructions_pass() helper
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11683>
2023-04-22 23:35:37 +00:00
Thomas H.P. Andersen
7e5dde11ef nir/nir_lower_uniforms_to_ubo: Use the nir_shader_instructions_pass() helper
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11683>
2023-04-22 23:35:37 +00:00
Thomas H.P. Andersen
d0fdc8ec6a nir/nir_lower_var_copies: Use the nir_shader_instructions_pass() helper
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11683>
2023-04-22 23:35:37 +00:00
Thomas H.P. Andersen
087b082f3d nir/nir_lower_viewport_transform: Use the nir_shader_instructions_pass() helper
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11683>
2023-04-22 23:35:36 +00:00
Thomas H.P. Andersen
ab7138e283 nir/nir_lower_wpos_ytransform: Use the nir_shader_instructions_pass() helper
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11683>
2023-04-22 23:35:36 +00:00
Thomas H.P. Andersen
ecab220c50 nir/nir_lower_wpos_center: Use the nir_shader_instructions_pass() helper
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11683>
2023-04-22 23:35:36 +00:00
Axel Davy
133e7ba571 frontend/nine: fix wfog
When wfog support is advertised, unless an orthogonal
projection matrix is detected, w is supposed to be used
instead of z for the fog equation when done in the pixel
shader.

Due to the spec being ambiguous, and tests being incomplete,
it seems we had got things wrong.
New tests confirm the behaviour.

For the explanation we will denote z_vs and w_vs the position
output's z and w channels in the vertex shader, and
z_ps, w_ps the position input z and w channels in the pixel shader.
w_ps = 1/w_vs
z_ps = z_vs/w_vs

In the programmable pixel shader, we used z_ps/w_ps, thus z_vs.
As basically z_vs and w_vs are usually in the same range, we didn't
notice an obvious difference with the correct behaviour.

In the ff pixel shader, we used z_ps for zfog and w_vs else.
z_ps was always used if a programmable vertex shader was detected.
This latter behaviour led to issue
https://gitlab.freedesktop.org/mesa/mesa/-/issues/8341

While using z_ps/w_ps like for programmable ps fixes the issue visually
for the same reason as it did for programmable ps, it breaks
wine tests using XYZRHW. These tests show that when passing
pre-transformed vertices and an orthogonal projection matrix,
z_vs is used, and due to the XYZRHW property, this is not
recovered by the z_ps/w_ps computation (instead z_ps=z_vs).
For the game affected by the issue, the projection matrix set
is not orthogonal.

The direct3D spec indicates that the projection matrix must be
set correctly for fog to work properly, even if we do not use the
transformation pipeline (could be related to xyzrhw, or programmable vs
or both). Previous tests had shown that the projection matrix
has the last two values of the last column tested against 0 and 1,
in order to activate zfog or wfog.
The R500 spec indicates that either z or 1/1/w can be used as source
for the fog computation, but it is not clear whether this is z_vs or
z_ps.

Tests confirmed the intuition that the correct behaviour
is to use z_ps (zfog) when an orthogonal projection matrix is set
(the spec spirit being that in that case z_ps=z_vs),
and 1/w_ps (wfog) else (even if programmable shaders are used).

This patch introduces this behaviour.
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8341

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22583>
2023-04-22 21:09:07 +00:00
Axel Davy
80d1da14f0 frontend/nine: fix fog key overflow
FOGTABLEMODE is 2 bits. It could thus
overwrite the part of the ps key reserved
for centroid interpolation.

Fix the size of FOGTABLEMODE and the key

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22583>
2023-04-22 21:09:07 +00:00
Axel Davy
9923a31945 frontend/nine: Apply writemask to pointsize
Seen when working on the code.
It seems like a sane thing to do, but it
might be wrong.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22583>
2023-04-22 21:09:07 +00:00
Axel Davy
02ce3abd8a frontend/nine: Fix missing clamping of pointsize for ff
Seen while working on this code.
It seems to be a sane thing to do.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22583>
2023-04-22 21:09:06 +00:00
Juan A. Suarez Romero
7edae7baa6 v3dv/ci: rename waiver test
Apparently dEQP-VK.draw.inverted_depth_ranges.nodepthclamp_deltazero was
renamed to dEQP-VK.draw.renderpass.inverted_depth_ranges.nodepthclamp_deltazero.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22641>
2023-04-22 19:43:11 +02:00
Gert Wollny
6a78af1dbb r600/sfn: make sure f2u32 is lowered late and correctly for 64 bit floats
With the latest changes in opt_algebraic we got f2u32 in the final code
that should be lowered before conversion to assembly.

Fixes: b3685f3ba7
    nir/algebraic: insert patterns inside optimizations list

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22640>
2023-04-22 15:46:16 +02:00
Tatsuyuki Ishi
068738eea9 util: Add mesa_blake3 wrappers.
The wrappers mirrors the mesa_sha1 API to ease migration.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22387>
2023-04-22 01:28:38 +00:00
Tatsuyuki Ishi
0e30076d83 util/blake3: Patch with hidden visibility for asm symbols.
For Unix platforms, the symbol visibility needs to be hidden to avoid
exposing them in driver shared objects.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22387>
2023-04-22 01:28:38 +00:00
Tatsuyuki Ishi
77826e8352 util: Add a copy of BLAKE3 hash library.
The files are copied from upstream repo, with a few modifications to fix
build errors, as described in the README.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22387>
2023-04-22 01:28:38 +00:00
Dylan Baker
a01d9ac330 docs: update calendar for 23.0.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22635>
2023-04-21 20:26:08 +00:00
Dylan Baker
404e8991ca docs: update calendar for 23.0.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22635>
2023-04-21 20:26:07 +00:00
Dylan Baker
328e832750 docs: update calendar for 23.0.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22635>
2023-04-21 20:26:07 +00:00
Dylan Baker
d6821080cd docs: Add sha256 sum for 23.0.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22635>
2023-04-21 20:26:07 +00:00
Dylan Baker
48e753d4c8 docs: add release notes for 23.0.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22635>
2023-04-21 20:26:07 +00:00
Dylan Baker
63ad833dd0 docs: Add sha256 sum for 23.0.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22635>
2023-04-21 20:26:07 +00:00
Dylan Baker
10a5ca13b5 docs: add release notes for 23.0.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22635>
2023-04-21 20:26:07 +00:00
Dylan Baker
6a5a7e791f docs: Add sha256 sum for 23.0.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22635>
2023-04-21 20:26:07 +00:00