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
Samuel Pitoiset
7729ea3d67
radv: only disable CU2 & CU3 when NGG is enabled
...
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
750591f4cb
radv: enable NGG on GFX10.3 APUs by default
...
According to Radeonsi, VanGogh benefits.
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:28 +00:00
Samuel Pitoiset
d1768b23b5
radv: save and dump vertex descriptors during GPU hang detection
...
It might be useful to know if the VA is valid and if other info
like the stride seems correct.
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/7753 >
2020-11-30 08:31:02 +01:00
Samuel Pitoiset
9f3e7a6502
radv: fix using bitfields for debug/perftest options
...
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/7753 >
2020-11-30 08:15:09 +01:00
James Park
b3504f4173
amd/common: Check with_tests before adding test
...
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7819 >
2020-11-28 23:30:53 +00:00
James Park
de353c1fbe
amd: Fix declaration mismatch
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7791 >
2020-11-27 20:49:00 -08:00
James Park
a212a8a0f0
amd: Fix signature mismatch
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7791 >
2020-11-27 20:49:00 -08:00
James Park
7c521e9968
amd: Work around MSVC limit for string literals
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7791 >
2020-11-27 20:49:00 -08:00
James Park
7404907870
amd: Replace vasprintf with vfprintf
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7791 >
2020-11-27 20:49:00 -08:00
James Park
3ad8ac38c7
amd: Stub sections that don't have _WIN32 support
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7791 >
2020-11-27 20:49:00 -08:00
James Park
ee72cd0757
amd: Remove bitfield sizes from enum values
...
Fixes negative indexing on MSVC.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7791 >
2020-11-27 20:49:00 -08:00
James Park
31b4fdc008
amd: Cast to int for %d snprintf argument
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7791 >
2020-11-27 20:49:00 -08:00