Commit graph

149838 commits

Author SHA1 Message Date
Brian Paul
6ef3881010 llvmpipe: asst. clean-ups in lp_setup_rect.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
5131200c28 llvmpipe: asst. clean-ups in lp_setup.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
5a63484b35 llvmpipe: asst. clean-ups in lp_query.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
49ab7d19bd llvmpipe: asst. clean-ups in lp_screen.[ch]
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
36df3d9b6f llvmpipe: asst. clean-ups in lp_surface.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
b763db6015 llvmpipe: asst. clean-ups in lp_context.[ch]
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
bc2068ac49 gallium: whitespace fixes in p_context.h, p_screen.h
Use consistent whitespace near parens.  Replace tabs w/ spaces, etc.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
2e55ee8c08 llvmpipe: asst. clean-ups in lp_rast_linear_fallback.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
25e214cdb6 llvmpipe: asst. clean-ups in lp_rast_linear.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
b522d9d233 llvmpipe: asst. clean-ups in lp_rast.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
4e58893275 llvmpipe: asst. clean-ups in lp_rast_rect.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
a020052a0b llvmpipe: asst. clean-ups in lp_rast_priv.h
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
e368ea1725 llvmpipe: asst. clean-ups in lp_rast_debug.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Brian Paul
ae9d8dba19 llvmpipe: asst. clean-ups in lp_rast.h
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19289>
2022-10-25 15:27:12 +00:00
Mike Blumenkrantz
fa7544959e zink: add some docs for c++ pipeline state functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19205>
2022-10-25 13:31:43 +00:00
Mike Blumenkrantz
59f560caa2 zink: add some descriptor docs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19205>
2022-10-25 13:31:43 +00:00
Mike Blumenkrantz
82096c8301 zink: stop passing pointer to changed_sets to populate_sets()
I think this used to be a thing for caching but I don't remember

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19205>
2022-10-25 13:31:43 +00:00
Mike Blumenkrantz
a6fdf7f649 zink: delete unused descriptor function
this is leftover from caching

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19205>
2022-10-25 13:31:43 +00:00
Mike Blumenkrantz
bff1f299d1 zink: add more zink_descriptor_type enum values to improve readability
the values are still the same, but now enum names can be used to more
accurately reflect their actual meaning

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19205>
2022-10-25 13:31:43 +00:00
Mike Blumenkrantz
852de28579 zink: ZINK_DESCRIPTOR_TYPES -> ZINK_DESCRIPTOR_BASE_TYPES
slightly more clear

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19205>
2022-10-25 13:31:43 +00:00
Mike Blumenkrantz
6f65a272f6 zink: rename some variables in descriptor code
this is more accurate

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19205>
2022-10-25 13:31:43 +00:00
Qiang Yu
cf74cf3901 radeonsi: implement nir shader query enabled intrinsics
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17457>
2022-10-25 12:58:43 +00:00
Qiang Yu
01d26e13d1 radeonsi: implement llvm abi atomic_add_prim_count
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17457>
2022-10-25 12:58:43 +00:00
Qiang Yu
540eafada1 ac/nir/ngg: add streamout emitted primitive query
For radeonsi to implement GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17457>
2022-10-25 12:58:43 +00:00
Qiang Yu
188a7f9226 ac/nir/ngg: add query param to ac_nir_lower_ngg_gs
radeonsi may disable it. gfx_level will also be used by latter
vertex param export when gfx11.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17457>
2022-10-25 12:58:43 +00:00
Qiang Yu
7fb506d068 nir: add nir_load_prim_xfb_query_enabled_amd
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17457>
2022-10-25 12:58:43 +00:00
Qiang Yu
a119a6464f nir,ac,radv: add primitive count add intrinsics
radeonsi use shader buffer, but radv use gds for the query
result storage.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17457>
2022-10-25 12:58:43 +00:00
Samuel Pitoiset
e18f76d890 radv: disable dual source blending in more situations
According to PAL, there is more restrictions that RADV doesn't have.

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/19278>
2022-10-25 12:22:34 +00:00
Pierre-Eric Pelloux-Prayer
df16fa43ff radeonsi: handle sqtt pipeline in shader prefetch
When sqtt is enabled, the shader code lives in the pipeline bo,
not in the shader bo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
6189af1ddb radeonsi: store the shader gpu adress in si_shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
619f009ff2 radeonsi/sqtt: simplify condition to determine if sqtt is on
We don't need to load screen->debug_flags because sctx->thread_trace
is already telling us if sqtt is enabled.
Furthermore we can perform this check only for GFX9 because sqtt
isn't supported  currently on older chips.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
cc5dd491ec radeonsi: simplify si_prefetch_shaders
Since 93cd96b523 the only used value of si_L2_prefetch_mode
was PREFETCH_ALL so we can remove some dead code in si_prefetch_shaders.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
676214b6ba radeonsi/tests: update expected results for polaris11
Using the latest released LLVM version 15.0.1.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
f6f24786da radeonsi/tests: update expected results for navi10
Using the latest released LLVM version 15.0.1.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
42d26ce8af radeonsi/tests: update expected results for navi21
Using the latest released LLVM version 15.0.1.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
4b2a3df607 radeonsi/tests: simplify the script
And use exit(0) on success, exit(1) on failure.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
ee9d7e5c62 radeonsi/tests: handle flakes file for all test suite
And a generic flakes file that applies to all GPUs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
f319f039fb radeonsi/sqtt: allow to disable spm counters
And fix rgp capture on GFX9 (where spm was disabled by default).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
8034a71430 radeonsi/sqtt: re-export shaders in a single bo
RGP expects a pipeline's shaders to be all stored sequentially, eg:

  [vs][ps][gs]

As such, it assumes a single bo is dumped to the .rgp file, with
the following info:
  * va of the bo
  * offset to each shader inside the bo

For radeonsi, the shaders are stored individually, so we may have
a big gap between the shaders forming a pipeline => we can produce
very large file because the layout in the file must match the one
in memory (see the warning in ac_rgp_file_write_elf_text).

This commit implements a workaround: gfx shaders are re-exported as a
pipeline.

To update the shader address, a new state is created (sqtt_pipeline),
which will overwrite the needed _PGM_LO_* registers.

This reduces DeuxEX rgp captures from 150GB+ to less than 100MB.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Pierre-Eric Pelloux-Prayer
5a9a43c8f9 radeonsi/sqtt: notify sqtt when we skip a flush
Otherwise we may not produce any data because
si_handle_thread_trace is never called.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18865>
2022-10-25 11:58:07 +00:00
Yonggang Luo
a37e3b7199 util: #include "c11/threads.h" instead of #include "util/u_cpu_detect.h" u_format.c
As it does not access any symbols in util/u_cpu_detect.h but accessed symbols in "c11/threads.h"

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19266>
2022-10-25 11:06:05 +00:00
Yonggang Luo
cf44028c02 util: Move UTIL_MAX_CPUS from u_thread.h to u_cpu_detect.h
UTIL_MAX_CPUS is not used by u_thread.* anymore after commit
"util: replace UTIL_MAX_CPUS by util_cpu_caps.num_cpu_mask_bits"

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19266>
2022-10-25 11:06:05 +00:00
Yonggang Luo
64ee9c1158 util: Merge duplicated function prototype in u_thread.h that named with util_barrier*
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19266>
2022-10-25 11:06:05 +00:00
Yonggang Luo
17d46893fd util: Remove non used UTIL_MAX_L3_CACHES in u_thread.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19266>
2022-10-25 11:06:05 +00:00
Karmjit Mahil
6a9364f4bc pvr: Change pvr_get_hw_clear_color() to pack based on accum formats.
`pvr_get_hw_clear_color()` now packs formats based on the accum
format which is how the hw deals with the formats internally and
might not line up exactly with the vk format representation.

E.g. R5G6B5_UNORM_PACK16 uses the U8 accum format so the USC will
internally use 3 bytes (1 per component) to deal with it instead
of 2 bytes which the vk format specifies. On USC EMITPIX, the PBE
will pack the results to 2 bytes using PACKMODE_R5G6B5 resulting
in the final value being in the vk format representation.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19218>
2022-10-25 10:15:09 +00:00
Karmjit Mahil
81a90c1e48 pvr: Add PBE accum format size in bytes.
This will be used later on to implement
vkCmdClearAttachments() where we'll need to pick the
appropriate clear color shader based on the dwords used.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19218>
2022-10-25 10:15:09 +00:00
Fabian Vogt
28f4fcaa4f gallivm: Fix LLVM optimization with the new pass manager
The previous list of passes contained several errors: "constprop" does not
exist anymore and a trailing ',' is not allowed. This made LLVMRunPasses
fail, but the error is silently ignored. Thus none of the listed passes
ran at all.

https://reviews.llvm.org/D85159 suggests "InstSimplify really should be
used anywhere ConstProp is being used" so replace constprop with
instsimplify and remove the trailing comma.

By enabling pass logging with
LLVMPassBuilderOptionsSetDebugLogging(opts, true),
the difference is visible. Before:

Running pass: AlwaysInlinerPass on [module]
Running analysis: InnerAnalysisManagerProxy<llvm::FunctionAnalysisManager, llvm::Module> on [module]
Running analysis: ProfileSummaryAnalysis on [module]
Running pass: CoroConditionalWrapper on [module]
Running pass: AnnotationRemarksPass on fs_variant_partial (1162 instructions)
Running analysis: TargetLibraryAnalysis on fs_variant_partial
Running pass: AnnotationRemarksPass on fs_variant_whole (1110 instructions)
Running analysis: TargetLibraryAnalysis on fs_variant_whole

After:

Running pass: AlwaysInlinerPass on [module]
Running analysis: InnerAnalysisManagerProxy<llvm::FunctionAnalysisManager, llvm::Module> on [module]
Running analysis: ProfileSummaryAnalysis on [module]
Running pass: CoroConditionalWrapper on [module]
Running pass: AnnotationRemarksPass on fs_variant_partial (1162 instructions)
Running analysis: TargetLibraryAnalysis on fs_variant_partial
Running pass: AnnotationRemarksPass on fs_variant_whole (1110 instructions)
Running analysis: TargetLibraryAnalysis on fs_variant_whole
Running analysis: InnerAnalysisManagerProxy<llvm::FunctionAnalysisManager, llvm::Module> on [module]
Running pass: SROAPass on fs_variant_partial (1162 instructions)
Running analysis: DominatorTreeAnalysis on fs_variant_partial
Running analysis: AssumptionAnalysis on fs_variant_partial
Running analysis: TargetIRAnalysis on fs_variant_partial
Running pass: EarlyCSEPass on fs_variant_partial (1111 instructions)
Running analysis: TargetLibraryAnalysis on fs_variant_partial
Running pass: SimplifyCFGPass on fs_variant_partial (961 instructions)
Running pass: ReassociatePass on fs_variant_partial (961 instructions)
Running pass: PromotePass on fs_variant_partial (897 instructions)
Running pass: InstCombinePass on fs_variant_partial (897 instructions)
Running analysis: OptimizationRemarkEmitterAnalysis on fs_variant_partial
Running analysis: AAManager on fs_variant_partial
Running analysis: BasicAA on fs_variant_partial
Running analysis: ScopedNoAliasAA on fs_variant_partial
Running analysis: TypeBasedAA on fs_variant_partial
Running analysis: OuterAnalysisManagerProxy<llvm::ModuleAnalysisManager, llvm::Function> on fs_variant_partial
Running pass: SROAPass on fs_variant_whole (1110 instructions)
Running analysis: DominatorTreeAnalysis on fs_variant_whole
Running analysis: AssumptionAnalysis on fs_variant_whole
Running analysis: TargetIRAnalysis on fs_variant_whole
Running pass: EarlyCSEPass on fs_variant_whole (1059 instructions)
Running analysis: TargetLibraryAnalysis on fs_variant_whole
Running pass: SimplifyCFGPass on fs_variant_whole (912 instructions)
Running pass: ReassociatePass on fs_variant_whole (912 instructions)
Running pass: PromotePass on fs_variant_whole (844 instructions)
Running pass: InstCombinePass on fs_variant_whole (844 instructions)
Running analysis: OptimizationRemarkEmitterAnalysis on fs_variant_whole
Running analysis: AAManager on fs_variant_whole
Running analysis: BasicAA on fs_variant_whole
Running analysis: ScopedNoAliasAA on fs_variant_whole
Running analysis: TypeBasedAA on fs_variant_whole
Running analysis: OuterAnalysisManagerProxy<llvm::ModuleAnalysisManager, llvm::Function> on fs_variant_whole

Fixes: 2037c34f24 ("gallivm: move to new pass manager to handle coroutines change.")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19217>
2022-10-25 09:41:58 +00:00
Daniel Schürmann
a36e27e507 aco: change thread_local memory resource to pointer
Apparently the TLS constructor doesn't work well if RADV
is instantiated multiple times and/or used by a program with
already existing threads.

Fixes: a128d444cb ('aco: use monotonic_buffer_resource for instructions')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19219>
2022-10-25 09:08:08 +00:00
Roman Gilg
43d93c32c9 loader/dri3: Add DRI performance option to wait for next buffer on swap
For simple clients using the swap chain contention back pressure to regulate
their drawing and that don't query buffer age introduce a new DRI option with
which set to true (the default is false) we block the client until a new buffer
is available. This way we stall the client's execution until a new buffer is
available and the redrawing of the client starts only at this point and not
before.

The motivation for that is to reduce latency for clients that regulate their
drawing by swapchain contention back pressure. These clients draw whenever
possible and their drawing is implicitly stopping whenever we block. When we
block at the end of the swap and return only when a new buffer is available
the client can draw and we directly present. Otherwise the client would draw,
we block on the buffer becoming available, and only then show what the client
had drawn, usually one frame later.

Co-authored-by: Michel Dänzer <michel@daenzer.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14684>
2022-10-25 08:30:35 +00:00
Roman Gilg
d54464279c loader/dri3: Simplify buffer age query
The ternary operator is hard to read. Instead initialize the return variable
to zero and adjust its value in an if-clause.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14684>
2022-10-25 08:30:35 +00:00