mesa.git
10 years agometa: Only clear the requested color buffers.
Kenneth Graunke [Fri, 2 May 2014 08:10:17 +0000 (01:10 -0700)]
meta: Only clear the requested color buffers.

This path is used to implement both glClear and glClearBuffer; the
latter is only supposed to clear particular buffers.  Core Mesa provides
us that information in the buffers bitmask; we must only clear buffers
mentioned there.

To accomplish this, we save/restore the color draw buffers state, and
use glDrawBuffers to restrict drawing to the relevant buffers.

Fixes Piglit's spec/!OpenGL 3.0/clearbuffer-mixed-formats and
spec/ARB_framebuffer_object/fbo-drawbuffers-none glClearBuffer tests
for drivers using meta clears (such as Broadwell).

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77852
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77856
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Add infrastructure for saving/restoring the DrawBuffers state.
Kenneth Graunke [Fri, 2 May 2014 08:06:04 +0000 (01:06 -0700)]
meta: Add infrastructure for saving/restoring the DrawBuffers state.

Sometimes we need to configure what draw buffers we render to, without
creating a new FBO.  This path will make that possible.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Add a new MESA_META_DRAW_BUFFERS bit.
Kenneth Graunke [Mon, 5 May 2014 21:03:46 +0000 (14:03 -0700)]
meta: Add a new MESA_META_DRAW_BUFFERS bit.

This will be used for saving/restoring the glDrawBuffers state.
For now, make sure that existing users of MESA_META_ALL don't get
the new bit, since they probably won't want it.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Unify the GLSL and fixed-function clear paths.
Kenneth Graunke [Mon, 5 May 2014 20:33:27 +0000 (13:33 -0700)]
meta: Unify the GLSL and fixed-function clear paths.

The majority of _mesa_meta_Clear and _mesa_meta_glsl_Clear was the same;
adding a boolean for whether to use GLSL allows us to share most of it
without polluting either path too much.

Tested for regressions by hacking i965 to always use the non-GLSL path.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Always intel_prepare_render() after invalidating front buffers.
Kenneth Graunke [Mon, 5 May 2014 18:02:18 +0000 (11:02 -0700)]
i965: Always intel_prepare_render() after invalidating front buffers.

Fixes glean/texture_srgb, which hit recursive-flush prevention
assertions in vbo_exec_FlushVertices.

This probably hurts the performance of front buffer rendering, but
very few people in their right mind do front buffer rendering.

Fixes Glean's texture_srgb test.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoradeonsi: implement ARB_texture_cube_map_array
Marek Olšák [Tue, 22 Apr 2014 19:23:29 +0000 (21:23 +0200)]
radeonsi: implement ARB_texture_cube_map_array

No LLVM changes needed.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
v2: updated GL3.txt and relnotes

10 years agoconfigure.ac: radeonsi requires EGL_DRM and GBM
Marek Olšák [Thu, 24 Apr 2014 11:40:56 +0000 (13:40 +0200)]
configure.ac: radeonsi requires EGL_DRM and GBM

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoglsl: fix bogus layout qualifier warnings
Tapani Pälli [Wed, 30 Apr 2014 07:56:59 +0000 (10:56 +0300)]
glsl: fix bogus layout qualifier warnings

Print out GL_ARB_explicit_attrib_location warnings only
when parsing attribute that uses "location" qualifier.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77245
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
10 years agodocs: Import 10.1.2 release notes, andd news item.
Carl Worth [Mon, 5 May 2014 20:25:44 +0000 (13:25 -0700)]
docs: Import 10.1.2 release notes, andd news item.

10 years agost/egl: Flush resources before presentation (android - bug 77966)
Paulo Sergio Travaglia [Fri, 2 May 2014 15:00:11 +0000 (12:00 -0300)]
st/egl: Flush resources before presentation (android - bug 77966)

[olv: Use the real name provided by the patch author.  Ideally this could be
moved to somewhere higher level so that we would not need to create a pipe
context to flush resources.  Plus, it is not clear if flushing resources for
another context is valid.]

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
10 years agodocs: mark ARB_stencil_texturing as done for nv50+/r600+
Ilia Mirkin [Mon, 5 May 2014 00:16:44 +0000 (20:16 -0400)]
docs: mark ARB_stencil_texturing as done for nv50+/r600+

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agomesa/st: implement ARB_stencil_texturing
Ilia Mirkin [Sat, 3 May 2014 09:08:53 +0000 (05:08 -0400)]
mesa/st: implement ARB_stencil_texturing

If StencilSampling is enabled on the texture object, pass in an
equivalent stencil-only format.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agonv50,nvc0: add X8Z24_UNORM, fix stencil-only formats
Ilia Mirkin [Sat, 3 May 2014 03:46:28 +0000 (23:46 -0400)]
nv50,nvc0: add X8Z24_UNORM, fix stencil-only formats

S8_UINT will become useful when ARB_texture_stencil8 becomes supported by
mesa. The other stencil formats are needed for ARB_stencil_texturing.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agoxa: fix segfault
Rob Clark [Sun, 4 May 2014 14:40:46 +0000 (10:40 -0400)]
xa: fix segfault

Fixes:

  Program received signal SIGSEGV, Segmentation fault.
  bind_samplers (comp=0x21b054, comp=0x21b054, ctx=0x211430)
      at ../../../../../src/gallium/state_trackers/xa/xa_composite.c:445
  445 mask_pic->srf->tex->format);
  (gdb) bt
  #0  bind_samplers (comp=0x21b054, comp=0x21b054, ctx=0x211430)
      at ../../../../../src/gallium/state_trackers/xa/xa_composite.c:445
  #1  xa_composite_prepare (ctx=0x211430, comp=comp@entry=0x21b054)
      at ../../../../../src/gallium/state_trackers/xa/xa_composite.c:488
  #2  0xb6f454b4 in XAPrepareComposite (op=<optimized out>, pSrcPicture=<optimized out>,
      pMaskPicture=<optimized out>, pDstPicture=<optimized out>, pSrc=0x5b3ad8, pMask=0x0,
      pDst=0x5923b8) at msm-exa-xa.c:533

We can't yet handle solid fill mask, so explicitly reject that, rather
than segfaulting.  Otherwise DDX would need to check XA version to see
if solid fill mask were supported.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agoi965: Set miptree target field when creating from a BO.
Kenneth Graunke [Fri, 2 May 2014 06:33:53 +0000 (23:33 -0700)]
i965: Set miptree target field when creating from a BO.

Prior to commit 8435b60a3577d2d905eae189cd7e770500177e99, the region
equivalent of this function called intel_miptree_create_layout, which
set mt->target to target.  With that commit, it no longer copied target.

Piglit's ext_image_dma_buf_import-sample_[xa]rgb8888 tests would then
hit an assertion failure, where image->TexObject->Target was
GL_TEXTURE_EXTERNAL_OES, and mt->target was GL_TEXTURE_2D.

Copying the target fixes this assertion failure.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
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 agomesa: Bump version to 10.3-devel
Ian Romanick [Sat, 3 May 2014 04:43:39 +0000 (21:43 -0700)]
mesa: Bump version to 10.3-devel

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodocs: Add missing release notes for ARB_separate_shader_objects
Ian Romanick [Sat, 3 May 2014 00:19:48 +0000 (17:19 -0700)]
docs: Add missing release notes for ARB_separate_shader_objects

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agoi965: Move push constant state packets to push constant update time.
Eric Anholt [Thu, 1 May 2014 16:59:22 +0000 (09:59 -0700)]
i965: Move push constant state packets to push constant update time.

-0.553779% +/- 0.423394% effect on cairo-perf-trace runtime on glamor
(n=612)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Merge gen8_upload_constant_state into gen7_upload_constant_state.
Eric Anholt [Thu, 1 May 2014 16:55:59 +0000 (09:55 -0700)]
i965: Merge gen8_upload_constant_state into gen7_upload_constant_state.

The two paths are really similar, and the extra conditionals will be
dwarfed by the cost of the actual upload.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Refactor gen7_upload_constant_state to look more like gen8.
Eric Anholt [Thu, 1 May 2014 16:54:07 +0000 (09:54 -0700)]
i965: Refactor gen7_upload_constant_state to look more like gen8.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Drop unnecessary state flag for units on NEW_BINDING_TABLE.
Eric Anholt [Thu, 1 May 2014 17:40:20 +0000 (10:40 -0700)]
i965: Drop unnecessary state flag for units on NEW_BINDING_TABLE.

Commit 30259856a8a82a55c030df1ad052e505c61144bc moved the state packets to
table generation time, but forgot to make this change.  Apparently the
performance win there was about not reemitting the table pointers on
unrelated state changes.

No performance difference on cairo on glamor (n=118).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/gen7+: Move sampler state packets to the stage sampler state table update.
Eric Anholt [Mon, 28 Apr 2014 18:27:22 +0000 (11:27 -0700)]
i965/gen7+: Move sampler state packets to the stage sampler state table update.

Now that we have the stage state coming into our setup of sampler states,
it's easy to drop an identifier into it of which stage the stage_state is,
and then look up which packet to emit in a little table.

No performance difference on cairo on glamor (n=492).

v2: Don't forget to do the workaround flush on IVB.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/gen6: Don't update unit state when samplers change.
Eric Anholt [Thu, 1 May 2014 20:49:57 +0000 (13:49 -0700)]
i965/gen6: Don't update unit state when samplers change.

There's no remaining dependency between these two packets that I can find.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Drop a NEW_SAMPLER annotation for use of sampler_count.
Eric Anholt [Mon, 28 Apr 2014 16:35:20 +0000 (09:35 -0700)]
i965: Drop a NEW_SAMPLER annotation for use of sampler_count.

The sampler count is set up from the gl_program at draw time, not at
sampler change time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Simplify sampler setup by passing the stage state.
Eric Anholt [Mon, 28 Apr 2014 16:23:57 +0000 (09:23 -0700)]
i965: Simplify sampler setup by passing the stage state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Make batch dumping go to stderr, too.
Eric Anholt [Thu, 1 May 2014 16:12:10 +0000 (09:12 -0700)]
i965: Make batch dumping go to stderr, too.

All our other debug goes there.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Fix a stale comment reference
Eric Anholt [Wed, 23 Apr 2014 21:04:04 +0000 (14:04 -0700)]
i965: Fix a stale comment reference

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglx: Conditionally compile GLX_MESA_query_renderer DRI3 support
Armin K [Fri, 2 May 2014 21:59:22 +0000 (23:59 +0200)]
glx: Conditionally compile GLX_MESA_query_renderer DRI3 support

Missed out with commit 625bdd64e5ea3327d4459b1ccccff8dab89129d0.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoradeonsi: add Mullins pci ids.
Samuel Li [Tue, 12 Nov 2013 20:49:55 +0000 (15:49 -0500)]
radeonsi: add Mullins pci ids.

Signed-off-by: Samuel Li <samuel.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: add support for Mullins asics.
Samuel Li [Thu, 1 May 2014 17:27:58 +0000 (13:27 -0400)]
radeonsi: add support for Mullins asics.

v2: name defaults to kabini for older llvm
v3: fix llvm version check

Signed-off-by: Samuel Li <samuel.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoconfigure: bump up libdrm_radeon requirement to 2.4.54
Alex Deucher [Fri, 2 May 2014 21:28:04 +0000 (17:28 -0400)]
configure: bump up libdrm_radeon requirement to 2.4.54

Required for Mullins.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodri3: Enable GLX_MESA_query_renderer on DRI3 too
Ian Romanick [Thu, 20 Feb 2014 19:47:14 +0000 (11:47 -0800)]
dri3: Enable GLX_MESA_query_renderer on DRI3 too

This should have happend around the time of commit 4680d23, but Keith's
DRI3 patches and my GLX_MESA_query_renderer patches crossed in the mail.

I don't have a working DRI3 setup, so I haven't been able to actually
verify this.  I'm hoping that someone can piglit this for me on DRI3...
It's also unfortunate the DRI2 and DRI3 can't share more code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Keith Packard <keithp@keithp.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoutil: Don't attempt to redefine INFINITY/NAN on VS 2013.
José Fonseca [Thu, 1 May 2014 13:17:51 +0000 (14:17 +0100)]
util: Don't attempt to redefine INFINITY/NAN on VS 2013.

There are now provided by VS.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agomesa: VS 2013 does not provide strcasecmp.
José Fonseca [Thu, 1 May 2014 13:17:14 +0000 (14:17 +0100)]
mesa: VS 2013 does not provide strcasecmp.

A define is necessary, like for earlier VS versions.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agoegl: Don't attempt to redefine stdint.h types with VS 2010.
José Fonseca [Thu, 1 May 2014 13:16:08 +0000 (14:16 +0100)]
egl: Don't attempt to redefine stdint.h types with VS 2010.

Just include stdint.h.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agoscons: Don't use bundled C99 headers for VS 2013.
José Fonseca [Thu, 1 May 2014 13:19:13 +0000 (14:19 +0100)]
scons: Don't use bundled C99 headers for VS 2013.

Use the ones provided by the compiler instead.

NOTE: External trees should be updated to not include '#include/c99'
directory directly, but rather rely on scons/gallium.py to do the right
thing.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agoscons: Don't restrict MSVC_VERSION values.
José Fonseca [Thu, 1 May 2014 14:49:36 +0000 (15:49 +0100)]
scons: Don't restrict MSVC_VERSION values.

Saves the trouble of continuously needing to update.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agodraw: Prevent signed/unsigned comparisons.
José Fonseca [Thu, 1 May 2014 14:41:43 +0000 (15:41 +0100)]
draw: Prevent signed/unsigned comparisons.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agost/vega: Prevent signed/unsigned comparisons.
José Fonseca [Thu, 1 May 2014 14:40:49 +0000 (15:40 +0100)]
st/vega: Prevent signed/unsigned comparisons.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agoscons: Adjust the warnings for VS.
José Fonseca [Thu, 1 May 2014 14:40:43 +0000 (15:40 +0100)]
scons: Adjust the warnings for VS.

Silence insignificant warnings so significant warnings have a chance to
stand out.

The only abundant warning that's not silenced here is "C4018:
signed/unsigned mismatch", as it could hide security issues, so it's better
to actually fix the code.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agoutil/u_debug_flush: Use util_snprintf.
José Fonseca [Thu, 1 May 2014 13:18:15 +0000 (14:18 +0100)]
util/u_debug_flush: Use util_snprintf.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agotargets/omx: add nouveau target
Emil Velikov [Sat, 5 Apr 2014 01:15:33 +0000 (02:15 +0100)]
targets/omx: add nouveau target

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agotargets/omx: use GALLIUM_VIDEO_CFLAGS
Emil Velikov [Sat, 5 Apr 2014 01:42:30 +0000 (02:42 +0100)]
targets/omx: use GALLIUM_VIDEO_CFLAGS

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agotargets/pipe-loader: cleanup version-script
Emil Velikov [Sat, 5 Apr 2014 17:04:18 +0000 (18:04 +0100)]
targets/pipe-loader: cleanup version-script

Drop the version/name tag from the script as it was never
meant to be there. Add swrast_create_screen as it is used
when loading swrast. Rename the file to pipe.sym.

v2: Rebase on top of the LD_NO_UNDEFINED changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agotargets/opencl: hide all the exported llvm/clang mayhem... hopefully
Emil Velikov [Fri, 4 Apr 2014 22:37:15 +0000 (23:37 +0100)]
targets/opencl: hide all the exported llvm/clang mayhem... hopefully

Both llvm and clang polute the exported symbol table, as soon
as we try to link with either one. Other than those two
everything else looks good (clean).

Cc: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agotargets/egl-static: freshen up the version script
Emil Velikov [Sat, 5 Apr 2014 17:03:05 +0000 (18:03 +0100)]
targets/egl-static: freshen up the version script

Namely drop the version/name tag of the exported symbol, and
rename the filename to egl.sym.

v2: Rebase on top of the LD_NO_UNDEFINED changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agotargets/gbm: add version-script to limit exported symbols
Emil Velikov [Fri, 4 Apr 2014 20:44:36 +0000 (21:44 +0100)]
targets/gbm: add version-script to limit exported symbols

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agotargets/vdpau: use version script to limit the exported symbols
Emil Velikov [Fri, 4 Apr 2014 22:59:30 +0000 (23:59 +0100)]
targets/vdpau: use version script to limit the exported symbols

Using export-symbols-regex is the least desirable method of restricting
the exported symbols, as is completely messes up with the symbol table.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agotargets/omx: drop the version from the omx targets
Emil Velikov [Sat, 5 Apr 2014 17:09:59 +0000 (18:09 +0100)]
targets/omx: drop the version from the omx targets

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agotargets/omx: use version script to limit amount of exported symbols
Emil Velikov [Fri, 4 Apr 2014 22:53:13 +0000 (23:53 +0100)]
targets/omx: use version script to limit amount of exported symbols

Using export-symbols-regex is the least desirable method of restricting
the exported symbols, as is completely messes up with the symbol table.

radeon_drm_winsys_create is not needed, avoid exporting it.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agotargets/dri: use a single version script to restict exported symbols
Emil Velikov [Fri, 4 Apr 2014 22:52:21 +0000 (23:52 +0100)]
targets/dri: use a single version script to restict exported symbols

Rather than having multiple (almost) identical version scripts use
a single one.

Cc: Christian König <christian.koenig@amd.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agotargets/xvmc: limit the amount of exported symbols
Emil Velikov [Fri, 4 Apr 2014 22:46:13 +0000 (23:46 +0100)]
targets/xvmc: limit the amount of exported symbols

In the presence of LLVM the final library exports every symbol from
the llvm namespace. Resolve this by using a version script (w/o the
version/name tag).

Considering that there are only ~25 symbols, explicitly list them
to minimize the chances of rogue symbols sneaking in.

Drop the *winsys_create functions as they were only meant for
gl-vdpau interop.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agotargets/osmesa: hide osmesa_create_screen
Emil Velikov [Fri, 4 Apr 2014 17:32:38 +0000 (18:32 +0100)]
targets/osmesa: hide osmesa_create_screen

The symbol is not meant to be exported, and its presence was
only a side effect due to the missing visibility flags.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agotargets/pipe-loader: drop driver_descriptor symbol from swrast
Emil Velikov [Fri, 4 Apr 2014 14:45:08 +0000 (15:45 +0100)]
targets/pipe-loader: drop driver_descriptor symbol from swrast

The symbol is used for hardware only drivers. For swrast the
loader uses swrast_create_screen. Add VISIBILITY_CFLAGS while
we're here.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agomesa: add extra null checks in vbo_rebase_prims()
Juha-Pekka Heikkila [Sun, 27 Apr 2014 20:04:58 +0000 (23:04 +0300)]
mesa: add extra null checks in vbo_rebase_prims()

v2 [idr]: Move declarations before code to prevent MSVC build breaks.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: add missing null checks in _tnl_register_fastpath()
Juha-Pekka Heikkila [Sun, 27 Apr 2014 20:04:57 +0000 (23:04 +0300)]
mesa: add missing null checks in _tnl_register_fastpath()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Add _mesa_error_no_memory for logging out-of-memory messages
Ian Romanick [Tue, 4 Mar 2014 13:39:37 +0000 (15:39 +0200)]
mesa: Add _mesa_error_no_memory for logging out-of-memory messages

This can be called from locations that don't have a context pointer
handy.  This patch also adds enough infrastructure so that the unit
tests for the GLSL compiler and the stand-alone compiler will build and
function.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
10 years agoglsl: make static constant variables "static const"
Chia-I Wu [Tue, 22 Apr 2014 08:58:16 +0000 (16:58 +0800)]
glsl: make static constant variables "static const"

This allows them to be moved to .rodata, and allow us to be sure that they
will not be modified.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
10 years agodocs: update 10.2 release notes
Petri Latvala [Wed, 23 Apr 2014 08:08:55 +0000 (11:08 +0300)]
docs: update 10.2 release notes

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965: Enable INTEL_performance_query for Gen5+.
Petri Latvala [Wed, 23 Apr 2014 08:08:54 +0000 (11:08 +0300)]
i965: Enable INTEL_performance_query for Gen5+.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Implement INTEL_performance_query.
Petri Latvala [Wed, 23 Apr 2014 08:08:53 +0000 (11:08 +0300)]
mesa: Implement INTEL_performance_query.

Using the existing driver hooks made for AMD_performance_monitor, implement
INTEL_performance_query functions.

v2: Whitespace changes.
v3: Whitespace changes, add a _mesa_warning()

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Add core support for the GL_INTEL_performance_query extension.
Petri Latvala [Wed, 23 Apr 2014 08:08:52 +0000 (11:08 +0300)]
mesa: Add core support for the GL_INTEL_performance_query extension.

Like AMD_performance_monitor, this extension provides an interface for
applications (and OpenGL-based tools) to access GPU performance
counters. Since the exact performance counters available vary between
vendors and hardware generations, the extension provides an API the
application can use to get the names, types, and minimum/maximum
values of all available counters.

Applications create performance queries based on available query
types, and begin/end measurement collection. Multiple queries can be
measuring simultaneously.

v2: Whitespace changes
v3: src/mapi/glapi/gen/gl_API.xml: Also expose the functions to GLES2.
v4: Whitespace changes, static_dispatch="false" for all functions, fix
    dispatch_sanity test for GLES2 functions

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Add INTEL_performance_query enums to tests/enum_strings.cpp
Petri Latvala [Wed, 23 Apr 2014 08:08:51 +0000 (11:08 +0300)]
mesa: Add INTEL_performance_query enums to tests/enum_strings.cpp

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoRegenerate gl_mangle.h.
Petri Latvala [Wed, 23 Apr 2014 08:08:50 +0000 (11:08 +0300)]
Regenerate gl_mangle.h.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodocs: update ARB_buffer_storage for nouveau
Ilia Mirkin [Thu, 1 May 2014 02:08:33 +0000 (22:08 -0400)]
docs: update ARB_buffer_storage for nouveau

10 years agonouveau: add ARB_buffer_storage support
Ilia Mirkin [Wed, 30 Apr 2014 20:45:16 +0000 (16:45 -0400)]
nouveau: add ARB_buffer_storage support

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agonouveau: remove cb_dirty, it's never used
Ilia Mirkin [Wed, 30 Apr 2014 06:08:52 +0000 (02:08 -0400)]
nouveau: remove cb_dirty, it's never used

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agonvc0: treat non-linear 2DRect textures the same as 2D
Ilia Mirkin [Wed, 30 Apr 2014 01:51:42 +0000 (21:51 -0400)]
nvc0: treat non-linear 2DRect textures the same as 2D

This fixes textureGather(2DRect) piglit tests, and does not appear to
have any adverse effects.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agomesa/st: enable carry/borrow lowering pass
Ilia Mirkin [Tue, 29 Apr 2014 03:13:37 +0000 (23:13 -0400)]
mesa/st: enable carry/borrow lowering pass

This handles the last of the ARB_gs5 instructions currently present in
mesa.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agoglsl: add lowering passes for carry/borrow
Ilia Mirkin [Tue, 29 Apr 2014 03:13:08 +0000 (23:13 -0400)]
glsl: add lowering passes for carry/borrow

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agomesa: Eliminate gl_shader_program::InternalSeparateShader
Ian Romanick [Thu, 27 Mar 2014 17:29:30 +0000 (10:29 -0700)]
mesa: Eliminate gl_shader_program::InternalSeparateShader

This was a work-around to allow linking a program with only a fragment
shader in a GLES context.  Now that we have GL_EXT_separate_shader_objects
in GLES contexts, we can just use that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa: Enable GL_EXT_separate_shader_objects for OpenGL ES
Ian Romanick [Wed, 26 Mar 2014 20:11:44 +0000 (13:11 -0700)]
mesa: Enable GL_EXT_separate_shader_objects for OpenGL ES

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Sort the list of extensions
Ian Romanick [Wed, 26 Mar 2014 18:43:32 +0000 (11:43 -0700)]
glsl: Sort the list of extensions

ARB, OES, then everything else.  If there's ever a KHR shading language
extension, it should go between ARB and OES.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agomesa: Remove support for desktop OpenGL GL_EXT_separate_shader_objects
Ian Romanick [Wed, 26 Mar 2014 18:25:16 +0000 (11:25 -0700)]
mesa: Remove support for desktop OpenGL GL_EXT_separate_shader_objects

I don't know of any applications that actually use it.  Now that Mesa
supports GL_ARB_separate_shader_objects in all drivers, this extension
is just cruft.

The entrypoints for the extension remain in the XML.  This is done so
that a new libGL will continue to provide dispatch support for old
drivers that try to expose this extension.

Future patches will add OpenGL ES GL_EXT_separate_shader_objects, but
that's a different thing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa/sso: Enable GL_ARB_separate_shader_objects by default
Ian Romanick [Sat, 29 Jun 2013 02:39:28 +0000 (19:39 -0700)]
mesa/sso: Enable GL_ARB_separate_shader_objects by default

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agosso: Add display list support for ARB_separate_shader_objects new functions
Ian Romanick [Tue, 29 Apr 2014 23:24:24 +0000 (16:24 -0700)]
sso: Add display list support for ARB_separate_shader_objects new functions

With this patch, the piglit arb_separate_shader_object-dlist test
passes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agolinker: Modify cross_validate_outputs_to_inputs to match using explicit locations
Ian Romanick [Wed, 2 Oct 2013 19:39:29 +0000 (12:39 -0700)]
linker: Modify cross_validate_outputs_to_inputs to match using explicit locations

This will be used for GL_ARB_separate_shader_objects.  That extension
not only allows separable shaders to rendezvous by location, but it also
allows traditionally linked shaders to rendezvous by location.  The spec
says:

    36. How does the behavior of input/output interface matching differ
        between separable programs and non-separable programs?

        RESOLVED: The rules for matching individual variables or block
        members between stages are identical for separable and
        non-separable programs, with one exception -- matching variables
        of different type with the same location, as discussed in issue
        34, applies only to separable programs.

        However, the ability to enforce matching requirements differs
        between program types.  In non-separable programs, both sides of
        an interface are contained in the same linked program.  In this
        case, if the linker detects a mismatch, it will generate a link
        error.

v2: Make sure consumer_inputs_with_locations is initialized when
consumer is NULL.  Noticed by Chia-I.

v3: Rebase on removal of ir_variable::user_location.

v4: Replace a (stale) FINISHME with some good explanation comments from
Eric.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agolinker: Sort shader I/O variables into a canonical order
Ian Romanick [Tue, 11 Feb 2014 23:38:23 +0000 (15:38 -0800)]
linker: Sort shader I/O variables into a canonical order

v2: Rebase on removal of ir_variable::user_location.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agolinker: Allow geometry shader without vertex shader for separable programs
Ian Romanick [Fri, 24 Jan 2014 02:26:29 +0000 (18:26 -0800)]
linker: Allow geometry shader without vertex shader for separable programs

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agolinker: Assign varying locations for separable programs
Ian Romanick [Fri, 14 Feb 2014 20:10:27 +0000 (12:10 -0800)]
linker: Assign varying locations for separable programs

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agolinker: Allow consumer stage or producer stage to be NULL
Ian Romanick [Fri, 14 Feb 2014 20:08:53 +0000 (12:08 -0800)]
linker: Allow consumer stage or producer stage to be NULL

When linking a separable program that contains only a fragment shader,
the producer will be NULL.  Similar cases will exist with geometry
shaders and, eventually, tessellation shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agolinker: Refactor code that gets an input matching an output
Ian Romanick [Thu, 3 Oct 2013 01:01:13 +0000 (18:01 -0700)]
linker: Refactor code that gets an input matching an output

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Exit when the shader IR contains an interface block instance
Ian Romanick [Wed, 2 Oct 2013 22:57:03 +0000 (15:57 -0700)]
glsl: Exit when the shader IR contains an interface block instance

While writing the link_varyings::single_interface_input test, I
discovered that populate_consumer_input_sets assumes that all shader
interface blocks have been lowered to discrete variables.  Since there
is a pass that does this, it is a reasonable assumption.  It was,
however, non-obvious.  Make the code fail when it encounters such a
thing, and add a test to verify that behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl/tests: Add first simple tests of populate_consumer_input_sets
Ian Romanick [Wed, 2 Oct 2013 22:44:14 +0000 (15:44 -0700)]
glsl/tests: Add first simple tests of populate_consumer_input_sets

Four initial tests:

* Create an IR list with a single input variable and verify that
  variable is the only thing in the hash tables.

* Same as the previous test, but use a built-in variable
  (gl_ClipDistance) with an explicit location set.

* Create an IR list with a single input variable from an interface block
  and verify that variable is the only thing in the hash tables.

* Create an IR list with a single input variable and a single input
  variable from an interface block.  Verify that each is the only thing
  in the proper hash tables.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agolinker: Refactor code that builds hash tables of varyings during linking
Ian Romanick [Wed, 2 Oct 2013 22:39:45 +0000 (15:39 -0700)]
linker: Refactor code that builds hash tables of varyings during linking

I want to make some changes to this code, but first I want to make some
unit tests for it... so that I can capture the pre- and
post-invariants.  Pulling the code out into its own function in a
non-anonymous namespace enables that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Fix saving the program pipeline state
Ian Romanick [Wed, 26 Mar 2014 01:34:31 +0000 (18:34 -0700)]
meta: Fix saving the program pipeline state

This code was broken in some odd ways before.  Too much state was being
saved, it was being restored in the wrong order, and in the wrong way.
The biggest problem was that the pipeline object was restored before
restoring the programs attached to the default pipeline.

Fixes a regression in the glean texgen test.

v3: Fairly significant re-write.  I think it's much cleaner now, and it
avoids a bug with some meta ops that use shaders (reported by Chia-I).

v4: Check Pipeline.Current against NULL instead of Pipeline.Default.
Suggested by Chia-I.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
10 years agomesa/sso: Refactor new function _mesa_bind_pipeline
Ian Romanick [Wed, 26 Mar 2014 01:19:42 +0000 (18:19 -0700)]
mesa/sso: Refactor new function _mesa_bind_pipeline

Pull most of the guts out of _mesa_BindPipeline into a new utility
function that can be use elsewhere (e.g., meta).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agolinker: Make lower_packed_varyings work with explicit locations
Ian Romanick [Sun, 27 Apr 2014 21:16:48 +0000 (14:16 -0700)]
linker: Make lower_packed_varyings work with explicit locations

Don't do anything with variables that have explicitly assigned
locations.  This is also how built-in varyings are handled.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Remove varying "base" parameters
Ian Romanick [Sun, 27 Apr 2014 00:45:35 +0000 (17:45 -0700)]
glsl: Remove varying "base" parameters

In February 2013 Paul unified the values used for shader stage outputs
and shader stage inputs.  See commits 8a076c5f0^..eed6baf76.  Since that
time, the location_base parameters are always VARYING_SLOT_VAR0.
Instead of passing that around, just hard code it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Constify parameter to a couple varying_matches methods
Ian Romanick [Thu, 13 Feb 2014 00:35:57 +0000 (16:35 -0800)]
glsl: Constify parameter to a couple varying_matches methods

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoclover: Add a stub implementation of clCreateImage() v3
Tom Stellard [Wed, 30 Apr 2014 19:57:24 +0000 (12:57 -0700)]
clover: Add a stub implementation of clCreateImage() v3

Now that we are uisng the OpenCL 1.2 headers, applications expect all
the OpenCL 1.2 functions to be implemented.

This fixes linking errors with the piglit CL tests.

v2:
  - Use c++ features
  - Fix error code handling

v3:
  - Move <iostream> into api/util.hpp
  - Fix indentation

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agodocs: Add missing ARB_gpu_shader5 subfeature to GL3.txt
Chris Forbes [Fri, 2 May 2014 05:09:13 +0000 (17:09 +1200)]
docs: Add missing ARB_gpu_shader5 subfeature to GL3.txt

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agodocs: Mark ARB_multi_bind as done
Fredrik Höglund [Mon, 18 Nov 2013 17:53:23 +0000 (18:53 +0100)]
docs: Mark ARB_multi_bind as done

...and update relnotes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Enable ARB_multi_bind
Fredrik Höglund [Fri, 15 Nov 2013 19:07:30 +0000 (20:07 +0100)]
mesa: Enable ARB_multi_bind

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Implement glBindImageTextures
Fredrik Höglund [Fri, 17 Jan 2014 17:37:06 +0000 (18:37 +0100)]
mesa: Implement glBindImageTextures

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Implement glBindVertexBuffers
Fredrik Höglund [Fri, 15 Nov 2013 19:01:07 +0000 (20:01 +0100)]
mesa: Implement glBindVertexBuffers

v2: Use the user provided offset and stride when the buffer ID is zero.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
10 years agomesa: Implement glBindBuffersRange
Fredrik Höglund [Fri, 15 Nov 2013 18:57:41 +0000 (19:57 +0100)]
mesa: Implement glBindBuffersRange

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Implement glBindBuffersBase
Fredrik Höglund [Fri, 15 Nov 2013 18:56:07 +0000 (19:56 +0100)]
mesa: Implement glBindBuffersBase

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Add _mesa_set_transform_feedback_binding()
Fredrik Höglund [Fri, 15 Nov 2013 18:53:29 +0000 (19:53 +0100)]
mesa: Add _mesa_set_transform_feedback_binding()

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Refactor set_ubo_binding()
Fredrik Höglund [Fri, 15 Nov 2013 18:51:02 +0000 (19:51 +0100)]
mesa: Refactor set_ubo_binding()

Make set_ubo_binding() just update the binding, and move the code
that does validation, flushes the vertices etc. into a new
bind_uniform_buffer() function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>