aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan
Commit message (Collapse)AuthorAgeFilesLines
* radv/winsys: add syncobj hooksDave Airlie2017-07-212-0/+44
| | | | | | | | This just adds syncobj create/destroy/export/import paths into the winsys interface. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Add support for VK_KHR_variable_pointers.Bas Nieuwenhuizen2017-07-203-0/+18
| | | | | | | | Just a trivial enable. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Acked-by: Dave Airlie <[email protected]>
* radv: Add VK_KHR_storage_buffer_storage_class support.Bas Nieuwenhuizen2017-07-202-0/+5
| | | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Acked-by: Dave Airlie <[email protected]>
* radv: port to new libdrm API.Dave Airlie2017-07-201-29/+92
| | | | | | | This bumps the libdrm requirement for amdgpu to the 2.4.82. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: introduce some wrapper in cs code to make porting off libdrm_amdgpu ↵Dave Airlie2017-07-201-18/+70
| | | | | | | | | | easier. This just introduces a central semaphore info struct, and passes it around, and introduces some wrappers that will make porting off libdrm_amdgpu easier. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Set the RADEON_SURF_OPTIMIZE_FOR_SPACE flag for imagesAlex Smith2017-07-181-0/+1
| | | | | | | | | | | | | This looks like a regression from df301237940 ("radv: use ac_compute_surface"). Before that, the opt4Space addrlib flag was set to true unless the image has FMASK (ac_compute_surface will similarly only set that flag for images without FMASK). This saves multiple gigabytes of VRAM on one of our games, and brings its VRAM utilisation on RADV in line with AMDGPU-PRO and NVIDIA. Signed-off-by: Alex Smith <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: don't shadow meta_va.Dave Airlie2017-07-181-1/+1
| | | | | | Coverity warned about dead code below, as meta_va was being shadowed. Signed-off-by: Dave Airlie <[email protected]>
* radv: advertise v6 of the wayland surface extensionEmil Velikov2017-07-171-1/+1
| | | | | | | | | | | | | Jason updated the Khronos spec to explicitly state that Wayland surfaces must support VK_PRESENT_MODE_MAILBOX_KHR. ANV did so since day one (back in 2015) Cc: [email protected] Cc: Bas Nieuwenhuizen <[email protected]> Cc: Dave Airlie <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* radv: predicate cmask eliminate when using DCC.Dave Airlie2017-07-176-7/+153
| | | | | | | | | | | | | | | | | | When using DCC some clear values don't require a cmask eliminate step. This patch adds support for black and black with alpha 1, there are other values, but I don't have access to a comprehensive list. This works by setting the cmask eliminate predicate when doing the fast clear, and later when doing the cmask elimination making sure the draws are predicated. This increases the fps on Sascha Willems deferred. Tonga: 580fps->670fps on a Tonga PRO card. Polaris 730->850fps Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/clear: add r32g32b32a32 fast clear support (v2)Dave Airlie2017-07-172-2/+26
| | | | | | | | | | | | | We can only fast clear 128-bit images if the r/g/b channels are the same, and we are using DCC. For DCC we'll bail out on translate if this isn't true, and we catch cmask clears explicitly. v2: remove 64-bit block (Bas), add uint32 as well. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: set cb base tile swizzles for MRT speedups (v4)Dave Airlie2017-07-173-2/+18
| | | | | | | | | | | | | | | | | | | | This patch uses addrlib to workout the tile swizzles according to the surface index. It seems to produce the same values as amdgpu-pro for the deferred test. v2: don't apply swizzle to CMASK. the eg docs don't mention it, and we clearly don't align cmask for that. v3: disable surf index for dedicated images, as these will most likely be shared, and I don't think the metadata has space for this info in it yet. v4: update for shareable images, rename combined_swizzle to tile_swizzle This gets the deferred demo from 730->950fps on my rx480. (dcc cmask elim predication patches get it further) Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: allow clear merging for depth/stencil with no care stencilDave Airlie2017-07-171-0/+3
| | | | | | | | | | | | Some of the Sascha Willems demos pick a D32/S8 format for the depth buffer, then do a LOAD_OP_CLEAR/LOAD_OP_DONT_CARE on it, which means we don't get to merge the undefined->depth and clear htile transitions. This add the stencil aspect to the pending clears if there is a depth clear pending and the stencil aspect is don't care. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Remove NV dedicated alloc extension.Bas Nieuwenhuizen2017-07-151-4/+0
| | | | | | | To not confuse apps in thinking it might be faster. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Andres Rodriguez <[email protected]>
* radv: Use the KHR dedicated alloc for the WSI.Bas Nieuwenhuizen2017-07-151-2/+2
| | | | | | | | NV isn't valid for external images anymore. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Fixes: 6ddc64b93ea "radv: Add support for VK_KHR_dedicated_allocation." Reviewed-by: Andres Rodriguez <[email protected]>
* radv: Implement VK_KHR_external_memoryJason Ekstrand2017-07-155-3/+199
| | | | | | | | | This effectively reverts commit 43a171878bb4b5aedb36a. Technically, VK_KHR_get_memory_requirements2 and VK_KHR_dedicated_allocation are required for the KHR version but this at least restores the removed functionality. This patch builds but has received zero testing. Acked-by: Dave Airlie <[email protected]>
* radv: Add support for VK_KHR_dedicated_allocation.Bas Nieuwenhuizen2017-07-152-2/+35
| | | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Acked-by: Dave Airlie <[email protected]>
* radv: Add support for VK_KHR_get_memory_requirements2.Bas Nieuwenhuizen2017-07-152-0/+32
| | | | | | | | | Fished the SparseImage call out of the headers as the spec missed the definition. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Acked-by: Dave Airlie <[email protected]>
* radv: Drop support for VK_KHX_external_semaphore_*Jason Ekstrand2017-07-154-188/+2
| | | | | | | These have been formally deprecated by Khronos never to be shipped again. The KHR versions should be implemented/used instead. Acked-by: Dave Airlie <[email protected]>
* radv: Fix descriptors for cube images with VK_IMAGE_USAGE_STORAGE_BITAlex Smith2017-07-133-29/+74
| | | | | | | | | | | | | | | | | | If a cube image has VK_IMAGE_USAGE_STORAGE_BIT set, the type in an image view's descriptor was set to a 2D array (and a few other fields adjusted accordingly). This is correct when the image view is actually bound as a storage image, but not when bound as a sampled image. In that case the type should be set as a cube. Fix by generating 2 sets of descriptors at view creation time for both storage and non-storage usage, and then choose between them based on descriptor type when writing descriptor sets. v2: Generate storage descriptors for images with TRANSFER_DST, since those may be used as storage images internally. Signed-off-by: Alex Smith <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Fix possible invalid free of dynamic descriptorsAlex Smith2017-07-131-1/+0
| | | | | | | | | This free was left in after dynamic descriptors were changed to not be allocated separately from the descriptor set, and can cause a crash. Fixes: 39644fa40a3 ("radv: Don't allocate dynamic descriptors separately") Signed-off-by: Alex Smith <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: add support for using addrlib max alignment.Dave Airlie2017-07-092-2/+2
| | | | | | | | Rather than using 64k, use what addrlib returns as the base alignment for vulkan allocations. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Add compute htile clear for combined depth+stencil surfaces.Bas Nieuwenhuizen2017-07-081-9/+7
| | | | | | | | Figured out the clear value when we have a combined depth stencil surface. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: don't overallocate depth/stencil formatsDave Airlie2017-07-061-1/+1
| | | | | | | | | | | For depth/stencil formats the surface layer allocates the stencil separately, so we don't need to include it in the bpe. This reduces the side of d32s8 allocates to something closer to pro. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: enable sisched toggle in perftest flags.Dave Airlie2017-07-063-0/+6
| | | | | | | | | RADV_PERFTEST=sisched to enable it. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* ac/radv: change api to create target machineDave Airlie2017-07-061-4/+8
| | | | | | | | This just modifies the API to make it easier to add other flags to target machine creation. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: add support for cmd predication.Dave Airlie2017-07-065-30/+64
| | | | | | | | This doesn't get used yet, it just adds support to various PKT3 emissions to enable it later. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Always set depthbuffer using image format instead of iview format.Bas Nieuwenhuizen2017-07-051-2/+2
| | | | | | | | We have some cases where changing between depth and stencil only aspect was causing hangs. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Dave Airlie <[email protected]>
* radv: Disable depth & stencil tests when the depthbuffer doesn't support it.Bas Nieuwenhuizen2017-07-056-11/+36
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Dave Airlie <[email protected]>
* radv: enable Int64 capability (v2)Dave Airlie2017-07-032-1/+2
| | | | | | | | | I'm not 100% sure this is all wired up but it looks like it is. v2: actually enable extension. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* ac/nir: implement 64-bit packing and unpackingConnor Abbott2017-07-031-0/+1
| | | | | | | | | | | | | | | We implement the split opcodes, and tell NIR to lower the original ones. The lowering to LLVM is a little more complicated, but NIR can optimize the split ones a little better, and some NIR lowering passes that we might want to use (particularly for doubles) emit the split ones. This should fix pack/unpackDouble2x32, which seems like a bug since when we enabled the Float64 capability. It will also fix pack/unpackInt2x32 when we enable the Int64 capability. Fixes: 798ae37c ("radv: Enable Float64 support.") Signed-off-by: Connor Abbott <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: use Mesa's u_atomic.h headerEric Engestrom2017-06-262-4/+6
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* radv/meta: don't need vertex info for resolve shader.Dave Airlie2017-06-261-18/+2
| | | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Remove unused args of radv_image_view_init.Bas Nieuwenhuizen2017-06-2611-55/+23
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Use correct image layout for blit based copies.Bas Nieuwenhuizen2017-06-261-10/+10
| | | | | | | | v2: Don't pass layout to image view usage mask. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Fixes: 0628580eff6 "radv: Specify semantics of HTILE layout helpers."
* radv: handle primitive id input into fragment shader with no geom shaderDave Airlie2017-06-264-10/+39
| | | | | | | | | | Fixes: dEQP-VK.pipeline.framebuffer_attachment.no_attachments dEQP-VK.pipeline.framebuffer_attachment.no_attachments_ms Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: compile fragment shader first.Dave Airlie2017-06-261-27/+27
| | | | | | | | This reorders things as we need something from the fs for the vs key. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: set prim_id for geometry shadersDave Airlie2017-06-261-0/+5
| | | | | | | | Noticed in passing. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: move assert down in radv_bind_descriptor_setDave Airlie2017-06-131-2/+2
| | | | | | | coverity complains about the deref before NULL check. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: return correct error on invalid handle from vkAllocateMemoryDave Airlie2017-06-131-2/+3
| | | | | | | Coverity pointed out this was returning uninitialised. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: fix trace dumping for !use_ib_bosGrazvydas Ignotas2017-06-111-3/+11
| | | | | | | | Fixes trace dumping crash for SI or when RADV_DEBUG=noibs is set. Fixes: 97dfff5410 "radv: Dump command buffer on hang." Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: don't even attempt to prefetch on SIGrazvydas Ignotas2017-06-111-7/+16
| | | | | | | | | | | | Before bcae327469 this was emitting CP DMA packet even on SI, but apparently hasn't caused too many problems. After that commit the CP DMA code now always sets the CIK+ only bit for prefetch. Just follow radeonsi there and don't try to prefetch at all. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101334 Fixes: bcae327469 "radv: realign cp dma code with radeonsi" Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: assert on CP_DMA_USE_L2 for SIGrazvydas Ignotas2017-06-111-0/+1
| | | | | | | | The register header (and radeonsi comment) states V_411_SRC_ADDR_TC_L2 is for CIK+ only, so let's assert on earlier ASICs. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: set fmask state to all 0s when no fmask. (v2)Dave Airlie2017-06-091-1/+2
| | | | | | | | | | | | | | | The shader reads the descriptor to decide if it should take the fmask value, however we weren't initing it always, which meant random crap, esp with MSAA depth textures. Fixes random hangs with: dEQP-VK.glsl.builtin_var.fragdepth.* v2: check fmask_state is not NULL Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver" Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: introduce perf test env var and allow to enable chainingDave Airlie2017-06-097-4/+20
| | | | | | | | | | | | | We have some features that seem to slow things down or cause other possible undesireable side effects, but it would be nice to test games etc with them easily. I forsee multisample DCC and maybe some shader opt changes using this. For now use it for batch chaining. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: remove an unused variableGrazvydas Ignotas2017-06-081-1/+0
| | | | | | | Trivial. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: move chip_class extraction down further.Dave Airlie2017-06-071-1/+2
| | | | | | | | This seems to matter here in a profile, without this we spend a lot more time exiting this function with no flush bits. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: move lots of index related things into the bind.Dave Airlie2017-06-072-19/+14
| | | | | | | | This just moves lots of stuff to the bind stage rather than dealing with it in the draw stage. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: move calculating the vertex sgpr to the pipeline.Dave Airlie2017-06-073-41/+34
| | | | | | | There is no need to calculate this at draw time. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: rename and make global some functions.Dave Airlie2017-06-072-12/+17
| | | | | | | I want to use these in the pipeline setup stage. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/gfx9: use correct register setting for uconfig regsDave Airlie2017-06-071-4/+4
| | | | | | Thanks to Marek for pointing this out. Signed-off-by: Dave Airlie <[email protected]>