aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd
Commit message (Collapse)AuthorAgeFilesLines
* aco: add add_interference() helperRhys Perry2020-07-161-22/+21
| | | | | | | | | This won't add interferences between spill ids of different types and will exit early if there's already an interference. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5805>
* aco: use unordered_set for spill id interferencesRhys Perry2020-07-161-2/+2
| | | | | | | | Seems to be faster. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5805>
* aco: rewrite graph coloring in spillerRhys Perry2020-07-161-137/+120
| | | | | | | | | I don't think this is much of an optimization in the typical case, but for very complex shaders this should work much better. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5805>
* aco: fix underestimated pressure in spiller when a phi has a killed defRhys Perry2020-07-161-0/+11
| | | | | | Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5805>
* radv/winsys: pass the buffer list via the CS ioctl for less CPU overheadSamuel Pitoiset2020-07-161-84/+112
| | | | | | | | | The legacy path requires one more ioctl to create the buffer list and this is more costly for the CPU. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5899>
* radv/winsys: replace alloca() by malloc() everywhereSamuel Pitoiset2020-07-161-3/+17
| | | | | | | | To remove the mix of alloca() and malloc(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5899>
* radv: destroy the base object if VkCreateInstance() failedSamuel Pitoiset2020-07-151-0/+2
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
* radv: destroy the base object if VkAllocateCommandBuffers() failedSamuel Pitoiset2020-07-151-29/+30
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
* radv: destroy the base object if VkCreateFence() failedSamuel Pitoiset2020-07-151-13/+21
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
* radv: destroy the base object if VkCreateSemaphore() failedSamuel Pitoiset2020-07-151-6/+14
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
* radv: destroy the base object if VkCreateEvent() failedSamuel Pitoiset2020-07-151-2/+4
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
* radv: destroy the base object if VkCreateBuffer() failedSamuel Pitoiset2020-07-151-6/+14
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
* radv: destroy the base object if VkCreateImage() failedSamuel Pitoiset2020-07-153-12/+26
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
* radv: destroy the base object if VkCreateRenderPass*() failedSamuel Pitoiset2020-07-151-5/+13
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
* radv: destroy the base object if VkCreateQueryPool() failedSamuel Pitoiset2020-07-151-9/+14
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
* meson: fix android vulkan buildEric Engestrom2020-07-141-1/+1
| | | | | | | | | | | | | | | | Android doesn't have `pthread_cancel()` and is unlikely to ever implement it [1], but `wsi_common_display.c` needs it (or an alternative). Let's just disable the platform on Android (as it used to be before 448eb19158f483d807ef). [1] https://android-review.googlesource.com/c/platform/bionic/+/1215779/1/docs/status.md Fixes: 448eb19158f483d807ef ("vulkan: automatically compile the `display` platform when available") Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Nataraj Deshpande <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5860>
* radv: add the custom border color BO to the list of buffersSamuel Pitoiset2020-07-141-0/+4
| | | | | | | | | | | | The buffer was never added to the list of buffers. This might lead to VM faults and GPU hangs. Found this by luck. Fixes: 57e796a12a8 ("radv: Implement VK_EXT_custom_border_color") Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5884>
* aco: add 32-bit integer addition to can_swap_operandsRhys Perry2020-07-131-0/+4
| | | | | | | | | | fossil-db (Navi): Totals from 167 (0.12% of 135946) affected shaders: CodeSize: 484892 -> 482628 (-0.47%) Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5695>
* radv: use lower_shuffle_to_swizzle_amdRhys Perry2020-07-131-0/+1
| | | | | | | | | | | | Affects a few shaders in Detroit: Become Human and Doom Eternal. fossil-db (Navi): Totals from 9 (0.01% of 135946) affected shaders: CodeSize: 31188 -> 25096 (-19.53%) Instrs: 6136 -> 4999 (-18.53%) Signed-off-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5695>
* aco: implement <32-bit masked_swizzle_amdRhys Perry2020-07-131-4/+14
| | | | | | | | | This is needed since we will be lowering some 8/16-bit shuffles to masked_swizzle_amd. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5695>
* aco: optimize some masked swizzles to DPPRhys Perry2020-07-132-3/+40
| | | | | | Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5695>
* aco: read 0 from inactive lanes when using dppRhys Perry2020-07-131-1/+1
| | | | | | Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5695>
* radv: advertise VK_EXT_extended_dynamic_stateSamuel Pitoiset2020-07-132-1/+7
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>
* radv: add support for dynamic vertex input binding strideSamuel Pitoiset2020-07-133-6/+47
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>
* radv: add support for dynamic depth/stencil statesSamuel Pitoiset2020-07-135-35/+444
| | | | | | | | | | Out-of-order rasterization is disabled if a pipeline uses an extended dynamic depth/stencil state because the driver doesn't support enabling/disabling out-of-order dynamically. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>
* radv: add support for dynamic and scissor countSamuel Pitoiset2020-07-132-2/+28
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>
* radv: add support for dynamic primitive topologySamuel Pitoiset2020-07-136-57/+115
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>
* radv: add support for dynamic cull mode and front faceSamuel Pitoiset2020-07-135-11/+119
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>
* radv: declare new extended dynamic statesSamuel Pitoiset2020-07-131-31/+51
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>
* radv: add VK_EXT_extended_dynamic_state but leave it disabledSamuel Pitoiset2020-07-131-0/+1
| | | | | | | | To make sure the new prototypes are declared. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>
* radv: rework dynamic viewports/scissors supportSamuel Pitoiset2020-07-132-16/+12
| | | | | | | | | | | The number of viewports/scissors is currently static because it can only be specified at pipeline creation, but it doesn't hurt to assume it's dynamic. Will help for supporting setting the number of viewports/scissors dynamically. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>
* radv: remove the secure compile support featureSamuel Pitoiset2020-07-135-918/+16
| | | | | | | | Steam was the only client of this feature and it seems no longer used. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5869>
* radv: return VK_ERROR_DEVICE_LOST if wait-for-idle failed or expiredSamuel Pitoiset2020-07-121-4/+10
| | | | | | | | | | When ctx_wait_idle failed, something really bad happened likely a GPU hang. Make sure to return the appropriate Vulkan error code in this case. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5843>
* aco: don't create phis with undef operands in the boolean phi passRhys Perry2020-07-101-14/+28
| | | | | | | | | | | | | | | We can create better merge code is we pass on undef. fossil-db (Navi): Totals from 1208 (0.89% of 135946) affected shaders: SGPRs: 66864 -> 66200 (-0.99%); split: -1.04%, +0.05% SpillSGPRs: 1179 -> 1156 (-1.95%) CodeSize: 6516672 -> 6469564 (-0.72%); split: -0.76%, +0.04% Instrs: 1232680 -> 1220859 (-0.96%); split: -0.97%, +0.01% Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3388>
* aco: optimize boolean phis with uniform selectionsRhys Perry2020-07-101-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | Even though the boolean can be divergent, the control flow can be (at least partially) uniform. For example, we don't have to create any s_andn2_b64/s_and_b64/s_or_b64 instructions with this code: a = ... loop { b = bool_phi a, c if (uniform) break c = ... } d = phi c fossil-db (Navi): Totals from 5506 (4.05% of 135946) affected shaders: SGPRs: 605720 -> 604024 (-0.28%) SpillSGPRs: 52025 -> 51733 (-0.56%) CodeSize: 65221188 -> 64957808 (-0.40%); split: -0.41%, +0.00% Instrs: 12637881 -> 12584610 (-0.42%); split: -0.42%, +0.00% Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3388>
* aco: create better code for boolean phis with constant operandsRhys Perry2020-07-102-20/+62
| | | | | | | | | | | | | fossil-db (Navi): Totals from 6394 (4.70% of 135946) affected shaders: SGPRs: 651408 -> 651344 (-0.01%) SpillSGPRs: 52102 -> 52019 (-0.16%) CodeSize: 68369664 -> 68229180 (-0.21%); split: -0.21%, +0.00% Instrs: 13236611 -> 13202126 (-0.26%); split: -0.26%, +0.00% Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3388>
* aco: rework boolean phi passRhys Perry2020-07-101-89/+79
| | | | | | | | | | | | | | | | | | | | | | | The pass should now create much less linear phis. Removes piles of phis and lots of sgpr spilling from Detroit: Become Human and parallel-rdp. fossil-db (Navi): Totals from 7654 (5.63% of 135946) affected shaders: SGPRs: 796224 -> 787616 (-1.08%); split: -1.08%, +0.00% VGPRs: 576164 -> 572116 (-0.70%); split: -0.70%, +0.00% SpillSGPRs: 147695 -> 52258 (-64.62%) SpillVGPRs: 2167 -> 2102 (-3.00%) CodeSize: 80671680 -> 76240420 (-5.49%); split: -5.50%, +0.01% Scratch: 137216 -> 135168 (-1.49%) MaxWaves: 54235 -> 54707 (+0.87%) Instrs: 15569429 -> 14820569 (-4.81%); split: -4.82%, +0.01% Signed-off-by: Rhys Perry <[email protected]> Co-authored-by: Daniel Schürmann <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3388>
* vulkan: automatically compile the `display` platform when availableEric Engestrom2020-07-101-1/+1
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3161>
* ac/llvm: export ac_init_llvm_once in targetsPierre-Eric Pelloux-Prayer2020-07-102-3/+3
| | | | | | | | | | | | | | | | If a program like mpv uses both radeon_dri.so (because --vo=gpu) and radeonsi_drv_video.so (because --hwdec=vaapi) then LLVM will be inialized twice. The commit exports the ac_init_llvm_once so there's only one instance of the function. See also 18b12bf5335 ("targets: export radeon winsys_create functions to silence LLVM warning") which implemented this workaround initially. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1377 Reviewed-by: Marek Olšák <[email protected]> Acked-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5648>
* aco: fix more validation errors from vgpr spill/restore codeSamuel Pitoiset2020-07-101-2/+2
| | | | | | | | | | | It looks like the attempt to fix this in 1e791e51a65 was incomplete. This fixes crashes with Devil May Cry 5 with a debug build. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5828>
* ac/llvm: remove the -1 hack from ac_atomic_inc_wrapPierre-Eric Pelloux-Prayer2020-07-091-10/+0
| | | | | | | To match the behavior of proprietary drivers. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5688>
* radv: compute prim_vertex_count at draw timeSamuel Pitoiset2020-07-093-27/+31
| | | | | | | | In preparation for the dynamic topology state. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5801>
* radv: adjust IA_MULTI_VGT_PARAM.PARTIAL_VS_WAVE at draw timeSamuel Pitoiset2020-07-092-14/+13
| | | | | | | | In preparation for the dynamic topology state. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5801>
* radv: adjust IA_MULTI_VGT_PARAM.WD_SWITCH_ON_EOP at draw timeSamuel Pitoiset2020-07-093-19/+14
| | | | | | | | In preparation for the dynamic topology state. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5801>
* radv: store the primitive topology hardware value in the pipelineSamuel Pitoiset2020-07-092-2/+2
| | | | | | | | Will help for upcoming changes. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5801>
* radv: implement missing VK_ACCESS_MEMORY_{READ,WRITE}_BITSamuel Pitoiset2020-07-091-0/+24
| | | | | | | | | | | | | | | | | | From the Vulkan spec 1.2.146: "VK_ACCESS_MEMORY_READ_BIT specifies all read accesses. It is always valid in any access mask, and is treated as equivalent to setting all READ access flags that are valid where it is used." "VK_ACCESS_MEMORY_WRITE_BIT specifies all write accesses. It is always valid in any access mask, and is treated as equivalent to setting all WRITE access flags that are valid where it is used." Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3241 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5807>
* amd/llvm: Mark pointer function arguments as 32-byte aligned.Bas Nieuwenhuizen2020-07-083-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise LLVM does not see the pointers as allowing speculative loads. The pipeline-db results are pretty wild, but mostly what is to be expected from allowing more code movement in LLVM: Totals from affected shaders: SGPRS: 157728 -> 168336 (6.73 %) VGPRS: 158628 -> 158664 (0.02 %) Spilled SGPRs: 10845 -> 24753 (128.24 %) Spilled VGPRs: 13 -> 13 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 8 -> 8 (0.00 %) dwords per thread Code Size: 17189180 -> 17313712 (0.72 %) bytes LDS: 204 -> 204 (0.00 %) blocks Max Waves: 5700 -> 5687 (-0.23 %) Wait states: 0 -> 0 (0.00 %) This gives some boosts for shaders we can move a descriptor load outside a loop. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3159>
* radv: use bitshifts for debug enum valuesSimon Ser2020-07-081-36/+36
| | | | | | | | | Explicit values are getting out of hand. Signed-off-by: Simon Ser <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5735>
* Revert "ac/surface: require that gfx8 doesn't have DCC in order to be ↵Marek Olšák2020-07-081-4/+3
| | | | | | | | | | | | displayable" This reverts commit 7406ea37e6b666d474ab62982ca333d518c84231. Fixes: 7406ea37 "ac/surface: require that gfx8 doesn't have DCC in order to be displayable" Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3190 Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5780>
* radv: Use correct semaphore handle type for Android import.Bas Nieuwenhuizen2020-07-081-1/+1
| | | | | | | | | | | Coincidentally got a bugreport of a game that is broken without the import fix below, but it turns out I made a copy-paste error as well .. In good news it is clearly tested now. Fixes: ad151499583 "radv: Set handle types in Android semaphore/fence import." Reviewed-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5783>