Commit Graph

520 Commits

Author SHA1 Message Date
James Park 0aaaee09a4 radv: Match function definitions to declarations
Fixes compiler errors for 32-bit Windows.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13749>
2021-11-12 09:46:10 +00:00
Samuel Pitoiset 9b80f4d5f2 radv: rename radv_shader_variant to radv_shader
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/13548>
2021-11-01 20:04:45 +00:00
Samuel Pitoiset b6a69dbb40 radv: re-emit prolog inputs when the nontrivial divisors state changed
If the application first uses nontrivial divisors, the driver emits
the vertex shader VA to the upload BO rather than directly via the
user SGPRs locations. But, if the vertex input dynamic state changes,
the driver might select a different VS prolog that no longer needs
nontrivial divisors.

In this case, the driver needs to re-emit the prolog inputs because
otherwise the VS prolog will jump to the PC that is emitted via the
user SGPR locations, and the previous one was somewhere in the
upload BO...

This fixes a GPU hang with Bioshock and Zink.

Fixes: d9c7a17542 ("radv: enable VK_EXT_vertex_input_dynamic_state")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13377>
2021-10-22 09:47:50 +02:00
Samuel Pitoiset 8ec6824335 radv,aco: decouple shader_info/options from radv_shader_args
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/13287>
2021-10-22 07:10:40 +00:00
Rhys Perry 80841196b2 radv: implement dynamic vertex input state using vertex shader prologs
This doesn't actually use the functionality or implement prolog
compilation yet.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11717>
2021-10-13 05:13:10 +00:00
Rhys Perry a1069b8bd4 radv: add segregated fit shader memory allocator
Way faster than the previous one, especially with a large number of
shaders.

This doesn't have much of an effect right now, but the previous allocator
was expensive compared to the cost of compiling vertex shader prologs.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11717>
2021-10-13 05:13:10 +00:00
Rhys Perry 404752bfb2 radv: add radv_shader_variant_get_va and radv_find_shader_variant helpers
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11717>
2021-10-13 05:13:10 +00:00
Samuel Pitoiset ced950e42f radv: store the post-processed shader binary config to the cache
This will allow us to reduce the size of radv_shader_info which is
stored in the cache entry.

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/12992>
2021-10-11 12:25:41 +00:00
Samuel Pitoiset 1585629db2 radv: move ac_shader_config to radv_shader_binary instead of legacy
This will allow us to avoid postprocessing binaries when they are
loaded from the shaders cache.

LLVM binaries already contain the shader config as part of the ELF,
so it's duplicated and increase the cache entry by 48 bytes. Though,
I don't think that should matter for LLVM.

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/12992>
2021-10-11 12:25:41 +00:00
Timur Kristóf 52413a93af radv: Enable NGG culling by default on GFX10.3, add nonggc debug flag.
This commit enables NGG culling on all GFX10.3 GPUs by default.

A new debug flag environment variable RADV_DEBUG=nonggc is added to
disable this feature on GPUs where it is enabled by default.

The previous perf test flag RADV_PERFTEST=nggc will not be needed on
GFX10.3 anymore but it can still be used to enable the feature on
GPUs where it isn't on by default.

Totals from 58239 (45.27% of 128647) affected shaders:
VGPRs: 1989752 -> 2049408 (+3.00%); split: -3.21%, +6.21%
SpillSGPRs: 675 -> 883 (+30.81%); split: -78.07%, +108.89%
CodeSize: 72205968 -> 153572764 (+112.69%)
LDS: 0 -> 227125248 (+inf%)
MaxWaves: 1614598 -> 1646934 (+2.00%); split: +3.08%, -1.08%
Instrs: 14202239 -> 29654042 (+108.80%)
Latency: 87986508 -> 136960419 (+55.66%); split: -0.23%, +55.89%
InvThroughput: 14444832 -> 21141875 (+46.36%); split: -0.01%, +46.37%
VClause: 340794 -> 493067 (+44.68%); split: -1.33%, +46.01%
SClause: 520983 -> 738636 (+41.78%); split: -0.25%, +42.03%
Copies: 775639 -> 2787382 (+259.37%)
Branches: 296911 -> 1225431 (+312.73%)
PreSGPRs: 1316896 -> 2057270 (+56.22%); split: -0.14%, +56.36%
PreVGPRs: 1473558 -> 1658432 (+12.55%); split: -1.44%, +13.99%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13086>
2021-10-08 14:18:54 +00:00
Samuel Pitoiset 64030e79c5 radv,aco: remap PS inputs when declaring shader arguments
LLVM seems to require all inputs for PS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13192>
2021-10-08 14:14:09 +02:00
Samuel Pitoiset 4e07fe5f78 radv,aco: compute and store the SPI PS input in radv_shader_info
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13192>
2021-10-08 14:14:08 +02:00
Samuel Pitoiset a07bc0c37a radv: do not set TRAP_PRESENT(1) for fragment shaders
It shouldn't be always set. Found by inspection.

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/13244>
2021-10-08 09:00:56 +02:00
Jason Ekstrand 7a2516568d radv: Switch to the new common vk_error helpers
Also, change every vk_error to use the closest object instead of
fetching all the way back to the instance.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>
2021-10-07 20:51:36 +00:00
Boris Brezillon b47090c5b3 spirv: Always declare FragCoord as a sysval
Now that all spirv_to_nir() users take care of converting sysvals to
varyings, we can unconditionally declare FragCoord as a sysval.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>
2021-10-07 19:45:35 +00:00
Boris Brezillon 4b62e90e71 spirv: Let spirv_to_nir() users turn sysvals into input varyings
This is an attempt at simplifying the spirv_to_nir() backend when it
comes to choosing between system values and input varyings. Let's patch
drivers to do the sysval to input varying conversion on their own so we
can get rid of the frag_coord_is_varying field in spirv_to_nir_options
and unconditionally create create sysvals for FragCoord, FrontFacing and
PointCoord inputs instead of adding new xxx_is_{sysval,varying} flags.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>
2021-10-07 19:45:35 +00:00
Rhys Perry 1e9f72ffbe radv,aco: use lower_to_fragment_fetch
This simplifies ACO and will let us optimize the FMASK fetch (for example,
move it out of loops).

fossil-db (Sienna Cichlid):
Totals from 955 (0.64% of 150170) affected shaders:
CodeSize: 4722016 -> 4722952 (+0.02%); split: -0.02%, +0.04%
Instrs: 875619 -> 875760 (+0.02%); split: -0.02%, +0.04%
Latency: 14069089 -> 14071699 (+0.02%); split: -0.02%, +0.04%
InvThroughput: 2321419 -> 2321218 (-0.01%); split: -0.02%, +0.01%
VClause: 23080 -> 23081 (+0.00%)
SClause: 32426 -> 32019 (-1.26%); split: -1.88%, +0.62%
Copies: 42787 -> 42777 (-0.02%); split: -0.19%, +0.16%
Branches: 17900 -> 17902 (+0.01%); split: -0.04%, +0.06%
PreSGPRs: 43229 -> 41002 (-5.15%); split: -5.16%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12214>
2021-10-07 15:36:39 +00:00
Samuel Pitoiset 69e656dae4 radv: move use of NGG to the graphics pipeline key
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/13099>
2021-10-04 10:05:18 +00:00
Samuel Pitoiset 0fa431087c radv: move forcing VRS rates to the graphics pipeline key
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/13099>
2021-10-04 10:05:18 +00:00
Samuel Pitoiset 5bacc668fa radv: move forcing MRT output NaN fixup to the graphics pipeline key
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/13099>
2021-10-04 10:05:18 +00:00
Samuel Pitoiset fb453d80a4 radv: move forcing invariant geometry to the graphics pipeline key
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/13099>
2021-10-04 10:05:18 +00:00
Samuel Pitoiset 421b5379df radv: move forcing discard to demote to the graphics pipeline key
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/13099>
2021-10-04 10:05:18 +00:00
Samuel Pitoiset 38c34bf132 radv: constify radv_shader_info for radv_lower_{io_to_mem,ngg}()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Samuel Pitoiset b52aaea630 radv: remove unnecessary ac_nir_ngg_config output struct
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Samuel Pitoiset 52e91f7640 radv: move ngg passthrough determination earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Samuel Pitoiset 2ce78a30ff move: move ngg lds bytes determination earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Samuel Pitoiset 90858dd718 radv: move ngg early prim export determination earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Rhys Perry 24501b5452 radv: move ngg culling determination earlier
Co-Authored-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Tony Wasserka 3c1802accd radv: Disable shader disassembly when no disassembler is available
ACO relies on LLVM to disassemble AMD shaders for ISAs newer than GFX7,
so disassembly needs to be skipped when LLVM is not enabled.

For vkGetPipelineExecutableInternalRepresentationsKHR and vkGetShaderInfoAMD,
the disassembly will not be reported anymore if it can't be generated.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Emmanuel Gil Peyrot d0ec3582af radv: Support shader compilation without LLVM dependencies
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Tony Wasserka 73e82f94c9 radv: Rename radv_shader_helper.h to radv_llvm_helper.h
This better reflects that the functions declared in this header are only
available with LLVM.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Samuel Pitoiset 07d2c152bc radv: make sure to load the Primitive ID for VS+GS as NGG
When the VS doesn't export the Primitive ID but the FS needs it.

Fixes dEQP-VK.pipeline.framebuffer_attachment.no_attachments*.

Fixes: 7ad69e2f7e ("radv: stop loading invocation ID for NGG vertex shaders")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13116>
2021-10-01 06:38:51 +00:00
Lionel Landwerlin 52c0e6e5b3 spirv: switch Groups capability to non AMD specific field
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13081>
2021-09-29 15:40:20 +00:00
Samuel Pitoiset e0efc1eafe radv: remove radv_shader_variant_key completely
Die radv_shader_variant_key, die!

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13085>
2021-09-29 09:59:09 +00:00
Samuel Pitoiset ac774b73fe radv: stop using vs_common_out.{as_es/as_ls/as_ngg*} shader keys
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13085>
2021-09-29 09:59:09 +00:00
Samuel Pitoiset 9aaf51639a radv: use the pipeline key more when possible
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13085>
2021-09-29 09:59:09 +00:00
Samuel Pitoiset bff052d6f5 radv: remove vs_common_out:export_prim_id
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13062>
2021-09-28 13:42:52 +00:00
Samuel Pitoiset 1e5b9b7410 radv: remove unnecessary radv_shader_info:{vs,tes}.export_prim_id
Use the VS outputinfo struct instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13062>
2021-09-28 13:42:52 +00:00
Samuel Pitoiset 2c21835963 radv: remove unused radv_nir_compiler_options fields
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13067>
2021-09-28 08:25:28 +02:00
Samuel Pitoiset 82193fa58c radv: cleanup uses of VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT
Use the pipeline key instead of this mess.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13067>
2021-09-28 08:25:26 +02:00
Samuel Pitoiset deede6b03d radv: pass the pipeline key to the backend compilers
It exactly matches the shader keys now. Everything was copied from
the pipeline key to the shader keys.

There is still some work to completely remove radv_shader_variant_key.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13032>
2021-09-27 11:57:25 +02:00
Samuel Pitoiset 97c7cfe823 radv: rework layout of radv_pipeline_key
To match radv_shader_variant_key.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13032>
2021-09-27 11:57:22 +02:00
Samuel Pitoiset c97147984b radv: store the topology instead of the output primitive type in the key
To match the pipeline key.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13032>
2021-09-27 11:57:17 +02:00
Timur Kristóf b653164973 radv: Fix gs_vgpr_comp_cnt for NGG culling in vertex shaders.
Previously these shaders always took the path to gs_vgpr_comp_cnt=3,
but now they are 0 when they don't use primitive id.

Fixes: 7ad69e2f7e
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13031>
2021-09-24 16:05:44 +00:00
Samuel Pitoiset 4c0bced1fb radv: remove useless as_ngg_passthrough init when lowering NGG in NIR
Nothing reads the value after that, except LLVM but we don't lower it
in NIR (yet).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13025>
2021-09-24 14:13:51 +00:00
Samuel Pitoiset 7ad69e2f7e radv: stop loading invocation ID for NGG vertex shaders
This is unnecessary and was copied from RadeonSI which needs it for
edge flags. RADV should never to read the invocation ID for VS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12997>
2021-09-24 08:26:08 +00:00
Timur Kristóf a7f2faea46 ac/nir: Emit edge flag instructions conditionally.
They are not needed by RADV but will be needed by RadeonSI.

Fossil DB results on Sienna Cichlid (with NGGC on):
Totals from 56917 (44.24% of 128647) affected shaders:
VGPRs: 1982664 -> 1975936 (-0.34%); split: -0.43%, +0.09%
CodeSize: 152790880 -> 149510316 (-2.15%); split: -2.15%, +0.00%
MaxWaves: 1617984 -> 1621900 (+0.24%)
Instrs: 29272825 -> 28907038 (-1.25%); split: -1.26%, +0.01%
Latency: 128744182 -> 127565678 (-0.92%); split: -1.14%, +0.22%
InvThroughput: 20125915 -> 19805168 (-1.59%); split: -1.63%, +0.03%
VClause: 521312 -> 519804 (-0.29%); split: -0.77%, +0.48%
SClause: 688861 -> 688897 (+0.01%); split: -0.04%, +0.05%
Copies: 3205421 -> 3177799 (-0.86%); split: -1.68%, +0.82%
Branches: 1181457 -> 1183147 (+0.14%); split: -0.03%, +0.17%
PreVGPRs: 1626681 -> 1595406 (-1.92%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12998>
2021-09-23 16:57:56 +02:00
Bas Nieuwenhuizen f1095260a4 radv: Experimentally enable RT extensions.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12592>
2021-09-21 01:53:39 +00:00
Bas Nieuwenhuizen 8ca54b4d38 radv: Support nir_intrinsic_load_global_constant.
SPIR-V parsing can result in some direct constant usage for shader
records. Lower this early to a global based intrinsic so that it
doesn't interfere with the later 32-bit offset based constants
for scratch usage.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12592>
2021-09-21 01:53:39 +00:00
Bas Nieuwenhuizen 2070d36cf3 radv: Do more meta shader lowering.
Need this to clean up our generated RT pipeline.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12592>
2021-09-21 01:53:39 +00:00