mesa.git
4 years agocompiler: Add color system value
Connor Abbott [Mon, 27 May 2019 15:48:42 +0000 (17:48 +0200)]
compiler: Add color system value

This is nice to have with radeonsi, where color varyings are handled
specially to avoid recompiles.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradv: Use NIR barycentric intrinsics
Connor Abbott [Fri, 10 May 2019 08:44:20 +0000 (10:44 +0200)]
radv: Use NIR barycentric intrinsics

We have to add a few lowering to deal with things that used to be dealt
with inline when creating inputs. We also move the code that fills out
the radv_shader_variant_info struct for linking purposes to
radv_shader.c, as it's no longer tied to the NIR->LLVM lowering.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoac/nir: Implement barycentric intrinsics
Connor Abbott [Mon, 13 May 2019 08:55:07 +0000 (10:55 +0200)]
ac/nir: Implement barycentric intrinsics

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agointel/nir: Extract add_const_offset_to_base
Connor Abbott [Tue, 14 May 2019 10:10:11 +0000 (12:10 +0200)]
intel/nir: Extract add_const_offset_to_base

Pretty much every driver using nir_lower_io_to_temporaries followed by
nir_lower_io is going to want this. In particular, radv and radeonsi in
the next commits.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agonir/lower_io_to_temporaries: Handle interpolation intrinsics
Connor Abbott [Wed, 15 May 2019 16:48:25 +0000 (18:48 +0200)]
nir/lower_io_to_temporaries: Handle interpolation intrinsics

These weren't properly supported. This does pretty much the same thing
that the radv code did.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agonir: Avoid coalescing vars created by lower_io_to_temporaries
Connor Abbott [Wed, 15 May 2019 10:49:29 +0000 (12:49 +0200)]
nir: Avoid coalescing vars created by lower_io_to_temporaries

Right now nir_copy_prop_vars is effectively undoing
nir_lower_io_to_temporaries for inputs by propagating the original
variable through the copy created in lower_io_to_temporaries. A
theoretical variable coalescing pass would have the same issue with
output variables, although that doesn't exist yet. To fix this, add a
new bit to nir_variable, and disable copy propagation when it's set.

This doesn't seem to affect any drivers now, probably since since no one
uses lower_io_to_temporaries for inputs as well as copy_prop_vars, but
it will fix radv once we flip on lower_io_to_temporaries for fs inputs.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agonir: Return correct size in nir_assign_io_var_locations()
Connor Abbott [Fri, 17 May 2019 12:56:45 +0000 (14:56 +0200)]
nir: Return correct size in nir_assign_io_var_locations()

It was double-counting cases where multiple variables were assigned to
the same slot, and not handling the case where the last variable is a
compact variable.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agonir: Handle compact variables when assigning i/o locations
Connor Abbott [Tue, 14 May 2019 12:08:46 +0000 (14:08 +0200)]
nir: Handle compact variables when assigning i/o locations

These are used in Vulkan for clip/cull distances, instead of the GLSL
lowering when the clip/cull arrays are shared.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agonir: Move st_nir_assign_var_locations() to common code
Connor Abbott [Fri, 10 May 2019 08:18:12 +0000 (10:18 +0200)]
nir: Move st_nir_assign_var_locations() to common code

It isn't really doing anything Gallium-specific, and it's needed for
handling component packing, overlapping, etc.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradv: Make FragCoord a sysval
Connor Abbott [Mon, 13 May 2019 13:39:54 +0000 (15:39 +0200)]
radv: Make FragCoord a sysval

load_fragcoord is already handled in common code for radeonsi, so we
don't need to do anything to handle it. However, there were some passes
creating NIR with the varying, so we switch them over to the sysval. In
the case of nir_lower_input_attachments which is used by both radv and
anv, we add handling for both until intel switches to using a sysval.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agospirv: Add an option for making FragCoord a sysval
Connor Abbott [Mon, 13 May 2019 13:32:26 +0000 (15:32 +0200)]
spirv: Add an option for making FragCoord a sysval

On AMD, FragCoord should be a sysval because it is handled separately
from all the other inputs. We were already doing this in radeonsi, but
we weren't doing it with radv. It'll be much more annoying to handle
VARYING_SLOT_POS in fragment shaders when we let NIR lower FS inputs for
us, so here we add an option so that radv can get it as a system value.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: Lower input attachments in NIR.
Daniel Schürmann [Fri, 5 Apr 2019 09:01:39 +0000 (11:01 +0200)]
radv: Lower input attachments in NIR.

v2 (Connor)
- Fix warning in release mode using MAYBE_UNUSED

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: Implement nir_intrinsic_load_layer_id().
Daniel Schürmann [Fri, 5 Apr 2019 08:52:31 +0000 (10:52 +0200)]
radv: Implement nir_intrinsic_load_layer_id().

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoanv,nir: Move lower_input_attachments pass from ANV to NIR.
Daniel Schürmann [Wed, 3 Apr 2019 15:29:20 +0000 (17:29 +0200)]
anv,nir: Move lower_input_attachments pass from ANV to NIR.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: don't emit PFP packets on ME.
Dave Airlie [Mon, 8 Jul 2019 06:53:27 +0000 (16:53 +1000)]
radv/gfx10: don't emit PFP packets on ME.

This was done for all previous GPUs.

This fixes Talos Principle launch hangs.

Fixes: 7e43022e8c8 (radv/gfx10: add gfx10_cs_emit_cache_flush)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoac: select the GFX ring when halting waves with UMR on GFX10
Samuel Pitoiset [Sun, 7 Jul 2019 17:32:29 +0000 (19:32 +0200)]
ac: select the GFX ring when halting waves with UMR on GFX10

GFX10 has two rings, so UMR want to know which one to halt.
Select the first one by default.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: Move NGG output handling outside of giant if-statement.
Bas Nieuwenhuizen [Sun, 7 Jul 2019 23:19:55 +0000 (01:19 +0200)]
radv/gfx10: Move NGG output handling outside of giant if-statement.

In merged shaders we put a big if around each shader, so both stages
can have a different number of threads. However, the NGG output code
still needs to run if the first shader is not executed.

This can happen when there are more gs threads than vs/es threads, or
when there are 0 es/vs threads (why? no clue).

Fixes: ee21bd7440c "radv/gfx10: implement NGG support (VS only)"
Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoradv: Actually use VK formats for the format table.
Bas Nieuwenhuizen [Sun, 7 Jul 2019 21:03:33 +0000 (23:03 +0200)]
radv: Actually use VK formats for the format table.

No ETC2 or ASTC on navi so nothing to add.

Fixes: 3dc5ec5d167 "radv/gfx10: generate gfx10_format_table.h"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoanv: fix VkExternalBufferProperties for host allocation
Chia-I Wu [Sat, 6 Jul 2019 19:12:51 +0000 (12:12 -0700)]
anv: fix VkExternalBufferProperties for host allocation

It was reported as unsupported previously.  It should be importable
and is compatible with itself.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Fixes: 69cc6272fbc199 ("anv: Implement VK_EXT_external_memory_host")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoanv: fix VkExternalBufferProperties for unsupported handles
Chia-I Wu [Sat, 6 Jul 2019 19:02:51 +0000 (12:02 -0700)]
anv: fix VkExternalBufferProperties for unsupported handles

compatibleHandleTypes must include the queried handle type.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoradv: Handle cmask being disallowed by addrlib.
Bas Nieuwenhuizen [Sun, 7 Jul 2019 19:24:17 +0000 (21:24 +0200)]
radv: Handle cmask being disallowed by addrlib.

alignment=0 does weird things with align64.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoradv/gfx10: enable support for NAVI10, NAVI12 and NAVI14
Samuel Pitoiset [Tue, 25 Jun 2019 06:21:37 +0000 (08:21 +0200)]
radv/gfx10: enable support for NAVI10, NAVI12 and NAVI14

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: Use GS rectlist when needed.
Bas Nieuwenhuizen [Sat, 6 Jul 2019 10:30:31 +0000 (12:30 +0200)]
radv/gfx10: Use GS rectlist when needed.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agoradv/gfx10: implement NGG support (VS only)
Samuel Pitoiset [Fri, 5 Jul 2019 06:33:06 +0000 (08:33 +0200)]
radv/gfx10: implement NGG support (VS only)

This needs to be cleaned up a bit, and it probably contains
missing stuff and/or bugs.

This doesn't fix the "half of the triangles" issue.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv: Combine vs and tes output keys parts.
Bas Nieuwenhuizen [Sat, 6 Jul 2019 21:24:07 +0000 (23:24 +0200)]
radv: Combine vs and tes output keys parts.

That way the same deref is valid for both shader stages.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agoradv/gfx10: Use new uconfig reg index packet for GFX10+.
Bas Nieuwenhuizen [Sat, 6 Jul 2019 12:48:58 +0000 (14:48 +0200)]
radv/gfx10: Use new uconfig reg index packet for GFX10+.

Otherwise the hardware/firmware seems to not set the registers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agoradv/gfx10: Set MEM_ORDERED flags on shaders.
Bas Nieuwenhuizen [Sat, 6 Jul 2019 10:31:25 +0000 (12:31 +0200)]
radv/gfx10: Set MEM_ORDERED flags on shaders.

Scattered because depending on stage they are at offset 24/25/27/30.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
4 years agoradv/gfx10: emit GE_CNTL instead of IA_MULTI_VGT_PARAM for legacy mode
Samuel Pitoiset [Wed, 26 Jun 2019 07:42:35 +0000 (09:42 +0200)]
radv/gfx10: emit GE_CNTL instead of IA_MULTI_VGT_PARAM for legacy mode

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: double the number of tessellation offchip buffers per SE
Samuel Pitoiset [Wed, 26 Jun 2019 07:09:33 +0000 (09:09 +0200)]
radv/gfx10: double the number of tessellation offchip buffers per SE

Each gfx10 shader engine corresponds to two gfx9 shader engines, so scale
the number of offchip buffers accordingly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: require LLVM 9+
Samuel Pitoiset [Tue, 25 Jun 2019 06:21:15 +0000 (08:21 +0200)]
radv/gfx10: require LLVM 9+

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: disable geometry and tessellation shaders
Samuel Pitoiset [Fri, 5 Jul 2019 07:08:04 +0000 (09:08 +0200)]
radv/gfx10: disable geometry and tessellation shaders

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: disable binning
Samuel Pitoiset [Tue, 25 Jun 2019 09:50:13 +0000 (11:50 +0200)]
radv/gfx10: disable binning

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: disable CLEAR_STATE
Samuel Pitoiset [Tue, 25 Jun 2019 09:48:27 +0000 (11:48 +0200)]
radv/gfx10: disable CLEAR_STATE

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: disable VK_EXT_transform_feedback
Samuel Pitoiset [Tue, 25 Jun 2019 13:48:06 +0000 (15:48 +0200)]
radv/gfx10: disable VK_EXT_transform_feedback

It requires a bunch of work, so disable for now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: set user data base registers
Samuel Pitoiset [Tue, 25 Jun 2019 15:45:25 +0000 (17:45 +0200)]
radv/gfx10: set user data base registers

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: add gfx10_cs_emit_cache_flush
Samuel Pitoiset [Tue, 25 Jun 2019 15:19:11 +0000 (17:19 +0200)]
radv/gfx10: add gfx10_cs_emit_cache_flush

The cache flush logic on GFX10 is quite different and it's
implemented with a new function.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: set the DCC constant encoding flag
Samuel Pitoiset [Tue, 25 Jun 2019 14:18:40 +0000 (16:18 +0200)]
radv/gfx10: set the DCC constant encoding flag

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: do not declare streamout SGPRS
Samuel Pitoiset [Fri, 5 Jul 2019 16:14:24 +0000 (18:14 +0200)]
radv/gfx10: do not declare streamout SGPRS

Streamout is completely different on GFX10.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: do not set stream output shader config
Samuel Pitoiset [Tue, 25 Jun 2019 13:45:20 +0000 (15:45 +0200)]
radv/gfx10: do not set stream output shader config

Transform feedback is really different on GFX10.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: emit VGT_VERTEX_REUSE_BLOCK_CNTL during gfx initialization
Samuel Pitoiset [Tue, 25 Jun 2019 13:38:44 +0000 (15:38 +0200)]
radv/gfx10: emit VGT_VERTEX_REUSE_BLOCK_CNTL during gfx initialization

The value doesn't need to be updated for tess.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: update shader-related fields in si_emit_graphics()
Samuel Pitoiset [Tue, 25 Jun 2019 12:48:08 +0000 (14:48 +0200)]
radv/gfx10: update shader-related fields in si_emit_graphics()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement si_emit_compute()
Samuel Pitoiset [Tue, 25 Jun 2019 12:42:06 +0000 (14:42 +0200)]
radv/gfx10: implement si_emit_compute()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: mask DCC tile swizzle by alignment
Samuel Pitoiset [Tue, 25 Jun 2019 12:28:10 +0000 (14:28 +0200)]
radv/gfx10: mask DCC tile swizzle by alignment

DCC alignment can be less than the alignment of the main surface. In that
case, the DCC tile swizzle needs to be masked accordingly. Should have no
impact on pre-gfx10.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: initialize GE_{MAX,MIN}_VTX_INDX/INDX_OFFSET
Samuel Pitoiset [Tue, 25 Jun 2019 12:13:36 +0000 (14:13 +0200)]
radv/gfx10: initialize GE_{MAX,MIN}_VTX_INDX/INDX_OFFSET

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_flush_vertex_descriptors() change
Samuel Pitoiset [Fri, 5 Jul 2019 14:09:03 +0000 (16:09 +0200)]
radv/gfx10: implement radv_flush_vertex_descriptors() change

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement fill_geom_tess_rings()
Samuel Pitoiset [Tue, 25 Jun 2019 12:10:42 +0000 (14:10 +0200)]
radv/gfx10: implement fill_geom_tess_rings()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_CmdBindDescriptorSets()
Samuel Pitoiset [Tue, 25 Jun 2019 12:02:52 +0000 (14:02 +0200)]
radv/gfx10: implement radv_CmdBindDescriptorSets()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement write_buffer_descriptor()
Samuel Pitoiset [Tue, 25 Jun 2019 12:00:04 +0000 (14:00 +0200)]
radv/gfx10: implement write_buffer_descriptor()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: use the correct register for image descriptor dumping
Samuel Pitoiset [Tue, 25 Jun 2019 11:56:22 +0000 (13:56 +0200)]
radv/gfx10: use the correct register for image descriptor dumping

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_pipeline_generate_hw_hs()
Samuel Pitoiset [Tue, 25 Jun 2019 11:17:51 +0000 (13:17 +0200)]
radv/gfx10: implement radv_pipeline_generate_hw_hs()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_fill_shader_variant()
Samuel Pitoiset [Tue, 25 Jun 2019 11:33:03 +0000 (13:33 +0200)]
radv/gfx10: implement radv_fill_shader_variant()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_pipeline_generate_geometry_shader()
Samuel Pitoiset [Tue, 25 Jun 2019 11:25:32 +0000 (13:25 +0200)]
radv/gfx10: implement radv_pipeline_generate_geometry_shader()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_init_sampler()
Samuel Pitoiset [Tue, 25 Jun 2019 10:32:01 +0000 (12:32 +0200)]
radv/gfx10: implement radv_init_sampler()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: fix PS exports for SPI_SHADER_32_AR
Samuel Pitoiset [Tue, 25 Jun 2019 10:16:39 +0000 (12:16 +0200)]
radv/gfx10: fix PS exports for SPI_SHADER_32_AR

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_get_device_name()
Samuel Pitoiset [Tue, 25 Jun 2019 10:11:42 +0000 (12:11 +0200)]
radv/gfx10: implement radv_get_device_name()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: set RADV_FORCE_FAMILY
Samuel Pitoiset [Tue, 25 Jun 2019 10:09:41 +0000 (12:09 +0200)]
radv/gfx10: set RADV_FORCE_FAMILY

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: fix a possible hang with exp pos0 with done=0 and exec=0
Samuel Pitoiset [Tue, 25 Jun 2019 10:05:35 +0000 (12:05 +0200)]
radv/gfx10: fix a possible hang with exp pos0 with done=0 and exec=0

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: set PA_SC_TILE_STEERING_OVERRIDE
Samuel Pitoiset [Tue, 25 Jun 2019 10:01:40 +0000 (12:01 +0200)]
radv/gfx10: set PA_SC_TILE_STEERING_OVERRIDE

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: set cache control registers
Samuel Pitoiset [Tue, 25 Jun 2019 09:59:53 +0000 (11:59 +0200)]
radv/gfx10: set cache control registers

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: set llvm_has_working_vgpr_indexing
Samuel Pitoiset [Tue, 25 Jun 2019 09:24:48 +0000 (11:24 +0200)]
radv/gfx10: set llvm_has_working_vgpr_indexing

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: update DB_DFSM_CONTROL register
Samuel Pitoiset [Tue, 25 Jun 2019 08:53:17 +0000 (10:53 +0200)]
radv/gfx10: update DB_DFSM_CONTROL register

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: update DB_Z_INFO register
Samuel Pitoiset [Tue, 25 Jun 2019 08:51:48 +0000 (10:51 +0200)]
radv/gfx10: update DB_Z_INFO register

GFX10 uses the same register as GFX8.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_emit_global_shader_pointers()
Samuel Pitoiset [Tue, 25 Jun 2019 09:40:02 +0000 (11:40 +0200)]
radv/gfx10: implement radv_emit_global_shader_pointers()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_emit_tess_factor_ring()
Samuel Pitoiset [Tue, 25 Jun 2019 09:32:53 +0000 (11:32 +0200)]
radv/gfx10: implement radv_emit_tess_factor_ring()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_emit_fb_ds_state()
Samuel Pitoiset [Tue, 25 Jun 2019 08:50:09 +0000 (10:50 +0200)]
radv/gfx10: implement radv_emit_fb_ds_state()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_initialise_ds_surface()
Samuel Pitoiset [Tue, 25 Jun 2019 08:42:49 +0000 (10:42 +0200)]
radv/gfx10: implement radv_initialise_ds_surface()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_emit_fb_color_state()
Samuel Pitoiset [Tue, 25 Jun 2019 08:30:29 +0000 (10:30 +0200)]
radv/gfx10: implement radv_emit_fb_color_state()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_initialise_color_surface()
Samuel Pitoiset [Tue, 25 Jun 2019 08:20:33 +0000 (10:20 +0200)]
radv/gfx10: implement radv_initialise_color_surface()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_init_dcc_control_reg()
Samuel Pitoiset [Tue, 25 Jun 2019 08:09:58 +0000 (10:09 +0200)]
radv/gfx10: implement radv_init_dcc_control_reg()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement radv_make_buffer_descriptor()
Samuel Pitoiset [Tue, 25 Jun 2019 07:37:58 +0000 (09:37 +0200)]
radv/gfx10: implement radv_make_buffer_descriptor()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: implement si_set_mutable_tex_desc_fields()
Samuel Pitoiset [Tue, 25 Jun 2019 07:29:19 +0000 (09:29 +0200)]
radv/gfx10: implement si_set_mutable_tex_desc_fields()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: add gfx10_make_texture_descriptor
Samuel Pitoiset [Tue, 25 Jun 2019 07:23:04 +0000 (09:23 +0200)]
radv/gfx10: add gfx10_make_texture_descriptor

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: generate gfx10_format_table.h
Samuel Pitoiset [Tue, 25 Jun 2019 16:15:14 +0000 (18:15 +0200)]
radv/gfx10: generate gfx10_format_table.h

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: increase maximum number of layers to 8192
Samuel Pitoiset [Tue, 25 Jun 2019 06:47:47 +0000 (08:47 +0200)]
radv/gfx10: increase maximum number of layers to 8192

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: increase maximum number of levels to 14
Samuel Pitoiset [Tue, 25 Jun 2019 06:47:35 +0000 (08:47 +0200)]
radv/gfx10: increase maximum number of levels to 14

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoradv/gfx10: set MAX_ALLOC_COUNT
Samuel Pitoiset [Tue, 25 Jun 2019 06:29:24 +0000 (08:29 +0200)]
radv/gfx10: set MAX_ALLOC_COUNT

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoac/nir: unpacked GS invocation ID on GFX10+
Samuel Pitoiset [Tue, 25 Jun 2019 09:45:26 +0000 (11:45 +0200)]
ac/nir: unpacked GS invocation ID on GFX10+

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoac: add missing formats to ac_get_tbuffer_format() for GFX10
Samuel Pitoiset [Thu, 4 Jul 2019 16:03:33 +0000 (18:03 +0200)]
ac: add missing formats to ac_get_tbuffer_format() for GFX10

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agovulkan/overlay: fix command buffer stats
Lionel Landwerlin [Thu, 4 Jul 2019 18:55:49 +0000 (21:55 +0300)]
vulkan/overlay: fix command buffer stats

Begin/Reset of command buffer both reset the content of the command
buffer. Don't forget to wipe them on Begin.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4438188f492e1f ("vulkan/overlay: record stats in command buffers and accumulate on exec/submit")
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
4 years agoanv: manually add KHR_display to the list of platforms
Lionel Landwerlin [Sun, 7 Jul 2019 08:46:18 +0000 (11:46 +0300)]
anv: manually add KHR_display to the list of platforms

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 38305e6c94ea31 ("anv: replace hard-coded platform list with vk.xml parse")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111078
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
4 years agodocs/features: add shader buffer and atomic support for llvmpipe
Dave Airlie [Sun, 7 Jul 2019 06:21:45 +0000 (16:21 +1000)]
docs/features: add shader buffer and atomic support for llvmpipe

4 years agollvmpipe: enable ARB_shader_storage_buffer_object
Dave Airlie [Wed, 26 Jun 2019 05:58:09 +0000 (15:58 +1000)]
llvmpipe: enable ARB_shader_storage_buffer_object

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agollvmpipe: add support for shader buffer binding.
Dave Airlie [Wed, 26 Jun 2019 05:57:30 +0000 (15:57 +1000)]
llvmpipe: add support for shader buffer binding.

This add support for setting shader buffers and passing them
to draw or binding them to the fragment shader jit.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agodraw: add shader buffer interfaces.
Dave Airlie [Wed, 26 Jun 2019 05:56:32 +0000 (15:56 +1000)]
draw: add shader buffer interfaces.

This adds the interface to add mapped shader buffers,
and sets up the jit linkage for them.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agogallivm: add buffer operations to the tgsi->llvm conversion.
Dave Airlie [Wed, 26 Jun 2019 05:53:53 +0000 (15:53 +1000)]
gallivm: add buffer operations to the tgsi->llvm conversion.

This adds load, store and atomic operations. These operations
have to respect the exec_mask, and can't operate in lanes where
the execute is off. This is needed to avoid side effects seen
outside the shaders.

There is also bounds checking on the ssbo accesses vs the size
ptr.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agogallivm: move mask_vec function up higher so it can be reused.
Dave Airlie [Wed, 26 Jun 2019 05:49:16 +0000 (15:49 +1000)]
gallivm: move mask_vec function up higher so it can be reused.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agotgsi: denote which load/store/atomic channels are unsigned
Dave Airlie [Wed, 26 Jun 2019 05:45:50 +0000 (15:45 +1000)]
tgsi: denote which load/store/atomic channels are unsigned

llvmpipe will need this info.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agollvmpipe: add support for ssbo to the fragment shader jit.
Dave Airlie [Wed, 26 Jun 2019 05:42:23 +0000 (15:42 +1000)]
llvmpipe: add support for ssbo to the fragment shader jit.

This just adds the ssbo ptrs to the jit fragment shader api.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agodraw: add support for ssbo ptrs to jit tables.
Dave Airlie [Wed, 26 Jun 2019 05:40:28 +0000 (15:40 +1000)]
draw: add support for ssbo ptrs to jit tables.

This adds ssbo/num_ssbo ptrs to the vs/gs jit tables.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agogallivm: add some basic SSBO limits. (v2)
Dave Airlie [Wed, 26 Jun 2019 05:41:33 +0000 (15:41 +1000)]
gallivm: add some basic SSBO limits. (v2)

v2: update ssbo size

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agoutil: add util_copy_shader_buffer.
Dave Airlie [Wed, 26 Jun 2019 05:37:11 +0000 (15:37 +1000)]
util: add util_copy_shader_buffer.

This just adds an inline to copy a pipe_shader_buffer.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agogallivm: add ssbo pointers to the soa build api.
Dave Airlie [Wed, 26 Jun 2019 05:34:52 +0000 (15:34 +1000)]
gallivm: add ssbo pointers to the soa build api.

Need to pass ssbo + ssbo size pointers just like constants.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agogallivm: add compare exchange wrapper
Dave Airlie [Mon, 1 Jul 2019 21:10:53 +0000 (07:10 +1000)]
gallivm: add compare exchange wrapper

This just pulls the wrapper from LLVM for older versions

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agovertex shader: add exec masking (v2)
Dave Airlie [Mon, 24 Jun 2019 04:45:36 +0000 (14:45 +1000)]
vertex shader: add exec masking (v2)

As suggested by Roland this is just a compare of fetch_max
vs the counter, much simpler than my original spaghetti code.

We require the vertex shader to have an exec mask to get proper
ssbo/image load/atore/atomics semantics

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
4 years agovirgl: Hide internal virgl_resource functions
Alexandros Frantzis [Fri, 5 Jul 2019 13:08:43 +0000 (16:08 +0300)]
virgl: Hide internal virgl_resource functions

Since the transition to virgl_resource_transfer_map(), several
previously public virgl_resource functions are not required to be public
anymore.

We also move the functions earlier in the file so they can be used
without functions declarations.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
4 years agovirgl: Use virgl_resource_transfer_map for textures
Alexandros Frantzis [Fri, 5 Jul 2019 11:27:11 +0000 (14:27 +0300)]
virgl: Use virgl_resource_transfer_map for textures

Replace custom texture map code (for maps which don't require resolve)
with virgl_resource_transfer_map.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
4 years agovirgl: Use virgl_resource_transfer_map for buffers
Alexandros Frantzis [Fri, 5 Jul 2019 11:23:19 +0000 (14:23 +0300)]
virgl: Use virgl_resource_transfer_map for buffers

Replace custom buffer map code with virgl_resource_transfer_map.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
4 years agovirgl: Introduce virgl_resource_transfer_map
Alexandros Frantzis [Fri, 5 Jul 2019 11:22:16 +0000 (14:22 +0300)]
virgl: Introduce virgl_resource_transfer_map

Normal mapping of buffers and textures uses almost identical logic.
This commit extracts the this logic in the form of the
virgl_resource_transfer_map() helper function.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
4 years agoiris: Use a uint16_t for key sizes
Jason Ekstrand [Thu, 4 Jul 2019 23:26:20 +0000 (18:26 -0500)]
iris: Use a uint16_t for key sizes

sizeof(struct brw_vs_prog_key) == 324.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
4 years agoac: destroy passes in ac_destroy_llvm_compiler
Marek Olšák [Sat, 29 Jun 2019 06:25:23 +0000 (02:25 -0400)]
ac: destroy passes in ac_destroy_llvm_compiler

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>