mesa.git
11 years agollvmpipe: abstract the code to set number of subpixel bits
Zack Rusin [Wed, 25 Sep 2013 23:38:33 +0000 (19:38 -0400)]
llvmpipe: abstract the code to set number of subpixel bits

As we're moving towards expanding the number of subpixel
bits and the width of the variables used in the computations
we need to make this code a bit more centralized.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agollvmpipe: implement 64 bit mul opcodes in llvmpipe
Zack Rusin [Tue, 8 Oct 2013 19:15:13 +0000 (15:15 -0400)]
llvmpipe: implement 64 bit mul opcodes in llvmpipe

Both the imul_hi and umul_hi are working with this patch.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agogallium: Add support for 32x32 muls with 64 bit results
Zack Rusin [Tue, 8 Oct 2013 19:11:02 +0000 (15:11 -0400)]
gallium: Add support for 32x32 muls with 64 bit results

The code introduces two new 32bit integer multiplication opcodes which
can be used to produce correct 64 bit results. GLSL, OpenCL and D3D10+
require them. We use two seperate opcodes, because they match the
behavior of GLSL and OpenCL, are a lot easier to add than a single
opcode with multiple destinations and because there's not much (any)
difference wrt code-generation.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agogallivm: support printing of 64 bit integers
Zack Rusin [Tue, 8 Oct 2013 18:10:09 +0000 (14:10 -0400)]
gallivm: support printing of 64 bit integers

only 8 and 32 bit integers were supported before.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agoi965/blorp: Fix the register types on blorp's push constants.
Eric Anholt [Thu, 29 Aug 2013 22:08:41 +0000 (15:08 -0700)]
i965/blorp: Fix the register types on blorp's push constants.

The UD values were getting set up as floats.  This happened to work out
because they were used as the second argument where the first was a dword,
and gen6+ doesn't do source conversions.  But it did trigger fulsim
warnings, and it meant if you used the push constant as the first operand
you would have been disappointed.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965: Fix 3D texture layout by more literally copying from the spec.
Eric Anholt [Tue, 8 Oct 2013 07:19:23 +0000 (00:19 -0700)]
i965: Fix 3D texture layout by more literally copying from the spec.

Fixes 3 texelFetch tests in piglit all.tests on ivb, and cubemap npot on gm45.

v2: Don't forget the gen4 DL=6 cubemap behavior.

Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
11 years agomesa: Fix compiler warnings when ALIGN's alignment is "1 << value".
Eric Anholt [Tue, 8 Oct 2013 07:23:29 +0000 (00:23 -0700)]
mesa: Fix compiler warnings when ALIGN's alignment is "1 << value".

We hadn't run into order of operation warnings before, apparently, since
addition is so low on the order.

Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoi965: Don't forget the cube map padding on gen5+.
Eric Anholt [Tue, 8 Oct 2013 07:20:04 +0000 (00:20 -0700)]
i965: Don't forget the cube map padding on gen5+.

We had a fixup for gen4's 3d-layout cubemaps (which, iirc, we'd
experimentally found to be necessary!), but while the spec still requires
it on gen5, we'd been missing it in the array-layout cubemaps.

Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoegl/main: remove undefined X11_LIBS automake variable
Gaetan Nadon [Sat, 28 Sep 2013 18:45:47 +0000 (14:45 -0400)]
egl/main: remove undefined X11_LIBS automake variable

The EGL library has some references to x11 but it gets the link flags
from the XCB_DRI2_LIBS if and only if HAVE_EGL_PLATFORM_X11 is true.

The X11_LIBS variable was probably coming from a PKG_CHECK_MODULES (x11)
earlier in history.

If it is possible to have HAVE_EGL_DRIVER_GLX without HAVE_EGL_PLATFORM_X11
then the link flags for libX11 should be passed. However, it won't come
from X11_LIBS which is undefined.

Reported-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
11 years agogallium/state_trackers/glx: X11/Xlib.h: No such file or directory
Gaetan Nadon [Thu, 19 Sep 2013 19:09:20 +0000 (15:09 -0400)]
gallium/state_trackers/glx: X11/Xlib.h: No such file or directory

The compiler cannot find the Xlib.h in the installed system headers.
All supplied include directives point to inside the mesa module.
The X11_CFLAGS variable is undefined (not defined in config.status).

It appears the intent was to use X11_INCLUDES defined in configure.ac.

The Xlib.h file is not installed on my workstation. It is supplied in
the libx11-dev package. This allows an X developer control over which
version of this file is used for X development.

Use to test: --enable-gallium-egl --enable-xlib-glx --disable-dri

Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
11 years agogallium/targets/libgl-xlib: X11/Xlib.h: No such file or directory
Gaetan Nadon [Thu, 19 Sep 2013 18:18:30 +0000 (14:18 -0400)]
gallium/targets/libgl-xlib: X11/Xlib.h: No such file or directory

The compiler cannot find the Xlib.h in the installed system headers.
All supplied include directives point to inside the mesa module.
The X11_CFLAGS variable is undefined (not defined in config.status).

It appears the intent was to use X11_INCLUDES defined in configure.ac.

The Xlib.h file is not installed on my workstation. It is supplied in
the libx11-dev package. This allows an X developer control over which
version of this file is used for X development.

Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
11 years agogallium/state_trackers/egl: use X11_INCLUDES rather than X11_CFLAGS
Gaetan Nadon [Thu, 19 Sep 2013 18:55:20 +0000 (14:55 -0400)]
gallium/state_trackers/egl: use X11_INCLUDES rather than X11_CFLAGS

The X11_CFLAGS variable is undefined (not defined in config.status).
It appears the intent was to use X11_INCLUDES defined in configure.ac.
It is used for building the code in the x11 subdir.

The build does not fail on this one as LIBDRM_CFLAGS happens to have
the inludedir value as the one for X11. It will not always be the case.
The option --enable-gallium-egl is required durimg configuration.

Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
11 years agost/vdpau: really block until surface is idle
Grigori Goronzy [Wed, 9 Oct 2013 00:23:52 +0000 (02:23 +0200)]
st/vdpau: really block until surface is idle

pipe_screen::fence_finish with zero timeout returns quickly and
doesn't wait at all. Fix that, and also delete the fence afterwards,
so that QuerySurfaceStatus returns the right state later.

Addresses:
https://trac.videolan.org/vlc/ticket/9281
https://bugs.freedesktop.org/show_bug.cgi?id=68792

Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agost/vdpau: add new formats to OutputSurface rendering
Grigori Goronzy [Wed, 9 Oct 2013 00:23:51 +0000 (02:23 +0200)]
st/vdpau: add new formats to OutputSurface rendering

OutputSurfaces have simple YCbCr rendering functionality built in,
but so far only 4:2:0 subsampling worked correctly. This fixes 4:2:2
and 4:4:4 formats.

Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agost/vdpau: fix GenerateCSCMatrix with NULL procamp
Grigori Goronzy [Wed, 9 Oct 2013 00:23:50 +0000 (02:23 +0200)]
st/vdpau: fix GenerateCSCMatrix with NULL procamp

As per API specification, it is legal to supply a NULL procamp. In this
case, a CSC matrix according to the colorspace should be generated,
but no further adjustments are made.

Addresses:
https://trac.videolan.org/vlc/ticket/9281
https://bugs.freedesktop.org/show_bug.cgi?id=68792

Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agoradeon/uvd: disable VC-1 simple/main profile
Grigori Goronzy [Wed, 9 Oct 2013 00:23:49 +0000 (02:23 +0200)]
radeon/uvd: disable VC-1 simple/main profile

It doesn't work (decodes to garbage) with most videos on UVD 3.0. Worse
yet, it often results in random memory corruption or GPU hangs. Rumor
has it only the newest UVD hardware could do it anyway.

Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agoradeon/uvd: try to fix VC-1 decoding
Grigori Goronzy [Wed, 9 Oct 2013 00:23:48 +0000 (02:23 +0200)]
radeon/uvd: try to fix VC-1 decoding

The DPB size calculations seem to be off; there is various random
corruption happening, even with advanced profile. Always assuming
a minimum number of references appears to fix it, similarly to
H.264. This might overallocate the DPB.  Also clean up the SPS/PPS
field setup so that it matches VC-1 specifications better.

With these changes, all advanced profile VC-1 files I could get my
hand on work fine.

Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agoradeon/uvd: fix video format reporting
Grigori Goronzy [Wed, 9 Oct 2013 00:23:47 +0000 (02:23 +0200)]
radeon/uvd: fix video format reporting

UVD can only support NV12 in the case of hardware decoding, but we
can still use all other formats for software decoding. Use the UNKNOWN
profile to signal that we're not interesting in hardware decoding.

v2: use profile instead of entrypoint

Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agogallium/dri targets: use DRI_DRIVER_LDFLAGS
Marek Olšák [Sun, 6 Oct 2013 17:52:13 +0000 (19:52 +0200)]
gallium/dri targets: use DRI_DRIVER_LDFLAGS

which contains -Wl,-Bsymbolic. If I understand it correctly, it prevents
symbols from clashing if multiple drivers are loaded at the same time.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
11 years agoradeonsi: fix occlusion queries for CIK
Marek Olšák [Tue, 8 Oct 2013 12:23:22 +0000 (14:23 +0200)]
radeonsi: fix occlusion queries for CIK

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
11 years agoradeonsi: draw register fixes for CIK
Marek Olšák [Tue, 8 Oct 2013 00:47:36 +0000 (02:47 +0200)]
radeonsi: draw register fixes for CIK

This doesn't fix any known issue. I'm just following the docs.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
11 years agoi965: keep SecHalf flag after register coalescing
Chia-I Wu [Fri, 27 Sep 2013 04:31:32 +0000 (12:31 +0800)]
i965: keep SecHalf flag after register coalescing

Copy sechalf to the new register, otherwise we would read wrong HW registers.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: allow SIMD8 sampler messages in SIMD16 mode
Chia-I Wu [Mon, 30 Sep 2013 06:12:19 +0000 (14:12 +0800)]
i965: allow SIMD8 sampler messages in SIMD16 mode

When the instruction to send the sampler message is forced uncompressed or
sechalf, send SIMD8 one even in SIMD16 mode.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: make BRW_COMPRESSION_2NDHALF valid for brw_SAMPLE
Chia-I Wu [Fri, 27 Sep 2013 07:23:56 +0000 (15:23 +0800)]
i965: make BRW_COMPRESSION_2NDHALF valid for brw_SAMPLE

SIMD8 sampler messages are allowed in SIMD16 mode, and they could not work
without BRW_COMPRESSION_2NDHALF.  Later PRMs (gen5 and later) do not
explicitly state whether BRW_COMPRESSION_2NDHALF is allowed, but they do have
examples using send with SecHalf.  It should be safe to assume SecHalf is
valid.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Initialize brw_blorp_const_color_program::prog_data.
Vinson Lee [Sat, 27 Jul 2013 07:04:41 +0000 (00:04 -0700)]
i965: Initialize brw_blorp_const_color_program::prog_data.

Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965: Fix a compiler warning about conservative depth enums.
Eric Anholt [Tue, 8 Oct 2013 20:17:07 +0000 (13:17 -0700)]
i965: Fix a compiler warning about conservative depth enums.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
11 years agoi965/gs: Fixup gl_PointSize on entry to geometry shaders.
Paul Berry [Sat, 13 Jul 2013 03:17:13 +0000 (20:17 -0700)]
i965/gs: Fixup gl_PointSize on entry to geometry shaders.

gl_PointSize is stored in the w component of VARYING_SLOT_PSIZ, but
the geometry shader infrastructure assumes that it should look for all
geometry shader inputs of type float in the x component.  So when
compiling a geomtery shader that uses a gl_PointSize input, fix it up
during the shader prolog by moving the w component to the x component.

This is similar to how we emit fixups and workarounds for vertex
shader attributes.

Fixes piglit test spec/glsl-1.50/execution/geometry/core-inputs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agoglsl/gs: handle gl_ClipDistance geometry input in lower_clip_distance.
Bryan Cain [Fri, 15 Feb 2013 15:30:51 +0000 (09:30 -0600)]
glsl/gs: handle gl_ClipDistance geometry input in lower_clip_distance.

This corresponds to the lowering of gl_ClipDistance to
gl_ClipDistanceMESA for vertex and geometry shader outputs.  Since
this lowering pass occurs after lower_named_interface blocks, it deals
with 2D arrays (gl_ClipDistance[vertex][clip_plane]) rather than 1D
arrays in an interface block
(gl_in[vertex].gl_ClipDistance[clip_plane]).

v2 (Paul Berry <stereotype441@gmail.com>): Fix indexing order for
gl_ClipDistance input lowering.  Properly lower bulk assignment of
gl_ClipDistance inputs.  Rework for GLSL 1.50 style geometry shaders.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
v3 (Paul Berry <stereotype441@gmail.com>): Add comments and assertions
to clarify that the 2D version of clip distance is only used for
geometry shader inputs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl/gs: add gl_in support to builtin_variables.cpp.
Paul Berry [Sat, 3 Aug 2013 01:12:23 +0000 (18:12 -0700)]
glsl/gs: add gl_in support to builtin_variables.cpp.

Previously, builtin_variables.cpp was written assuming that we
supported ARB_geometry_shader4 style geometry shader inputs, meaning
that each built-in varying input to a geometry was supplied via an
array variable whose name ended in "In", e.g. gl_PositionIn or
gl_PointSizeIn.

However, in GLSL 1.50 style geometry shaders, things work
differently--built-in inputs are supplied to geometry shaders via a
built-in interface block called gl_in, which contains all the built-in
inputs using their usual names (e.g. the gl_Position input is supplied
to the geometry shader as gl_in[i].gl_Position).

This patch adds the necessary logic to builtin_variables.cpp to create
the gl_in interface block and populate it accordingly for geometry
shader inputs.  The old ARB_geometry_shader4 style varyings are
removed, though they can easily be added back in the future if we
decide to support ARB_geometry_shader4.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agoglsl: Keep track of location for interface block fields.
Paul Berry [Mon, 9 Sep 2013 23:39:47 +0000 (16:39 -0700)]
glsl: Keep track of location for interface block fields.

This patch adds a "location" element to struct glsl_struct_field, so
that we can keep track of the gl_varying_slot associated with each
built-in geometry shader input.

In lower_named_interface_blocks, we use this value to populate the
"location" field in the ir_variable that stores each geometry shader
input.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agoglx: Generate fewer errors in MakeContextCurrent
Adam Jackson [Fri, 4 Oct 2013 13:25:51 +0000 (09:25 -0400)]
glx: Generate fewer errors in MakeContextCurrent

For a few reasons.

1: In the (current) common case, these conditionals are never true. All
we're doing by checking them is slowing down MakeCurrent.  The server
does these checks already anyway.

2: GLX >= 3.0 contexts may legally be made current without a bound
framebuffer.

This does not fix piglit/glx-create-context-current-no-framebuffer, but
is a prerequisite for fixing it.

Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
11 years agoglx: Propagate failures from SendMakeCurrentRequest where possible
Adam Jackson [Fri, 4 Oct 2013 13:25:51 +0000 (09:25 -0400)]
glx: Propagate failures from SendMakeCurrentRequest where possible

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
11 years agoglx: Hide xGLXMakeCurrentReply inside SendMakeCurrentRequest
Adam Jackson [Fri, 4 Oct 2013 13:25:51 +0000 (09:25 -0400)]
glx: Hide xGLXMakeCurrentReply inside SendMakeCurrentRequest

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
11 years agost/dri: don't export any private symbols
Marek Olšák [Mon, 7 Oct 2013 11:49:42 +0000 (13:49 +0200)]
st/dri: don't export any private symbols

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agogallium/swrast: don't export any private symbols
Marek Olšák [Mon, 7 Oct 2013 11:49:42 +0000 (13:49 +0200)]
gallium/swrast: don't export any private symbols

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agogallium/radeon: don't export any private symbols
Marek Olšák [Mon, 7 Oct 2013 11:49:42 +0000 (13:49 +0200)]
gallium/radeon: don't export any private symbols

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoconfigure.ac: report an error if LLVM shared libs are disabled and CL is enabled
Marek Olšák [Mon, 7 Oct 2013 11:03:34 +0000 (13:03 +0200)]
configure.ac: report an error if LLVM shared libs are disabled and CL is enabled

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agost/mesa: improve format selection for GLES
Marek Olšák [Sat, 28 Sep 2013 19:28:53 +0000 (21:28 +0200)]
st/mesa: improve format selection for GLES

Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
11 years agoi915g: Rename sampler to fragment_sampler
Stéphane Marchesin [Tue, 8 Oct 2013 03:49:35 +0000 (20:49 -0700)]
i915g: Rename sampler to fragment_sampler

Otherwise it is fairly confusing.

11 years agoi915g: Fix the sampler bind function
Stéphane Marchesin [Tue, 8 Oct 2013 03:33:31 +0000 (20:33 -0700)]
i915g: Fix the sampler bind function

The new sampler bind sends us NULL samplers, so we need to count
the number of valid samplers ourselves. This fixes ~500 piglit
regressions from the sampler rework.

While we're at it, let's also support start.

11 years agogen7: Use logical, not physical, dims in 3DSTATE_DEPTH_BUFFER (v2)
Chad Versace [Thu, 3 Oct 2013 00:21:33 +0000 (17:21 -0700)]
gen7: Use logical, not physical, dims in 3DSTATE_DEPTH_BUFFER (v2)

In 3DSTATE_DEPTH_BUFFER, we set Width and Height to the miptree slice's
physical dimensions. (Logical and physical dimensions may differ for
multisample surfaces).

However, in SURFACE_STATE, we always set Width and Height to the slice's
logical dimensions. We should do the same for 3DSTATE_DEPTH_BUFFER,
because the hw docs say so.

No Piglit regressions (-x glx -x glean) on Ivybridge with Wayland.

v2: No Piglit regressions, for real this time.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
11 years agodoxygen: Generate Doxygen for i965
Chad Versace [Fri, 4 Oct 2013 20:40:42 +0000 (13:40 -0700)]
doxygen: Generate Doxygen for i965

Now, one can do the following to generate and read the i965 Doxygen:

  cd $MESA_TOP/doxygen
  make
  firefox i965/index.html

Reviewed-by: Frank Henigman <fjhenigman@google.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
11 years agoi965: Remove the "ARF" register file.
Matt Turner [Sat, 28 Sep 2013 00:37:51 +0000 (17:37 -0700)]
i965: Remove the "ARF" register file.

The registers in the architecture register file don't share much in
common, so there's no point in grouping them together. Use the HW_REG
class instead. The vec4 backend already does this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Fixup for don't dead-code eliminate instructions that write to the accumulator.
Matt Turner [Fri, 20 Sep 2013 02:31:31 +0000 (19:31 -0700)]
i965: Fixup for don't dead-code eliminate instructions that write to the accumulator.

Accidentally pushed an old version of the patch.

v2: Set destination register using brw_null_reg().
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Generate code for ir_binop_imul_high.
Matt Turner [Wed, 18 Sep 2013 04:34:45 +0000 (21:34 -0700)]
i965: Generate code for ir_binop_imul_high.

v2: Make accumulator's type match the type of the operation. Noticed by
    Ken.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Use the multiplication result's type for the accumulator.
Matt Turner [Thu, 26 Sep 2013 20:51:37 +0000 (13:51 -0700)]
i965: Use the multiplication result's type for the accumulator.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965/fs: Disable CSE on instructions writing to HW_REG.
Matt Turner [Thu, 26 Sep 2013 20:38:11 +0000 (13:38 -0700)]
i965/fs: Disable CSE on instructions writing to HW_REG.

CSE would otherwise combine the two mul(8) emitted by [iu]mulExtended:

mul(8)  acc0 x y
mach(8) null x y
mov(8)  lsb  acc0
...
mul(8)  acc0 x y
mach(8) msb  x y
Into:
mul(8)  temp x y
mov(8)  acc0 temp
mach(8) null x y
mov(8)  lsb  acc0
...
mov(8)  acc0 temp
mach(8) msb  x y

But mul(8) into the accumulator produces more than 32-bits of precision,
which is required and lost if multiplying into a general register and
moving to the accumulator.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoglsl: Implement [iu]mulExtended() built-ins for ARB_gpu_shader5.
Matt Turner [Wed, 18 Sep 2013 04:34:15 +0000 (21:34 -0700)]
glsl: Implement [iu]mulExtended() built-ins for ARB_gpu_shader5.

These built-ins have two "out" parameters, which makes implementing them
efficiently with our current compiler infrastructure difficult. Instead,
implement them in terms of the existing ir_binop_mul IR (to return the
low 32-bits) and a new ir_binop_mul64 which returns the high 32-bits.

v2: Rename mul64 -> imul_high as suggested by Ken.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Add Gen assertion checks for newer instructions.
Matt Turner [Fri, 20 Sep 2013 05:55:24 +0000 (22:55 -0700)]
i965: Add Gen assertion checks for newer instructions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Don't dead-code eliminate instructions that write to the accumulator.
Matt Turner [Fri, 20 Sep 2013 02:31:31 +0000 (19:31 -0700)]
i965: Don't dead-code eliminate instructions that write to the accumulator.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Generate code for ir_binop_carry and ir_binop_borrow.
Matt Turner [Thu, 19 Sep 2013 20:01:08 +0000 (13:01 -0700)]
i965: Generate code for ir_binop_carry and ir_binop_borrow.

Using the ADDC and SUBB instructions on Gen7.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Add UD null register helpers.
Matt Turner [Thu, 19 Sep 2013 20:02:23 +0000 (13:02 -0700)]
i965: Add UD null register helpers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl: Implement usubBorrow() built-in for ARB_gpu_shader5.
Matt Turner [Wed, 18 Sep 2013 01:02:05 +0000 (18:02 -0700)]
glsl: Implement usubBorrow() built-in for ARB_gpu_shader5.

i965 implements this with a single (multiple destination) instruction,
SUBB. Emitting SUBB directly from usubBorrow() would be ideal, but our
optimization passes don't know how to copy with expressions with
side-effects.

Radeon has an SUBB_UINT instruction that only generates the borrow
bit. I've chosen to go this route and implement usubBorrow() by doing the
subtraction and the borrow operations separately.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Implement uaddCarry() built-in for ARB_gpu_shader5.
Matt Turner [Wed, 18 Sep 2013 00:44:03 +0000 (17:44 -0700)]
glsl: Implement uaddCarry() built-in for ARB_gpu_shader5.

i965 implements this with a single (multiple destination) instruction,
ADDC. Emitting ADDC directly from uaddCarry() would be ideal, but our
optimization passes don't know how to copy with expressions with
side-effects.

Radeon has an ADDC_UINT instruction that only generates the carry
bit. I've chosen to go this route and implement uaddCarry() by doing the
addition and the carry operations separately.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Add ir_binop_carry and ir_binop_borrow.
Matt Turner [Thu, 19 Sep 2013 19:56:10 +0000 (12:56 -0700)]
glsl: Add ir_binop_carry and ir_binop_borrow.

Calculates the carry out of the addition of two values and the
borrow from subtraction respectively. Will be used in uaddCarry() and
usubBorrow() built-in implementations.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl_compiler: Enable any extension that any Mesa driver enables
Ian Romanick [Wed, 11 Sep 2013 23:08:23 +0000 (18:08 -0500)]
glsl_compiler: Enable any extension that any Mesa driver enables

The only GLSL extension that is not enabled is AMD_vertex_shader_layer.
I think the standalone-compiler could enable this (as shading language
support is complete), but no driver enables it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl_compiler: Sort extensions by name
Ian Romanick [Wed, 11 Sep 2013 22:53:06 +0000 (17:53 -0500)]
glsl_compiler: Sort extensions by name

Makes it a little easier to see which ones are missing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl_compiler: Always log the compiler diagnostics
Ian Romanick [Mon, 9 Sep 2013 19:14:17 +0000 (14:14 -0500)]
glsl_compiler: Always log the compiler diagnostics

Not just when there's an error.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl_compiler: Set max GLSL version on the command line
Ian Romanick [Mon, 9 Sep 2013 19:07:15 +0000 (14:07 -0500)]
glsl_compiler: Set max GLSL version on the command line

Infer whether or not to use ES based on the GLSL version (100 or 300 are
for ES).  This replaces the --glsl-es command line option.  Set various
compiler limits based on the minimums required for the specified GLSL
version.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl_compiler: Use no_argument instead of 0 in getopt_long options
Ian Romanick [Mon, 9 Sep 2013 15:06:59 +0000 (10:06 -0500)]
glsl_compiler: Use no_argument instead of 0 in getopt_long options

The choices aren't just 0 and 1, so using the enum names is much more
clear.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl_compiler: Re-enable building glsl_compiler
Ian Romanick [Mon, 9 Sep 2013 14:58:08 +0000 (09:58 -0500)]
glsl_compiler: Re-enable building glsl_compiler

This allows application developers to use Mesa's compiler as a
standalone validator for their shaders.

This is mostly a revert of commit 569f0e4.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl: Remove glsl_parser_state MaxVaryingFloats field
Ian Romanick [Tue, 10 Sep 2013 17:16:57 +0000 (12:16 -0500)]
glsl: Remove glsl_parser_state MaxVaryingFloats field

Pull the data directly from the context like the other varying related
limits.  The parser state shadow copies were added back when the parser
state didn't have a pointer to the context.  There's no reason to do it
now days.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Set gl_MaxVertexOutputs from VertexProgram.MaxOutputComponents etc
Ian Romanick [Tue, 10 Sep 2013 17:13:04 +0000 (12:13 -0500)]
glsl: Set gl_MaxVertexOutputs from VertexProgram.MaxOutputComponents etc

gl_MaxVertexOutputVectors => ctx->Const.VertexProgram.MaxOutputComponents
gl_MaxFragmentInputVectors => ctx->Const.FragmentProgram.MaxInputComponents

v2: Add types so that the code compiles.  Pointed out by Brian.

v3: Leave gl_MaxVaryingFloats et al. as-is.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> [v2]
Reviewed-by: Marek Olšák <marek.olsak@amd.com> [v2]
Reviewed-by: Paul Berry <stereotype441@gmail.com> [v2]
11 years agoglsl: Count shader inputs and outputs separately
Ian Romanick [Tue, 10 Sep 2013 17:00:34 +0000 (12:00 -0500)]
glsl: Count shader inputs and outputs separately

Starting with OpenGL 3.2 input limits and output limits for stages may
not match.  This means they need to be accounted separately.

No piglit regressions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglapi: add output info to GetProgramiv's params
Emilio Pozuelo Monfort [Thu, 3 Oct 2013 17:33:58 +0000 (19:33 +0200)]
glapi: add output info to GetProgramiv's params

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoclover: fix building with llvm-3.4 since rev191922
Laurent Carlier [Fri, 4 Oct 2013 19:22:30 +0000 (21:22 +0200)]
clover: fix building with llvm-3.4 since rev191922

http://llvm.org/viewvc/llvm-project?view=revision&revision=191922

11 years agost/mesa: silence warning about unhandled ir_query_levels in switch
Brian Paul [Mon, 7 Oct 2013 15:08:10 +0000 (09:08 -0600)]
st/mesa: silence warning about unhandled ir_query_levels in switch

11 years agoradeon/vdpau: only export necessary symbols
Christian König [Wed, 25 Sep 2013 13:51:08 +0000 (15:51 +0200)]
radeon/vdpau: only export necessary symbols

Export only the absolutely necessary symbols in radeon vdpau targets.

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agoradeon/uvd: optimize message handling a bit
Christian König [Wed, 25 Sep 2013 14:26:58 +0000 (16:26 +0200)]
radeon/uvd: optimize message handling a bit

No need to keep a copy of the message in system memory anymore,
since it should now be in GART memory on newer chips.

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agodocs: Mark a few more things as "in progress" in GL3.txt.
Kenneth Graunke [Sun, 6 Oct 2013 20:58:34 +0000 (13:58 -0700)]
docs: Mark a few more things as "in progress" in GL3.txt.

11 years agodri/nouveau: add AllocTextureImageBuffer implementation
Ilia Mirkin [Fri, 4 Oct 2013 08:28:58 +0000 (04:28 -0400)]
dri/nouveau: add AllocTextureImageBuffer implementation

This fixes issues where get_rt_format would see a 0 format because the
nouveau_surface had not been properly initialized. Fixes crash on
supertuxkart startup (which still fails due to out-of-vram issues).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
11 years agoglsl: Fix usage of the wrong union member in program_resource_visitor::recursion.
Francisco Jerez [Sat, 21 Sep 2013 01:36:08 +0000 (18:36 -0700)]
glsl: Fix usage of the wrong union member in program_resource_visitor::recursion.

In the array-of-struct case, recursion() takes the row_major flag for
each iteration from 't->fields.structure[i]', but 't' is not a record
type.  Inherit the array declaration row_major flag instead.

This mistake was found by running piglit on valgrind.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69449
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoRevert "r600g: only flush the caches that need to be flushed during CP DMA operations"
Marek Olšák [Sat, 5 Oct 2013 16:34:32 +0000 (18:34 +0200)]
Revert "r600g: only flush the caches that need to be flushed during CP DMA operations"

This reverts commit 7948ed1250cae78ae1b22dbce4ab23aceacc6159.

It caused graphical corruption. I've got no idea why.

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

Conflicts:
src/gallium/drivers/r600/evergreen_hw_context.c
src/gallium/drivers/r600/r600_hw_context.c
src/gallium/drivers/r600/r600_pipe.h

11 years agoi965/ivb: Flag RG32F quirk for texture gather regardless of swizzles
Chris Forbes [Sat, 5 Oct 2013 10:26:07 +0000 (23:26 +1300)]
i965/ivb: Flag RG32F quirk for texture gather regardless of swizzles

As of ARB_gpu_shader5, textureGather doesn't always read the
post-swizzle RED channel -- so we can't just look at the red swizzle
state.

Theoretically we could only flag the quirk if *some* green swizzle is in
use, but that's probably more trouble than it's worth.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/vs: Add support for textureGather(.., comp)
Chris Forbes [Sat, 5 Oct 2013 10:10:04 +0000 (23:10 +1300)]
i965/vs: Add support for textureGather(.., comp)

- For HSW: Select the channel based on the component selected (swizzle
  is done in HW)
- For IVB: Select the channel based on the swizzle state for the
  component selected. Only apply the RG32F w/a if we actually want
  green -- we're about to flag it regardless of swizzle state.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/fs: Add support for textureGather(.., comp)
Chris Forbes [Sat, 5 Oct 2013 09:59:17 +0000 (22:59 +1300)]
i965/fs: Add support for textureGather(.., comp)

- For HSW: Select the channel based on the component selected (swizzle
  is done in HW)
- For IVB: Select the channel based on the swizzle state for the
  component selected. Only apply the RG32F w/a if we actually want
  green -- we're about to flag it regardless of swizzle state.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl: add ARB_gpu_shader5's additional textureGather signatures
Chris Forbes [Sat, 5 Oct 2013 04:57:18 +0000 (17:57 +1300)]
glsl: add ARB_gpu_shader5's additional textureGather signatures

- gsampler2DRect support
- optional `comp` parameter

Future patches will add shadow sampler support and
textureGatherOffsets().

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl: Add support for specifying the component in textureGather
Chris Forbes [Sat, 5 Oct 2013 05:26:56 +0000 (18:26 +1300)]
glsl: Add support for specifying the component in textureGather

ARB_gpu_shader5 introduces new variants of textureGather* which have an
explicit component selector, rather than relying purely on the sampler's
swizzle state.

This patch adds the GLSL plumbing for the extra parameter.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agodocs: mark ARB_conservative_depth done on i965
Chris Forbes [Sat, 5 Oct 2013 08:45:07 +0000 (21:45 +1300)]
docs: mark ARB_conservative_depth done on i965

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
11 years agoi965: Enable ARB_conservative_depth for Gen7+.
Chris Forbes [Sat, 5 Oct 2013 08:40:57 +0000 (21:40 +1300)]
i965: Enable ARB_conservative_depth for Gen7+.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/wm: Program correct conservative depth modes
Chris Forbes [Sat, 5 Oct 2013 08:39:25 +0000 (21:39 +1300)]
i965/wm: Program correct conservative depth modes

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agodocs: rephrase 9.2.1, 9.1.7 news item
Brian Paul [Sat, 5 Oct 2013 20:25:23 +0000 (14:25 -0600)]
docs: rephrase 9.2.1, 9.1.7 news item

Both are bug-fix releases, not new development releases.

11 years agodocs: add the MD5 sums for the 9.2.1 and 9.1.7 releases
Brian Paul [Sat, 5 Oct 2013 20:20:37 +0000 (14:20 -0600)]
docs: add the MD5 sums for the 9.2.1 and 9.1.7 releases

11 years agodocs: Mark off KHR_debug, update relnotes
Timothy Arceri [Sat, 5 Oct 2013 09:00:20 +0000 (19:00 +1000)]
docs: Mark off KHR_debug, update relnotes

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/vs: add missing break between ir_query_levels and ir_tg4 cases
Chris Forbes [Sat, 5 Oct 2013 10:18:39 +0000 (23:18 +1300)]
i965/vs: add missing break between ir_query_levels and ir_tg4 cases

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
11 years agodocs: Mark off ARB_texture_query_levels, update relnotes
Chris Forbes [Sat, 5 Oct 2013 06:15:15 +0000 (19:15 +1300)]
docs: Mark off ARB_texture_query_levels, update relnotes

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
11 years agoi965: enable ARB_texture_query_levels on Gen6+
Chris Forbes [Sat, 5 Oct 2013 04:11:57 +0000 (17:11 +1300)]
i965: enable ARB_texture_query_levels on Gen6+

Theoretically would work on Gen5 as well but requires GLSL 1.30, which
is not (yet) enabled by default there.

V2: Enable for Gen5 conditionally on GLSL version.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoi965/vs: implement ir_query_levels
Chris Forbes [Thu, 26 Sep 2013 17:52:20 +0000 (05:52 +1200)]
i965/vs: implement ir_query_levels

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoi965/fs: implement ir_query_levels
Chris Forbes [Thu, 26 Sep 2013 08:44:18 +0000 (20:44 +1200)]
i965/fs: implement ir_query_levels

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoi965: ignore all texturing opcodes without a coordinate, for cubemap normalize
Chris Forbes [Thu, 26 Sep 2013 08:08:32 +0000 (20:08 +1200)]
i965: ignore all texturing opcodes without a coordinate, for cubemap normalize

Previously we special-cased textureSize() but this is the more correct
condition.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoglsl: add plumbing for GL_ARB_texture_query_levels
Chris Forbes [Thu, 26 Sep 2013 07:37:30 +0000 (19:37 +1200)]
glsl: add plumbing for GL_ARB_texture_query_levels

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agomesa: add plumbing for GL_ARB_texture_query_levels
Chris Forbes [Thu, 26 Sep 2013 07:09:21 +0000 (19:09 +1200)]
mesa: add plumbing for GL_ARB_texture_query_levels

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agodocs: Add release notes for 9.1.7 release
Carl Worth [Sat, 5 Oct 2013 04:56:58 +0000 (21:56 -0700)]
docs: Add release notes for 9.1.7 release

Including a news item.

11 years agodocs: Add release notes and NEWS item for 9.2.1 release
Carl Worth [Sat, 5 Oct 2013 03:53:09 +0000 (20:53 -0700)]
docs: Add release notes and NEWS item for 9.2.1 release

Better late than never, right?

11 years agohaiku: Ensure correct libraries are referenced.
Alexander von Gluck IV [Fri, 4 Oct 2013 17:28:42 +0000 (17:28 +0000)]
haiku: Ensure correct libraries are referenced.

11 years agohaiku: Clean up code, use target-helpers
Alexander von Gluck IV [Fri, 4 Oct 2013 15:26:03 +0000 (15:26 +0000)]
haiku: Clean up code, use target-helpers

* Thanks for the help xexaxo!

11 years agohaiku: Drop haiku-softpipe.c; fix extern C
Alexander von Gluck IV [Thu, 3 Oct 2013 21:05:23 +0000 (21:05 +0000)]
haiku: Drop haiku-softpipe.c; fix extern C

* It isn't needed any longer as we're
  moving in the code that called it.
* The winsys code is C, so make sure
  we include the header in the extern C

11 years agohaiku: Correct Haiku softpipe library
Alexander von Gluck IV [Thu, 3 Oct 2013 02:14:20 +0000 (02:14 +0000)]
haiku: Correct Haiku softpipe library

* Use LoadableModule vs SharedLibrary

11 years agohaiku: Add first Haiku renderer (softpipe)
Alexander von Gluck IV [Thu, 3 Oct 2013 01:22:48 +0000 (01:22 +0000)]
haiku: Add first Haiku renderer (softpipe)

* This shared library gets parsed by the
  system as a system "add-on"

11 years agohaiku: Build Haiku's libGL from within Mesa
Alexander von Gluck IV [Tue, 1 Oct 2013 21:03:48 +0000 (21:03 +0000)]
haiku: Build Haiku's libGL from within Mesa

* This in essence means that Mesa would be
  taking control of Haiku's OpenGL kit.
* This works by dispatching renderers from the
  OpenGL add-ons directory