Commit Graph

80860 Commits

Author SHA1 Message Date
Emil Velikov cbc4837b83 anv: kill of custom define HAVE_WAYLAND_PLATFORM
Vulkan API already has equivalent, so simplify things as just use it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:04 +01:00
Emil Velikov 9bc99f5668 anv: refactor wayland build handling
Rather than having things split out in multiple places, consolidate it
and add all the missing bits. Also ensure that we use the already built
static library libwayland-drm.la.

v2 Add missing '\' in the CFLAGS.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net> (v1)
2016-05-01 08:38:04 +01:00
Emil Velikov 3a2d09dd65 automake: include vulkan subdir after wayland-drm
We'll reuse the existing wayland-drm static library with next commit.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-05-01 08:38:04 +01:00
Emil Velikov fe918556a2 anv: use a common variable to manage the library dependencies
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:04 +01:00
Emil Velikov 82d0b59f02 anv: use the GENERATED_FILES variable
... rather than having duplicates files through the sources lists.

Splitting things as is, has the side effect of making things clearer and
easing a potential android build. The latter of which automatically adds
BUILT_SOURCES to the binary.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:04 +01:00
Emil Velikov 3ee7d8b0eb anv: fold the tests' makefile
Recent commit removed the winsys defines from anv_private.h thus
breaking the tests. To fix that and avoid it in the future, merge the
tests makefile in the libvulkan one.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:04 +01:00
Emil Velikov f3cb0dcae1 anv: build the core vulkan only once
Introduce a static library libvulkan_common.la that is used by
libvukan_intel.la and libvulkan_test.la.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:04 +01:00
Emil Velikov 21800d77ff anv: kill off custom CFLAGS
AM_CFLAGS already does all that we need.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:04 +01:00
Emil Velikov 623cb3a598 anv: add missing link against the math library
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:04 +01:00
Emil Velikov e98cf60446 anv: split sources lists to Makefile.sources
Will allow others to reuse the lists (scons/android anyone ?) and makes
the file a lot shorter and easier to read.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:04 +01:00
Emil Velikov 0d3e7b17c9 anv: remove custom rule to install the intel_icd.json
Autoconf already does the exact same thing as the manually written rule.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94969
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:04 +01:00
Emil Velikov 30e6f68b3b anv: tweak the LDFLAGS
Copy/paste from the rest of mesa, but namely.
 - The module should be shared only.
 - We don't need the explicit ".so", as the vulkan loader will retrieve
the full filename from the json
 - No unresolved symbols in the final binary
 - Use the linker garbage collector to slim down the final binary.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:03 +01:00
Emil Velikov b370ec7c76 anv: tweak the %.json rule
It's used only by dev_icd.json so just call it that way. While we're
here, manually expand $< (as it might cause issue on some systems)
and drop the unneeded install_libdir substitution.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-05-01 08:38:03 +01:00
Emil Velikov abd360ab75 anv: add a comment about dev_icd.json
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-05-01 08:38:03 +01:00
Emil Velikov 44978a91ff genxml: ship all the files needed in the tarball
v2: The xml files are not called "gen*_pack.xml" (Jason)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:38:03 +01:00
Emil Velikov 3f23a0f8c1 anv: remove description about GENX_FUNC macro
The macro has been gone since commit 1f1cf6fcb0 "anv: Get rid of
GENX_FUNC"

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-05-01 08:37:25 +01:00
Emil Velikov 0700cdd5aa gallium/target-helpers: remove inline_wrapper_sw_helper.h
Unused as of commit dddedbec0e "{st,targets}/nine: use static/dynamic
pipe-loader"

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-05-01 08:37:25 +01:00
Mark Kettenis b8e59292e6 egl/x11: resolve "initialization from incompatible pointer type" warning
With earlier commit we've moved a few functions and changing the
argument type from _EGLDisplay * to struct dri2_egl_display *.

The latter is effectively a wrapper around the former, thus
functionality was preserved, although GCC rightfully warned us about the
misuse.

Add a simple wrapper that casts and propagates the correct type.

Fixes: 9bbf3737f9 ("egl/x11: authenticate before doing chipset id
ioctls")
Cc: "11.2 11.1" <mesa-stable@lists.freedesktop.org>
Reported-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-05-01 08:37:25 +01:00
Chuck Atkins a92910ae37 glx: Refactor the configure options for glx implementation choice (v3)
Instead of cascading support for various different implementations of
GLX, all three options are now specified through the --enable-glx
option:

  --enable-glx=dri          : Enable the DRI-based GLX
  --enable-glx=xlib         : Enable the classic Xlib-based GLX
  --enable-glx=gallium-xlib : Enable the gallium Xlib-based GLX
  --enable-glx[=yes]        : Defaults to dri if DRI is enabled, else
                              gallium-xlib if gallium is enabled, else
                              xlib

This removes the --enable-xlib-glx option and fixes a bug in which both
the classic xlib-glx and gallium xlib-glx implementations were getting
built causing different versioned and conflicting libGL libraries to be
installed.

v2: Changes from various review feedback from Emil:
  a) Fixed typos
  b) Corrected help docs for new option
  c) Added appropriate a-b and r-b tags in commit msg
  d) Fixed various GLX related dependency checks.
v3: Rebased to current master and added changelog in commit msg

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94086

Acked-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-05-01 08:37:25 +01:00
Thomas Hindoe Paaboel Andersen cbcd7b60f5 nir/lower_double_ops: fix indentation
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-04-30 12:16:32 -07:00
Thomas Hindoe Paaboel Andersen 21424e019d nir/opt_dead_cf: fix indentation
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-04-30 12:16:29 -07:00
Thomas Hindoe Paaboel Andersen 6935726197 nir/opt_dead_cf: correction of side effect check
Parenthesis are needed here as ! takes precedence over the &. The
check had the opposite effect than intended.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-04-30 12:16:22 -07:00
Rob Clark 663c0e5155 freedreno/ir3: use pipe_debug_callback for shader-db traces
For multi-threaded shader-db support.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-30 14:56:20 -04:00
Rob Clark 2578e3edcb freedreno/a4xx: add debug callback to emit
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-30 14:56:19 -04:00
Rob Clark 51f20dd279 freedreno/a3xx: add debug callback to emit
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-30 14:56:19 -04:00
Rob Clark 41d288c306 freedreno: wire up core pipe_debug_callback
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-30 14:56:19 -04:00
Rob Clark e04db879f8 freedreno/ir3: handle color clamp variant ourselves
Now that there is a pass to do this in NIR, lets just use that and
manage the variants ourself, rather than letting state-tracker do it.
This way, mesa/st will precompile shaders without requiring
ST_DEBUG=precompile (which requires a debug build).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-30 14:56:19 -04:00
Rob Clark 64abf6d404 nir: clamp-color-output support
Handled by tgsi_emulate for glsl->tgsi case.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2016-04-30 14:56:19 -04:00
Rob Clark 482cdc4c92 freedreno: fix indentation
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-30 14:56:19 -04:00
Marek Olšák 53435514c1 radeonsi: fix synchronization of shader images
This fixes the winsys->cs_is_buffer_referenced query, which is used for
synchronization before buffers are mapped.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-04-30 19:36:16 +02:00
Samuel Pitoiset 8f2238ccba st/glsl_to_tgsi: fix potential crash when allocating temporaries
When index - t->temps_size is greater than 4096, allocating space for
temporaries on demand will miserably crash. This can happen when a game
uses a lot of temporaries like the recent released Tomb raider.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
2016-04-30 17:41:32 +02:00
Kenneth Graunke 750c38fad1 glsl: Lower vector_extracts to swizzles after lower_vector_derefs.
lower_vector_derefs can produce new vector_extract operations.
Neither i965 nor st_glsl_to_tgsi can handle them, so we'd best
convert them to swizzles.

Together with the previous patch, this fixes assertion failures in
GLideN64, as well as a new Piglit test which reproduces the issue:
spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95164
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-04-29 16:03:36 -07:00
Kenneth Graunke 1cd600dbb9 glsl: Convert lower_vec_index_to_swizzle to a rvalue visitor.
The old visitor missed some cases.  For example, it wouldn't handle
an ir_dereference_array with a vector_extract as the index.

Rather than trying to add the missing cases, just rewrite it as an
ir_rvalue_visitor.  This makes it easy to replace any expression,
and is much less code.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95164
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-04-29 16:03:29 -07:00
Thomas Faller d53cf1ea4c mesa: simplify _mesa_Lightfv
Signed-off-by: Thomas Faller <tfaller1@gmx.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-04-29 11:08:01 -06:00
Nicolai Hähnle aa6f88f891 gallium/radeon: fix crash in r600_set_streamout_targets
Protect against dereferencing a gap in the targets array. This was triggered
by a test in the Khronos CTS.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-04-29 11:55:06 -05:00
Nicolai Hähnle 98c348d26b st/glsl_to_tgsi: reduce stack explosion in recursive expression visitor
In optimized builds, visit(ir_expression *) experiences inlining with gcc that
leads the function to have a roughly 32KB stack frame. This is a problem given
that the function is called recursively. In non-optimized builds, the stack
frame is much smaller, hence one gets crashes that happen only in optimized
builds.

Arguably there is a compiler bug or at least severe misfeature here. In any
case, the easy thing to do for now seems to be moving the bulk of the
non-recursive code into a separate function. This is sufficient to convince my
version of gcc not to blow up the stack frame of the recursive part. Just to be
sure, add the gcc-specific noinline attribute to prevent this bug from
reoccuring if inliner heuristics change.

v2: put ATTRIBUTE_NOINLINE into macros.h

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95133
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95026
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92850
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2016-04-29 11:52:59 -05:00
Nicolai Hähnle 59af21c3e9 tgsi/text: fix parsing of memory instructions
Properly handle Target and Format parameters when present.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-04-29 11:39:56 -05:00
Nicolai Hähnle 4055babc75 tgsi/text: add str_match_name_from_array
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-04-29 11:39:53 -05:00
Nicolai Hähnle a56edbdd8f tgsi/text: add str_match_format helper function
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-04-29 11:39:51 -05:00
Nicolai Hähnle acb65a23a3 tgsi/build: pass Memory.Texture and .Format through tgsi_build_full_instruction
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-04-29 11:39:32 -05:00
Nicolai Hähnle 318d305f6d tgsi/dump: signal nospace when the last print exceeded the size
Previously, there was a bug where nospace wasn't signalled if it just so
happened that the very last print exceeded the available space.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-04-29 11:39:28 -05:00
Nicolai Hähnle e08eaa5b72 tgsi/dump: shared dump_ctx initialization
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-04-29 11:39:21 -05:00
Emil Velikov 4b1ea6910e st/omx: don't return early in vid_enc_EncodeFrame()
Earlier commit plugged a memory leak, although it missed a pair of
brackets. Thus we unconditionally returned even in the case of no error.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95203
Fixes: b87856d25d ("st/omx: Fix resource leak on OMX_ErrorNone")
Tested-by: Andy Furniss <adf.lists@gmail.com>
Acked-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
What an embarassing bug - missing brackets. Andy can you confirm that it
resolves the issue ?
2016-04-29 15:36:18 +01:00
Andres Gomez c750029b37 glsl: Checks for interpolation into its own function.
This generalizes the validation also to be done for variables inside
interface blocks, which, for some cases, was missing.

For a discussion about the additional validation cases included see
https://lists.freedesktop.org/archives/mesa-dev/2016-March/109117.html
and Khronos bug #15671.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
2016-04-29 08:03:00 +02:00
Jason Ekstrand 6d4a426745 nir/algebraic: Support lowering for both 64 and 32-bit ldexp
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2016-04-28 21:36:52 -07:00
Jason Ekstrand f0af5b87ec nir/opcodes: Make ldexp take an explicitly 32-bit int
There is no sense in having the double version of ldexp take a 64-bit
integer.  Instead, let's just take a 32-bit int all the time.  This also
matches what GLSL does where both variants of ldexp take a regular integer
for the exponent argument.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2016-04-28 21:36:52 -07:00
Jason Ekstrand bee40dd730 nir/opcodes: Simplify the expressions for [un]pack_double
The new expressions are more explicit in terms of where the bits go so it's
a little easier to tell what's going on.  This is the way GLSL specifies
things so it's a bit easier to verify too.  It also has the benifit that
the new expressions easily vectorize so we can constant-fold vector forms
of the _split versions correctly.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2016-04-28 21:36:52 -07:00
Kenneth Graunke 2655265fcb mesa: Fix indirect draw buffer size check on 32-bit systems.
Fixes dEQP-GLES31.functional subtests:
draw_indirect.negative.command_offset_not_in_buffer_signed32_wrap
draw_indirect.negative.command_offset_not_in_buffer_unsigned32_wrap

These tests use really large values that overflow GLsizeiptr, at
which point the buffer size isn't less than "end".

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95138
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
2016-04-28 16:31:45 -07:00
Jason Ekstrand 70f89dd75e nir: Switch the arguments to nir_foreach_def
This matches the "foreach x in container" pattern found in many other
programming languages.  Generated by the following regular expression:

s/nir_foreach_def(\([^,]*\),\s*\([^,]*\))/nir_foreach_def(\2, \1)/

Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-04-28 15:54:48 -07:00
Jason Ekstrand 5015260a05 nir: Switch the arguments to nir_foreach_use and friends
This matches the "foreach x in container" pattern found in many other
programming languages.  Generated by the following regular expression:

s/nir_foreach_use(\([^,]*\),\s*\([^,]*\))/nir_foreach_use(\2, \1)/

and similar expressions for nir_foreach_use_safe, etc.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-04-28 15:54:48 -07:00