summaryrefslogtreecommitdiffstats
path: root/src/amd
Commit message (Collapse)AuthorAgeFilesLines
* radv: Only convert linear->srgb in compute resolves.Bas Nieuwenhuizen2017-08-065-79/+54
| | | | | | | | | It justs works with the fragment shader resolve, so no need to do a custom conversion. In fact with SRGB dest, it actually gives wrong results. Fixes: 69136f4e633 "radv/meta: add resolve pass using fragment/vertex shaders" Reviewed-by: Dave Airlie <[email protected]>
* radv: Don't use SRGB format for image stores during resolve.Bas Nieuwenhuizen2017-08-062-1/+24
| | | | | | | | | These seem to store very bogus results. Luckily there is some code that converts srgb->linear already, so just making the descriptor format UNORM should work. Fixes: 588185eb6b7 "radv/meta: add srgb conversion to end of resolve shader." Reviewed-by: Dave Airlie <[email protected]>
* radv: generate the same driver UUID as radeonsiAndres Rodriguez2017-08-062-1/+9
| | | | | | | These need to match for interop compatibility queries. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* radv: generate same device UUID as radeonsiAndres Rodriguez2017-08-061-7/+4
| | | | | | | | | | | This is required for interop use cases. The same device must report identical UUIDs through the GL and Vulkan APIs so that users can identify when it is safe to perform a memory object import. v2: use ac helpers to calculate the uuid Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* ac/gpu: add driver/device UUID query helpersAndres Rodriguez2017-08-062-0/+32
| | | | | | | | | We need vulkan and gl to produce the same UUIDs. Therefore we should keep the mechanism to compute these in a common location to guarantee they are updated in lockstep. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radv: avoid GPU hangs if someone does a resolve with non-multisample src (v2)Dave Airlie2017-08-051-0/+5
| | | | | | | | | | | | This is a bug in the app, but I'd rather avoid hanging the GPU, esp if someone is running in validation and it takes out their development environment. v2: get it right, reverse the polarity. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: also fix texture image descriptors for mipmap tile swizzleDave Airlie2017-08-041-1/+2
| | | | | | | This fixes the image descriptors for mipmapped tile swizzle Fixes: 2b7e8556 (ac/surface: enable tile swizzle for mipmapped textures) Signed-off-by: Dave Airlie <[email protected]>
* radv: fix tile swizzle regression on mipmaps.Dave Airlie2017-08-041-5/+6
| | | | | | | | | | | When Marek enabled mipmapped swizzle, radv didn't have the code in place to handle it. This fixes the regression. I'll look more into GFX9 once I have a vega card (soon). Fixes: 2b7e8556 (ac/surface: enable tile swizzle for mipmapped textures) Signed-off-by: Dave Airlie <[email protected]>
* ac/surface: align DCC size for surfaces that use tile swizzleMarek Olšák2017-08-041-2/+9
| | | | | | | | Note that dcc_alignment = pipe_interleave_bytes * num_pipes * num_banks, which is greater than the previous open-coded alignment. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* ac/surface: limit tile swizzle to non-mipmaps on SIMarek Olšák2017-08-041-1/+3
| | | | | | | Mipmapping with tile swizzle doesn't work. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* ac/surface: enable tile swizzle for mipmapped texturesMarek Olšák2017-08-041-34/+46
| | | | | | | | | | | The tile swizzle computation was done after the whole miptree was computed, but that was too late, because at that point AddrSurfInfoOut contained information about the smallest miplevel, which is never 2D-tiled. The correct way is to do the computation before the second level is computed. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* ac/surface: set structure size and handle errors for AddrComputeBaseSwizzleMarek Olšák2017-08-041-1/+8
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* ac/surface: increment surf_index only when tile swizzle is allowedMarek Olšák2017-08-043-4/+6
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* ac/surface: compute tile swizzle only when it's allowedMarek Olšák2017-08-041-2/+4
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* ac/surface: add RADEON_SURF_SHAREABLEMarek Olšák2017-08-041-0/+1
| | | | | | | Shareable textures won't use tile swizzle. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* ac/surface: remove RADEON_SURF_HAS_TILE_MODE_INDEXMarek Olšák2017-08-043-5/+0
| | | | | | | it's useless Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* ac/surface: move tile_swizzle to ac_surface and document itMarek Olšák2017-08-044-8/+25
| | | | | | | Gfx9 will use it too. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* android: ac/common: always build NIR translationMauro Rossi2017-08-031-1/+2
| | | | | | | | | | Android build changes to avoid the following building error: external/mesa/src/gallium/drivers/radeonsi/si_shader_nir.c:505: error: undefined reference to 'ac_nir_translate' Fixes: 86d4b46d66 "ac/common: always build NIR translation" Reviewed-by: Emil Velikov <[email protected]>
* ac: add ac_shader_abi.h in distcheckJuan A. Suarez Romero2017-08-031-0/+1
| | | | | | | | | | | | | | | | | | | Fixes: CXXLD addrlib/libamdgpu_addrlib.la ar: `u' modifier ignored since `D' is the default (see `U') ../../../../src/amd/common/ac_nir_to_llvm.c:33:27: fatal error: ac_shader_abi.h: No such file or directory #include "ac_shader_abi.h" ^ compilation terminated. Makefile:985: recipe for target 'common/common_libamd_common_la-ac_nir_to_llvm.lo' failed When running `make distcheck` Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Juan A. Suarez Romero <[email protected]>
* radv: Add suballocation for shaders.Bas Nieuwenhuizen2017-08-035-21/+93
| | | | | | | | | | | | | This reduces the number of BOs that we need for the BO lists during a submission. Currently uses a fairly simple linear search for finding free space, that could eventually be improved to a binary tree, which with some per-node info could make a check for space O(1) and finding it O(log n), in the number of buffers in that slab. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radeonsi: fix streamout overflow predication on VI+Nicolai Hähnle2017-08-021-0/+1
| | | | | | | | | | There is a firmware regression that causes failures. Work around it by using the compute shader for query_buffer_objects to summarize the query results. v2: rename to PREDICATION_OP_BOOL64 (consistent with sid.h) Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: Add float cast before shadow comparator clamp.Bas Nieuwenhuizen2017-08-021-1/+2
| | | | | | | | LLVM complained about passing an i32 to a float clamp. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Fixes: 0f9e32519bb "ac/nir: clamp shadow texture comparison value on VI" Reviewed-by: Marek Olšák <[email protected]>
* radeon/ac: use ds_swizzle for derivs on si/cik.Dave Airlie2017-08-023-24/+43
| | | | | | | | | | | | This looks like it's supported since llvm 3.9 at least, so switch over radeonsi and radv to using it, -pro also uses this. We can now drop creating lds for these operations as the ds_swizzle operation doesn't actually write to lds at all. Acked-by: Marek Olšák <[email protected]> (stable requested due to fixing radv CIK conformance tests) Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
* ac/nir: fix nir_op_unpack_64_2x32_split_y emissionConnor Abbott2017-08-011-1/+1
| | | | | | This was broken thanks to a typo in b2367cf. Reviewed-by: Nicolai Hähnle <[email protected]>
* ac/nir: fix lsb emissionConnor Abbott2017-08-011-1/+11
| | | | | | | | | | | This makes it match radeonsi. The LLVM backend itself will emit the correct instruction, but LLVM might do incorrect optimizations since it thinks the output is undefined when the input is 0, even though it's not supposed to be. We really need a new intrinsic, or for the backend to become smarter and recognize this pattern. Cc: [email protected] Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: handle 10-bit format clamping workaround.Dave Airlie2017-08-018-16/+51
| | | | | | | | | | | | | | | This fixes: dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.* for a2r10g10b10 formats as destination on SI/CIK hardware. This adds support to the meta program for emitting 10-bit outputs, and adds 10-bit support to the fragment shader key. It also only does the int8/10 on SI/CIK. Fixes: f4e499ec7 (radv: add initial non-conformant radv vulkan driver) Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Don't underflow non-visible VRAM size.Bas Nieuwenhuizen2017-07-311-2/+4
| | | | | | | | | | | | | | In some APU situations the reported visible size can be larger than VRAM size. This properly clamps the value. Surprisingly both CTS and spec seem to allow a heap type with size 0, so this seemed like the easiest option to me. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Fixes: 4ae84efbc5c "radv: Use enum for memory heaps." Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Tested-by: Michel Dänzer <[email protected]>
* ac/common: always build NIR translationNicolai Hähnle2017-07-311-7/+2
| | | | | | radeonsi needs it now, and we require LLVM 3.9 anyway. Fixes a build with radeonsi but not radv.
* ac/nir: implement load_frag_coord intrinsicNicolai Hähnle2017-07-311-0/+10
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: pass ac_llvm_context to unpack_paramNicolai Hähnle2017-07-311-18/+18
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir,radeonsi: add and use ac_shader_abi::frag_posNicolai Hähnle2017-07-312-13/+18
| | | | | | v2: update for LLVMValueRefs in ac_shader_abi Reviewed-by: Marek Olšák <[email protected]>
* ac/nir,radeonsi: add and use ac_shader_abi::{ancillary,sample_coverage}Nicolai Hähnle2017-07-312-6/+6
| | | | | | v2: update for LLVMValueRefs in ac_shader_abi Reviewed-by: Marek Olšák <[email protected]>
* ac/nir,radv: move force_persample to ac_shader_info::force_persampleNicolai Hähnle2017-07-316-6/+10
| | | | | | | Avoid accessing radv-specific structures during the meat of NIR-to-LLVM translation. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: use new function ac_build_umin for edgeflag clampingNicolai Hähnle2017-07-312-0/+8
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: clamp shadow texture comparison value on VINicolai Hähnle2017-07-311-1/+13
| | | | | | | Needed for TC-compatible HTILE in radeonsi for test cases like piglit spec/arb_texture_rg/execution/fs-shadow2d-red-01.shader_test Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: add always_vector argument to ac_build_gather_values_extendedNicolai Hähnle2017-07-313-19/+13
| | | | | | | | | | This simplifies a bunch of places that no longer need special treatment of value_count == 1. We rely on LLVM to optimize away the 1-element vector types. This fixes a bunch of bugs where 1-element arrays are indexed indirectly. Reviewed-by: Marek Olšák <[email protected]>
* ac/nir,radeonsi: add ac_shader_abi::front_faceNicolai Hähnle2017-07-312-3/+3
| | | | | | v2: update for LLVMValueRefs in ac_shader_abi Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: pass ac_nir_context to emit_ddxyNicolai Hähnle2017-07-311-15/+14
| | | | | | | Allocating the ddxy_lds is considered to be part of the API shader translation and not part of the ABI. Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: pass ac_nir_context to SSBO intrinsic handlersNicolai Hähnle2017-07-311-55/+59
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: load buffer descriptors via ac_shader_abi::load_ssboNicolai Hähnle2017-07-312-8/+30
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: pass ac_nir_context to emit_discard_ifNicolai Hähnle2017-07-311-8/+8
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: extract shader_info->fs.can_discard from NIR shader infoNicolai Hähnle2017-07-311-2/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: handle old-style shadow tex instructions correctlyNicolai Hähnle2017-07-311-1/+3
| | | | | | The first element is only extracted for new-style shadow tex. Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: whitespace fixesNicolai Hähnle2017-07-311-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: use shader_info pass to determine whether instance_id is usedNicolai Hähnle2017-07-313-2/+9
| | | | | | This improves the separation of ABI and NIR translation. Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: move setting shader_info->fs.writes_memory to radv-specific codeNicolai Hähnle2017-07-311-6/+3
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: add image and write parameter to ac_shader_abi::load_sampler_descNicolai Hähnle2017-07-312-19/+28
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: add support for arrays-of-arrays to get_sampler_descNicolai Hähnle2017-07-311-5/+20
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: pass ac_nir_context to tex_fetch_ptrs and related functionsNicolai Hähnle2017-07-311-75/+83
| | | | Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: add and use ac_shader_abi::load_sampler_descNicolai Hähnle2017-07-312-48/+84
| | | | Reviewed-by: Marek Olšák <[email protected]>