summaryrefslogtreecommitdiffstats
path: root/src/amd
Commit message (Collapse)AuthorAgeFilesLines
* radv: Don't generate radv_timestamp.hBas Nieuwenhuizen2016-11-242-8/+1
| | | | | | | | Not needed anymore. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* radv: fix texel fetch offset with 2d arrays.Dave Airlie2016-11-241-3/+4
| | | | | | | | | | | | The code didn't limit the offsets to the number supplied, so if we expected 3 but only got 2 we were accessing undefined memory. This fixes random failures in: dEQP-VK.glsl.texture_functions.texelfetchoffset.sampler2darray_* Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: fix flipped blitsDave Airlie2016-11-231-57/+111
| | | | | | | | This fixes: dEQP-VK.api.copy_and_blit.blit_image.simple_tests.mirror* Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: just local vars for src/dst subresources.Dave Airlie2016-11-231-8/+10
| | | | | | | | This is just a cleanup before I rework this code to fix mirrored blits. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: add support for VK_AMD_draw_indirect_countFredrik Höglund2016-11-242-14/+84
| | | | Reviewed-by: Dave Airlie <[email protected]>
* radv: add support for VK_AMD_negative_viewport_heightFredrik Höglund2016-11-241-0/+4
| | | | | | The driver already supports this extension in practice. Reviewed-by: Dave Airlie <[email protected]>
* radv: add support for VK_KHR_sampler_mirror_clamp_to_edgeFredrik Höglund2016-11-241-0/+4
| | | | | | | radv_tex_wrap() already supports VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, so all that's needed is to advertise support for the extension. Reviewed-by: Dave Airlie <[email protected]>
* radv: add support for anisotropic filtering on SI-CIFredrik Höglund2016-11-242-9/+33
| | | | | | | | | Ported from radeonsi. Note that si_make_texture_descriptor() already sets img7 to the mask value referred to in the comment. Reviewed-by: Dave Airlie <[email protected]>
* radv: move pipeline barrier image transitions after src flushingDave Airlie2016-11-231-8/+12
| | | | | | | | | This seems like it would conform better with the spec. noticed while digging into fast clears. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: add support for shader stats dumpDave Airlie2016-11-223-0/+87
| | | | | | | | | | | I've started working on a shader-db alike for Vulkan, it's based on vktrace and it records pipelines, this adds support to dump the shader stats exactly like radeonsi does, so I can reuse the shader-db scripts it uses. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: fix sample id loadingDave Airlie2016-11-221-1/+18
| | | | | | | | The sample id is packed into bits 8-12, so adjust things properly. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: add implementation of load_sample_pos intrinsic.Dave Airlie2016-11-221-0/+12
| | | | | | | This fixes a bunch of crashes in CTS tests looking for this. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: cleanup ddxy emissionDave Airlie2016-11-221-93/+43
| | | | | | | | | | This cleans up the ddxy emission along the same lines as radeonsi. It also means we don't use LDS on VI chips we use the dspermute interface, it also removes some duplicated code. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/meta: cleanup resolve vertex state emissionDave Airlie2016-11-221-47/+2
| | | | | | | | For the hw resolve there is no need to emit any sort of texture coordinates, so drop them all in the meta path. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Incorporate GPU family into cache UUID.Bas Nieuwenhuizen2016-11-221-3/+5
| | | | | | Invalidates the cache when someone switches cards. Signed-off-by: Bas Nieuwenhuizen <[email protected]>
* radv: Use library mtime for cache UUID.Bas Nieuwenhuizen2016-11-221-4/+32
| | | | | | | | | | | | We want to also invalidate the cache when LLVM gets changed. As the specific LLVM revision is not fixed at build time, we will need to check at runtime. Computing a checksum for LLVM is going to be very expensive, so just use the mtime. Tested on my computer that the returned DSO for the LLVM symbol is actually the LLVM DSO. Signed-off-by: Bas Nieuwenhuizen <[email protected]>
* radv: Store UUID in physical device.Bas Nieuwenhuizen2016-11-223-14/+16
| | | | | | | No sense in repeatedly determining it. Also, it might be dependent on the device as shaders get compiled differently for SI/CIK/VI etc. Signed-off-by: Bas Nieuwenhuizen <[email protected]>
* radv: spir-v allows texture size query with and without lod.Dave Airlie2016-11-211-1/+4
| | | | | | | | | | The translation to llvm was failing here due to required lod. This fixes some new SteamVR shaders. Cc: "13.0" <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: fix image view creation for depth and stencil onlyDave Airlie2016-11-212-13/+9
| | | | | | | | | | | | | | | This fixes the image view for sampling just the depth. It removes some pointless swizzle code, and adds a missing case for the x8_d24 format. Fixes: dEQP-VK.renderpass.formats.d32_sfloat_s8_uint.input.* dEQP-VK.renderpass.formats.d24_unorm_s8_uint.input.* dEQP-VK.renderpass.formats.x8_d24_unorm_pack32.input.* Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: make sure to flush input attachments correctly.Dave Airlie2016-11-211-0/+1
| | | | | | | | | | This fixes 9 of the dEQP-VK.renderpass.attachment_allocation.input_output.* tests. Cc: "13.0" <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* ac/nir/llvm: fix channel in texture gather lowering code.Dave Airlie2016-11-161-1/+1
| | | | | | | | This fixes a number of CTS tests like: dEQP-VK.glsl.texture_gather.basic.2d.rgba8ui.size_npot.clamp_to_edge_repeat Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: don't crash on null swapchain destroy.Dave Airlie2016-11-161-0/+3
| | | | | | | | | Just return if the passed in swapchain is NULL. Fixes: dEQP-VK.wsi.xlib.swapchain.destroy.null_handle Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* amd: automake: android: rename sources lists to foo_FILESEmil Velikov2016-11-153-5/+5
| | | | | | | | Autotools goes smart on us warning that foo_SOURCES variable is present yet a target with name foo is missing. Rename things (like we do throughout the build) to silence the warnings. Signed-off-by: Emil Velikov <[email protected]>
* amd: flatten amd/common makefile structureMauro Rossi2016-11-153-38/+14
| | | | | | | | | | | This pulls amd/common build rules into upper level makefile, along with amd/addlib which is already there. v2: [Emil Velikov] - Move NEED_RADEON_LLVM conditional, drop amd/common from SUBDIRS - Drop AM_ from common_libamd_common_la* Signed-off-by: Emil Velikov <[email protected]>
* radv/pipeline: Don't dereference NULL dynamic state pointersDarren Salt2016-11-121-20/+47
| | | | | | | | | | | | | | | | | This is a port of commit a4a59172482d50318a5ae7f99021bcf0125e0f53: Add guards to prevent dereferencing NULL dynamic pipeline state. Asserts of pCreateInfo members are moved to the earliest points at which they should not be NULL. This fixes a segfault, related to pColorBlendState, seen in Talos Principle which I've observed after startup is completed and when exiting the menus, depending on when Vulkan rendering is selected. v2: moved the NULL check in radv_pipeline_init_blend_state to after the declarations. Acked-by: Edward O'Callaghan <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* ac/nir/llvm: Fix setting function attributes for intrinsicsDaniel Scharrer2016-11-111-1/+5
| | | | | | | | This fixes a NULL pointer dereference for intrinsics with more than one function attribute introduced in commit 2fdaf38. The fix is ported from the lp_build_intrinsic changes in commit 8bdd52c. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* vulkan: import latest public vulkan headers + and fix drivers.Dave Airlie2016-11-111-1/+1
| | | | | | | | | I just noticed the new vulkan headers changed a prototype, so I've decided to import them and fix the drivers to use the new API. Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: fix texturesamples to handle single sample caseDave Airlie2016-11-111-2/+10
| | | | | | | | | | | | We can only read the valid samples if this is an MSAA texture, which means the type field must be 0x14 or 0x15. This fixes: dEQP-VK.glsl.texture_functions.query.texturesamples.* Cc: "13.0" <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: automake: list correct file in the EXTRA_DISTEmil Velikov2016-11-101-1/+1
| | | | | | | | | Earlier commit renamed the file radeon_icd.json{,.in} but missed one reference of the file - in EXTRA_DIST. Cc: "13.0" <[email protected]> Fixes: 0f434a68a ("radv: Suffix the radeon_icd file with the host CPU") Signed-off-by: Emil Velikov <[email protected]>
* radv: fixup botched llvm API changes.Dave Airlie2016-11-101-4/+3
| | | | | Reported-by: Jan Vesely <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* ac/nir/llvm: adopt to new LLVM attribute API.Dave Airlie2016-11-101-36/+108
| | | | | | | | Ported from corresponding changes to gallivm. tested build against 3.9 and master. Signed-off-by: Dave Airlie <[email protected]>
* radv: Suffix the radeon_icd file with the host CPUEmil Velikov2016-11-093-3/+9
| | | | | | | | | | | Port of the anv commit d96345de989 ("anv: Suffix the intel_icd file with the host CPU"). v2: s/intel_icd/radeon_icd/ in commit summary (Gražvydas) Cc: "13.0" <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Dave Airlie <[email protected]> (IRC)
* radv: use correct .specVersion for extensionsEmil Velikov2016-11-091-4/+4
| | | | | | | | Analogous to previous commit. Cc: "13.0" <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Dave Airlie <[email protected]> (IRC)
* amd/addrlib: limit fastcall/regparm to GCC i386Emil Velikov2016-11-091-1/+5
| | | | | | | | | | | | | | | | The use of regparm causes an error on arm/arm64 builds with clang. fastcall is allowed, but still throws a warning. As both options only have effect on 32-bit x86 builds, limit them to that case. v2: keep the __i386__ within GCC (Nicolai) Cc: 13.0 <[email protected]> Cc: Rob Herring <[email protected]> Cc: Nicolai Hähnle <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Rob Herring <[email protected]>
* radv: fix GetFenceStatus for signaled fencesDave Airlie2016-11-091-0/+2
| | | | | | | | | | if a fence is created pre-signaled we should return that in GetFenceStatus even if it hasn't been submitted. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Gustaw Smolarczyk <[email protected]> Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: enable conditional discard optimisation on radv.Dave Airlie2016-11-101-0/+1
| | | | | | | | | | | | | This fixes a bunch of GPU hangs introduced in some CTS tests like dEQP-VK.memory.pipeline_barrier.host_write_uniform_buffer.65536 It works around an issue seen in the LLVM backend, but also makes the radv code work more like the radeonsi stack. Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* ac/nir: add support for discard_if intrinsic (v2)Dave Airlie2016-11-101-0/+21
| | | | | | | | | | We are going to start lowering to this in NIR code, so prepare radv for it. v2: handle conversion to kilp properly (nha) Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: emit correct last export when Z/stencil export is enabledDave Airlie2016-11-091-3/+5
| | | | | | | | | | | | | | | I was getting a random GPU hang in the renderpass simple tests, it turns out sometimes radv emitted the wrong thing "last". This fixes the logic to emit Z/stencil last if they occur, and not mark a color output as last. Also this relies on the Z/STENCIL being the first two fragment outputs, which they are so yay. Fixes: dEQP-VK.renderpass.simple.color_depth (random hangs) Cc: "13.0" <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* android: amd/common: add support for libmesa_amd_commonMauro Rossi2016-11-053-0/+59
| | | | | | | | | | | | | | | Fixes the following building error introduced with commit 7115e56 and related amd/common dependencies: external/mesa/src/gallium/drivers/radeonsi/si_shader.c:6861: error: undefined reference to 'ac_is_sgpr_param' external/mesa/src/gallium/drivers/radeonsi/si_shader.c:6951: error: undefined reference to 'ac_is_sgpr_param' clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed make: *** [ninja_wrapper] Error 1 Signed-off-by: Marek Olšák <[email protected]>
* amd/common: add ac_is_sgpr_param helperNicolai Hähnle2016-11-032-0/+12
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* amd/common: build also for gallium driversNicolai Hähnle2016-11-032-1/+9
| | | | | | | | At least when LLVM is used, which is basically always (unless you're only building r600 without OpenCL). Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* amd/common: move llvm helper prototype to ac_llvm_util.hNicolai Hähnle2016-11-034-7/+13
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radv: add support for anisotropic filtering on VI+Fredrik Höglund2016-11-031-3/+27
| | | | | | | Ported from radeonsi. Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: fix dual source blendingDave Airlie2016-11-031-3/+9
| | | | | | | | | | | Dolphin tried to use this, but we hadn't had any tests for it properly. All that is required is the shader output format needs to be set for 0 and 1 exports. Cc: "13.0" <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: expose xlib platform extensionDave Airlie2016-11-021-0/+6
| | | | | | | | | I missed this when I added the xlib code, this allows dolphin emu to start and crash later. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* amd: fix a typo in PIXEL_PIPE_STAT_RESET definitionMarek Olšák2016-11-011-1/+1
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radv: drop some unused cmask info members.Dave Airlie2016-11-012-8/+0
| | | | | | | | These were assigned but never used. Inspired by similiar patch in radeonsi. Signed-off-by: Dave Airlie <[email protected]>
* radv: split the device local memory heap into twoFredrik Höglund2016-10-283-6/+20
| | | | | | | | | | Advertise two device local memory heaps; one that is host visible and one that is not. This makes it possible for clients to tell how much host visible vs. non-host visible memory is available. Signed-off-by: Dave Airlie <[email protected]>
* radv: add a write-combining host-local memory typeFredrik Höglund2016-10-281-4/+13
| | | | | | | | | | | | | | | | | | | | | | Add the new memory type between the two device-local types. This makes the list of supported memory types look like this: 1) DEVICE_LOCAL | | | 2) | HOST_VISIBLE | HOST_COHERENT | 3) DEVICE_LOCAL | HOST_VISIBLE | HOST_COHERENT | 4) | HOST_VISIBLE | HOST_COHERENT | HOST_CACHED With this order a client that searches for a HOST_VISIBLE and HOST_COHERENT memory type using the algorithm described in section 10.2 of the Vulkan specification (revision 32) will find the host- local memory type first. A client that requires the memory type to be HOST_VISIBLE and HOST_COHERENT, but not DEVICE_LOCAL is most likely searching for a memory type suitable for staging buffers / images. Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac/llvm: trim texture return valuesDave Airlie2016-10-271-1/+2
| | | | | | | | | | | | | The intrinsic engine asserts in llvm due to this, as we put a vec4 into a vec1, and the next instruction isn't expecting it. So trim the vector at the end before inserting it. Reported-by: Christoph Haag <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>