Commit Graph

116361 Commits

Author SHA1 Message Date
Dave Airlie 731260de7d gallium: add flatshade lowering capability
This allows the driver to request flatshade lowering.
(NIR drivers only so far).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-17 10:41:36 +02:00
Dave Airlie dc91a02a72 nir: add a pass to lower flat shading.
This takes any color or backcolor that has unspecified
shading and converts it to flat shading.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-17 10:41:36 +02:00
Erik Faye-Lund 26c6640835 gallium/u_blitter: set a more sane viewport-state
This actually corresponds to legal GL depth-ranges, because depth-clear
values are always in the 0..1 range in OpenGL.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-17 09:26:25 +02:00
Marek Olšák 4857d695f5 st/mesa: reorder and document code in st_translate_vertex_program
move the TGSI code after the ARB_vp code

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák 5d0630e504 st/mesa: call prog_to_nir sooner for ARB_fp
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák f54dcaf232 st/mesa: don't call translate_*_program functions for NIR
move the initializaton to st_link_nir

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák f86b28dfdc st/mesa: finalize NIR after shader variant passes for TCS/TES/GS/CS
Same as VS and FS.

This might fix vertex color clamping.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák 45378689e0 st/mesa: unify transform feedback info translation code
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák b23967a5e1 st/mesa: move vertex program preparation code into st_prepare_vertex_program
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák 8dfcec405a st/mesa: clean up more after the removal of st_compute_program
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák 196fc59c40 st/mesa: deduplicate st_common_program code in st_program_string_notify
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák 05f59bb777 st/mesa: sink TCS/TES/GS/CS translate code into st_translate_common_program
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák 74c007ba7f st/mesa: deduplicate cases in st_deserialise_ir_program
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák 1cc866c264 st/mesa: remove st_compute_program in favor of st_common_program
The conversion from pipe_shader_state to pipe_compute_state is done
at the end.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák 691240cdbe st/mesa: don't store stream output info to shader cache for tess ctrl shaders
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák 33de483d55 st/mesa: simplify the signature of st_release_basic_variants
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák ab843a3702 st/mesa: deduplicate code for ATI fs in st_program_string_notify
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Marek Olšák b596bb5b66 st/mesa: use *prog at the end of st_link_nir
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-10-16 20:10:47 -04:00
Dylan Baker 4e07869a06 appveyor: Cache meson's wrap downloads
This makes us less reliant on wrap-db (and reduces the amount of
downloading that goes on during the build).

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1936
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-16 23:26:09 +00:00
Dylan Baker c65f907ce9 gitlab-ci: Set the meson wrapmode to disabled
This will prevent us from accidentally falling back to the wrap-db
instead of using locally installed versions.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-16 23:26:09 +00:00
Dylan Baker 449f831088 Revert "gitlab-ci: Disable meson-mingw32-x86_64 job again for now"
This reverts commit d60b8679a4.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-16 23:26:09 +00:00
Dylan Baker 6e375ff1aa gitlab-ci: Add a pkg-config for mingw
The one debian provides is broken in buster+, so I've just written my
own. This allows meson to find the installed zlib and prevents it from
falling back to wraps.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-16 23:26:09 +00:00
Dylan Baker 4441da0044 meson: Don't use expat on windows
It's not really needed, and there's no debian package for it so we're
forced to fall back to wraps in mesa's CI. This can be problematic in
itself.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-16 23:26:09 +00:00
Karol Herbst 656c038d01 st/mesa: fix crash for drivers supporting nir defaulting to tgsi
nvc0 and I assume radeonsi as well hit an assert inside glsl_to_tgsi as atan
instructions get inserted into the shader.

Fixes: cece947a8d ("glsl/builtin: Add alternate versions of atan using new ops")
Cc: Neil Roberts <nroberts@igalia.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2019-10-16 21:53:46 +00:00
Eric Engestrom aaab70035a util/u_atomic: fix return type of p_atomic_{inc,dec}_return() and p_atomic_{cmp,}xchg()
We're trying to cast the return type to the type of the var, but instead
we were casting `sizeof(*v)`.

Fixes: 6df72e970c ("util: Make u_atomic.h typeless.")
Fixes: 0a7f17cf5b ("util/u_atomic: add p_atomic_xchg")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
2019-10-16 19:41:47 +01:00
Eric Engestrom d3b06a199e mesa/math: delete duplicate extern symbol
It's already defined in `m_debug_util.h`, along with an explanation of
what it is and how to use it.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-10-16 19:31:24 +01:00
Eric Engestrom 38427da02b mesa/math: delete leftover... from 18 years ago (!)
Left over from 0a79baf1bf ("remove dead vertex assembly").

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-10-16 19:31:20 +01:00
Andreas Baierl 0ee931c1de lima: Fix crash when there are no vertex shader attributes
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
2019-10-16 16:45:05 +00:00
Andreas Baierl f906f5f053 lima: Fix compiler warning in standalone compiler
'struct lima_context' has to be declared before usage in lima_program.h

Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
2019-10-16 15:13:13 +00:00
Rhys Perry 88f1c0a360 aco: emit_split_vector() s_memtime results
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
2019-10-16 15:31:19 +01:00
Rhys Perry ded51b13da aco: don't CSE s_memtime
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
2019-10-16 15:31:19 +01:00
Rhys Perry d7838152f5 aco: fix scheduling with s_memtime/s_memrealtime
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
2019-10-16 15:31:19 +01:00
Alan Coopersmith 6804b8e1ff intel/common: include unistd.h for ioctl() prototype on Solaris
Fixes build errors of:
In file included from ../src/intel/vulkan/anv_private.h:48,
                 from ../src/intel/vulkan/genX_blorp_exec.c:26:
../src/intel/common/gen_gem.h: In function ‘gen_ioctl’:
../src/intel/common/gen_gem.h:68:15: error: implicit declaration of function ‘ioctl’ [-Werror=implicit-function-declaration]
   68 |         ret = ioctl(fd, request, arg);
      |               ^~~~~
In file included from ../include/c11/threads_posix.h:35,
                 from ../include/c11/threads.h:66,
                 from ../src/mesa/main/mtypes.h:39,
                 from ../src/intel/compiler/brw_compiler.h:30,
                 from ../src/intel/vulkan/anv_private.h:51,
                 from ../src/intel/vulkan/genX_blorp_exec.c:26:
/usr/include/unistd.h: At top level:
/usr/include/unistd.h:471:12: error: conflicting types for ‘ioctl’
  471 | extern int ioctl(int, int, ...);
      |            ^~~~~
/usr/include/unistd.h:471:1: note: a parameter list with an ellipsis can’t match an empty parameter name list declaration
  471 | extern int ioctl(int, int, ...);
      | ^~~~~~
In file included from ../src/intel/vulkan/anv_private.h:48,
                 from ../src/intel/vulkan/genX_blorp_exec.c:26:
../src/intel/common/gen_gem.h:68:15: note: previous implicit declaration of ‘ioctl’ was here
   68 |         ret = ioctl(fd, request, arg);
      |               ^~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-16 13:45:57 +01:00
Alan Coopersmith d8a9420f6f meson: recognize "sunos" as the system name for Solaris
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-10-16 13:45:57 +01:00
Alan Coopersmith 7040795a69 util: Solaris has linux-style pthread_setname_np
Fixes: dcf9d91a ("util: Handle differences in pthread_setname_np")

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-16 13:45:57 +01:00
Alan Coopersmith b3028a9fb8 util: Workaround lack of flock on Solaris
v2: Replace autoconf check for flock() with meson check

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-16 13:45:57 +01:00
Alan Coopersmith a56c3e3a47 util: Make Solaris implemention of p_atomic_add work with gcc
gcc is very particular about where you place the (void) cast
The previous placement made it error out with:

In file included from disk_cache.c:40:0:
../../src/util/u_atomic.h:203:29: error: void value not ignored as it ought to be
 #define p_atomic_add(v, i) ((void)         \
                              ^
disk_cache.c:658:4: note: in expansion of macro ‘p_atomic_add’
    p_atomic_add(cache->size, size);
    ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-16 13:45:57 +01:00
Alan Coopersmith ddde652e70 c99_compat.h: Don't try to use 'restrict' in C++ code
Fixes build failures on Solaris in C++ files using gcc:

../src/util/u_math.h:628:41: error: expected ‘,’ or ‘...’ before ‘dest’
  628 | util_memcpy_cpu_to_le32(void * restrict dest, const void * restrict src, size_t n)
      |                                         ^~~~
../src/util/u_math.h: In function ‘void* util_memcpy_cpu_to_le32(void*)’:
../src/util/u_math.h:641:18: error: ‘dest’ was not declared in this scope
  641 |    return memcpy(dest, src, n);
      |                  ^~~~
../src/util/u_math.h:641:24: error: ‘src’ was not declared in this scope
  641 |    return memcpy(dest, src, n);
      |                        ^~~
../src/util/u_math.h:641:29: error: ‘n’ was not declared in this scope; did you mean ‘yn’?
  641 |    return memcpy(dest, src, n);
      |                             ^
      |                             yn

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2019-10-16 13:45:57 +01:00
Alyssa Rosenzweig c94ccbf201 pan/midgard: Do not repeatedly spill same value
It doesn't make sense. You already spilled it once, and it didn't help.
Don't try again, or you'll end up in a loop.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-10-16 08:17:56 -04:00
Alyssa Rosenzweig 2d914ebe81 pan/midgard: Fix memory corruption in register spilling
Essentially an off-by-one error ... bit of an edge case, but seems to
occur in some glamor shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-10-16 08:17:56 -04:00
Alyssa Rosenzweig 01a78dbbab pan/midgard: Allow COMPUTE jobs in panfrost_bo_access_for_stage
Fixes: ada752afe4 ("panfrost: Extend the panfrost_batch_add_bo() API to pass access flags")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-10-16 08:17:56 -04:00
Alyssa Rosenzweig fd2216e1fd pan/midgard: Use 16-bit liveness masks
We'll want liveness per-byte, so we need to accomodate up to 16 bytes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-10-16 08:17:56 -04:00
Alyssa Rosenzweig 4fee7b30c0 panfrost: Disable frame throttling
The new frame throttling implemention interacts unfortunately with
pipelining, leading to fence fds leaking like crazy and ultimately apps
crashing quickly.

With this patch, apps still crash but not as quickly. We need to either
figure out the real cause or revert the core changes.

Nevertheless, we don't want frame throttling in the first place, so.

Fixes: a65e29ccb2 ("gallium: simplify throttle implementation")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-10-16 08:13:38 -04:00
Pierre-Eric Pelloux-Prayer 16233797f4 mesa: fix invalid target error handling for teximage
This commit moves the target check before using _mesa_get_current_tex_object
to fix a "Mesa implementation error: bad target in _mesa_get_current_tex_object()"
error.

Fixes: 9dd1f7cec0 ("mesa: pass gl_texture_object as arg to not depend on state")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-16 10:41:31 +02:00
Marek Olšák 268e0e01f3 radeonsi/nir: simplify si_lower_nir signature
just a cleanup
2019-10-15 21:52:09 -04:00
Alyssa Rosenzweig 923aa3918c pan/midgard: Fix mir_mask_of_read_components with dot products
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-10-15 21:41:12 -04:00
Alyssa Rosenzweig 47b58199f0 pan/midgard: Add perspective ops to mir_get_swizzle
I really need to just make this a table..

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-10-15 21:41:12 -04:00
Alyssa Rosenzweig 7db36d94af pan/midgard: Don't try to propagate swizzles to branches
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-10-15 21:41:12 -04:00
Alyssa Rosenzweig 9c0915ba4a pan/midgard: Allow non-contiguous masks in UBO lowering
We don't really need to impose this condition, but we do need to cope
with the slightly more general case.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-10-15 21:41:11 -04:00
Alyssa Rosenzweig a6867fb3fd pan/midgard: Report read mask for branch arguments
Conditionals in particular read values.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-10-15 21:41:11 -04:00