Commit Graph

118877 Commits

Author SHA1 Message Date
Mauro Rossi 962b70c259 android: radeonsi,ac: fix building error due to ac changes
Updates amd Makefile.sources and fixes the following building errors:

external/mesa/src/gallium/drivers/radeonsi/si_compute_prim_discard.c:338: error: undefined reference to 'ac_add_arg'
external/mesa/src/gallium/drivers/radeonsi/si_compute_prim_discard.c:340: error: undefined reference to 'ac_add_arg'
external/mesa/src/gallium/drivers/radeonsi/si_compute_prim_discard.c:341: error: undefined reference to 'ac_add_arg'
external/mesa/src/gallium/drivers/radeonsi/si_compute_prim_discard.c:342: error: undefined reference to 'ac_add_arg'

Fixes: 9885af3 ("ac: Add a shared interface between radv, radeonsi, LLVM and ACO")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2019-12-27 09:20:49 +01:00
Mauro Rossi ad1c65e322 android: radv: fix vk_format_table.c generated source build
RADV Android build rules are now getting the wrong vk_format.h
from src/vulkan/util include, the simplest way to fix is to add
src/amd/vulkan include prior to src/vulkan/util include

Fixes the following building errors:

out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libmesa_radv_common_intermediates/vk_format_table.c:39:4:
 error: use of undeclared identifier 'VK_FORMAT_LAYOUT_PLAIN'
...
out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libmesa_radv_common_intermediates/vk_format_table.c:131:8:
error: use of undeclared identifier 'VK_FORMAT_TYPE_UNSIGNED'; did you mean 'UTIL_FORMAT_TYPE_UNSIGNED'?
      {VK_FORMAT_TYPE_UNSIGNED, true, false, false, 4, 0},      /* x = a */
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Fixes: 3a28281 ("util: Add a mapping from VkFormat to PIPE_FORMAT.")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2019-12-27 09:20:44 +01:00
Mauro Rossi 13ef793770 android: util: Add a mapping from VkFormat to PIPE_FORMAT.
Updates Makefile.sources and fixes the following building error:

In file included from external/mesa/src/vulkan/util/vk_format.c:24:
In file included from external/mesa/src/vulkan/util/vk_format.h:28:
external/mesa/src/util/format/u_format.h:33:10: fatal error: 'pipe/p_format.h' file not found
#include "pipe/p_format.h"
         ^~~~~~~~~~~~~~~~~
1 error generated.

Fixes: 3a28281 ("util: Add a mapping from VkFormat to PIPE_FORMAT.")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-12-27 09:20:40 +01:00
Mauro Rossi 200be80858 android: nir: add a load/store vectorization pass
Fixes the following aco building error:

external/mesa/src/amd/compiler/aco_instruction_selection_setup.cpp:846:
error: undefined reference to 'nir_opt_load_store_vectorize'

Fixes: ce9205c ("nir: add a load/store vectorization pass")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-12-27 09:20:35 +01:00
Dave Airlie c8042c289e llvmpipe: add debug option to enable OpenCL support.
LP_DEBUG=cl will enable CL support for now.

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:33 +10:00
Dave Airlie 29784bb49c gallivm/nir: add vec8/16 support
Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:33 +10:00
Dave Airlie 5be1ea7d79 gallivm/nir: lower packing
This fixes some CL upsample tests, which lower into packing that needs
lowering.

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:33 +10:00
Dave Airlie 31e0e8a51b llvmpipe: lower hadd/add_sat
Fixes some CL piglits.

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:33 +10:00
Dave Airlie 0a73eafdbe gallivm: handle non-32 bit undefined
other sized undefs caused llvm asserts

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:33 +10:00
Dave Airlie b16fd4d9e9 llvmpipe/nir: use nir_max_vec_components in more places
This is prep work for when vec8/16 have landed.

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:33 +10:00
Dave Airlie 073734ca7f llvmpipe: add support for compute shader params
Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:33 +10:00
Dave Airlie 22d631e235 llvmpipe: handle serialized nir as a shader type.
Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:33 +10:00
Dave Airlie 264663d55d gallivm/llvmpipe: add support for global operations.
Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:33 +10:00
Dave Airlie 9630c2ddd8 gallivm/llvmpipe: add support for block size intrinsic
We have to pass the main block size into the coroutine
and into the shader.

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:32 +10:00
Dave Airlie 336954f7e7 gallivm/llvmpipe: add support for work dimension intrinsic.
We have to pass the work_dim given by the user into the shader.

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:32 +10:00
Dave Airlie b8d403c03f tgsi/mesa: handle KERNEL case
Translate to compute for now.

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:32 +10:00
Dave Airlie dac8cb981f gallivm/nir: allow 8/16-bit conversion and comparison.
This adds the convert to 8/16 and support for 8/16 comparsions

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:32 +10:00
Dave Airlie 3adf74f2ef gallivm: pick integer builders for alu instructions.
This allows these to be used with non 32-bit types.

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:26:32 +10:00
Dave Airlie df3e0fe9d8 gallivm: add support for 8-bit/16-bit integer builders
Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:22:43 +10:00
Dave Airlie 258b9bc02e llvmpipe/gallivm: add kernel inputs
compute shaders need kernel input support

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:22:40 +10:00
Dave Airlie 84ba008774 gallivm: add 64-bit const int creator.
Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-12-27 13:22:35 +10:00
Dave Airlie 41c77dbc1e nir: sanitize work group intrinsics to always be 32-bit.
This saves handling them in the backend later.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
2019-12-27 13:22:34 +10:00
Bas Nieuwenhuizen a435f002c4 radv: Expose all sample counts for integer formats as well.
Things work the same between float and integer.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2261
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2019-12-26 10:48:29 +01:00
Alyssa Rosenzweig be691ca22d panfrost: Route gl_VertexID through cmdstream
It shows up as a special (magic?) attribute. We could try to be clever
and only include the extra record if gl_VertexID is actually read, but
honestly that's just extra complexity for no good reason. Might as well
just always include it; this won't be a real bottleneck, I don't think.

Fixes dEQP-GLES3.functional.shaders.builtin_variable.vertex_id.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:55:04 -05:00
Alyssa Rosenzweig 8781378224 panfrost: Extend attribute_count for vertex builtins
They stretch beyond the usual limit for attributes so are included
implicitly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:55:04 -05:00
Alyssa Rosenzweig 306800d747 pan/midgard: Lower gl_VertexID/gl_InstanceID to attributes
We have special records for these, put in a fixed location by convention
per the blob.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:55:04 -05:00
Alyssa Rosenzweig 6e68890fd6 pan/midgard: Factor out emit_attr_read
We will load attributes directly for gl_VertexID.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:55:04 -05:00
Alyssa Rosenzweig 695b35605b panfrost: Unset vertex_id_zero_based
We don't want the lowering; we have native gl_VertexID.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:55:04 -05:00
Alyssa Rosenzweig 3b3d9653a7 pan/decode: Handle gl_VertexID/gl_InstanceID
Just like varyings have special records for point coordinates (etc),
attributes have special records for vertex/instance ID. We can parse
these fairly easily, although they don't line up exactly with normal
attribute records.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:54:58 -05:00
Alyssa Rosenzweig d36ca7c0a3 panfrost: Remove pan_shift_odd
Padded counts are numbers of the form:

   n = (2k + 1) * 2^s

for k, s integers. Rather than explicitly store k and s separately and
then compute this formula on demand, it's much cleaner to store the
padded number itself, which is what you manipulate most of the time.
When you do need k,s it is easy to factor by noticing the bitwise
representation:

   s = ctz(n)
   k = n >> (s + 1)

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:42:07 -05:00
Alyssa Rosenzweig 62ce9001c2 panfrost: Slight cleanup of Gallium's pan_attribute.c
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:42:07 -05:00
Alyssa Rosenzweig 385a4f773f pan/decode: Fix reference computation for invocations
Slight bug with instancing. No harm done but let's get rid of the
pandecode warning, it's just noise.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:42:07 -05:00
Alyssa Rosenzweig 9c249d3e6b panfrost: Fix off-by-one in pan_invocation.c
When instance_count=2, the packing code was broken. Fixes a dEQP test.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:42:07 -05:00
Alyssa Rosenzweig 467ae0d39d panfrost: Factor out panfrost_compute_magic_divisor
The algorithm doesn't need to be tangled up in details about the
attribute records themselves. We'll need to compute magic divisors for
gl_InstanceID in a second.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 22:42:07 -05:00
Alyssa Rosenzweig 31305e1b28 panfrost: Move instancing routines to encoder/
Nothing Gallium specific or stateful about them.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 19:48:57 -05:00
Alyssa Rosenzweig 8a57672673 panfrost: Factor batch/resource out of instancing routines
They don't need them; this will allow us to move the code into encoder/
which in turn will make the messy Gallium code less scary.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 19:48:57 -05:00
Alyssa Rosenzweig ddcd68f52b panfrost: Rename pan_instancing.c -> pan_attributes.c
Let's follow the naming convention that panfrost command stream code is
organized by command stream structure.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 19:48:57 -05:00
Alyssa Rosenzweig a0e75adabb pan/midgard: Compute destination override
We shift over the mask in this case.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 19:23:02 -05:00
Alyssa Rosenzweig 9a5d462480 pan/midgard: Add mir_upper_override helper
Checks if we should emit a dest_override=upper, given a mask.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 19:23:02 -05:00
Alyssa Rosenzweig fc4193d0c7 pan/midgard: Support loads from R11G11B10 in a blend shader
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 19:22:54 -05:00
Alyssa Rosenzweig 3af5a398f3 pan/midgard: Enable lower_(un)pack_* lowering
These show up in some blend shaders. Let's use the shared lowering and
remove our own.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 19:21:52 -05:00
Tomeu Vizoso 843a6db6bb panfrost: Increase PIPE_SHADER_CAP_MAX_OUTPUTS to 16
GL ES 3.0 requires it to be higher, and stuff seems to work just fine.

Fixes: dEQP-GLES3.functional.implementation_limits.max_vertex_output_components

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-12-24 19:21:52 -05:00
Tomeu Vizoso f107059bb2 panfrost: Handle Z24_UNORM_S8_UINT as MALI_Z32_UNORM
Fixes dEQP-GLES3.functional.texture.format.sized.2d.depth24_stencil8_pot

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-12-24 19:21:52 -05:00
Alyssa Rosenzweig 6b7243f28f pan/midgard: Implement shadow cubemaps
We need to reshuffle to sync up the shadow coordinate temporary with the
cubemap coordinate temporary. Once that's in place, it's simple enough
(we load the shadow coordinate into .z like 2D).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 23:46:23 +00:00
Alyssa Rosenzweig 9e5a1412ed pan/midgard: Generalize temp coordinate to non-2D
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 23:46:23 +00:00
Alyssa Rosenzweig 1bce7fdecd pan/midgard: Do witchcraft on texture offsets
My latest divination spell has uncovered a pattern in the aether.
Although the swizzle is unaligned, its format is otherwise standard.
Document this, removing the old incorrect understanding of the swizzle
(which coincided on common special swizzles only).

Fixes dEQP-GLES3.functional.shaders.texture_functions.texelfetchoffset.sampler2d_fixed_fragment

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 23:46:23 +00:00
Alyssa Rosenzweig 4ec1f95d76 pan/midgard: Fix fallthrough from offset to comparator
Fixes: ccbc9a4e67 ("pan/midgard: Implement textureOffset for 2D textures")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 23:46:22 +00:00
Alyssa Rosenzweig 64b2fe9626 pan/midgard: Expand swizzle for texelFetch
We zero the extra components anyway. Fixes
dEQP-GLES3.functional.shaders.texture_functions.texelfetch.sampler2d_fixed_fragment

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 23:46:22 +00:00
Alyssa Rosenzweig 72e5749a63 pan/midgard: Clamp LOD register swizzle
Fixes register allocation failures with textureLodOffset.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 23:46:22 +00:00
Alyssa Rosenzweig 06df977c1c pan/midgard: Extend IS_VEC4_ONLY to arguments
I think both need to be aligned at least for ld_cubemap_coords.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-12-24 23:46:22 +00:00