summaryrefslogtreecommitdiffstats
path: root/src/amd
Commit message (Collapse)AuthorAgeFilesLines
* radv: fix radv_fixup_vertex_input_fetches()Samuel Pitoiset2019-02-141-1/+1
| | | | | | | | We should check that num_channels is 4, otherwise that breaks the world. Sorry for the short breakage. Fixes: 4b3549c0846 ("radv: reduce the number of loaded channels for vertex input fetches") Signed-off-by: Samuel Pitoiset <[email protected]>
* radv: reduce the number of loaded channels for vertex input fetchesSamuel Pitoiset2019-02-141-2/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | It's unnecessary to load more channels than the vertex attribute format. The remaining channels are filled with 0 for y and z, and 1 for w. 29077 shaders in 15096 tests Totals: SGPRS: 1321605 -> 1318869 (-0.21 %) VGPRS: 935236 -> 932252 (-0.32 %) Spilled SGPRs: 24860 -> 24776 (-0.34 %) Code Size: 49832348 -> 49819464 (-0.03 %) bytes Max Waves: 242101 -> 242611 (0.21 %) Totals from affected shaders: SGPRS: 93675 -> 90939 (-2.92 %) VGPRS: 58016 -> 55032 (-5.14 %) Spilled SGPRs: 172 -> 88 (-48.84 %) Code Size: 2862740 -> 2849856 (-0.45 %) bytes Max Waves: 15474 -> 15984 (3.30 %) This mostly helps Croteam games (Talos/Sam2017). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: store vertex attribute formats as pipeline keysSamuel Pitoiset2019-02-143-3/+21
| | | | | | | The formats will be used for reducing the number of loaded channels. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: use MAX_{VBS,VERTEX_ATTRIBS} when defining max vertex input limitsSamuel Pitoiset2019-02-141-2/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* ac: make use of ac_build_expand_to_vec4() in visit_image_store()Samuel Pitoiset2019-02-143-8/+6
| | | | | | | And make ac_build_expand() a static function. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: always export gl_SampleMask when the fragment shader uses itSamuel Pitoiset2019-02-131-4/+4
| | | | | | | | | For some reasons, this breaks trees rendering in Project Cars. Fixes: 85010585cde ("radv: only enable gl_SampleMask if MSAA is enabled too") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109401 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/winsys: fix BO list creation when RADV_DEBUG=allbos is setSamuel Pitoiset2019-02-131-0/+1
| | | | | | Fixes: 50fd253bd6e ("radv/winsys: Add priority handling during submit.") Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: fix using LOAD_CONTEXT_REG with old GFX ME firmwares on GFX8Samuel Pitoiset2019-02-123-3/+10
| | | | | | | | | This fixes a critical issue. Cc: <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109575 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: add support for push constants inlining when possibleSamuel Pitoiset2019-02-125-28/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | This removes some scalar loads from shaders, but it increases the number of SET_SH_REG packets. This is currently basic but it could be improved if needed. Inlining dynamic offsets might also help. Original idea from Dave Airlie. 29077 shaders in 15096 tests Totals: SGPRS: 1321325 -> 1357101 (2.71 %) VGPRS: 936000 -> 932576 (-0.37 %) Spilled SGPRs: 24804 -> 24791 (-0.05 %) Code Size: 49827960 -> 49642232 (-0.37 %) bytes Max Waves: 242007 -> 242700 (0.29 %) Totals from affected shaders: SGPRS: 290989 -> 326765 (12.29 %) VGPRS: 244680 -> 241256 (-1.40 %) Spilled SGPRs: 1442 -> 1429 (-0.90 %) Code Size: 8126688 -> 7940960 (-2.29 %) bytes Max Waves: 80952 -> 81645 (0.86 %) Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: keep track of the number of remaining user SGPRsSamuel Pitoiset2019-02-121-0/+4
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: gather if shaders load dynamic offsets separatelySamuel Pitoiset2019-02-122-0/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: gather more info about push constantsSamuel Pitoiset2019-02-124-1/+44
| | | | | | | | This is needed in order to inline some push constants when possible. This also adds a new helper for initializing the pass. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: fix compiler issues with GCC 9Samuel Pitoiset2019-02-121-42/+48
| | | | | | | | | | | | | | | | | "The C standard says that compound literals which occur inside of the body of a function have automatic storage duration associated with the enclosing block. Older GCC releases were putting such compound literals into the scope of the whole function, so their lifetime actually ended at the end of containing function. This has been fixed in GCC 9. Code that relied on this extended lifetime needs to be fixed, move the compound literals to whatever scope they need to accessible in." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109543 Cc: <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Gustaw Smolarczyk <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: remove alloc parameter from pipeline initDave Airlie2019-02-111-5/+2
| | | | | | clang points out this isn't used. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/llvm: initialise passes member.Dave Airlie2019-02-111-1/+1
| | | | | | Fixes coverity warning Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: assert that colorAttachment is valid for CmdClearAttachmentLionel Landwerlin2019-02-081-3/+1
| | | | | | | | | | | | | This partially reverts a change from b7a93cbdede05a ("radv: Handle VK_ATTACHMENT_UNUSED in CmdClearAttachment") which fixed actual issues but also started to accept invalid values for the colorAttachment field. This change asserts that the field is valid for the current pass. Signed-off-by: Lionel Landwerlin <[email protected]> Fixes: b7a93cbdede05a ("radv: Handle VK_ATTACHMENT_UNUSED in CmdClearAttachment") Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Implement VK_EXT_buffer_device_address.Bas Nieuwenhuizen2019-02-063-1/+22
| | | | | | v2: Also update the release notes. Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: Do not use the bo list for local buffers.Bas Nieuwenhuizen2019-02-061-0/+6
| | | | | | The kernel already does it for us. Reviewed-by: Samuel Pitoiset <[email protected]>
* amd/common: Implement global memory accesses.Bas Nieuwenhuizen2019-02-061-20/+131
| | | | | | | | | | Needed for VK_EXT_buffer_device_address. The pointers are implmemented as i8*, since I could not figure out how to emulate setting struct offsets in LLVM based on the SPIR-V offsets (and more weird stuff like row major matrices). Acked-by: Samuel Pitoiset <[email protected]>
* amd/common: Do not use 32-bit loads for shared memory.Bas Nieuwenhuizen2019-02-061-6/+12
| | | | | | | | | We use a straight glsl->llvm type conversion so types should already be right. Also even though the writemasks were changed we we not actually doing 32-bit things, so this fails miserably. Reviewed-by: Samuel Pitoiset <[email protected]>
* amd/common: handle nir_deref_cast for shared memory from integers.Bas Nieuwenhuizen2019-02-061-68/+82
| | | | | | | Can happen e.g. after a phi. Fixes: a2b5cc3c399 "radv: enable variable pointers" Reviewed-by: Samuel Pitoiset <[email protected]>
* amd/common: Handle nir_deref_type_ptr_as_array for shared memory.Bas Nieuwenhuizen2019-02-061-0/+4
| | | | | Fixes: a2b5cc3c399 "radv: enable variable pointers" Reviewed-by: Samuel Pitoiset <[email protected]>
* amd/common: Fix stores to derefs with unknown variable.Bas Nieuwenhuizen2019-02-061-8/+13
| | | | | Fixes: a2b5cc3c399 "radv: enable variable pointers" Reviewed-by: Samuel Pitoiset <[email protected]>
* amd/common: Use correct writemask for shared memory stores.Bas Nieuwenhuizen2019-02-061-1/+1
| | | | | | | The check was for 1 bit being set, which is clearly not what we want. CC: <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: Fix the shader info pass for not having the variable.Bas Nieuwenhuizen2019-02-061-2/+2
| | | | | | | | For example with VK_EXT_buffer_device_address or VK_KHR_variable_pointers. Fixes: a2b5cc3c399 "radv: enable variable pointers" Reviewed-by: Samuel Pitoiset <[email protected]>
* amd/common: Implement ptr->int casts in ac_to_integer.Bas Nieuwenhuizen2019-02-061-0/+13
| | | | | | | | | For the implicit casts inherent in nir. This should probably have been done for shared memory for VK_KHR_variable_pointers. Reviewed-by: Samuel Pitoiset <[email protected]>
* amd/common: Add gep helper for pointer increment.Bas Nieuwenhuizen2019-02-062-0/+13
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: Only look at pImmutableSamples if the descriptor has a sampler.Bas Nieuwenhuizen2019-02-061-2/+6
| | | | | | | Equivalent of ANV patch c7f4a2867ce492d78c1f8e2870c0a593d280572d CC: <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: Handle VK_ATTACHMENT_UNUSED in CmdClearAttachmentDanylo Piliaiev2019-02-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | From the Vulkan 1.0.98 spec for vkCmdClearAttachments: "If any attachment to be cleared in the current subpass is VK_ATTACHMENT_UNUSED, then the clear has no effect on that attachment." "If the aspectMask member of any element of pAttachments contains VK_IMAGE_ASPECT_COLOR_BIT, then the colorAttachment member of that element must either refer to a color attachment which is VK_ATTACHMENT_UNUSED, or must be a valid color attachment." "If the aspectMask member of any element of pAttachments contains VK_IMAGE_ASPECT_DEPTH_BIT, then the current subpass' depth/stencil attachment must either be VK_ATTACHMENT_UNUSED, or must have a depth component" "If the aspectMask member of any element of pAttachments contains VK_IMAGE_ASPECT_STENCIL_BIT, then the current subpass' depth/stencil attachment must either be VK_ATTACHMENT_UNUSED, or must have a stencil component" Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: don't flush src stages when dstStageMask == BOTTOM_OF_PIPESamuel Pitoiset2019-02-042-3/+19
| | | | | | | Original patch by Fredrik Höglund. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: do not set preserveAttachments for internal render passesSamuel Pitoiset2019-02-044-18/+18
| | | | | | | We don't use that. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: drop useless checks when resolving subpass color attachmentsSamuel Pitoiset2019-02-042-8/+4
| | | | | | | | | | | The Vulkan spec says: "If pResolveAttachments is not NULL, for each resolve attachment that does not have the value VK_ATTACHMENT_UNUSED, the corresponding color attachment must not have the value VK_ATTACHMENT_UNUSED." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: execute external subpass barriers after ending subpassesSamuel Pitoiset2019-02-041-2/+2
| | | | | | | | | Outgoing dependencies (ie. external) should happen after the subpass. This doesn't change anything for subpass resolves as we already make sure that attachments are shader readable. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: accumulate all ingoing external dependencies to the first subpassSamuel Pitoiset2019-02-041-0/+4
| | | | | | | In case two or more subpasses declare ingoing external dependencies. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: handle subpass dependencies correctlySamuel Pitoiset2019-02-041-6/+6
| | | | | | | | | The different masks should be accumulated. For example if two subpasses declare an outgoing dependency (ie. dst == VK_SUBPASS_EXTERNAL). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: track if subpasses have color attachmentsSamuel Pitoiset2019-02-043-9/+7
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: add radv_render_pass_add_subpass_dep() helperSamuel Pitoiset2019-02-041-40/+38
| | | | | | | To share common code that handles subpass dependencies. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: move some render pass things to radv_render_pass_compile()Samuel Pitoiset2019-02-041-28/+38
| | | | | | | | radv_render_pass_compile() is common to vkCreateRenderPass() and vkCreateRenderPass2(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: handle final layouts at end of every subpass and render passSamuel Pitoiset2019-02-041-22/+38
| | | | | | | | That shouldn't change anything as we check if the last subpass id is the final subpass. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: determine the last subpass id for every attachmentsSamuel Pitoiset2019-02-042-0/+15
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: use the new attachments array when starting subpassesSamuel Pitoiset2019-02-041-12/+5
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: store the list of attachments for every subpassSamuel Pitoiset2019-02-047-55/+96
| | | | | | | | | This reworks how the depth stencil attachment is used for simplicity. This also introduces radv_render_pass_compile() helper that will be used for further optimizations. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: move subpass image transitions to radv_cmd_buffer_begin_subpass()Samuel Pitoiset2019-02-045-29/+27
| | | | | | | Instead of doing them in radv_cmd_buffer_set_subpass(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: add radv_cmd_buffer_begin_subpass() helperSamuel Pitoiset2019-02-041-12/+32
| | | | | | | | To unify some code in BeginRenderPass() and NextSubpass(). Based on Intel ANV driver. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: remove useless MAYBE_UNUSED in CmdBeginRenderPass()Samuel Pitoiset2019-02-041-1/+1
| | | | | | | Trivial. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: remove unused radv_render_pass_attachment::view_maskSamuel Pitoiset2019-02-042-11/+0
| | | | | | | Trivial. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: bail out when no image transitions will be performedSamuel Pitoiset2019-02-041-0/+3
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: fix buildSamuel Pitoiset2019-02-012-2/+2
| | | | | Fixes: 9b9ccee4d64 ("radv: take LDS into account for compute shader occupancy stats") Signed-off-by: Samuel Pitoiset <[email protected]>
* radv: take LDS into account for compute shader occupancy statsTimothy Arceri2019-02-013-5/+14
| | | | | | Ported from d205faeb6c96. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* ac/radv/radeonsi: add ac_get_num_physical_sgprs() helperTimothy Arceri2019-02-014-9/+9
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>