mesa.git
8 years agoi965: Combine src/dest tex vs. rb checks in intel_copy_image_sub_data.
Kenneth Graunke [Fri, 20 May 2016 03:29:04 +0000 (20:29 -0700)]
i965: Combine src/dest tex vs. rb checks in intel_copy_image_sub_data.

This simplifies things a little - now we only have one (tex or rb?)
if-ladder for src, and a second for dst, rather than four.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
8 years agoi965: Account for MinLayer in CopyImageSubData's blitter/CPU paths.
Kenneth Graunke [Fri, 20 May 2016 02:20:12 +0000 (19:20 -0700)]
i965: Account for MinLayer in CopyImageSubData's blitter/CPU paths.

Fixes Piglit's arb_copy_image-texview test with the Meta path disabled
(so we hit the blitter/CPU fallback paths).

v2: Add MinLayer even for cube maps (suggested by Ilia).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
8 years agofreedreno/ir3: cmdline compiler for glsl
Rob Clark [Sat, 14 May 2016 17:38:13 +0000 (13:38 -0400)]
freedreno/ir3: cmdline compiler for glsl

Use glsl/libstandalone.la to add support for taking glsl src files (in
addition to .tgsi) as input.  Then glsl->nir and feed the result into
the ir3 backend as normal.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agoglsl: split out libstandalone
Rob Clark [Sat, 14 May 2016 15:59:26 +0000 (11:59 -0400)]
glsl: split out libstandalone

Split standalone glsl_compiler into a libstandalone.la and a thin
main.cpp.  This way drivers can re-use the glsl standalone frontend in
their own standalone compilers.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoandroid: drop build of standalone glsl_compiler
Rob Clark [Wed, 25 May 2016 13:59:02 +0000 (09:59 -0400)]
android: drop build of standalone glsl_compiler

It's only a tool for debugging the glsl compiler, and should not be
installed.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Rob Herring <robh@kernel.org>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoi965: Mark fallthrough in switch statement.
Matt Turner [Tue, 24 May 2016 19:23:00 +0000 (12:23 -0700)]
i965: Mark fallthrough in switch statement.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoi965: Assert that a depth_mt exists when using HiZ.
Matt Turner [Tue, 24 May 2016 20:06:36 +0000 (13:06 -0700)]
i965: Assert that a depth_mt exists when using HiZ.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agonir: Strengthen assertion that 'out' is nonnull.
Matt Turner [Tue, 24 May 2016 19:24:56 +0000 (12:24 -0700)]
nir: Strengthen assertion that 'out' is nonnull.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agospirv: Mark default cases unreachable().
Matt Turner [Tue, 24 May 2016 19:29:30 +0000 (12:29 -0700)]
spirv: Mark default cases unreachable().

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoisl: Mark default cases unreachable.
Matt Turner [Tue, 24 May 2016 20:13:04 +0000 (13:13 -0700)]
isl: Mark default cases unreachable.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoisl: Remove useless qualifier from return type.
Matt Turner [Tue, 24 May 2016 19:29:51 +0000 (12:29 -0700)]
isl: Remove useless qualifier from return type.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agonvc0: add descriptions for hardware perf counters/metrics
Samuel Pitoiset [Wed, 25 May 2016 09:22:44 +0000 (11:22 +0200)]
nvc0: add descriptions for hardware perf counters/metrics

The GALLIUM_HUD does not yet expose a description for each events, but
this might be useful for developers who want to have a long description
of hw perf counters directly in the source code.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agomesa: 80-column wrapping for _context_lost_GetSynciv()
Brian Paul [Wed, 25 May 2016 17:49:31 +0000 (11:49 -0600)]
mesa: 80-column wrapping for _context_lost_GetSynciv()

Reviewed-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
8 years agomesa: add GLAPIENTRY to new _context_lost_X functions
Brian Paul [Wed, 25 May 2016 17:45:13 +0000 (11:45 -0600)]
mesa: add GLAPIENTRY to new _context_lost_X functions

To fix MSVC build.  Any function which goes into the dispatch table
needs to have the GLAPIENTRY (__stdcall) tag.

Reviewed-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
8 years agoscons: support 2.5.0
Giuseppe Bilotta [Wed, 25 May 2016 13:32:08 +0000 (07:32 -0600)]
scons: support 2.5.0

The get_implicit_deps changed in SCons 2.5, expecting a callable rather
than a path as third argument. Detect the SCons versions and set the
argument appropriately to support both 2.5 and earlier versions.

This closes #95211.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95211
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoscons: whitespace cleanup
Giuseppe Bilotta [Wed, 25 May 2016 13:30:06 +0000 (07:30 -0600)]
scons: whitespace cleanup

This text transformation was done automatically via the following shell
command:

$ find -name SCons\* -exec sed -i s/\\s\\+$// '{}' \;

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoi965/fs: take into account doubles when emitting system values
Alejandro Piñeiro [Tue, 24 May 2016 13:00:30 +0000 (15:00 +0200)]
i965/fs: take into account doubles when emitting system values

Fixes the following cts test:
GL42-CTS.vertex_attrib_64bit.limits_test

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: Fix shadowing of 'height' parameter
Kristian Høgsberg Kristensen [Wed, 25 May 2016 16:30:26 +0000 (09:30 -0700)]
i965: Fix shadowing of 'height' parameter

The nested declaration of 'height' shadows a parameter and uses
uninitialized memory. Fix by renaming to 'plane_height' which also makes
the code clearer.

This would typically break the bo size computation, but we don't use
that except when mmaping, and we don't mmap YUV buffers much.

Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
Reported-by: Mathias Fröhlich <Mathias.Froehlich@gmx.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomesa: Add .gitignore entries for make check binaries
Kristian Høgsberg Kristensen [Wed, 25 May 2016 04:07:10 +0000 (21:07 -0700)]
mesa: Add .gitignore entries for make check binaries

Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
Acked-by: Matt Turner <mattst88@gmail.com>
8 years agoi965: Enable GL_KHR_robustness
Kristian Høgsberg Kristensen [Tue, 24 May 2016 05:49:51 +0000 (22:49 -0700)]
i965: Enable GL_KHR_robustness

GL_KHR_robustness adds the GL_CONTEXT_LOST error and five new entry
points that we already implement.  This patch adds a new dispatch table
that returns GL_CONTEXT_LOST from all entry points and implements the
GL_LOSE_CONTEXT_ON_RESET strategy by setting that table when we learn
that we've lost the context.

With the GL_CONTEXT_LOST reporting in place and dispatch for the new
entry points we can turn on GL_KHR_robustness.

Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years ago.mailmap: Use Chia-I Wu personal e-mail.
Emil Velikov [Wed, 25 May 2016 16:38:06 +0000 (17:38 +0100)]
.mailmap: Use Chia-I Wu personal e-mail.

The LunarG one is bouncing.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years ago.mailmap: Use my (Emil Velikov) personal e-mail.
Emil Velikov [Wed, 25 May 2016 16:28:22 +0000 (17:28 +0100)]
.mailmap: Use my (Emil Velikov) personal e-mail.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agodocs: add missing GL_OES/EXT_gpu_shader5 enablement note
Ilia Mirkin [Wed, 25 May 2016 00:03:22 +0000 (20:03 -0400)]
docs: add missing GL_OES/EXT_gpu_shader5 enablement note

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoglsl: add GL_EXT_clip_cull_distance define, add helpers
Ilia Mirkin [Tue, 24 May 2016 23:57:47 +0000 (19:57 -0400)]
glsl: add GL_EXT_clip_cull_distance define, add helpers

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
8 years agotgsi: print TGSI_PROPERTY_NEXT_SHADER value as string, not an integer
Brian Paul [Tue, 24 May 2016 23:44:30 +0000 (17:44 -0600)]
tgsi: print TGSI_PROPERTY_NEXT_SHADER value as string, not an integer

Print "GEOM" instead of "2", for example.

v2: also update the text parsing code, per Ilia.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agotgsi: s/6/PIPE_SHADER_TYPES/ for tgsi_processor_type_names array size
Brian Paul [Tue, 24 May 2016 23:44:08 +0000 (17:44 -0600)]
tgsi: s/6/PIPE_SHADER_TYPES/ for tgsi_processor_type_names array size

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agonir/spirv: Handle location decorations on structure members
Jason Ekstrand [Tue, 24 May 2016 21:17:16 +0000 (14:17 -0700)]
nir/spirv: Handle location decorations on structure members

8 years agonir/spirv: Add explicit handling for all decorations
Jason Ekstrand [Tue, 24 May 2016 20:59:10 +0000 (13:59 -0700)]
nir/spirv: Add explicit handling for all decorations

From time to time we have had cases where glslang has added a decoration we
don't handle and it has caused problems.  This audit ensures that, for
every decoration, we either handle it or hit an unreachable() with an
accurate description of why we don't have to.

8 years agoi965/draw: Use the correct buffer index for interleaved VBO sizes
Jason Ekstrand [Tue, 24 May 2016 23:57:38 +0000 (16:57 -0700)]
i965/draw: Use the correct buffer index for interleaved VBO sizes

The buffer_range_* arrays are indexed by buffer index not element index.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
8 years agoi965/gen7: Fix gl_HelperInvocation
Jordan Justen [Tue, 24 May 2016 00:34:51 +0000 (17:34 -0700)]
i965/gen7: Fix gl_HelperInvocation

It appears that UV immediates aren't working on Ivy Bridge. In this
case, a signed version will work, and this fixes the piglit
tests/spec/glsl-4.50/execution/helper-invocation.shader_test test.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agomesa_glinterop: make GL interop version field bidirectional
Emil Velikov [Thu, 21 Apr 2016 16:29:16 +0000 (17:29 +0100)]
mesa_glinterop: make GL interop version field bidirectional

This allows clear and easy communication between the two.

Caller: Requesting information (struct vN)
Callee: I know how to deal with older version (vN-1) only. Here is your
data and the version I support.
Caller: Older version ? Sure I'll cap all access to the fields provided
by the older version (vN-1)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agomesa_glinterop: drop mesa_glinterop_device_info::interop_version
Emil Velikov [Thu, 21 Apr 2016 16:16:49 +0000 (17:16 +0100)]
mesa_glinterop: drop mesa_glinterop_device_info::interop_version

One cannot use a single version to control both export_in and export_out
versions. Using this forces us to always extend/bump both structs at the
same time.

An alternative scheme is coming with next patch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agost/dri: add note about GL interop version checks
Emil Velikov [Tue, 3 May 2016 10:13:12 +0000 (11:13 +0100)]
st/dri: add note about GL interop version checks

... and make them more explicit.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agomesa_glinterop: rename MESA_GLINTEROP_INVALID_{VALUE,VERSION}
Emil Velikov [Tue, 3 May 2016 10:10:54 +0000 (11:10 +0100)]
mesa_glinterop: rename MESA_GLINTEROP_INVALID_{VALUE,VERSION}

Be more explicit what it actually does.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agomesa_glinterop: s/struct_version/version/
Emil Velikov [Thu, 21 Apr 2016 15:18:39 +0000 (16:18 +0100)]
mesa_glinterop: s/struct_version/version/

OCD polish for consistency with other mesa interfaces.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agomesa_glinterop: fix GL interop *_VERSION comments
Emil Velikov [Thu, 21 Apr 2016 15:16:07 +0000 (16:16 +0100)]
mesa_glinterop: fix GL interop *_VERSION comments

Using the macro to set the version is wrong and ill-advised. Please don't
do it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agomesa_glinterop: remove inclusion of EGL header
Emil Velikov [Tue, 3 May 2016 11:25:53 +0000 (12:25 +0100)]
mesa_glinterop: remove inclusion of EGL header

Analogous to previous commit, but for EGL.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agomesa_glinterop: remove inclusion of GLX header
Emil Velikov [Tue, 3 May 2016 11:25:34 +0000 (12:25 +0100)]
mesa_glinterop: remove inclusion of GLX header

Since we only need partial information about the GLX symbols we can
forward declare them and drop the include. Obviously each user of the
said API will needs more than what's provides, so they'll include the
GLX header.

If they don't, the compiler will give us a nice warning ;-)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agomesa_glinterop: remove unneeded GLAPI/GLAPIENTRY/APIENTRYP symbols
Emil Velikov [Tue, 3 May 2016 11:14:26 +0000 (12:14 +0100)]
mesa_glinterop: remove unneeded GLAPI/GLAPIENTRY/APIENTRYP symbols

These come from windows.h, gl.h, glcorearb.h and/or glext.h.

The interop interface is aimed at non-Windows platforms while the macros
are used/derived due to Windows specifics. Thus we can safely remove
them.

Strictly speaking there should be GLXAPIENTRY/EGLAPIENTRY and alike
macros, although a) there is no GLX ones and b) this brings us even
further from decoupling the file from the GLX/EGL header dependency.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agomesa_glinterop: replace GL types with their native counterpart.
Emil Velikov [Tue, 3 May 2016 11:13:43 +0000 (12:13 +0100)]
mesa_glinterop: replace GL types with their native counterpart.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agomesa_glinterop: use generic variable types for the GL interop
Emil Velikov [Thu, 21 Apr 2016 15:36:01 +0000 (16:36 +0100)]
mesa_glinterop: use generic variable types for the GL interop

Thus we can preserve the ABI, while avoiding the inclusion of some/all
of the following:

  EGL/egl.h
  GL/gl.h
  GL/glcorearb.h
  GLES/gl.h
  GLES2/gl2.h
  GLES3/gl3.h
  GLES3/gl31.h

This will allow us to build/use it alongside any combination of APIs.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agomesa_glinterop: use consistent naming scheme for GL interop
Emil Velikov [Thu, 21 Apr 2016 15:20:45 +0000 (16:20 +0100)]
mesa_glinterop: use consistent naming scheme for GL interop

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agoRevert "mesa: Build EGL without X11 headers after interop patchset"
Emil Velikov [Tue, 24 May 2016 13:21:31 +0000 (14:21 +0100)]
Revert "mesa: Build EGL without X11 headers after interop patchset"

This reverts commit 4e2c9a04354b6b133845b8b93c0c5d34261a91d0.

The solution was incomplete and fragile. An alternative one is coming
shortly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
8 years agodocs: Note that GL_OES_geometry_shader and GL_OES_tessellation_shader are started
Ian Romanick [Tue, 24 May 2016 19:43:18 +0000 (12:43 -0700)]
docs: Note that GL_OES_geometry_shader and GL_OES_tessellation_shader are started

The GL_OES_geometry_shader work is on the oes_shader_io_blocks branch
of idr's fd.o repository.

The GL_OES_tessellation_shader work is on the tess-gles branch
of kwg's fd.o repository.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoc11/threads: resolve link issues with -O0
Emil Velikov [Tue, 24 May 2016 15:23:09 +0000 (16:23 +0100)]
c11/threads: resolve link issues with -O0

Add weak symbol notation for the pthread_mutexattr* symbols, thus making
the linker happy. When building with -O1 or greater the optimiser will
kick in and remove the said functions as they are dead/unreachable code.

Ideally we'll enable the optimisations locally, yet that does not seem
to work atm.

v2: Add the AX_GCC_FUNC_ATTRIBUTE([weak]) hunk in configure.

Cc: Alejandro Piñeiro <apinheiro@igalia.com>
Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
8 years agoswr: [rasterizer] remove containers.hpp
Tim Rowley [Fri, 20 May 2016 00:08:53 +0000 (18:08 -0600)]
swr: [rasterizer] remove containers.hpp

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer core] remove utility dead code
Tim Rowley [Thu, 19 May 2016 22:23:07 +0000 (16:23 -0600)]
swr: [rasterizer core] remove utility dead code

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer core] buckets fixes
Tim Rowley [Tue, 17 May 2016 23:26:27 +0000 (17:26 -0600)]
swr: [rasterizer core] buckets fixes

1. Don't clear bucket descriptions to fix issues with sim level
   buckets getting out of sync.

2. Close out threadviz file descriptors in ClearThreads().

3. Skip buckets for jitter based buckets when multithreaded. We need
   thread local storage through llvm jit functions to be fixed before
   we can enable this.

4. Fix buckets StopCapture to correctly detect capture complete.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer core] move centroid setup out of CalcCentroidBarycentrics
Tim Rowley [Tue, 17 May 2016 22:32:08 +0000 (16:32 -0600)]
swr: [rasterizer core] move centroid setup out of CalcCentroidBarycentrics

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer jitter] implement InstanceID/VertexID in fetch jit
Tim Rowley [Fri, 20 May 2016 16:15:43 +0000 (11:15 -0500)]
swr: [rasterizer jitter] implement InstanceID/VertexID in fetch jit

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agomesa: Silence unused parameter warnings
Ian Romanick [Thu, 19 May 2016 01:26:34 +0000 (18:26 -0700)]
mesa: Silence unused parameter warnings

Neither shProg nor name was used.  Remove them both.

main/shader_query.cpp:779:53: warning: unused parameter ‘shProg’ [-Wunused-parameter]
 program_resource_location(struct gl_shader_program *shProg,
                                                     ^
main/shader_query.cpp:780:72: warning: unused parameter ‘name’ [-Wunused-parameter]
                           struct gl_program_resource *res, const char *name,
                                                                        ^

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
8 years agoglsl/linker: Silence unused parameter warning
Ian Romanick [Thu, 19 May 2016 19:06:55 +0000 (12:06 -0700)]
glsl/linker: Silence unused parameter warning

The parameter is required for the interface.

glsl/link_uniforms.cpp:689:61: warning: unused parameter ‘record_type’ [-Wunused-parameter]
                             bool row_major, const glsl_type *record_type,
                                                             ^

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
8 years agodri: Add YVU formats
Kristian Høgsberg Kristensen [Wed, 27 Apr 2016 22:00:54 +0000 (15:00 -0700)]
dri: Add YVU formats

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Allow creating planar YUV __DRIimages
Kristian Høgsberg Kristensen [Mon, 2 May 2016 04:25:35 +0000 (21:25 -0700)]
i965: Allow creating planar YUV __DRIimages

Lift the resctriction we had before and allow creation of images with
multiple planes. We still require all the planes to be within the same
bo.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoi965: Invoke lowering pass for YUV textures
Kristian Høgsberg Kristensen [Mon, 2 May 2016 04:22:54 +0000 (21:22 -0700)]
i965: Invoke lowering pass for YUV textures

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Support textures with multiple planes
Kristian Høgsberg Kristensen [Mon, 2 May 2016 04:20:02 +0000 (21:20 -0700)]
i965: Support textures with multiple planes

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Create multiple miptrees for planar YUV images
Kristian Høgsberg Kristensen [Mon, 2 May 2016 04:24:00 +0000 (21:24 -0700)]
i965: Create multiple miptrees for planar YUV images

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Refactor intel_set_texture_image_bo() to create_mt_for_dri_image()
Kristian Høgsberg Kristensen [Tue, 10 May 2016 05:53:47 +0000 (22:53 -0700)]
i965: Refactor intel_set_texture_image_bo() to create_mt_for_dri_image()

This function now only creates the mt and we then call
intel_set_texture_image_mt() in intel_image_target_texture_2d() to set
it for the texture image.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Use intel_set_texture_image_mt() in intelSetTexBuffer2()
Kristian Høgsberg Kristensen [Tue, 10 May 2016 00:02:45 +0000 (17:02 -0700)]
i965: Use intel_set_texture_image_mt() in intelSetTexBuffer2()

Create the mt for the drawable bo directly and call our new
intel_miptree_create_for_bo() helper instead.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoi965: Add new intel_set_texture_image_mt() helper
Kristian Høgsberg Kristensen [Mon, 9 May 2016 23:53:06 +0000 (16:53 -0700)]
i965: Add new intel_set_texture_image_mt() helper

This factors out the work of setting up a miptree as the backing for a
texture image into a new helper.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agonir: Add a lowering pass for YUV textures
Kristian Høgsberg Kristensen [Mon, 2 May 2016 04:13:37 +0000 (21:13 -0700)]
nir: Add a lowering pass for YUV textures

This lowers sampling from YUV textures to 1) one or more texture
instructions to sample each plane and 2) color space conversion to RGB.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonir: Handle NULL in nir_copy_deref()
Kristian Høgsberg Kristensen [Tue, 10 May 2016 22:08:38 +0000 (15:08 -0700)]
nir: Handle NULL in nir_copy_deref()

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonir: Add new 'plane' texture source type
Kristian Høgsberg Kristensen [Mon, 2 May 2016 04:12:48 +0000 (21:12 -0700)]
nir: Add new 'plane' texture source type

This will be used to select the plane to sample from for planar
textures.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agomesa: log buffer ID numbers in decimal, not hexadecimal
Brian Paul [Mon, 23 May 2016 20:58:02 +0000 (14:58 -0600)]
mesa: log buffer ID numbers in decimal, not hexadecimal

All the other error messages use decimal.  Let's be consistent.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
8 years agomesa: use enum name in bind_buffer_object() error message
Brian Paul [Mon, 23 May 2016 20:56:38 +0000 (14:56 -0600)]
mesa: use enum name in bind_buffer_object() error message

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
8 years agomesa: raise error for glEnable(GL_VERTEX_ARRAY), etc. in core profile
Brian Paul [Mon, 23 May 2016 16:28:24 +0000 (10:28 -0600)]
mesa: raise error for glEnable(GL_VERTEX_ARRAY), etc. in core profile

Otherwise, if the call executes normally we'll hit an assertion later
in the VBO code when we draw something.  Note that these cases were
already handled correctly for the glIsEnabled() function (and the API
checks were copied from there).

Tested with new piglit gl-3.1-enable-vertex-array test.

v2: fix compat/es mix-up, per Ilia.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agodocs/egl: Android platform can also be build using autotools
Nicolas Boichat [Tue, 24 May 2016 05:55:20 +0000 (13:55 +0800)]
docs/egl: Android platform can also be build using autotools

We added support for Android build using autotools (configure),
update the documentation to reflect that.

Signed-off-by: Nicolas Boichat <drinkcat@google.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoi965: fix double-precision vertex inputs measurement
Juan A. Suarez Romero [Fri, 20 May 2016 14:35:52 +0000 (16:35 +0200)]
i965: fix double-precision vertex inputs measurement

For double-precision vertex inputs we need to measure them in dvec4
terms, and for single-precision vertex inputs we need to measure them in
vec4 terms.

For the later case, we use type_size_vec4() function. For the former
case, we had a wrong implementation based on type_size_vec4().

This commit introduces a proper type_size_dvec4() function, that we use
to measure vertex inputs.

Measuring double-precision vertex inputs as dvec4 is required because
ARB_vertex_attrib_64bit states that these uses the same number of
locations than the single-precision version. That is, two consecutives
dvec4 would be located in location "x" and location "x+1", not "x+2".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agodocs: true up nvc0 status - images, etc
Ilia Mirkin [Tue, 24 May 2016 03:04:06 +0000 (23:04 -0400)]
docs: true up nvc0 status - images, etc

Images aren't supported on maxwell, but neither is tessellation. Don't
overly confuse matters by trying to expose those subtleties in the
GL3.txt file/relnotes.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Dave Airlie <airlied@redhat.com>
8 years agost/mesa: enable ARB_ES3_1_compatibility when ES 3.1 would be exposed
Ilia Mirkin [Tue, 24 May 2016 03:00:45 +0000 (23:00 -0400)]
st/mesa: enable ARB_ES3_1_compatibility when ES 3.1 would be exposed

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agomesa: remove separate enable for KHR_robust_buffer_access_behavior
Ilia Mirkin [Tue, 24 May 2016 02:41:23 +0000 (22:41 -0400)]
mesa: remove separate enable for KHR_robust_buffer_access_behavior

This extension appears to be a strict subset of the ARB version. Also
remove it from GL3.txt since it doesn't seem relevant.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl: add support for explicit components to frag outputs
Timothy Arceri [Tue, 17 May 2016 01:15:27 +0000 (11:15 +1000)]
glsl: add support for explicit components to frag outputs

V2: fix error checking for arrays and components. V1 was
only taking into account all the array elements and all the
components of one of the varyings during the comparision
and treating the other as a single slot/component.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
8 years agomesa: add view classes for 3d astc formats
Ilia Mirkin [Sun, 8 May 2016 21:21:45 +0000 (17:21 -0400)]
mesa: add view classes for 3d astc formats

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
8 years agoglsl: add EXT_clip_cull_distance support based on ARB_cull_distance
Ilia Mirkin [Tue, 24 May 2016 01:38:38 +0000 (21:38 -0400)]
glsl: add EXT_clip_cull_distance support based on ARB_cull_distance

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agonvc0: expose robust buffer access
Ilia Mirkin [Tue, 17 May 2016 05:30:52 +0000 (01:30 -0400)]
nvc0: expose robust buffer access

We apparently pass all the relevant CTS tests. There are probably some
shortcomings, but they can be addressed down the line.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoi965: Use ISL for surface format introspection
Jason Ekstrand [Fri, 20 May 2016 23:10:41 +0000 (16:10 -0700)]
i965: Use ISL for surface format introspection

With this, we can delete the surface format table in brw_surface_formats.c
because all of the information we need is now in ISL.

8 years agoanv/formats: Use isl_format_supports* for format introspection
Jason Ekstrand [Fri, 20 May 2016 23:07:04 +0000 (16:07 -0700)]
anv/formats: Use isl_format_supports* for format introspection

8 years agoisl: Add per-gen format introspection
Jason Ekstrand [Fri, 20 May 2016 22:42:34 +0000 (15:42 -0700)]
isl: Add per-gen format introspection

This is just a copy-and-paste from brw_surface_formats.c.  For the
supports_vertex_fetch function, we do a bit more work so that it properly
handles Bay Trail.

8 years agoisl: Add the ISL_FORMAT_R32G32_FLOAT_LD format
Jason Ekstrand [Fri, 20 May 2016 22:41:57 +0000 (15:41 -0700)]
isl: Add the ISL_FORMAT_R32G32_FLOAT_LD format

8 years agoisl: Add support for quering the string name of a format
Jason Ekstrand [Fri, 20 May 2016 22:41:20 +0000 (15:41 -0700)]
isl: Add support for quering the string name of a format

8 years agoi965: Enable ARB/KHR_robust_buffer_access_behavior on BYT and HSW+
Jason Ekstrand [Tue, 17 May 2016 20:46:43 +0000 (13:46 -0700)]
i965: Enable ARB/KHR_robust_buffer_access_behavior on BYT and HSW+

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agomain: Add extension enable bits for KHR_robust_buffer_access_behavior
Jason Ekstrand [Fri, 20 May 2016 23:45:31 +0000 (16:45 -0700)]
main: Add extension enable bits for KHR_robust_buffer_access_behavior

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agonir/lower_samplers: Protect against sampler index overflow
Jason Ekstrand [Wed, 18 May 2016 21:56:19 +0000 (14:56 -0700)]
nir/lower_samplers: Protect against sampler index overflow

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl: Add an option to clamp block indices when lowering UBO/SSBOs
Jason Ekstrand [Thu, 19 May 2016 03:28:07 +0000 (20:28 -0700)]
glsl: Add an option to clamp block indices when lowering UBO/SSBOs

This prevents array overflow when the block is actually an array of UBOs or
SSBOs.  On some hardware such as i965, such overflows can cause GPU hangs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl/linker: Add a helper variable for compiler options
Jason Ekstrand [Thu, 19 May 2016 03:29:59 +0000 (20:29 -0700)]
glsl/linker: Add a helper variable for compiler options

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/draw: Use the real size for index buffers
Jason Ekstrand [Tue, 17 May 2016 22:34:40 +0000 (15:34 -0700)]
i965/draw: Use the real size for index buffers

Previously, we were using the size of the whole BO which may be
substantially larger than the actual index buffer size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/draw: Use the real size for vertex buffers
Jason Ekstrand [Tue, 17 May 2016 22:34:07 +0000 (15:34 -0700)]
i965/draw: Use the real size for vertex buffers

Previously, we were using the size of the BO which may be substantially
larger than the actual vertex buffer size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/draw: Use 3-channel formats for vertex fetch when possible.
Jason Ekstrand [Thu, 19 May 2016 21:33:50 +0000 (14:33 -0700)]
i965/draw: Use 3-channel formats for vertex fetch when possible.

For a long time, several of the 3-channel vertex formats didn't exist so we
faked them with 4-channel versions.  Starting with Sandy Bridge, we can use
R16G16B16_FLOAT and 8 and 16-bit integer formats become available on
Haswell and Bay Trail.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/surface_formats: Update the VB column for new formats added on BYT
Jason Ekstrand [Thu, 19 May 2016 22:43:43 +0000 (15:43 -0700)]
i965/surface_formats: Update the VB column for new formats added on BYT

Bay Trail and Haswell added a bunch of new vertex formats.  There was also
the addition of 64-bit passthrough formats for BDW+.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/draw: Properly handle rounding when dividing by InstanceDivisor
Jason Ekstrand [Wed, 18 May 2016 20:05:48 +0000 (13:05 -0700)]
i965/draw: Properly handle rounding when dividing by InstanceDivisor

The old code always divided rounded down and then subtracted 1.  What we
wanted was to divide rounded up and then subtract 1 which is equivalent to
subtracting 1 and then dividing rounded down.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/draw: Account for BaseInstance in VBO bounds
Jason Ekstrand [Wed, 18 May 2016 20:05:02 +0000 (13:05 -0700)]
i965/draw: Account for BaseInstance in VBO bounds

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/draw: Use worst-case VBO bounds if brw->num_instances == 0
Jason Ekstrand [Wed, 18 May 2016 19:28:31 +0000 (12:28 -0700)]
i965/draw: Use worst-case VBO bounds if brw->num_instances == 0

Previously, we only handled the "I don't know what's going on" case for
things with InstanceDivisor == 0.  However, in the DrawIndirect case we can
get num_instances == 0 and we don't know what's going on with the instanced
ones either.  This commit makes the worst-case bound the default and then
conservatively tightens the bound.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/draw: Delay when we get the bo for vertex buffers
Jason Ekstrand [Wed, 18 May 2016 04:42:49 +0000 (21:42 -0700)]
i965/draw: Delay when we get the bo for vertex buffers

The previous code got the BO the first time we encountered it.  However,
this can potentially lead to problems if the BO is used for multiple arrays
with the same buffer object because the range we declare as busy may not be
quite right.  By delaying the call to intel_bufferobj_buffer, we can ensure
that we have the full range for the given buffer.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/draw: Stop relying on min_index == -1 for invalid index bounds
Jason Ekstrand [Wed, 18 May 2016 18:34:44 +0000 (11:34 -0700)]
i965/draw: Stop relying on min_index == -1 for invalid index bounds

The vbo layer passes an index_bounds_valid flag that we should be using
instead.  This also fixes a bug when min_index == -1 and basevertex != 0
where we were actually comparing min_index + basevertex == -1 which was
false and we were getting the wrong buffer-sizing path.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agovbo: Declare the index range invalid for DrawTransformFeedback
Jason Ekstrand [Thu, 19 May 2016 06:47:01 +0000 (23:47 -0700)]
vbo: Declare the index range invalid for DrawTransformFeedback

Right now, we're setting the range to [0, 0] which is obviously bogus.
Instead, we should set it to be invalid like we do for DrawIndirect.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agovbo: Declare the index range invalid for DrawIndirect
Jason Ekstrand [Wed, 18 May 2016 05:24:59 +0000 (22:24 -0700)]
vbo: Declare the index range invalid for DrawIndirect

Right now, we're just setting the range to [0, MAX_UINT32] which, while
correct isn't helpful.  With DrawIndirect, you can't really know what the
actual range is so we may as well flag it as being an invalid range.  This
is what we do for draws with index buffer which is similar (the indices
aren't statically known) if a bit simpler.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agomesa/teximage: fix GL_FLOAT in comment
Ilia Mirkin [Tue, 24 May 2016 01:43:51 +0000 (21:43 -0400)]
mesa/teximage: fix GL_FLOAT in comment

Noticed by Brian. Trivial.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoglsl: fix explicit location validation for doubles
Timothy Arceri [Mon, 23 May 2016 03:07:14 +0000 (13:07 +1000)]
glsl: fix explicit location validation for doubles

Previously we would fail to find a match for the second half of a
dvec4 as 'i' would get incremented to 1 before we added the var to
the array at component 0.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
8 years agodocs: update ARB_cull_distance status.
Dave Airlie [Fri, 13 May 2016 06:11:27 +0000 (16:11 +1000)]
docs: update ARB_cull_distance status.

Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agost/mesa: reenable culling
Dave Airlie [Fri, 20 May 2016 01:27:29 +0000 (11:27 +1000)]
st/mesa: reenable culling

Now the lowering pass is fixed, reenable ARB_cull_distance.

Signed-off-by: Dave Airlie <airlied@redhat.com>