summaryrefslogtreecommitdiffstats
path: root/src/amd
Commit message (Collapse)AuthorAgeFilesLines
* amd/common: Fix build with new ac_add_function_attr()Tobias Klausmann2017-03-013-3/+5
| | | | | | | | | | | | | Fix usage of ac_add_function_attr() and make it known! common/ac_nir_to_llvm.c: In function 'create_llvm_function': common/ac_nir_to_llvm.c:265:4: error: implicit declaration of function 'ac_add_function_attr' [-Werror=implicit-function-declaration] ac_add_function_attr(main_function, i + 1, AC_FUNC_ATTR_BYVAL); ^~~~~~~~~~~~~~~~~~~~ Signed-off-by: Tobias Klausmann <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* gallivm,ac: add function attributes at call sites instead of declarationsMarek Olšák2017-03-014-48/+86
| | | | | | | | | | | | | | | | They can vary at call sites if the intrinsic is NOT a legacy SI intrinsic. We need this to force readnone or inaccessiblememonly on some amdgcn intrinsics. This is only used with LLVM 4.0 and later. Intrinsics only used with LLVM <= 3.9 don't need the LEGACY flag. gallivm and ac code is in the same patch, because splitting would be more complicated with all the LEGACY uses all over the place. v2: don't change the prototype of lp_add_function_attr. Reviewed-by: Jose Fonseca <[email protected]> (v1)
* gallivm,ac: remove unused FUNC_ATTR_LAST enumsMarek Olšák2017-03-011-1/+0
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* radv: fix txs for sampler buffersDave Airlie2017-03-011-1/+1
| | | | | | | | | I messed this up when I wrote it, this fixes: dEQP-VK.memory.pipeline_barrier.*uniform_texel_buffer.* Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "17.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* amd/common: fix ASICREV_IS_POLARIS11_M for Polaris12Marek Olšák2017-02-281-1/+1
| | | | | | Cc: 17.0 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Don't allocate space for unused immutable samplers.Bas Nieuwenhuizen2017-02-281-9/+14
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv/ac: Use constants for immutable samplers.Bas Nieuwenhuizen2017-02-281-0/+16
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Detect if all immutable samplers for a binding are equal.Bas Nieuwenhuizen2017-02-282-0/+6
| | | | | | | We can then use constants for indexed loads. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Store the immutable samplers as uint32_t[4].Bas Nieuwenhuizen2017-02-282-10/+6
| | | | | | | So we don't need to know about radv_sampler in ac_nir_to_llvm. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radeon/ac: make ac_shader_binary_config_start() available externallyTimothy Arceri2017-02-282-1/+8
| | | | | | | | The read config functions are different for r600 and radeonsi so we can't just share the one in amd common. So just share this instead. Reviewed-by: Marek Olšák <[email protected]>
* radeon/ac: add llvm_ir_string to ac_shader_binary structTimothy Arceri2017-02-281-0/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* radv: fix depth format in blit2d.Dave Airlie2017-02-281-2/+5
| | | | | | | | | | | | | For blitting we need to use the depth or stencil format, never the combined. This fixes: dEQP-VK.texture.shadow.2d.nearest.less_or_equal_d32_sfloat_s8_uint and a few others. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "13.0 17.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/formats: add fast clear for 8-bit signed ints.Dave Airlie2017-02-281-0/+16
| | | | | | | These formats are used by some CTS tests, may as well fill them in. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Use correct size for availability flag.Bas Nieuwenhuizen2017-02-271-2/+5
| | | | | | | | | | Per spec, VK_QUERY_RESULT_64_BIT specifies the integer size and the availability flag is an integer. We apparently handled this correctly already for the copy to buffer case. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Cc: 13.0 17.0 <[email protected]>
* radv: Only use PKT3_OCCLUSION_QUERY when it doesn't hang.Bas Nieuwenhuizen2017-02-271-20/+45
| | | | | | | | | | | | | PKT3_OCCLUSION_QUERY hangs when used in a nested IB. This only calls it when in a primary command buffer and we change GetQueryPoolResults to not need it. CmdCopyQueryPoolResults still needs it so we break that behavior for secondary command buffers. However, that would hang already and using an unitialized value is better than a hang. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Cc: 13.0 17.0 <[email protected]>
* radv: Reset emitted compute pipeline when calling secondary cmd buffer.Bas Nieuwenhuizen2017-02-271-0/+1
| | | | | | | | | Otherwise if the new compute pipeline is the same as the last used pipeline before the call, we don't emit it again. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Cc: 13.0 17.0 <[email protected]>
* radv: add support for NV_dedicated_allocationDave Airlie2017-02-274-20/+62
| | | | | | | | | This adds initial support for NV_dedicated_allocation, then uses it for the wsi image/memory allocation paths internally in the driver. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/winsys: fix freeing imported memory.Andres Rodriguez2017-02-271-0/+2
| | | | | | | | This bo->fd wasn't setting some stuff correctly that could lead to crashes for anything using this path later. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* vulkan/wsi/radv: add initial prime support (v1.1)Dave Airlie2017-02-274-13/+150
| | | | | | | | | | | | | | | | | | | This is a complete rewrite of my previous rfc patches. This adds the ability to present to a different GPU that rendering using a driver side operation that can copy from the tiled to linear shared image. This does prime support completely in the swapchain present code, and each queue has a precreated command buffer for each image and for the each queue family. This means presenting should work on graphics and compute queues and transfer in the future. v1.1: initialise needs_linear_copy in swapchain. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Tested-by: Mike Lothian <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: Add integer->integer casts.Bas Nieuwenhuizen2017-02-261-0/+18
| | | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Acked-by: Edward O'Callaghan <[email protected]>
* ac: silence a warningMarek Olšák2017-02-251-2/+1
| | | | trivial
* radv/entrypoints: Only generate entrypoints for supported featuresEmil Velikov2017-02-241-3/+42
| | | | | | | | | | | | | | | This changes the way radv_entrypoints_gen.py works from generating a table containing every single entrypoint in the XML to just the ones that we actually need. There's no reason for us to burn entrypoint table space on a bunch of NV extensions we never plan to implement. RADV implements VK_AMD_draw_indirect_count, so add that to the list. Port of 114c281e707919a1420d3a20219ce4392d8b360d "and/entrypoints: Only generate entrypoints for supported features" Signed-off-by: Emil Velikov <[email protected]> Acked-by: Dave Airlie <[email protected]>
* radv: add sample mask output supportDave Airlie2017-02-243-2/+9
| | | | | | | | | This adds support to write to sample mask from the fragment shader. We can optimise this later like radeonsi. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: refactor our fmask sample index fixup.Dave Airlie2017-02-241-122/+107
| | | | | | | | This refactors out the sample index fixup between txf and image load. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: fetch sample index via fmask for image coord as well.Dave Airlie2017-02-241-54/+126
| | | | | | | | | | | This follows the txf_ms code, I can't figure out why amdgpu-pro doesn't do this in their shaders, they must know someone we don't. This fixes: dEQP-VK.pipeline.multisample_shader_builtin.sample_id.* Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: add sample mask input supportDave Airlie2017-02-241-1/+6
| | | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: enable location at sample when persample is forced.Dave Airlie2017-02-241-0/+3
| | | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: fix interpolation at wrong place for offset interpDave Airlie2017-02-242-3/+4
| | | | | | | | | The code was interpolating at the offset from the sample, not the offset from the center. Also fix for persample interpolation modes we should force the pixel center to be at the sample. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: handle gs->copy shader clip distances.Dave Airlie2017-02-231-13/+68
| | | | | | | | | | | This fixes up the clip distance passing between the geometry shader and the copy shader. It packs the clip and cull distances into one or two consecutive slots, and avoids wasting space and make sure the gs output and copy shader input agree on where things are stored. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: pass clips properly from vertex->geometry shader stages.Dave Airlie2017-02-231-6/+40
| | | | | | | | | | | This works out the geometry shader clip/cull inputs separately to the outputs, and uses that information to read from the ES->GS ring buffer. It stores the clip/cull distances packed into one or two slots. It fixes the es output emission and gs input reading to match. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: rename num clips/cull to output clips/cullsDave Airlie2017-02-231-10/+10
| | | | | | | | | As geom shaders can have different ones on entry and exit. also move to uint8_t as these are never that big. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* vulkan: Combine wsi and util makefilesDylan Baker2017-02-221-1/+1
| | | | Reviewed-by: Matt Turner <[email protected]>
* radv: fix typo in the subpass barrier patch.Dave Airlie2017-02-221-1/+1
| | | | | | Fixes: dbb0eaccc radv: handle subpass cache flushes Signed-off-by: Dave Airlie <[email protected]>
* util/radv: move *_get_function_timestamp() to utilsTimothy Arceri2017-02-221-19/+3
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radv: make radv_resolve_entrypoint staticEmil Velikov2017-02-212-2/+1
| | | | | | | | Used only within the generated source file. Fixes: 12301c54186 ("radv: drop the RADV_CALL macro.") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* radv: remove unused radv_dispatch_table dtableEmil Velikov2017-02-212-3/+0
| | | | | | Fixes: 12301c54186 ("radv: drop the RADV_CALL macro.") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* radv: remove unneeded extern C notationEmil Velikov2017-02-211-7/+1
| | | | | | | Header is never #include(d) by a C++ source. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* radv: Don't flush at the start of a command buffer.Bas Nieuwenhuizen2017-02-211-15/+0
| | | | | | | The preamble flushes now and the rest is the responsibility of the app. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Flush in the initial preamble CS.Bas Nieuwenhuizen2017-02-213-90/+148
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Special case the initial preamble.Bas Nieuwenhuizen2017-02-214-15/+22
| | | | | | | For flushing we don't want to flush every third IB. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Split emitting the cache flush out.Bas Nieuwenhuizen2017-02-211-64/+77
| | | | | | | So that we can use it without a cmd_buffer. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Free empty_cs on device destruction.Bas Nieuwenhuizen2017-02-211-0/+2
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: handle subpass cache flushesDave Airlie2017-02-211-48/+63
| | | | | | | | | | | | | | | | This splits out the cache flush bit setting code dependent on the src/dest access flags. It then calls it from the subpass barrier code. It also marks a TODO to remove the aggressive CS/PS flushes at some point. This fixes a bunch of the dEQP-VK.renderpass.attachment_allocation.input_output.* tests. Signed-off-by: Dave Airlie <[email protected]>
* vulkan/wsi/x11: add support to detect if we can support rendering (v3)Dave Airlie2017-02-204-4/+12
| | | | | | | | | | | | | | | | | This adds support to radv_GetPhysicalDeviceXlibPresentationSupportKHR and radv_GetPhysicalDeviceXcbPresentationSupportKHR to check if the local device file descriptor is compatible with the descriptor retrieved from the X server via DRI3. This will stop radv binding to an X server until we have prime support in place. Hopefully apps use this API before trying to render things. v2: drop unneeded function, don't leak memory. (jekstrand) v3: also check in surface_get_support callback. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* Revert "radv: detect command buffers that do no work and drop them (v2)"Dave Airlie2017-02-206-32/+8
| | | | | | | | | | | | | | | | This just keeps popping up minor problems and regressions we should revisit in a more sustainable manner later. This also reverts: Revert "radv: query cmds should mark a cmd buffer as having draws." Revert "radv: also fixup event emission to not get culled." This reverts commit d1640e79328af4a63c056e3ccab299a3bffbede7. This reverts commit 8b47b97215af7157bc15676167cab73aa5a61a76. This reverts commit b4b19afebeac84ddce3f1f8b7ffe0da6474fe29a. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: Handle VK_REMAINING_ARRAY_LAYERS in fast clear eliminate.Bas Nieuwenhuizen2017-02-191-2/+2
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: handle layered fast clears.Dave Airlie2017-02-195-29/+43
| | | | | | | | | | | | | | This iterates the fast clear flush across the layers in the specified range. It also moves the compute resolve flush into the function and builds the range in there. This fixes: dEQP-VK.geometry.layered.* regressions since fast clears. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: pass subresourceRange by pointer.Dave Airlie2017-02-191-13/+13
| | | | | | | This struct is 5 dwords, we should really just pass a pointer to it. Signed-off-by: Dave Airlie <[email protected]>
* radv: fix typo in a2b10g10r10 fast clear calculation.Dave Airlie2017-02-191-1/+1
| | | | | | | | | | | | This fixes: dEQP-VK.renderpass.formats.a2b10g10r10_unorm_pack32* regressions. Fixes: f22836dbdd radv: Add CPU color packing for VK_FORMAT_A2B10G10R10_UNORM_PACK32. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Invert ring SGPR check.Bas Nieuwenhuizen2017-02-191-1/+1
| | | | | | | | | I assume this wants to check if all pipelines use the same SGPR for the rings. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Acked-by: Edward O'Callaghan <[email protected]>