Commit Graph

139949 Commits

Author SHA1 Message Date
Alyssa Rosenzweig 876de2831f panfrost: Pull erratum workaround into own function
This _does_ need to be draw-time, but it doesn't need to be in the
monster routine.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 672079e592 panfrost: Distribute masks for FPK selection
We can calculate these at much lower frequencies and just & together at
draw time.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 974709c51c panfrost: Partially determine FPK state
This might be disabled at draw-time, but we can merge part of the state
check to compile-time.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 0dd3d32141 panfrost: Hoist allow_forward_pixel_to_be_killed
Only a function of the shader code.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 997c1c84f3 panfrost: Streamline the !fs_required case
Takes some complexity out of the per-draw path.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 00e3705f60 panfrost: Move early-z decision earlier
These were already grouped nicely, just never got used. I also added
coverage writes to the list of reasons not to use early-z for
completeness. At the moment this doesn't do anything since this is a
Midgard flag and we haven't hooked up coverage writes on Midgard.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig c05e04d530 panfrost: Fill out the rasterizer CSO
The RSD state is all over the place but let's try to collect what we
can.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 88b9e5e471 panfrost: Correct the type of sample_mask
Let's not encode impossible masks.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig aee43b8cb0 panfrost: Preset evaluate_per_sample
Even though this isn't totally known at compile-time, at least one case
is, so let's handle that one ahead-of-time.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 04f2cb8ec5 panfrost: Move depth/stencil/alpha to CSO create
Now that we can merge RSD state, there's no reason to pack this at
draw-time. This is fun!

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig ca690579b8 panfrost: Prepack partial RSD at compile time
Even for fragment shaders! Just need to merge the partial descriptors.

Fixes: c21c6d134b ("panfrost: Use the pan_shader_prepare_rsd() helper")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 398e65693b panfrost: Add draw-time merge helper
The famous GenXML "OR" trick. Will be *essential* to packing RSDs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 5a8e1dfaf3 panfrost: Precompute bifrost_blend_type_from_nir
Needed in the draw call hot path. Do it at compile time.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 87256d335b panfrost: Split Bifrost BLEND emit by word
This allows the GenXML packs to be effectively inlined and folded,
skipping over the Midgard pieces.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 9ad1403747 panfrost: Remove unused dither flag
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig bb0b3fde10 panfrost: Streamline fixed-function get_blend path
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 2984d3bf1f panfrost: Pass batch to panfrost_get_blend
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig b98c40ce36 panfrost: Simplify blend_final
Now that we've moved everything but the blend shader up to the CSO, we
can just return a blend shader pointer (or zero to indicate the absence
thereof), and remove a source of name conflicts.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 6ca84265e4 panfrost: Distribute out constant colour code
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig b82ac27ec3 panfrost: Pack blend equations at CSO create time
These are large. Get them out of the per-draw path.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig aa85a64821 panfrost: Garbage collect Gallium blend includes
Got moved to common blend handling.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig ffeeda3414 panfrost: Translate fixed-function blend at CSO create
Fixes: 93824b6451 ("panfrost: Move the blend logic out of the gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 3943adbd91 panfrost: Move blend properties to CSO create
Fixes: 93824b6451 ("panfrost: Move the blend logic out of the gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig d7590efd25 panfrost: Fix pan_blend_to_fixed_function_equation prototype
Doesn't need the whole state, just the equation itself.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Fixes: 93824b6451 ("panfrost: Move the blend logic out of the gallium driver")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig b2affb6cc5 panfrost: Fix blend fixed-function prototype
Needs to be broken up into different functions for disjoint state.
Simpler prototypes and allows matching to CSOs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 5d3e2b5e9e panfrost: Fix blend constant fetch prototype
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Fixes: 93824b6451 ("panfrost: Move the blend logic out of the gallium driver")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig c35194b945 panfrost: Fix is_opaque prototype
Fixes: 93824b6451 ("panfrost: Move the blend logic out of the gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig a0592066b0 panfrost: Fix the reads_dest prototype
Takes too much state, only pass what we need.

Fixes: 93824b6451 ("panfrost: Move the blend logic out of the gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 1d62ec348a panfrost: Fix blending for unbacked MRT
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Bas Nieuwenhuizen c7904b5b9b aco: Implement bvh64_intersect_ray_amd intrinsic.
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10818>
2021-05-18 23:02:25 +02:00
Bas Nieuwenhuizen 2d6a6469b8 nir: Add bvh64_intersect_ray_amd intrinsic.
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10818>
2021-05-18 23:01:47 +02:00
Gert Wollny 5be00fe88a r600: Enable NIR debug flags also for Cayman
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:08 +02:00
Gert Wollny ed595c1785 r600/sfn: legalize image access on Cayman
This,  seems to avoid hardware resets with the
  ARB_shader_image_load_store-invalid
piglit.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny 27f5157777 r600/sfn: Add lowering pass to legalize image access
Make sure only existing images are accessed and that the accessed
coordinates are within the image.
The generated code is quite exponsive, because it encapsulates each
access to an image with two if statements, one to check whether the
image index actually exists (this will get optimized away if the
image selection is direct), and one if statement to check whether
the coordinates are in range. For that reason it will only be enabled
for Cayman were invalid access seems to raise more issues.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny ffc5be25ca r600/sfn: Fix cube query layer number for indirect access
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny 6a15c7d9ad r600/sfn: read number of images from shader info
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny efdb888b29 r600/sfn: Fix Geometry shader for Cayman
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny 80efb6369a r600/sfn: Fix Cayman SSBO write with more than one value
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny 3b1f82c777 r600/sfn: Fix ssbo/image atomic swap for Cayman
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny 9898bc2915 r600/sfn: Fix texture gather for Cayman
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny 2d8b27507d r600/sfn: Use unified code path for index register load
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny e9be6be49b r600/sfn: Use unified index register code for samplers
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny 07514ff2c8 r600/sfn: Fix Cayman trans ops
v2: return from emit_sin_r600 on > Cayman (Kenn Glennard)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:16:07 +02:00
Gert Wollny 89672820b7 r600/sfn: count only distinct literals per instruction group
This is to avoid useless instruction group splits.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:07:10 +02:00
Gert Wollny aa055f78ba r600/sfn: Don't check the faction when searching for the input slot
All loads from the same driver location are merged into one variable,
so there is no need to check the frachtion.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:07:10 +02:00
Gert Wollny 3b4b962c15 r600/sfn: Lower FS pos input w-transform in NIR
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:07:10 +02:00
Gert Wollny ba8d19ab80 r600/sfn: force new CF if fetch through TC would be used in same clause
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:07:10 +02:00
Gert Wollny 91209206f2 r600/sfn: Use valid pixel mode for SSBO and Image result fetches
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:07:10 +02:00
Gert Wollny 129de7ee60 r600/sfn: Use valid pixel mode only in fragment shaders
The doc says that it should only be set in the FS.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:07:10 +02:00
Gert Wollny 9bf5033941 r600: don't put INTERP_X and INTERP_Z into one instruction group
Apparently this is not allowed and results in interpolation errors.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
2021-05-18 22:07:10 +02:00