Rhys Perry
7610630124
aco: coalesce constant copies
...
fossil-db (Navi):
Totals from 20108 (14.49% of 138791) affected shaders:
CodeSize: 117835376 -> 117830512 (-0.00%)
Instrs: 22813722 -> 22733245 (-0.35%)
Cycles: 1009135584 -> 1008543628 (-0.06%)
VMEM: 5401668 -> 5391247 (-0.19%)
SMEM: 1286824 -> 1283663 (-0.25%)
Copies: 1742154 -> 1661686 (-4.62%)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798 >
2020-12-04 14:44:49 +00:00
Rhys Perry
f53d4e5f60
aco: use v_lshrrev_b64 for 64-bit VGPR copies on GFX10+
...
This isn't worth it on GFX9-, but the proprietary compiler uses it on
GFX10.
fossil-db (Navi):
Totals from 23825 (17.17% of 138791) affected shaders:
CodeSize: 130623632 -> 130623800 (+0.00%); split: -0.00%, +0.00%
Instrs: 25185559 -> 25108597 (-0.31%)
Cycles: 709864740 -> 708910860 (-0.13%)
VMEM: 7205343 -> 7168839 (-0.51%); split: +0.00%, -0.51%
SMEM: 1584946 -> 1575183 (-0.62%)
Copies: 2043134 -> 1966230 (-3.76%)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798 >
2020-12-04 14:44:48 +00:00
Rhys Perry
8c02a8e2d2
aco: add get_const/is_constant_representable helpers
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798 >
2020-12-04 14:44:48 +00:00
Rhys Perry
b10de4c1d8
aco: allow 64-bit literals if they can be sign/zero-extended from 32-bit
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798 >
2020-12-04 14:44:48 +00:00
Rhys Perry
24ee0f55f2
aco: remove sign-extension in constantValue64()
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798 >
2020-12-04 14:44:48 +00:00
Rhys Perry
8451911156
aco: test self-intersecting copies when src=higher
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798 >
2020-12-04 14:44:48 +00:00
Rhys Perry
2c40846ab6
aco: don't assume src=lower when splitting self-intersecting copies
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 09c584caeb ("aco: split self-intersecting copies instead of swapping")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7798 >
2020-12-04 14:44:48 +00:00
Samuel Pitoiset
055aff2613
radv: reduce maxTransformFeedbackBufferDataSize to 512
...
DRAW_OPAQUE_VERTEX_STRIDE only has 9 bits, so the register can
represent 511 bytes at most.
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/7900 >
2020-12-04 07:52:23 +01:00
Vinson Lee
cf7bf7fade
amd/addrlib: Initialize Lib members in constructors.
...
Fix defects reported by Coverity Scan.
uninit_member: Non-static class member m_maxBaseAlign is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member m_maxMetaBaseAlign is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7768 >
2020-12-03 23:02:17 +00:00
Bas Nieuwenhuizen
9a3aaffeb8
radv: Don't invalidate the SCACHE for image barriers.
...
Even ACO never uses the constant cache for images.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7875 >
2020-12-03 22:21:06 +00:00
James Park
0546ceba16
radv: Use portable ffs and util_bitcount macros
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
3ff1eccce6
radv: Replace pthread thread with thrd_t
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
63dc2a53af
radv: Replace pthread mutex with mtx_t
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
aefaceab09
radv: Use unsigned with u_bit_scan for MSVC
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
60c362c490
radv: Create shader cache if ENABLE_SHADER_CACHE
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
bed6e462e1
radv: Use standard __VA_ARGS__ macro
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
09fb370068
radv: Fix function parameter types
...
Avoids unnecessary type aliasing.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
6ec0953e22
radv: Fix leak in radv_amdgpu_winsys_destroy()
...
Fixes: fa97061a82 ("radv/winsys: Add binary syncobj ABI changes for timeline semaphores.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
314bcb3937
radv: Fix callback signatures
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
be42e9a6d1
radv: Update radv_assert for MSVC
...
MSVC hates parentheses in radv_assert, so replace with do/while(0).
Also switch nonstandard DEBUG with standard NDEBUG, which Aco uses.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
02481e1203
radv: Ignore radv_printflike on Windows
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
7f7586704c
radv: Don't return value in void function
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
3fe62252e4
radv: Use os_localtime instead of localtime_r
...
Cross-platform abstraction that works with MSVC.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
fe67fe688a
radv: Wrap pragmas with __GNUC__ to fix MSVC
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
c4a516ca70
radv: Replace VLAs with alloca
...
MSVC does not support VLAs.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
2749258368
radv: Update build defines for Windows
...
Add VK_USE_PLATFORM_WIN32_KHR.
Use VK_NO_PROTOTYPES to deal with __declspec(dllexport) mismatch.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
James Park
0c70842232
radv: Exclude amdgpu driver files for Windows
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866 >
2020-12-02 11:27:01 +00:00
Marek Olšák
8ae3ad95ef
ac: enable late allocation on VanGogh to increase perf
...
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7721 >
2020-12-01 15:33:03 -05:00
Marek Olšák
d7ee265a95
ac,radeonsi: fix load_first_vertex
...
GL doesn't use it, so this change is not necessary, but it's better
this way.
There is also a small cleanup using si_unpack_param.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7721 >
2020-12-01 15:33:03 -05:00
Timur Kristóf
94f8cb29ee
aco: Fix NGG GS assert failure from the WG scan.
...
There was a temp which was defined in a branch but used outside,
without a phi.
Fixes: 62b5012ec3
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7817 >
2020-12-01 15:04:58 +00:00
Samuel Pitoiset
3a858ecd40
Revert "radv/llvm,aco: always split typed vertex buffer loads on GFX6 and GFX10+"
...
It introduces regressions.
This reverts commit 6fb4babfe9 .
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7852 >
2020-12-01 14:31:16 +01:00
James Park
cc62a0dfe4
aco: Avoid extra bitfield padding
...
MSVC may insert padding for data type switches.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
44f05d6b74
aco: Stub sections that don't have _WIN32 support
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
2c3fd34103
aco: Fix warnings for bools in bitwise logic
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
8bc2a419fc
aco: Initialize union within Operand for MSVC
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
a2c981f8d0
aco: Use u_memstream instead of POSIX memstream
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
8259cfaa65
aco: Replace indexed array initialization
...
Use std::array instead to make MSVC happy.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
76ad75dbb8
aco: Const correct aco_compiler_statistics
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
9779a9a51e
aco: Declare num_reduce_ops for array size
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
93094b8c5e
aco: Remove nonstandard parentheses
...
Remove parentheses in cases where a parenthesized type is followed by an
initializer list.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
d1f742e497
aco: Add missing C++ includes
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
e352ebf88e
aco: Fix warnings about unsafe integer/bool mix
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
James Park
fcd53bebe6
aco: Define NOMINMAX in Meson build file
...
Fix conflicts between std::min/max and Win32 min/max.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7785 >
2020-12-01 11:08:21 +00:00
Rhys Perry
2d12991e01
aco: use FALLTHROUGH macro
...
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/7844 >
2020-12-01 10:28:36 +00:00
Rhys Perry
ce56902f85
radv: use FALLTHROUGH macro
...
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/7844 >
2020-12-01 10:28:36 +00:00
Samuel Pitoiset
6fb4babfe9
radv/llvm,aco: always split typed vertex buffer loads on GFX6 and GFX10+
...
To avoid any alignment issues that triggers memory violations and
eventually a GPU. This can happen if the stride (static or dynamic)
is unaligned and also if the VBO offset is aligned to scalar
(eg. stride is 8 and VBO offset is 2 for R16G16B16A16_SNORM).
The AMD Windows driver also always splits typed vertex fetches.
fossils-db (Sienna Cichlid):
Totals from 56508 (40.54% of 139391) affected shaders:
SGPRs: 2643545 -> 2664516 (+0.79%); split: -0.19%, +0.98%
VGPRs: 2007472 -> 1995408 (-0.60%); split: -0.74%, +0.13%
CodeSize: 70596372 -> 73913312 (+4.70%); split: -0.00%, +4.70%
MaxWaves: 772653 -> 774916 (+0.29%); split: +0.37%, -0.08%
Instrs: 14074162 -> 14567072 (+3.50%); split: -0.00%, +3.51%
Cycles: 69281276 -> 71253252 (+2.85%); split: -0.00%, +2.85%
VMEM: 22047039 -> 25554196 (+15.91%); split: +17.20%, -1.29%
SMEM: 4120370 -> 4360820 (+5.84%); split: +7.41%, -1.58%
VClause: 416913 -> 438361 (+5.14%); split: -1.86%, +7.01%
SClause: 536739 -> 542637 (+1.10%); split: -0.33%, +1.43%
Copies: 977194 -> 970015 (-0.73%); split: -2.43%, +1.69%
Branches: 241205 -> 241193 (-0.00%); split: -0.06%, +0.06%
PreVGPRs: 1505645 -> 1505379 (-0.02%)
This fixes GPU hangs with bin/draw-vertices from Piglit on GFX10+
with Zink.
Cc: mesa-stable
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/7751 >
2020-12-01 10:14:27 +00:00
Pierre-Eric Pelloux-Prayer
148a24f305
amd/ac: update fallthrough comments
...
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7747 >
2020-12-01 10:04:41 +01:00
James Park
f86668f487
vulkan/util: Consolidate typed_memcpy
...
Collapse typed_memcpy definitions into one header.
Use do/while(0) pattern to fix MSVC compilation.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7830 >
2020-12-01 07:48:08 +00:00
Samuel Pitoiset
04ea3d6501
radv: disable WGP_MODE for NGG on GFX10.3
...
Ported from RadeonSI, reducing the CU mask probably broke WGP mode.
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/7769 >
2020-11-30 09:31:29 +00:00
Samuel Pitoiset
bf36cfced1
radv: only mask 1 CU for GS/VS waves on GFX10.3
...
Ported from Radeonsi and PAL.
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/7769 >
2020-11-30 09:31:29 +00:00