aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd
Commit message (Collapse)AuthorAgeFilesLines
* radv: fix 32-bits build (again)Samuel Pitoiset2020-03-111-2/+2
| | | | | | Fixes: dcfc08f5b8a ("radv/sqtt: describe begin/end command buffers with user markers") Signed-off-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4044>
* aco: Don't store TCS outputs to LDS when we're sure that none are read.Timur Kristóf2020-03-111-0/+4
| | | | | | | | | | | | This allows us not to write an output to LDS, even if it has an indirect offset. No pipeline DB changes. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Only write TCS outputs to LDS when they are read by the TCS.Timur Kristóf2020-03-111-2/+25
| | | | | | | | | | | | | | Note that tess factors are always read at the end of the shader, so those are still always saved to LDS. Totals from affected shaders: VGPRS: 25244 -> 25164 (-0.32 %) Code Size: 1768268 -> 1690804 (-4.38 %) bytes Max Waves: 4947 -> 4953 (0.12 %) Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Store tess factors in VMEM only at the end of the shader.Timur Kristóf2020-03-111-2/+36
| | | | | | | | | | | | | | This optimizes out several superfluous stores of the tess factors, especially if the shader wrote those outputs multiple times. Pipeline DB changes on GFX10: Totals from affected shaders: SGPRS: 30384 -> 29536 (-2.79 %) Code Size: 2260720 -> 2214484 (-2.05 %) bytes Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Don't generate an if when the first part of a merged HS or GS is empty.Timur Kristóf2020-03-111-3/+10
| | | | | | | | | | | | In some cases (eg. in a few tessellation CTS tests) the VS part of a merged HS is completely empty. Let's not generate a divergent if in these cases. (LLVM also doesn't do it.) No pipeline DB changes, only affects the CTS. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* radv: Enable ACO on all stages.Timur Kristóf2020-03-111-25/+6
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Enable running TES as ES, including merged TES+GS.Timur Kristóf2020-03-111-9/+13
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* radv: Enable ACO for TES when there is no GS.Timur Kristóf2020-03-111-7/+9
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Implement loading TES inputs.Timur Kristóf2020-03-111-0/+26
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Enable streamout when TES runs on the HW VS stage.Timur Kristóf2020-03-111-1/+1
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Store TES outputs when TES runs on the HW VS stage.Timur Kristóf2020-03-111-0/+1
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Use TES output info when TES runs on the VS stage.Timur Kristóf2020-03-111-3/+15
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Setup tessellation evaluation shader variables.Timur Kristóf2020-03-111-4/+39
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* radv: Enable ACO for tessellation control shaders.Timur Kristóf2020-03-111-2/+4
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Fix LS VGPR init bug on affected hardware.Timur Kristóf2020-03-111-0/+34
| | | | | | | | | | | Vega 10 and Raven have a HW bug: when the HS thread count is zero, the LS input arguments are loaded in the wrong registers. This commit works around this by using the registers where the data actually is, for the affected arguments. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Store VS outputs correctly when tessellation is used.Timur Kristóf2020-03-111-1/+9
| | | | | | | | | | | When tessellation is used, the VS runs on the HW LS stage (merged into HS on GFX9-10). This commit enables such VS to store its outputs properly in LDS so that the TCS can load them as its per-vertex inputs. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Implement tessellation control shader input/output.Timur Kristóf2020-03-112-0/+308
| | | | | | | | | | | | | | | | | | | | | | Tessellation control shaders can have per-vertex inputs, and both per-vertex and per-patch outputs. TCS can not only store, but also load their outputs. The TCS outputs are stored in RING_HS_TESS_OFFCHIP in VMEM, which is where the TES reads them from. Additionally, the are also stored in LDS to make sure they can be loaded fast when read by the TCS. Tessellation factors are always just stored in LDS. At the end of the shader, the first shader invocation reads these from LDS and writes them to RING_HS_TESS_FACTOR in VMEM, and additionally to RING_HS_TESS_OFFCHIP when they are read by the Tessellation Evaluation Shader. This implementation matches the memory layouts used by radv_nir_to_llvm. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Fix combining DS additions in the optimizer.Timur Kristóf2020-03-111-5/+8
| | | | | | | | Previously, it was calculated incorrectly for 64-bit writes and reads. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Slight fix to lds_store and lds_load.Timur Kristóf2020-03-111-9/+15
| | | | | | | | | | | This commit fixes lds_store and lds_load so that they can properly support 32 and 64-bit loads and stores; and makes them a little more reusable so they can be used by tessellation control shaders. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Refactor VS output stores in preparation for tessellation.Timur Kristóf2020-03-111-65/+23
| | | | | | | | | | This commit takes the new helpers into use by the VS output store function. This function is also where the VS outputs will be handled when the VS runs on the HW LS stage. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Refactor load_per_vertex_input in preparation for tessellation.Timur Kristóf2020-03-111-71/+47
| | | | | | | | | This commit carves out the GS per-vertex input load, and takes the new helper functions into use. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Introduce new helpers for calculating address offsets.Timur Kristóf2020-03-111-0/+88
| | | | | | | | | These helpers are going to make it unnecessary to reimplement the (almost) same address offset calculation in mulitple places. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Introduce new VMEM load/store helpers.Timur Kristóf2020-03-111-0/+169
| | | | | | | | | These are going to be used for loading and storing inputs and outputs in various stages, such as GS, TCS and TES. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Remove esgs_itemsize from LDS alignment calculation.Timur Kristóf2020-03-111-2/+0
| | | | | | | | | | It was problematic to have it, because some shader stages might not even know about the esgs_itemsize, for example TCS and the merged VS+TCS stages. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Extract LDS alignment calculation to a separate function.Timur Kristóf2020-03-111-11/+13
| | | | | | | | | This function is going to be reused in multiple functions when storing or loading something in the LDS. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Remove vertex_geometry_gs assertion from merged shaders.Timur Kristóf2020-03-111-2/+4
| | | | | | | | | We are going to support more kinds of merged shaders, such as vertex_tess_control_hs and tess_eval_geometry_gs. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Use mesa shader stage when loading inputs.Timur Kristóf2020-03-111-2/+2
| | | | | | | | This makes it more clear which stages should load these inputs. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Setup correct HW stages when tessellation is used.Timur Kristóf2020-03-112-1/+13
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Implement load_view_index for TCS and TES.Timur Kristóf2020-03-111-3/+5
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Implement memory_barrier_tcs_patch.Timur Kristóf2020-03-111-2/+2
| | | | | | | | | | TCS outputs are going to be written to LDS, so it has to use memory_barrier_shared in order to ensure that it waits for LDS writes. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Implement control_barrier for tessellation control shaders.Timur Kristóf2020-03-111-3/+24
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Implement load_invocation_id for tessellation control shaders.Timur Kristóf2020-03-111-5/+13
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Implement load_patch_vertices_in.Timur Kristóf2020-03-111-0/+8
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Implement load_primitive_id for tessellation shaders.Timur Kristóf2020-03-111-2/+15
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Implement load_tess_coord.Timur Kristóf2020-03-112-0/+25
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Setup tessellation control shader variables.Timur Kristóf2020-03-111-4/+61
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* aco: Extract setup_gs_variables into a separate function.Timur Kristóf2020-03-111-16/+22
| | | | | | Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* radv: Move some helper functions to the radv_shader.h header file.Timur Kristóf2020-03-112-83/+94
| | | | | | | | | Move calculate_tess_lds_size and get_tcs_num_patches to radv_shader.h ACO will need to call these functions too. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
* radv: do not recursively begin/end render pass for meta operationsSamuel Pitoiset2020-03-119-150/+180
| | | | | | | | | | To avoid breaking SQTT user markers that are emitted to report barriers and layout transitions to RGP. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4136> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4136>
* radv/sqtt: describe pipeline and wait events barriersSamuel Pitoiset2020-03-103-0/+133
| | | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
* radv/rgp: bump the instrumentation spec version to 1Samuel Pitoiset2020-03-101-1/+1
| | | | | | | | | RGP expects the version to be 1, otherwise it doesn't display the barriers (including layout transitions) correctly. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
* radv/sqtt: describe render pass color/depthstencil clearsSamuel Pitoiset2020-03-103-0/+21
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
* radv/sqtt: describe draw/dispatch and emit event markersSamuel Pitoiset2020-03-103-2/+457
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
* radv/sqtt: describe begin/end command buffers with user markersSamuel Pitoiset2020-03-103-0/+108
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
* radv: initial implementation of the driver internal layer SQTTSamuel Pitoiset2020-03-103-0/+347
| | | | | | | | | | This layer is used to emit SQTT user markers to command buffers. It currently only emits API markers but it will consolidated soon with barrier markers and more. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
* radv/sqtt: add a helper that emits thread trace userdata markersSamuel Pitoiset2020-03-102-0/+19
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
* radv: use device entrypoints from the SQTT layer if enabledSamuel Pitoiset2020-03-101-0/+11
| | | | | | | | | This allows to override RADV device entrypoints if the prefix is 'sqtt' instead of 'radv'. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
* radv/entrypoints: declare a driver internal layer for SQTTSamuel Pitoiset2020-03-101-3/+2
| | | | | | | | | | | Some Vulkan commands will be overriden to emit user SQTT markers. These markers are then used by the Radeon GPU Profiler to display timings, barrier operations (cache flushes, pipeline stalls, layout transitions) and more. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
* ac: add a bug workaround for the 100% NGG culling caseMarek Olšák2020-03-091-0/+33
| | | | | | Fixes: 8db00a51f85 - radeonsi/gfx10: implement NGG culling for 4x wave32 subgroups Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4079>
* radv/sqtt: fix RADV_THREAD_TRACE_BUFFER_SIZE spellingEdmondo Tommasina2020-03-091-1/+1
| | | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4116> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4116>