Commit graph

147698 commits

Author SHA1 Message Date
Samuel Pitoiset
68e69d002f radv: stop emitting RMW context registers for updating sample locations
RMW context registers have been removed in RadeonSI a while ago
because they don't seem good for performance.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18234>
2022-08-26 06:33:05 +00:00
Samuel Pitoiset
2f5891108a radv: cleanup dynamic states in radv_emit_graphics_pipeline()
Some dynamic states always need to be emitted when the first pipeline
is emitted, some others depend on pipeline state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18234>
2022-08-26 06:33:05 +00:00
Samuel Pitoiset
85a55009be radv: stop clearing bitfields for registers that are emitted dynamically
These fields aren't set at pipeline creation, so clearing them is
just useless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18234>
2022-08-26 06:33:05 +00:00
Samuel Pitoiset
7aaa016b23 radv: stop setting CB_COLOR_CONTROL.ROP3 from the pipeline
This is useless because logic op is a dynamic state and it's already
emitted from the cmdbuf.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18234>
2022-08-26 06:33:05 +00:00
Qiang Yu
b5c10a9028 ac/llvm: cast tes_u/v_replaced to float
Otherwise LLVM float ops fail to operate on them.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
f75452918b ac/nir/ngg: support clipdist culling
Port from radeonsi.

Besides vertex position based primitive culling, clipdist
attribute can also be used to cull a primitive. Normally
it's used by fixed-pipeline, but when NGG we can treate it
as a culling condition to filter out invisible primitive
before fixed-pipeline.

There are two kinds of clipdist:
1. user define a clip plane explicitly by glClipPlane(),
   fixed-pipeline calculate with vertex position to get
   clipdist, then cull. This is the legacy way.
2. Now GLSL define gl_ClipDistance/gl_CullDiatance so that
   user can calculate clipdist in any way he like.

This implementation support both way.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
620e62bb39 ac/nir/ngg: support component position store
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
1bdeb961bd ac/nir/ngg: add gs culling
Port from radeonsi.

Cull primitive after GS thread and before final vertex/primitive
export. GS culling is like VS/TES culling which read out saved
vertex positions of a primitive from LDS then call the primitive
culling algorithm to check whether it's visiable or not, only
passed primitives will be exported.

Unlike the VS/TES culling that read vertex index of a primitive
from VGPRs as shader args, GS will set a primitive complete flag
for each last vertex of a primitive in LDS, so that vertex thread
know the previous 1/2/3 vertex can form a primitive and do primitive
culling.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
b212fd4b1e ac/nir/ngg: save and restore position output base for nogs
radeonsi has different driver_location and io location.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
7e17e01973 ac/nir/ngg: save and restore output bit size for gs
radeonsi does not have io nir variables, so need to save output
bit size when lower store_output intrinsic.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
93a635c2c8 ac/nir/ngg: use same driver location for gs output
driver_location and io location are different for radeonsi,
and radeonsi llvm rely on the correct driver_location to
index output variables.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
347a94666c ac/nir/ngg: fix and simplify gs store output lower
Simplify: 64bit IO has been lowered by nir_lower_io with
nir_lower_io_lower_64bit_to_32, so no need to handle in the
ngg lower.

Fix: we need to increase io_sem.location by base_offset for
correct gs_output_info.

radeonsi has different driver_location and io location, so
also change the output variable index to io location.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
db0e9d3cab ac/nir/ngg: support line culling
Port from ac_llvm_cull.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
f1f2c931a7 ac/nir/cull: support caller react when primitive is rejected
Make accept_func optional, and return accpect result for caller
react when primitive is rejected.

This is for GS culling.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
035d70f721 ac/nir/ngg,radv: use nir_load_viewport_xy_scale_and_offset
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
a19dcdf9d5 nir,ac/llvm: add nir_intrinsic_load_viewport_xy_scale_and_offset
Used by RADV/Radeonsi NGG culling. Pack them into a single vec4
load for radeonsi to reduce const buffer load.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Qiang Yu
1aef9c8318 nir,ac/llvm: add nir_intrinsic_load_half_line_width_amd
Used by AMD GPU NGG line culling. We could use nir load
line width and viewport scale to calculate this in shader,
but this way needs expensive divide ops.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17651>
2022-08-26 05:50:30 +00:00
Dave Airlie
0c2b824f67 gallivm: don't indirect image/sampler destroy.
These are pointless indirections, just call direct the destroy
functions.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17946>
2022-08-26 04:39:59 +00:00
Dave Airlie
5fdd77c7f2 gallivm/sample: remove unused base parameter from dynamic callbacks.
This parameters was never used anywhere, so just remove it.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17946>
2022-08-26 04:39:59 +00:00
Dave Airlie
1f0d1a96cb gallivm: drop unused parameter to lp_build_sample_aos
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17946>
2022-08-26 04:39:59 +00:00
Kenneth Graunke
71ace23fa7 iris: Use linear for exported resources if we can't convey tiling
If we have modifiers, we can use those to convey the tiling of exported
resources.  If we have the deprecated i915 GET/SET_TILING uAPI, we can
use that to convey the tiling.

If we have neither, then we have to fall back to linear.

Fixes: e658835436 ("iris/bufmgr: Do not use map_gtt or use set/get_tiling on DG1")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6938
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18240>
2022-08-25 16:08:56 -07:00
Jesse Natalie
d66e840ab4 dzn: Get max supported shader model
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:49 +00:00
Jesse Natalie
85359eba03 d3d12: Get max supported shader model
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:49 +00:00
Jesse Natalie
cb21534a7c microsoft/compiler: Support SM6.7
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:49 +00:00
Jesse Natalie
01b6676d5f microsoft/compiler: SM6.6 is supported
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:48 +00:00
Jesse Natalie
8a4cba7143 microsoft/compiler: Handle SM6.6 handles
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:48 +00:00
Jesse Natalie
15e472f7d2 microsoft/compiler: Pass lower_bound, upper_bound, space to createhandle
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:48 +00:00
Jesse Natalie
6725362dfe microsoft/compiler: Delete double-assignment of sampler metadata field
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:48 +00:00
Jesse Natalie
a19628e3c7 microsoft/compiler: Add getters for res bind/props structs
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:48 +00:00
Jesse Natalie
b5c6416d40 microsoft/compiler: Add dynamic create handle helper
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:48 +00:00
Jesse Natalie
e9489beb76 microsoft/compiler: Add struct and function defs for SM6.6 handle funcs
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:48 +00:00
Jesse Natalie
d4b964b546 microsoft/compiler: Support up to shader model 6.5
We don't actually use any of the new features, but that's okay, it's
still valid DXIL at the higher shader models.

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:48 +00:00
Jesse Natalie
ebb9ff2165 microsoft/compiler: Always emit a shader at the max-supported shader model
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
2022-08-25 21:22:48 +00:00
Chia-I Wu
6abadd27ec turnip: improve tracing of secondary cmd buffers
This visualizes secondary cmd buffers in perfetto.  I did not test
dynamic rendering, which appears to call tu_clone_trace_range already.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
4b37439764 turnip: add cmd_buffer tracepoint
It is only used for primary cmd buffers for the moment.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
4c03e40991 turnip: rename some tracing stages
Rename SURFACE_STAGE_ID to RENDER_PASS_STAGE_ID.  Indicate whether gmem
or bypass is used in the stage name.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
57d2d75237 turnip: clean up tu_perfetto.h
Move enums, stages, queues, and some function declarations to
tu_perfetto.cc.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
c867753c94 turnip: convert tu_perfetto_state to a stack
A stage does not end until its nested stages end.  tu_perfetto_state can
be a stack.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
c6d488814c turnip: add tu_clone_trace_range helper
Remove some duplicated code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
9aa57bae9f util/u_trace: add PERFETTO HeaderScope
Headers with the PERFETTO scope will be included by the generated
perfetto utils header.  This is needed because to_prim_type may have
header dependencies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
dea0d684b7 util/u_trace: include the generated header first
This is a good practice to make sure the generated header is
self-contained (no missing includes, declarations, etc.).

Remove unnecessary SOURCE header scope from the default.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
0d57cf8cad turnip: tidy up tracepoint header includes
Remove unused util/u_dump.h.  Add missing forward declarations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
b1ba0791e3 turnip: fix gem_store tracepoint
Set cmd->trace_renderpass_end after tu6_emit_tile_store in case of gmem.

To be able to do that, we push the update of cmd->trace_renderpass_end
down into tu_cmd_render_tiles/tu_cmd_render_sysmem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
f539bd7a03 turnip: move trace_start_gmem_store before cond exec
Suggested by Danylo.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
3f045bd176 turnip: fix a missing trace_end_gmem_clear
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:14 +00:00
Chia-I Wu
91a0411d2a turnip: improve perfetto sync_timestamp
tu_device_get_gpu_timestamp takes >100us on my otherwise idle sc7180.
Read the cpu block again after the call returns.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
2022-08-25 21:00:13 +00:00
Yiwei Zhang
ce0e13155d venus: avoid scrubing wsi/external sempahores
When the renderer supports sync_fd import for the binary semaphore,
venus can import the special signaled payload to the semaphore instead
of scrubing it. This avoids the bugs w.r.t timeline semaphore and device
group submission in the legacy scrub path.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang
7cf59d6982 venus: re-implement sync_fd external sempahore
sync_wait is deferred to a submission that waits on the semaphore.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang
4da0ac54cf venus: re-implement sync_fd external fence
Instead of waiting for signal before importing, we are able to retain
the imported sync file and handle the fence related commands on the
driver side.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang
db9fa4be04 venus: query renderer sync_fd props to fill the feature stubs
This change enables the fixed code paths.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00