vc4: Add missing null terminator to the debug options list.

So far, apparently there's been some NULL laying at the address just after
the options anyway, but the next commit changed that.
vc4: Add a debug flag for flushing after every draw.

It was useful on i965, but it's even more useful for debugging tiled
renderers.
vc4: Ignore non-address bits of the offset for load/store.

These only get used for full buffer dumps, which we don't support yet
anyway.
vc4: Don't forget to do initial tile clearing for depth/stencil.
vc4: Add support for loading/storing the depth buffer.

For now it still requires the color buffer to be present -- we're relying
on the store of color buffer contents to end the frame, and we have to do
something with color buffers in the rendering config packet.
vc4: Flip around the depth/stencil fields.

After implementing depth stores, it looks like this is the way things
actually are, according to hiz-depth-read-fbo-d24-s0's probes.
vc4: Fill out the stencil clear field.

The rest of stencil handling isn't done yet, but it documents an extra
cl_u8(0) and helps make it obvious why we don't need to format clear_depth
the same way the depth/stencil buffer is formatted.
vc4: Fix segfaults when rendering with no color render target.
configure: bail out if building svga without libdrm

With recent commit we removed the NEED_NONNULL_WINSYS checks when
selecting the hardware (inc svga) winsys. svga has only one winsys
that explicitly requires libdrm (via it's bundled version of
vmwgfx_drm.h) but configure.ac never really checks for it.

Add the check early to prevent people from shooting themselves when
they select the driver but lack libdrm.

$ ./autogen.sh --disable-dri --disable-egl --disable-gallium-llvm
--with-dri-drivers=swrast --with-gallium-drivers=svga,swrast

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82539
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
configure: kill off NEED_NONNULL_WINSYS

The variable was unused and gave false information. The need for nonnull
winsys currently does not relate as it used to. Nowadays one can mix and
match more freely with plenty of winsys' to make your head spin.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
configure: kill off NEED_WINSYS_WRAPPER

Just drop the conditional and simplify our build. This means that
it'll build every time, but it does not require any dependencies nor
does it take that long to compile 200 lines of boilerplate code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
configure: inform the user when we're building sw/kms-dri

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
configure: enable the gallium loader only when needed

With the gallium megadrivers we've converted most ST to optionally
use either statically linked in or shared pipe-drivers.

The hardcoded switch forgot to conditionally enable the build of the
shared pipe-drivers which resulted in them being constantly build.

Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Cc: James Ausmus <james.ausmus@intel.com>
Reported-by: James Ausmus <james.ausmus@intel.com>
Tested-by: James Ausmus <james.ausmus@intel.com>
Bugzilla: https://code.google.com/p/chromium/issues/detail?id=412089
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
automake: remove obsolete NEED_GALLIUM_LOADER

Superseded by HAVE_LOADER_GALLIUM. The latter has a *DRM* brethren
making the whose easier on which one to keep.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
xmlconfig: suppress libGL warnings when LIBGL_DEBUG == "quiet"

Let's handle LIBGL_DEBUG env. variable in Mesa in a consistent way.

Fixes: https://bugzilla.novell.com/show_bug.cgi?id=895730
Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
Reviewed-by: Courtney Goeltzenleuchter <courtney@lunarg.com>
configure.ac: strip _GNU_SOURCE from llvm-config output

Mesa already defines _GNU_SOURCE for glibc based systems and defining
_GNU_SOURCE will break the Mesa build on other systems such as OpenBSD.

_GNU_SOURCE only seems to be included in llvm-config output when
LLVM is built via autoconf and not when it is built by cmake.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
ir_to_mesa: Stop converting uniform booleans.

Excess conversions considered harmful.

Recently Matt reworked the boolean uniform handling to use the value of
UniformBooleanTrue, rather than integer 1, when uploading uniforms:

    mesa: Upload boolean uniforms using UniformBooleanTrue.
    glsl: Use UniformBooleanTrue value for uniform initializers.

Marek then set the default to 1.0f for drivers without native integer
support:

    mesa: set UniformBooleanTrue = 1.0f by default

However, ir_to_mesa was assuming a value of integer 1, and arranging for
it to be converted to 1.0f on upload.  Since Marek's commit, we were
uploading 1.0f = 0x3f800000 which was being interpreted as the integer
value 1065353216 and converted to float as 1.06535322E9, which broke
assumptions in ir_to_mesa that "true" was exactly 1.0f.

+13 Piglits on classic swrast (fs-bool-less-compare-true,
{vs,fs}-op-not-bool-using-if, glsl-1.20/execution/uniform-initializer).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83573
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
ilo: add ilo_builder.h to the sources list

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
freedreno/ir3: add no-copy-propagate fallback step

Most of the things the new compiler still has trouble with basically
amount to cp stage removing too many copies.  But without the cp stage,
the shaders the new compiler produces are still better (perf and
correctness) than the old compiler.  So a simple thing to do until I
have more time to work on it is first trying falling back to new
compiler without cp, before finally falling back to old compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno: don't overflow cmdstream buffer so much

We currently aren't too clever about dealing with running out of
cmdstream buffer space.  Since we use a single buffer for both drawing
and tiling commands, we need to ensure there is enough space at the tail
of the cmdstream buffer to fit the tiling commands.

Until we get more clever, the easy solution is a threshold to trigger
flushing rendering even if the application does not trigger flush (swap,
changing render target, etc).  This way we at least don't crash for apps
that do several thousand draw calls (like some piglit tests do).

Signed-off-by: Rob Clark <robclark@freedesktop.org>