Harri Nieminen
aea48a4ff1
amd: fix typos
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22432 >
2023-04-13 23:08:22 +00:00
Konstantin Seurer
2bf9ae78c5
radv: Remove radv_bvh_aabb_node::aabb
...
It was only read by RRA which can infer it from the parenbt internal
node.
Change in average build time (Control):
84.69471 ms -> 84.25319 ms
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22400 >
2023-04-11 07:57:34 +00:00
Alyssa Rosenzweig
968c5c6334
radv: Use umod_imm
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010 >
2023-03-22 06:18:18 +00:00
Konstantin Seurer
2d93ab795b
radv/rt: Pre shift cull_mask
...
This removes the need for masking the instance mask.
Totals from 14 (14.43% of 97) affected shaders:
CodeSize: 378696 -> 378308 (-0.10%); split: -0.12%, +0.02%
Instrs: 70854 -> 70855 (+0.00%); split: -0.02%, +0.02%
Latency: 1651235 -> 1651215 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 336290 -> 336285 (-0.00%); split: -0.00%, +0.00%
Copies: 9915 -> 9923 (+0.08%); split: -0.03%, +0.11%
PreSGPRs: 890 -> 896 (+0.67%)
PERCENTAGE DELTAS Shaders CodeSize Instrs Latency InvThroughput Copies PreSGPRs
q2rtx-pipe 48 -0.02% -0.02% -0.00% -0.00% -0.03% .
q2rtx_1 49 -0.10% +0.02% +0.00% +0.00% +0.14% +0.31%
-------------------------------------------------------------------------------------------
All affected 14 -0.10% +0.00% -0.00% -0.00% +0.08% +0.67%
-------------------------------------------------------------------------------------------
Total 97 -0.06% +0.00% -0.00% -0.00% +0.06% +0.16%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21530 >
2023-02-26 12:58:13 +00:00
Konstantin Seurer
4d2a7ea146
radv: Use vk_acceleration_structure
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21047 >
2023-02-22 11:58:57 +00:00
Konstantin Seurer
af19762935
radv/rt: Skip instances after loading the entire node
...
This avoids waiting for instance_data which can improve performance:
vk_ray_tracing_ao_KHR_app: 0.2% (The TLAS has 2 instances)
Quake II RTX: 1%
Control: 1%
We also have to shuffle around some code to avoid increasing VGPR usage.
That leaves us with the following stats:
Quake II RTX:
Totals from 7 (14.29% of 49) affected shaders:
CodeSize: 165612 -> 165716 (+0.06%)
Instrs: 31446 -> 31460 (+0.04%)
Latency: 596709 -> 554292 (-7.11%)
InvThroughput: 121998 -> 113327 (-7.11%)
VClause: 596 -> 587 (-1.51%)
Copies: 4664 -> 4646 (-0.39%)
PreVGPRs: 620 -> 639 (+3.06%)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21421 >
2023-02-21 15:51:14 +00:00
Konstantin Seurer
c76060c253
radv: Advertise ray query support with LLVM
...
What could go wrong?
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268 >
2023-02-17 17:04:47 +00:00
Konstantin Seurer
03105138f1
radv/rt: Get rid of accel struct null checks
...
Quake II RTX ray queries:
Totals from 7 (14.29% of 49) affected shaders:
CodeSize: 167220 -> 165560 (-0.99%)
Instrs: 31674 -> 31454 (-0.69%)
Latency: 385145 -> 596737 (+54.94%)
InvThroughput: 78837 -> 122005 (+54.76%)
Copies: 4740 -> 4667 (-1.54%); split: -1.60%, +0.06%
Branches: 1565 -> 1493 (-4.60%)
PreSGPRs: 488 -> 501 (+2.66%); split: -0.41%, +3.07%
PreVGPRs: 617 -> 620 (+0.49%)
Performance stays the same.
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539 >
2023-01-15 21:30:21 +00:00
Konstantin Seurer
ea38efb17e
radv: Add a driconf to advertise rt pipelines
...
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20464 >
2022-12-31 20:24:54 +00:00
Bas Nieuwenhuizen
efa4e9568b
radv: Use correct watermark for early loop exit.
...
The previous check assumed the stack starts at offset=0, which isn't
necessarily true for ray queries.
Note that this didn't cause correctness issues, just made an optimization
not apply. Found when I accidentally made this load-bearing in a
refactor.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20265 >
2022-12-11 18:51:29 +00:00
Bas Nieuwenhuizen
f0d6a1a685
radv: Rename stack_base to stack_low_watermark.
...
Better covers the purpose.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20265 >
2022-12-11 18:51:29 +00:00
Bas Nieuwenhuizen
1b5dc33caa
radv: Convert instance bvh address to node in bvh build.
...
So we don't have to do it in the traversal loop. Should 2 and
instructions and a 64-bit shift, so 4/8 cycles per instance node
visit.
Totals from 7 (0.01% of 134913) affected shaders:
CodeSize: 208460 -> 208292 (-0.08%)
Instrs: 38276 -> 38248 (-0.07%)
Latency: 803181 -> 803142 (-0.00%)
InvThroughput: 165384 -> 165376 (-0.00%)
Copies: 4912 -> 4905 (-0.14%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706 >
2022-11-19 14:24:36 +00:00
Bas Nieuwenhuizen
d09ed23b9a
radv: Fiddle with opaque flag positions to reduce instructions.
...
Totals from 7 (0.01% of 134913) affected shaders:
CodeSize: 209076 -> 208460 (-0.29%)
Instrs: 38374 -> 38276 (-0.26%)
Latency: 803899 -> 803181 (-0.09%)
InvThroughput: 165530 -> 165384 (-0.09%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706 >
2022-11-19 14:24:36 +00:00
Bas Nieuwenhuizen
3884210902
radv: Skip and for node_to_addr with bvh_base.
...
Cause the bvh base is always 64 byte aligned.
Totals from 7 (0.01% of 134913) affected shaders:
CodeSize: 209216 -> 209076 (-0.07%)
Instrs: 38402 -> 38374 (-0.07%)
Latency: 804537 -> 803899 (-0.08%)
InvThroughput: 165663 -> 165530 (-0.08%)
Copies: 4919 -> 4912 (-0.14%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706 >
2022-11-19 14:24:36 +00:00
Bas Nieuwenhuizen
0a26975840
radv: Move ray flag compares out of the loop.
...
To save on and+cmp combos with VALU instructions.
Totals from 7 (0.01% of 134913) affected shaders:
CodeSize: 208476 -> 209216 (+0.35%)
Instrs: 38384 -> 38402 (+0.05%)
Latency: 805725 -> 804537 (-0.15%)
InvThroughput: 165906 -> 165663 (-0.15%)
Copies: 4936 -> 4919 (-0.34%)
PreSGPRs: 393 -> 430 (+9.41%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706 >
2022-11-19 14:24:36 +00:00
Bas Nieuwenhuizen
9a8453d07e
radv: Use compares for node type in traversal.
...
The HW has no bit test instruction, so we change 3 pairs of and+cmp
to a single and + 3 cmps, saving 2 VALU instructions.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19454 >
2022-11-05 16:38:48 +00:00
Friedrich Vock
030a1f6843
radv: Use a struct for AABBs
...
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19292 >
2022-10-30 19:48:46 +00:00
Konstantin Seurer
ac01f09d57
radv/rt: Load instance id and custom index on demand
...
Stats for Quae II RTX:
57fps -> 57fps
Totals from 7 (14.00% of 50) affected shaders:
VGPRs: 800 -> 784 (-2.00%)
CodeSize: 217868 -> 218308 (+0.20%)
MaxWaves: 62 -> 63 (+1.61%)
Instrs: 40384 -> 40420 (+0.09%); split: -0.01%, +0.10%
Latency: 866315 -> 870692 (+0.51%)
InvThroughput: 199189 -> 196595 (-1.30%); split: -1.75%, +0.45%
VClause: 1058 -> 1077 (+1.80%)
SClause: 1126 -> 1130 (+0.36%)
Copies: 5787 -> 5772 (-0.26%); split: -0.40%, +0.14%
PreVGPRs: 764 -> 750 (-1.83%)
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19159 >
2022-10-24 14:39:25 +00:00
Bas Nieuwenhuizen
66664b8d7c
radv: Implement pipeline-wide skiptriangles/skipaabbs.
...
Reviewed-By: Konstantin Seurer <konstantin.seurer@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19030 >
2022-10-11 18:03:23 +00:00
Bas Nieuwenhuizen
30ce1676fe
radv: Properly annotate all the invalid node usage.
...
Reviewed-By: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18799 >
2022-10-10 23:35:25 +00:00
Bas Nieuwenhuizen
a8abdc0d89
radv: Add traversal backtracking with a short stack.
...
So we can now work with arbitrarily deep BVHs.
Reviewed-By: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18799 >
2022-10-10 23:35:25 +00:00
Bas Nieuwenhuizen
251bba2fa0
radv: Split global & local bvh node variable.
...
Need the local id later for follow up work.
Reviewed-By: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18799 >
2022-10-10 23:35:25 +00:00
Bas Nieuwenhuizen
f1e1509c92
radv: Add a field for the offset of the bvh in the blas.
...
So that we can put some metadata in front.
Reviewed-By: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18799 >
2022-10-10 23:35:25 +00:00
Bas Nieuwenhuizen
1dd5d94f65
radv: Do an early check of distance in triangle culling.
...
Culls like 99% of the triangles that are culled at all.
Reduces VALU usage in Q2RTX traversal by ~8%, though doesn't look
like VALU is a bottleneck at this point ...
For Control we get a ~5% reduction in VALU usage, but similarly it
doesn't look like a bottleneck.
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18830 >
2022-09-28 11:08:28 +00:00
Konstantin Seurer
ac45935345
radv: Add a common traversal build helper
...
Adds a helper for building the ray traversal loop to radv_rt_common.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18650 >
2022-09-24 13:23:40 +00:00
Bas Nieuwenhuizen
3c09681edd
radv: Use proper matrices for instance nodes.
...
Converts both wto and otw matrices to be full row-major 4x3 matrices.
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692 >
2022-09-23 22:52:23 +00:00
Konstantin Seurer
e83bd87ee9
radv: Use nir_test_mask instead of i2b(iand)
...
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17242 >
2022-06-30 18:00:32 +00:00
Konstantin Seurer
5f5882ef08
radv: Enable ray queries by default
...
Ray queries and acceleration structure builds
are quite stable now and so we can enable those
features for CI and more feedback and bug reports.
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16007 >
2022-05-24 08:32:43 +00:00
Marek Olšák
39800f0fa3
amd: change chip_class naming to "enum amd_gfx_level gfx_level"
...
This aligns the naming with PAL.
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Acked-by: Pierre-Eric Pellou-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16469 >
2022-05-13 14:56:22 -04:00
Rhys Perry
b62e90ad43
radv: use nir_op_imm helpers
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15854 >
2022-04-15 23:56:11 +00:00
Konstantin Seurer
521492e8b1
radv: Refactor ray tracing support checks
...
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15860 >
2022-04-12 16:13:38 +00:00
Konstantin Seurer
c4650cbdb0
radv: Replace magic constants with enum values
...
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15722 >
2022-04-03 12:43:00 +00:00
Konstantin Seurer
6d2e95db7b
radv: Move common code to seperate file
...
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14565 >
2022-03-13 12:02:05 +01:00