mesa.git
10 years agotargets/gbm: exit gracefully if pipe_loader_drm_probe_fd is not available
Emil Velikov [Sat, 22 Feb 2014 16:20:04 +0000 (16:20 +0000)]
targets/gbm: exit gracefully if pipe_loader_drm_probe_fd is not available

When one builds without gallium_drm_loader, the above function will
not be available, thus we'll segfault in gallium_screen_create due
to memory access violation.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75335
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoi965: Don't try to use the hardware blitter for multisampled miptrees.
Kenneth Graunke [Sat, 22 Feb 2014 03:15:51 +0000 (19:15 -0800)]
i965: Don't try to use the hardware blitter for multisampled miptrees.

The blitter is completely ignorant of MSAA buffer layouts, so any
attempt to use BLT paths with MSAA buffers is likely to break
spectacularly.

In most cases, BLORP handles MSAA blits, so we never hit this bug.
Until recently, it also wasn't worth fixing, since Meta couldn't handle
MSAA either, so there was nothing to fall back to.  But now there is.

+143 piglit tests on Broadwell (which doesn't have BLORP support).
Surprisingly, three also start failing.  Since non-IMS MSAA buffers
store samples in successive array slices, using the blitter ought to
access sample 0 and ignore the rest, which is apparently good enough for
a few not-very-picky Piglit tests.  Presumably the meta replacement code
is still broken.

No Piglit changes on Ivybridge.

v2: Move the early return to the top of the function (suggested by
    Paul).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agofreedreno/a3xx/compiler: half-precision output
Rob Clark [Sat, 22 Feb 2014 14:46:39 +0000 (09:46 -0500)]
freedreno/a3xx/compiler: half-precision output

Using generic shaders caused a measurable fps drop, which was isolated to
use of full precision (vs half precision) output.  This is an attempt to
regain that lost performance by using half precision solid/blit shaders
(when the output format is not float32).

Note: for the built-in shaders, I would not expect them to be register
starved.  And in fact it is the solid frag shader that seems to have the
biggest impact.  So I suspect you get double the pixel pipe units (or
half the cycles) when the output is half precision.  So there may be
some gain to using half precision output for application shaders as
well, even though the rest of register usage is still full precision.
But for half precision to work for more complex shaders, we need to deal
with some constraints, like cat2 needing same precision for it's two src
registers.  So for now it is not enabled by default except for the
built-in shaders.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno/a3xx: add shader variants
Rob Clark [Sat, 22 Feb 2014 00:17:43 +0000 (19:17 -0500)]
freedreno/a3xx: add shader variants

Start putting in place infrastructure to deal with multiple shader
variants.  Initially we'll use this for two sided color (frag) and
binning pass (vert) shaders.  Possibly need for others later (such
as YUV vs RGB eglImage?).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno/a3xx/compiler: collapse nop's with repeat
Rob Clark [Fri, 21 Feb 2014 23:03:30 +0000 (18:03 -0500)]
freedreno/a3xx/compiler: collapse nop's with repeat

Easier than making more extensive use of rpt, and the more compact
shaders seem to bring some bit of performance boost.  (Perhaps repeat
flag benefits are more than just instruction cache, possibly it saves
on instruction decode as well?)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno/a3xx: drop hand-coded blit/solid shaders
Rob Clark [Fri, 21 Feb 2014 19:36:11 +0000 (14:36 -0500)]
freedreno/a3xx: drop hand-coded blit/solid shaders

Instead in the common code, construct these shaders from TGSI.  For now
we let a2xx keep it's hand coded shaders, as it's compiler isn't quite
up to the job yet.  All the same it is a net drop in code size and gets
rid of special cases.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno/lowering: cleanup api
Rob Clark [Sun, 23 Feb 2014 19:39:04 +0000 (14:39 -0500)]
freedreno/lowering: cleanup api

Make things configurable, and tweak the API a bit to avoid an extra
tgsi_shader_scan().  Getting closer to something generic which can be
moved out of freedreno and shaderd by other drivers.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno/a3xx: add float 16 and 32bit formats
Rob Clark [Sun, 23 Feb 2014 19:29:59 +0000 (14:29 -0500)]
freedreno/a3xx: add float 16 and 32bit formats

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: resync generated headers
Rob Clark [Sun, 23 Feb 2014 19:29:22 +0000 (14:29 -0500)]
freedreno: resync generated headers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agoglx/drisw: use the implemented version of __DRIswrastLoaderExtension
Emil Velikov [Wed, 12 Feb 2014 20:08:07 +0000 (20:08 +0000)]
glx/drisw: use the implemented version of __DRIswrastLoaderExtension

... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglx/dri: use the implemented version of __DRIdamageExtension
Emil Velikov [Wed, 12 Feb 2014 19:53:52 +0000 (19:53 +0000)]
glx/dri: use the implemented version of __DRIdamageExtension

... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglx/dri_common: use the implemented version of __DRIsystemTimeExtension
Emil Velikov [Wed, 12 Feb 2014 19:50:53 +0000 (19:50 +0000)]
glx/dri_common: use the implemented version of __DRIsystemTimeExtension

... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglx/dri: use the implemented version of __DRIgetDrawableInfoExtension
Emil Velikov [Wed, 12 Feb 2014 19:45:41 +0000 (19:45 +0000)]
glx/dri: use the implemented version of __DRIgetDrawableInfoExtension

... over the one provided by the headers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodri_util: use the implemented version of __DRIimageDriverExtension
Emil Velikov [Wed, 12 Feb 2014 18:51:49 +0000 (18:51 +0000)]
dri_util: use the implemented version of __DRIimageDriverExtension

... over the one provided by the headers.

Currently both versions are identical, but that is not
guaranteed to be the case in the future.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglx/dri3: set the implemented version of __DRIimageLoaderExtension
Emil Velikov [Wed, 12 Feb 2014 18:46:32 +0000 (18:46 +0000)]
glx/dri3: set the implemented version of __DRIimageLoaderExtension

... over the one provided by the spec.
Currently both versions are identical, but that is not
guaranteed to be the case in the future.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agogbm: explicitly set __DRIimageLoaderExtension members
Emil Velikov [Wed, 12 Feb 2014 18:43:11 +0000 (18:43 +0000)]
gbm: explicitly set __DRIimageLoaderExtension members

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoegl/wayland: explicitly set __DRIimageLoaderExtension members
Emil Velikov [Wed, 12 Feb 2014 18:32:59 +0000 (18:32 +0000)]
egl/wayland: explicitly set __DRIimageLoaderExtension members

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
10 years agodrivers/dri: explicitly set __DRI2flushExtension members
Emil Velikov [Wed, 12 Feb 2014 18:21:46 +0000 (18:21 +0000)]
drivers/dri: explicitly set __DRI2flushExtension members

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
10 years agogbm: explicitly set __DRIdri2LoaderExtension members
Emil Velikov [Wed, 12 Feb 2014 19:25:39 +0000 (19:25 +0000)]
gbm: explicitly set __DRIdri2LoaderExtension members

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
10 years agoglx/dri2: set the implemented version of __DRIdri2LoaderExtension
Emil Velikov [Wed, 12 Feb 2014 18:07:15 +0000 (18:07 +0000)]
glx/dri2: set the implemented version of __DRIdri2LoaderExtension

... over the version number provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodri_interface: note introduction of __DRIdri2LoaderExtension members
Emil Velikov [Wed, 12 Feb 2014 19:05:08 +0000 (19:05 +0000)]
dri_interface: note introduction of __DRIdri2LoaderExtension members

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodri_interface: note introduction of various __DRItexBufferExtension members
Emil Velikov [Wed, 12 Feb 2014 19:00:21 +0000 (19:00 +0000)]
dri_interface: note introduction of various __DRItexBufferExtension members

Note the member function releaseTexBuffer was added without
bumping spec version, and currently no drivers implement it.

v2: releaseTexBuffer was introduced by version 3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodri_interface: Note the version introducing __DRIswrastLoaderExtensionRec::putImage2
Emil Velikov [Tue, 18 Feb 2014 02:31:27 +0000 (02:31 +0000)]
dri_interface: Note the version introducing __DRIswrastLoaderExtensionRec::putImage2

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodri_util: explicitly set __DRIcopySubBufferExtension members
Emil Velikov [Wed, 12 Feb 2014 17:17:28 +0000 (17:17 +0000)]
dri_util: explicitly set __DRIcopySubBufferExtension members

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodri_util: explicitly set __DRIswrastExtension members.
Emil Velikov [Wed, 12 Feb 2014 17:08:43 +0000 (17:08 +0000)]
dri_util: explicitly set __DRIswrastExtension members.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Pass stdout to _mesa_print_ir from st_glsl_to_tgsi.
Kenneth Graunke [Sun, 23 Feb 2014 06:08:55 +0000 (22:08 -0800)]
glsl: Pass stdout to _mesa_print_ir from st_glsl_to_tgsi.

Fixes the Gallium build since commit 1e3bd9f9a5af90295788c5d71ea27c.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75389
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Move the remaining driver debug over to stderr.
Eric Anholt [Mon, 23 Dec 2013 08:56:20 +0000 (00:56 -0800)]
i965: Move the remaining driver debug over to stderr.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoi965: Move compiler debugging output to stderr.
Eric Anholt [Mon, 23 Dec 2013 07:29:31 +0000 (23:29 -0800)]
i965: Move compiler debugging output to stderr.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoglsl: Add a file argument to the IR printer.
Eric Anholt [Fri, 21 Feb 2014 02:00:23 +0000 (18:00 -0800)]
glsl: Add a file argument to the IR printer.

While we want to be able to print to stdout for glsl_compiler, for
debugging drivers we want to be able to dump to stderr because that's
where other driver debug (like LIBGL_DEBUG) tends to go, and because some
apps actually close stdout to shut up their own messages (such as the X
Server, or NWN).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoi965: Refactor debug dumping of GLSL IR.
Eric Anholt [Fri, 21 Feb 2014 02:23:52 +0000 (18:23 -0800)]
i965: Refactor debug dumping of GLSL IR.

This was only going to get worse when tesselation shows up, and was
causing too much extra duplication in my stderr changes coming up.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agointel: Remove some dead code I noticed in intel_screen.c.
Eric Anholt [Thu, 20 Feb 2014 22:49:50 +0000 (14:49 -0800)]
intel: Remove some dead code I noticed in intel_screen.c.

It was present in the initial i915tex import.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoi965: Use the object label when available for INTEL_DEBUG=vs,gs,fs output.
Eric Anholt [Thu, 20 Feb 2014 21:31:40 +0000 (13:31 -0800)]
i965: Use the object label when available for INTEL_DEBUG=vs,gs,fs output.

Note that this requires updated run.py in shader_db.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoi965: Use the object label when available for shader_time output.
Eric Anholt [Thu, 20 Feb 2014 21:26:45 +0000 (13:26 -0800)]
i965: Use the object label when available for shader_time output.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agometa: Set some object labels on our meta shaders.
Eric Anholt [Thu, 20 Feb 2014 21:22:12 +0000 (13:22 -0800)]
meta: Set some object labels on our meta shaders.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agonv50: make sure to clear _all_ layers of all attachments
Ilia Mirkin [Thu, 13 Feb 2014 10:10:23 +0000 (05:10 -0500)]
nv50: make sure to clear _all_ layers of all attachments

Unfortunately there's only one RT_ARRAY_MODE setting for all
attachments, so clears were previously truncated to the minimum number
of layers any attachment had. Instead set the RT_ARRAY_MODE to 512 (the
max number of layers) before doing the clear. This fixes
gl-3.2-layered-rendering-clear-color-mismatched-layer-count.

Also fix clears of individual layered rt/zeta, in case it ever happens.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
10 years agoilo: fix and enable fast depth clear
Chia-I Wu [Thu, 16 Jan 2014 07:29:03 +0000 (15:29 +0800)]
ilo: fix and enable fast depth clear

Use tex->bo_format instead of zs->format in ilo_blitter_rectlist_clear_zs()
because the latter may be combined depth/stencil format.  hiz_can_clear_zs()
is no-op for GEN7+, but move the GEN check so that the assertions are tested.

Finally, call the fast depth clear function from ilo_clear().

10 years agoilo: add slice clear value
Chia-I Wu [Thu, 20 Feb 2014 06:37:23 +0000 (14:37 +0800)]
ilo: add slice clear value

It is needed for 3DSTATE_CLEAR_PARAMS, and can also be used to track what
value the slice has been cleared to.

10 years agoilo: better readability and doc for texture flags
Chia-I Wu [Thu, 20 Feb 2014 05:51:03 +0000 (13:51 +0800)]
ilo: better readability and doc for texture flags

Improve comments for the flags, and explicitly separate their uses in slice
flags and resolve flags.

10 years agoilo: fix for stencil only rectlist ops
Chia-I Wu [Thu, 20 Feb 2014 08:57:05 +0000 (16:57 +0800)]
ilo: fix for stencil only rectlist ops

3DSTATE_STENCIL_BUFFER inherits some states from 3DSTATE_DEPTH_BUFFER.  We
need to emit both even the surface is stencil only.

10 years agoilo: fix a false assertion failure on GEN6
Chia-I Wu [Wed, 15 Jan 2014 18:10:45 +0000 (02:10 +0800)]
ilo: fix a false assertion failure on GEN6

Layer offsetting is possible when it is level 0, layer 0.

10 years agoilo: pipe_texture::usage is not a bitfield
Chia-I Wu [Thu, 20 Feb 2014 08:59:24 +0000 (16:59 +0800)]
ilo: pipe_texture::usage is not a bitfield

It happens to work because PIPE_USAGE_STAGING is 0x100.

10 years agoilo: set ILO_TEXTURE_CPU_WRITE for imported textures
Chia-I Wu [Tue, 14 Jan 2014 15:35:43 +0000 (23:35 +0800)]
ilo: set ILO_TEXTURE_CPU_WRITE for imported textures

Assume the bo has been written by another process, which will trigger a HiZ
resolve.

10 years agonv50/ir/ra: fix SpillCodeInserter::offsetSlot usage
Christoph Bumiller [Wed, 19 Feb 2014 03:00:34 +0000 (04:00 +0100)]
nv50/ir/ra: fix SpillCodeInserter::offsetSlot usage

We were turning non-memory spill slots into NULL.

Cc: 10.1 <mesa-stable@lists.freedesktop.org>
10 years agoRevert "i965/fs: Make fs_reg's type an enum for better debugging."
Matt Turner [Sat, 22 Feb 2014 07:52:24 +0000 (23:52 -0800)]
Revert "i965/fs: Make fs_reg's type an enum for better debugging."

This reverts commit 5ceadd29b0af835d741bcf09b9622c628e549ae6.

I rebased and apparently failed to build test.

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

10 years agoi965/fs: Drop the emit(fs_inst) overload.
Kenneth Graunke [Fri, 21 Feb 2014 23:23:42 +0000 (15:23 -0800)]
i965/fs: Drop the emit(fs_inst) overload.

Using this emit function implicitly creates three copies, which
is pointlessly inefficient.

1. Code creates the original instruction.
2. Calling emit(fs_inst) copies it into the function.
3. It then allocates a new fs_inst and copies it into that.

The second could be eliminated by changing the signature to

   fs_inst(const fs_inst &)

but that wouldn't eliminate the third.  Making callers heap allocate the
instruction and call emit(fs_inst *) allows us to just use the original
one, with no extra copies, and isn't much more of a burden.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Pass fs_regs by constant reference where possible.
Matt Turner [Thu, 20 Feb 2014 04:31:14 +0000 (20:31 -0800)]
i965/fs: Pass fs_regs by constant reference where possible.

These functions (modulo emit_lrp, necessitating the small fix-up) pass
these arguments by value unmodified to other functions. No point in
making an additional copy.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Move setting opcode = NOP to its one useful location.
Matt Turner [Thu, 20 Feb 2014 16:19:19 +0000 (08:19 -0800)]
i965/fs: Move setting opcode = NOP to its one useful location.

All other callers of init() immediately set opcode to something else.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Use a bitfield for fs_inst's bool fields.
Matt Turner [Thu, 20 Feb 2014 03:49:46 +0000 (19:49 -0800)]
i965/fs: Use a bitfield for fs_inst's bool fields.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Reorder fs_inst's fields for better packing.
Matt Turner [Thu, 20 Feb 2014 01:22:55 +0000 (17:22 -0800)]
i965/fs: Reorder fs_inst's fields for better packing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Reduce the sizes of some fs_inst members.
Matt Turner [Thu, 20 Feb 2014 01:12:57 +0000 (17:12 -0800)]
i965/fs: Reduce the sizes of some fs_inst members.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Reorder fs_reg for better packing.
Matt Turner [Thu, 20 Feb 2014 02:53:00 +0000 (18:53 -0800)]
i965/fs: Reorder fs_reg for better packing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Make fs_reg's type an enum for better debugging.
Matt Turner [Thu, 20 Feb 2014 02:38:40 +0000 (18:38 -0800)]
i965/fs: Make fs_reg's type an enum for better debugging.

Since the enum is marked as packed, it'll still take only one byte.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Reduce the sizes of some fs_reg members.
Matt Turner [Thu, 20 Feb 2014 01:45:56 +0000 (17:45 -0800)]
i965/fs: Reduce the sizes of some fs_reg members.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Mark brw_reg_type and register_file enums as PACKED.
Matt Turner [Thu, 20 Feb 2014 02:37:11 +0000 (18:37 -0800)]
i965: Mark brw_reg_type and register_file enums as PACKED.

The C99 spec says the type of an enum is implementation defined (but can
be char, signed int, or unsigned int). gcc appears to always give enums
four bytes, even when they can fit in less. It does so because this is
what other compilers seem to do [0] and therefore to maintain ABI
compatibility with them.

gcc has an -fshort-enum flag that tells the compiler to use only as much
space as needed for an enum. Adding __attribute__((__packed__)) to an
enum definition has the same behavior, but on a per-enum basis.

brw_reg_type and register_file are not part of the ABI, so we can safely
mark them as PACKED so that they'll take only a byte, rather than four.

[0] http://gcc.gnu.org/onlinedocs/gcc/Non-bugs.html#index-fshort-enums-3868

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Reduce predicate field of backend_instruction to uint8_t.
Matt Turner [Thu, 20 Feb 2014 01:21:16 +0000 (17:21 -0800)]
i965: Reduce predicate field of backend_instruction to uint8_t.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agolibgl-xlib: Fix xlib_sw_winsys.h include path.
Vinson Lee [Sat, 22 Feb 2014 03:53:29 +0000 (19:53 -0800)]
libgl-xlib: Fix xlib_sw_winsys.h include path.

This patch fixes this SCons build error introduced with commit
4f37e52f374b8b1d7177634dc09ab71e30e1779d.

  Compiling src/gallium/targets/libgl-xlib/xlib.c ...
src/gallium/targets/libgl-xlib/xlib.c:35:42: fatal error: state_tracker/xlib_sw_winsys.h: No such file or directory
 #include "state_tracker/xlib_sw_winsys.h"
                                          ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75347
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
10 years agomesa: Move declarations before code.
Vinson Lee [Sat, 22 Feb 2014 03:37:31 +0000 (19:37 -0800)]
mesa: Move declarations before code.

This patch fixes these MSVC build errors.

  Compiling src\mesa\drivers\common\meta_blit.c ...
meta_blit.c
src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ';' before 'type'
src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ')' before 'type'
src\mesa\drivers\common\meta_blit.c(255) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(255) : warning C4552: '<' : operator has no effect; expected operator with side-effect
src\mesa\drivers\common\meta_blit.c(255) : error C2059: syntax error : ')'
src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ';' before '{'
src\mesa\drivers\common\meta_blit.c(258) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ';' before 'type'
src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ')' before 'type'
src\mesa\drivers\common\meta_blit.c(263) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(263) : warning C4552: '<=' : operator has no effect; expected operator with side-effect
src\mesa\drivers\common\meta_blit.c(263) : error C2059: syntax error : ')'
src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ';' before '{'
src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ';' before 'type'
src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ')' before 'type'
src\mesa\drivers\common\meta_blit.c(264) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(264) : warning C4552: '<' : operator has no effect; expected operator with side-effect
src\mesa\drivers\common\meta_blit.c(264) : error C2059: syntax error : ')'
src\mesa\drivers\common\meta_blit.c(264) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ';' before '{'
src\mesa\drivers\common\meta_blit.c(268) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(268) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(269) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(269) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(270) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(270) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(559) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data
src\mesa\drivers\common\meta_blit.c(723) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data
src\mesa\drivers\common\meta_blit.c(773) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
10 years agopipe-loader: introduce pipe_loader_sw_probe_null helper function
Emil Velikov [Mon, 10 Feb 2014 21:04:40 +0000 (21:04 +0000)]
pipe-loader: introduce pipe_loader_sw_probe_null helper function

v2: Handle null_sw_create failure, add missing function return type

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
10 years agopipe-loader: introduce pipe_loader_sw_probe_dri helper
Emil Velikov [Sat, 22 Feb 2014 03:21:40 +0000 (03:21 +0000)]
pipe-loader: introduce pipe_loader_sw_probe_dri helper

Will be used in the following commits.

v2: Link gallium tests against the library.
v3: Handle dri_create_sw_winsys failure
v4: Rebase on top of the targets/xa changes

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v2)
10 years agopipe-loader: introduce pipe_loader_sw_probe_xlib helper
Emil Velikov [Mon, 10 Feb 2014 20:19:20 +0000 (20:19 +0000)]
pipe-loader: introduce pipe_loader_sw_probe_xlib helper

Will be used in the upcoming patches.

v2: handle xlib_create_sw_winsys failure, drop unneeded header

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
10 years agopipe-loader: use bool type for pipe_loader_drm_probe_fd()
Emil Velikov [Sat, 22 Feb 2014 03:15:42 +0000 (03:15 +0000)]
pipe-loader: use bool type for pipe_loader_drm_probe_fd()

v2: Rebase on top of the rendernode changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
Reviewed-by: Francisco Jerez <currojerez@riseup.net> (v1)
10 years agowinsys/xlib: move xlib_create_sw_winsys within the winsys
Emil Velikov [Thu, 13 Feb 2014 15:24:16 +0000 (15:24 +0000)]
winsys/xlib: move xlib_create_sw_winsys within the winsys

v2: Rebase on top of vl_winsys_xsp.c removal
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
10 years agopipe-loader: handle memory allocation failure
Emil Velikov [Mon, 10 Feb 2014 20:08:31 +0000 (20:08 +0000)]
pipe-loader: handle memory allocation failure

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agopipe-loader: build pipe_loader_drm_x_auth whenever HAVE_PIPE_LOADER_XCB is defined
Emil Velikov [Mon, 10 Feb 2014 18:45:32 +0000 (18:45 +0000)]
pipe-loader: build pipe_loader_drm_x_auth whenever HAVE_PIPE_LOADER_XCB is defined

Currently HAVE_PIPE_LOADER_XCB is defined, rather than being set to 1/0.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agopipe-loader: destroy sw_winsys on sw_release
Emil Velikov [Mon, 10 Feb 2014 20:03:19 +0000 (20:03 +0000)]
pipe-loader: destroy sw_winsys on sw_release

The sw pipe-loader implicitly handles winsys_create, thus we
it would make sense to implicitly destroy it upon releasing
the loader.

Currently we leak the sw_winsys when releasing the pipe-loader.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agovl/winsys_dri: cleanup vl_screen_create error path
Emil Velikov [Mon, 10 Feb 2014 18:29:43 +0000 (18:29 +0000)]
vl/winsys_dri: cleanup vl_screen_create error path

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agotargets/pipe-loader: link pipe-nouveau against libdrm
Emil Velikov [Mon, 10 Feb 2014 19:12:12 +0000 (19:12 +0000)]
targets/pipe-loader: link pipe-nouveau against libdrm

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agometa: Eliminate samplers[] array in favor of using vec4_prefix.
Kenneth Graunke [Sat, 22 Feb 2014 00:58:09 +0000 (16:58 -0800)]
meta: Eliminate samplers[] array in favor of using vec4_prefix.

We don't need an array mapping the shader index to "sampler2DMS",
"isampler2DMS", and so on.  We can simply do "%ssampler2DMS" and pass in
vec4_prefix, which is "", "i", or "u".

This eliminates the use of C99 array initializers and should fix the
MSVC build.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75344
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Delete the fabulous target_to_target() function.
Kenneth Graunke [Fri, 21 Feb 2014 21:47:29 +0000 (13:47 -0800)]
i965: Delete the fabulous target_to_target() function.

gl_texture_object's Target field is never a cube face enumeration, so
target_to_target is just the identity function.  Aptly named, at least.

I verified this by putting an assert(!"ZOMG, CUBES!") in the cube face
case, and running Piglit.  Nothing ever hit it.  Beyond that, I
inspected the code in mesa/main.

This could probably also be deleted from i915, but I haven't tested
there.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Fix S8 and X8 reversal in brw_depthbuffer_format refactor.
Kenneth Graunke [Fri, 21 Feb 2014 07:08:22 +0000 (23:08 -0800)]
i965: Fix S8 and X8 reversal in brw_depthbuffer_format refactor.

In commit 09d9a8913e8c28fc4c1c60d7da85a2f093786894, I accidentally
botched the X8 and S8 cases.  (I wrote this patch before realizing that
X8 and S8 had been swapped in the big MESA_FORMAT rename, and apparently
didn't rebase it properly after fixing that...)

Fixes regressions in 13 Piglit tests on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75291
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Move declarations before code.
Vinson Lee [Sat, 22 Feb 2014 03:09:30 +0000 (19:09 -0800)]
mesa: Move declarations before code.

This patch fixes these MSVC build errors introduced with
73b78f9c9f86dd38fb165f4730aeac9519635b07.

  Compiling src\mesa\main\uniforms.c ...
uniforms.c
src\mesa\main\uniforms.c(291) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(294) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(294) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(294) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(306) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(309) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(309) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(309) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(322) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(325) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(325) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(325) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(345) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(348) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(348) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(348) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(360) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(363) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(363) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(363) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(376) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(379) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(379) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(379) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(588) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(591) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(591) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(591) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(603) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(606) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(606) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(606) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(619) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(622) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(622) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(622) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
10 years agomesa/sso: Change CreateShaderProgramv return type from uint to GLuint.
Vinson Lee [Sat, 22 Feb 2014 01:16:14 +0000 (17:16 -0800)]
mesa/sso: Change CreateShaderProgramv return type from uint to GLuint.

This patch fixes this MinGW build error.

  Compiling src/mapi/glapi/glapi_dispatch.c ...
In file included from src/mapi/glapi/glapi_dispatch.c:41:0:
build/windows-x86_64-debug/mapi/glapi/glapitable.h:930:4: error: expected specifier-qualifier-list before 'uint'
    uint (GLAPIENTRYP CreateShaderProgramv)(GLenum type, GLsizei count, const GLchar * const * strings); /* 886 */
    ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
10 years agoscons: Add main/pipelineobj.c to src/mesa/SConscript.
Vinson Lee [Sat, 22 Feb 2014 00:58:17 +0000 (16:58 -0800)]
scons: Add main/pipelineobj.c to src/mesa/SConscript.

This patch fixes this SCons build error.

build/linux-x86_64-debug/mesa/libmesa.a(context.os): In function `init_attrib_groups':
src/mesa/main/context.c:815: undefined reference to `_mesa_init_pipeline'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
10 years agomesa/sso: Fix typo of 'unsigned'.
Vinson Lee [Sat, 22 Feb 2014 00:38:45 +0000 (16:38 -0800)]
mesa/sso: Fix typo of 'unsigned'.

Fix build error introduced with commit f4c13a890fa24ff1f998e7cac0ecc31505a29403.

  CC       pixeltransfer.lo
main/pipelineobj.c: In function '_mesa_delete_pipeline_object':
main/pipelineobj.c:59:4: error: unknown type name 'unsinged'
    unsinged i;
    ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
10 years agomesa/sso: Implement _mesa_GetProgramPipelineiv
Gregory Hainaut [Fri, 28 Jun 2013 21:20:11 +0000 (14:20 -0700)]
mesa/sso: Implement _mesa_GetProgramPipelineiv

This was originally included in another patch, but it was split out by
Ian Romanick.

v2 (idr):
* Trivial reformatting.
* Remove GL_COMPUTE_SHADER.  Compute shaders don't participate in pipeline
  objects anyway.  Suggested by Matt Turner.

v3 (idr):
* Use _mesa_has_geometry_shaders.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa/sso: Implement _mesa_ActiveShaderProgram
Gregory Hainaut [Fri, 28 Jun 2013 21:19:12 +0000 (14:19 -0700)]
mesa/sso: Implement _mesa_ActiveShaderProgram

This was originally included in another patch, but it was split out by
Ian Romanick.

v2 (idr): Return early from _mesa_ActiveShaderProgram if
_mesa_lookup_shader_program_err returns an error.  Suggested by Jordan.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v2]
10 years agomesa/sso: Implement _mesa_CreateShaderProgramv
Gregory Hainaut [Fri, 28 Jun 2013 21:13:49 +0000 (14:13 -0700)]
mesa/sso: Implement _mesa_CreateShaderProgramv

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa/sso: Refactor implementation of _mesa_CreateShaderProgramEXT
Gregory Hainaut [Fri, 28 Jun 2013 21:11:38 +0000 (14:11 -0700)]
mesa/sso: Refactor implementation of _mesa_CreateShaderProgramEXT

This will allow the guts of the implementation to be shared with
_mesa_CreateShaderProgramv.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa/sso: Add support for GL_PROGRAM_SEPARABLE query
Gregory Hainaut [Fri, 28 Jun 2013 21:05:49 +0000 (14:05 -0700)]
mesa/sso: Add support for GL_PROGRAM_SEPARABLE query

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa/sso: Implement _mesa_IsProgramPipeline
Gregory Hainaut [Fri, 28 Jun 2013 21:01:18 +0000 (14:01 -0700)]
mesa/sso: Implement _mesa_IsProgramPipeline

Implement IsProgramPipeline based on the VAO code.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa/sso: Implement _mesa_GenProgramPipelines
Gregory Hainaut [Fri, 28 Jun 2013 21:00:13 +0000 (14:00 -0700)]
mesa/sso: Implement _mesa_GenProgramPipelines

Implement GenProgramPipelines based on the VAO code.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa/sso: Implement _mesa_DeleteProgramPipelines
Gregory Hainaut [Fri, 28 Jun 2013 20:57:50 +0000 (13:57 -0700)]
mesa/sso: Implement _mesa_DeleteProgramPipelines

Implement DeleteProgramPipelines based on the VAO code.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa/sso: Add pipeline container/state
Gregory Hainaut [Fri, 28 Jun 2013 20:54:06 +0000 (13:54 -0700)]
mesa/sso: Add pipeline container/state

V1:
* Extend gl_shader_state as pipeline object state
* Add a new container gl_pipeline_shader_state that contains
   binding point of the previous object
* Update mesa init/free shader state due to the extension of
   the attibute
* Add an init/free pipeline function for the context

V2:
* Rename gl_shader_state to gl_pipeline_object
* Rename Pipeline.PipelineObj to Pipeline.Current
* Formatting improvement

V3 (idr):
* Split out from previous uber patch.
* Remove '#if 0' debug printfs.

V4 (idr):
* Fix some errors in comments.  Suggested by Jordan.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa: Add a mutex and refcounting to gl_shader_state
Gregory Hainaut [Fri, 28 Jun 2013 20:43:43 +0000 (13:43 -0700)]
mesa: Add a mutex and refcounting to gl_shader_state

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa: Make get_shader_flags publicly available
Gregory Hainaut [Fri, 28 Jun 2013 20:35:15 +0000 (13:35 -0700)]
mesa: Make get_shader_flags publicly available

Future patches will use this function outside shaderapi.c.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa/sso: Add extension entry points for GL_ARB_separate_shader_objects
Gregory Hainaut [Fri, 3 May 2013 17:44:05 +0000 (19:44 +0200)]
mesa/sso: Add extension entry points for GL_ARB_separate_shader_objects

Nothings implemented yet but glProgramUniform* which are mostly a
copy/paste of the older function glUniform*

I create dedicated pipelineobj.[ch] file that will contains function
related to the "new" pipeline container object.

V2: formatting improvement

V3:
* indentation fix
* Update copyright
* Add a comment on ProgramParameteri already present in another extension
* Remove TODO, will be readded on correct patch

V4 (idr):
* Fix dispatch_sanity unit test
* Make extension string available in core profiles (instead of just
  compatibility).
* Trivial reformating

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agoglsl/sso: Add parser and AST-to-HIR support for separate shader object layouts
Ian Romanick [Wed, 25 Sep 2013 23:16:00 +0000 (16:16 -0700)]
glsl/sso: Add parser and AST-to-HIR support for separate shader object layouts

GL_ARB_separate_shader_objects adds the ability to specify location
layouts for interstage inputs and outputs.

In addition, this extension makes 'in' and 'out' generally available for
shader inputs and outputs.  This mimics the behavior of
GL_ARB_explicit_attrib_location.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa/sso: Add extension tracking for ARB_separate_shader_objects
Ian Romanick [Wed, 25 Sep 2013 17:11:28 +0000 (10:11 -0700)]
mesa/sso: Add extension tracking for ARB_separate_shader_objects

This adds the necessary bits for both the API and the GLSL compiler.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa: Refactor per-stage link check to its own function
Ian Romanick [Sat, 8 Feb 2014 05:13:02 +0000 (21:13 -0800)]
mesa: Refactor per-stage link check to its own function

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agospecs: MESA_query_renderer.spec resolve a couple of typos
Emil Velikov [Fri, 21 Feb 2014 22:52:46 +0000 (22:52 +0000)]
specs: MESA_query_renderer.spec resolve a couple of typos

Cc: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoconfigure: use shared-glapi when more than one gl* API is used
Emil Velikov [Wed, 19 Feb 2014 00:54:04 +0000 (00:54 +0000)]
configure: use shared-glapi when more than one gl* API is used

Current behaviour states that shared-glapi is usefull when building
with dri, which is not the case. Shared-glapi is used to dispatch
the gl* functions across the one or more gl api's which can be dri
based but do not need to be.

Fixed the following build

 ./configure --enable-gles2 --disable-dri --enable-gallium-egl \
      --with-egl-platforms=fbdev --with-gallium-drivers=swrast

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75098
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoconfigure: use default dri drivers whenever opengl and dri are enabled
Emil Velikov [Tue, 18 Feb 2014 00:57:24 +0000 (00:57 +0000)]
configure: use default dri drivers whenever opengl and dri are enabled

Commit ee55500c22a(configure: cleanup classic dri drivers handling)
cleaned up the logic handling autodetection of dri drivers, but missed
the case when one can explicitly disable dri, and still request opengl.

Fixes build issues for the following
./autogen.sh --disable-dri --with-gallium-drivers=swrast

While we're here, explicitly clear with_dri_drivers whenever building
without such drivers to prevent choking later on.

v2: Simplify with_dri_drivers handling.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75126
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoi965: Stop throwing away our double precision for time calculations.
Eric Anholt [Thu, 20 Feb 2014 22:54:29 +0000 (14:54 -0800)]
i965: Stop throwing away our double precision for time calculations.

Fixes negative times being reported in our perf debug.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Add support for integer blits.
Eric Anholt [Tue, 11 Feb 2014 07:44:54 +0000 (23:44 -0800)]
meta: Add support for integer blits.

Compared to i965, the code generated doesn't use the AVG instruction.  But
I'm not sure that multisampled integer resolves are really that important
to worry about.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Add support for doing MSAA to MSAA blits.
Eric Anholt [Mon, 10 Feb 2014 23:24:07 +0000 (15:24 -0800)]
meta: Add support for doing MSAA to MSAA blits.

These are non-stretched, non-resolving blits, so it's just a matter of
sampling once from our gl_SampleID and storing that to our color/depth.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Save and restore a bunch of MSAA state.
Eric Anholt [Tue, 11 Feb 2014 00:23:50 +0000 (16:23 -0800)]
meta: Save and restore a bunch of MSAA state.

We're disabling GL_MULTISAMPLE, so we didn't need to worry about a lot of
that state.  But to do MSAA to MSAA blits, we need to start handling more
state.

v2: Fix pasteo caught by Kenneth.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Try to do blending of sRGB values in linear colorspace.
Eric Anholt [Mon, 10 Feb 2014 19:20:11 +0000 (11:20 -0800)]
meta: Try to do blending of sRGB values in linear colorspace.

Blending of values would occur when doing GL_LINEAR filtering with
scaling, and in an upcoming commit when doing MSAA resolves.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Add support for doing multisample resolves.
Eric Anholt [Fri, 7 Feb 2014 22:00:31 +0000 (14:00 -0800)]
meta: Add support for doing multisample resolves.

Note that this doesn't handle GL_EXT_multisample_scaled_blit yet.  The
i965 code for that extension bakes in knowledge of the sample positions
(well, knowledge of the sample positions aligned to a lower-resolution
grid), which we would have to do at runtime somehow for meta.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Fix miptree matching for multisampled, non-interleaved miptrees.
Eric Anholt [Tue, 18 Feb 2014 23:14:30 +0000 (15:14 -0800)]
i965: Fix miptree matching for multisampled, non-interleaved miptrees.

We haven't been executing this code before the meta-blit case, because
we've been flagging the miptree as validated at texstorage time, and never
having to revalidate.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: Remove unnecessary condition.
Courtney Goeltzenleuchter [Fri, 21 Feb 2014 17:31:43 +0000 (10:31 -0700)]
mesa: Remove unnecessary condition.

Identified by Valgrind memory check. Initialized block-opaque in a
different patch. This test seems unnecessary. If opaque must be true,
just set to true.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>