Commit Graph

57716 Commits

Author SHA1 Message Date
Roland Scheidegger d86fddc876 util: don't flush overflowing values to infinity in half-float conversion
I am not able to find _any_ rounding behavior specified for OpenGL for
float to half-float conversions. However, it is specified for fp11/fp10
which suggests round to next finite value but round-to-zero would also
be allowed, but finite values must not be flushed to infinity in either
case.
Hence I believe it makes sense to do the same for half-floats too.
We could probably also use round-to-zero consistently, which is in fact
required by d3d10 (but it doesn't seem to matter much).
Does not match the mesa core function doing the same though (which is
saying it was built to match intel gpus which I don't believe for a
second as it would cause failures in d3d10, moreover the PRM (for
ivy bridge, not listed in older manuals) while not specifying rounding
behavior clearly states finite numbers are never flushed to infinity).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-07-27 16:41:29 +02:00
Roland Scheidegger 47e528b740 tgsi: handle texel swizzles correctly for d3d10-style sample opcodes
Same as for gallivm (though these don't quite work correctly in softpipe,
so untested).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-07-27 16:41:29 +02:00
Roland Scheidegger abcc40e7f0 gallivm: handle texel swizzles correctly for d3d10-style sample opcodes
unlike OpenGL, the texel swizzle is embedded in the instruction, so honor
that.
(Technically we now execute both the sampler_view swizzle and the
per-instruction swizzle but this should be quite ok.)

v2: add documentation note as it's not obvious.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-07-27 16:41:29 +02:00
Kenneth Graunke f2be639972 docs: Mark ARB_vertex_attrib_binding as started.
Fredrik Höglund has a partial implementation in his git tree.
2013-07-26 23:47:27 -07:00
Ian Romanick b55c1638ad mesa: Disable GL_EXT_framebuffer_object in core profiles and OpenGL 3.1
GL_EXT_framebuffer_object differs from GL_ARB_framebuffer_object in ways
that we can't and don't implement in core profiles.  Exposing it is a
lie, so we shouldn't do that.

It's possible the some other GL_EXT_framebuffer_* extensions should be
disabled, but it's not quite so clear cut.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-26 22:56:26 -07:00
Matt Turner 86ae3027a1 docs: Mark GL_ARB_shading_language_420pack as done. 2013-07-26 22:33:39 -07:00
Chris Forbes 6c0dad6128 docs: Mark off 420pack
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2013-07-27 21:29:01 +12:00
Tapani Pälli 8c211dd742 glsl: disable ARB_texture_cube_map_array_enable keywords for glsl es
Patch fixes a crash with Webgl 'shader-with-non-reserved-words'
conformance test by ignoring desktop extension keywords on GLSL ES.

v2: fix reserved and allowed desktop glsl versions (Chris)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64087
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-26 10:05:20 -07:00
Chris Forbes 124f567f1d i965/vs: Fix flaky texture swizzling
If any component used the ZERO or ONE swizzle, its corresponding member
in the `swizzle` array would never be initialized. We *mostly* got away
with this, except when that memory happened to contain a value that
clobbered another channel when combined using BRW_SWIZZLE4().

NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-27 06:34:29 +12:00
Niels Ole Salscheider 81a156d099 st/clover: Allow double precision operations
Pass "cl_khr_fp64" preprocessor definition to clang

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-07-25 18:55:56 -07:00
Dave Airlie 19338157c9 gallium/vl: add prime support
This fixes the dri2 opening to check if DRI_PRIME is set,
and picks the correct drm device path to open, this along
with a change to libvdpau allows vdpauinfo to work at least,

Martin Peres tested with nouveau, and there seems to be a
further issue with final displaying, it only works sometimes,
but this patch is at least necessary to help debug further.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Christian König <christian.koenig@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67283
Tested-by: Armin K. <krejzi@email.com>
2013-07-26 08:42:00 +10:00
Kenneth Graunke 0e9549e2bd Revert "i965: Delete pre-DRI2.3 viewport hacks."
This reverts commit c9db037dc9.

Eric believes that the viewport hacks are still necessary for EGL;
invalidate events aren't hooked up properly.

This commit caused a regression where EFL applications wouldn't show
anything other than window decorations; GLBenchmark also showed issues.

The revert had conflicts due to the intel_context/brw_context merge.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66606
Cc: mesa-stable@lists.freedesktop.org
2013-07-25 15:25:43 -07:00
Kenneth Graunke a8c8c5f8d2 mesa: Bump version to 9.3.0-devel.
This should have been done when making the 9.2 branch, but was missed.
2013-07-25 13:34:53 -07:00
Kenneth Graunke 7d24d1b873 docs: Remove <em> obfuscation on public mailing list addresses.
Wrapping every character of an email address in <em> looks bizarre, and
makes it impossible to read the text.  Apparently Brian did this in 2003
to try and obfuscate email addresses and avoid spam.

Of course, mesa-*@lists.freedesktop.org are public mailing lists and
trivial to find on the internet.  So obfuscation buys us nothing
(assuming the <em> technique even works at all, which I doubt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
LOLed-at-by: Matt Turner :)
2013-07-25 13:34:43 -07:00
Rob Clark 890e27ef25 xa: bump major version
Bump major version, as the change to require explicit
xa_context_flush(), the addition of the handle-type parameter to
xa_surface_handle(), and change of surface to ref/unref will require a
minor change in DDX.
2013-07-25 13:59:55 -04:00
Jerome Glisse 8b21a3825b xa: move surface to ref/unref api
This make ddx life easier.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-07-25 13:59:55 -04:00
Jerome Glisse d156c032c9 xa: let ddx handle flush
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-07-25 13:59:55 -04:00
Jerome Glisse 6e8c9589db xa: export a common context flush function
First step before moving flushing inside the ddx.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-07-25 13:59:55 -04:00
Jerome Glisse d1444225d3 xa: add handle type parameter to get handle
Allow to retrieve non shared handle.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-07-25 13:59:55 -04:00
Rob Clark 984da46219 xa: add xa_surface_from_handle()
For freedreno DDX, we have to create the scanout GEM bo in a special way
(until we have our own KMS/DRM kernel driver.. and even then for
phones/tablets you probably need to use the android drivers if you don't
want to port the lcd panel driver support).  The easiest way to handle
this is let the DDX create the scanout bo, and then create the xa
surface from that.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-07-25 13:59:54 -04:00
Vinson Lee 60c248c3af gallivm: Remove NoFramePointerElimNonLeaf for LLVM >= 3.4.
TargetOptions::NoFramePointerElimNonLeaf was removed in LLVM 3.4
r187093.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-07-25 09:50:07 -07:00
Paul Berry a5eecb246d glsl: Handle empty if statement encountered during loop analysis.
The is_loop_terminator() function was asserting that the following
kind of if statement could never occur:

    if (...) { } else { }

(presumably based on the assumption that such an if statement would be
eliminated by previous optimization stages).  But that isn't the
case--it's possible that previous optimization stages might simplify
more complex code down to this empty if statement, in which case it
won't be eliminated until the next time through the optimization loop.

So is_loop_terminator() needs to handle it.  Fortunately it's easy to
handle--it's not a loop terminator because it does nothing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64330
CC: mesa-stable@lists.freedesktop.org

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-25 09:37:02 -07:00
Paul Berry b8f13fbb85 i965: Initialize inout_offset parameter to brw_search_cache().
Two callers of brw_search_cache() weren't initializing that function's
inout_offset parameter: brw_blorp_const_color_params::get_wm_prog()
and brw_blorp_const_color_params::get_wm_prog().

That's a benign problem, since the only effect of not initializing
inout_offset prior to calling brw_search_cache() is that the bit
corresponding to cache_id in brw->state.dirty.cache may not be set
reliably.  This is ok, since the cache_id's used by
brw_blorp_const_color_params::get_wm_prog() and
brw_blorp_blit_params::get_wm_prog() (BRW_BLORP_CONST_COLOR_PROG and
BRW_BLORP_BLIT_PROG, respectively) correspond to dirty bits that are
not used.

However, failing to initialize this parameter causes valgrind to
complain.  So let's go ahead and fix it to reduce valgrind noise.

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-25 09:36:15 -07:00
Paul Berry 42a921fa92 glsl: don't rename variables in interface block arrays.
The linker matches up variables in interface blocks according to their
block name and variable name.  When support for interface block arrays
was added in commit d6863acb, we renamed variables appearing in
interface blocks so that their name included the array size.  For
example, in a block like this:

out foo {
   float bar
} baz[3];

The variable "bar" would get renamed to "bar[3]".

This is unnecessary, and leads to problems in supporting geometry
shaders, since geometry shaders require vertex shader outputs which
are non-arrays to be linked up to geometry shader inputs which are
arrays.

This patch makes the behaviour of interface block arrays the same as
simple non-array interface blocks; in both cases, the variables
contained within them are not renamed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-07-25 09:34:24 -07:00
Zack Rusin f19cb0e5f3 draw: fix vertex id computation
vertex id has to be unaffected by the start index (i.e. when calling
draw arrays with start_index = 5, the first vertex_id has to still
be 0, not 5) and it has to be equal to the index when performing
indexed rendering (in which case it has to be unaffected by the
index bias). This fixes our behavior.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-07-25 02:02:59 -04:00
Zack Rusin 0e9ec86973 draw: cleanup and fix instance id computation
The instance id system value always starts at 0, even if the
specified start instance is larger than 0. Instead of implicitly
setting instance id to instance id plus start instance and then
having to subtract instance id when computing the buffer offsets
lets just set instance id to the proper instance id. This fixes
instance id computation and cleansup buffer offset computation.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-07-25 02:02:36 -04:00
Vinson Lee 0ac3164708 gallivm: Remove dead code in lp_build_compare_ext.
There are earlier returns for PIPE_FUNC_NEVER and PIPE_FUNC_ALWAYS. The
switch value of 'func' cannot be either of those values.

Fixes "Logically dead code" defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-07-24 23:47:34 -07:00
Brian Paul 8a9df7a370 mesa: implement mipmap generation for compressed 2D array textures
We weren't looping over all the slices in the array.  The updated
code should also correctly handle 3D compressed textures too, whenever
we have that feature.

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

NOTE: This is a candidate for the 9.x branches
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-07-24 15:29:30 -06:00
Brian Paul 484fa87984 meta: handle 2D texture arrays in decompress_texture_image()
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66850

NOTE: This is a candidate for the 9.x branches.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-07-24 15:29:30 -06:00
Brian Paul 2931bcb0d2 mesa: handle 2D texture arrays in get_tex_rgba_compressed()
If we call glGetTexImage() for a compressed 2D texture array we need
to loop over all the slices.

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

NOTE: This is a candidate for the 9.x branches.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-07-24 15:29:29 -06:00
Christoph Bumiller 5c37039797 nv50,nvc0: s/uint16/uint32 for constant buffer offset
Looks like a thinko, "Hey, constant buffers can be at most 64 KiB
in size, offset can't be larger." But it can, of course.

I think piglit lacks a test for UBO and BindBufferRange that
tests if it actually works.
2013-07-24 20:46:38 +02:00
Roland Scheidegger 1e003b44e8 draw: always call util_cpu_detect() in draw context creation.
Since disabling denorms in draw_vbo() we require the util_cpu_caps to be
initialized there. Hence add another util_cpu_detect() call in
draw_create_context() which should ensure this.
(There is another call in draw_get_option_use_llvm() which only gets called
with x86 (not x86_64) but calling it always there wouldn't help since it most
likely wouldn't get called when compiling without llvm, so leave it alone
there.)
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=66806.
(Because util_cpu_caps wasn't initialized when first calling util_fpstate_get()
hence it returning zero, but it would later get initialized by rtasm translate
code hence when draw call returned it unmasked all exceptions by calling
util_fpstate_set(). This was happening only with DRAW_USE_LLVM=0 or not
compiling with llvm, otherwise the llvm init code was calling it on time too.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2013-07-24 15:58:07 +02:00
Roland Scheidegger bceb5f36ec mesa: fix rgtc snorm decoding
The codeword must be unsigned (otherwise will shift in 1's from above when
merging low/high parts so some texels decode wrong).
This also affects gallium's util/u_format_rgtc.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-07-24 15:58:00 +02:00
Andre Heider 0acf3a8407 gallium/util: Fix detection of AVX cpu caps
For AVX it's not sufficient to only rely on the cpuid flags. If the CPU
supports these extensions, but the OS doesn't, issuing these insns will
trigger an undefined opcode exception.

In addition to the AVX cpuid bit we also need to:
* test cpuid for OSXSAVE support
* XGETBV to check if the OS saves/restores AVX regs on context switches

See "Detecting Availability and Support" at
http://software.intel.com/en-us/articles/introduction-to-intel-advanced-vector-extensions

Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-07-23 23:12:58 +01:00
Chris Forbes 5a7bdd4b41 docs: Add items for GL4.4
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-23 19:04:43 +12:00
Francisco Jerez df530829f7 clover: Respect kernel argument alignment restrictions.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-07-22 23:09:34 +02:00
Francisco Jerez f64c0ca692 clover: Extend kernel arguments for differing host and device data types.
Loosely based on a similar patch by Tom Stellard.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-07-22 23:09:34 +02:00
Francisco Jerez 829caf410e clover: Byte-swap kernel arguments when host and device endianness differ.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-07-22 23:09:22 +02:00
Francisco Jerez 2265b40e37 clover: Add kernel argument fields to allow differing host/target data types.
Loosely based on a similar patch by Tom Stellard.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-07-22 22:47:27 +02:00
Francisco Jerez a3dcab43c6 clover: Pass corresponding module::argument to kernel::argument::bind().
And remove size information from most kernel::argument derived
classes, it's no longer going to be necessary.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-07-22 22:45:41 +02:00
Tom Stellard 8c9d3c62f6 clover: Return correct value for CL_DEVICE_ENDIAN_LITTLE
Query the driver using PIPE_CAP_ENDIANNESS rather than always returning
true.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-07-22 22:45:20 +02:00
Tom Stellard 4e90bc9a12 gallium: Add PIPE_CAP_ENDIANNESS
Cc: mesa-stable@lists.freedesktop.org
[ Francisco Jerez: Fix "PIPE_ENDIAN_SMALL" in the documentation,
  define PIPE_ENDIAN_NATIVE. ]
2013-07-22 22:43:17 +02:00
Matt Turner c09a4cbbaf configure.ac: Use correct options names in AC_ARG_ENABLE. 2013-07-22 10:48:45 -07:00
Matt Turner 242a59d535 egl/build: Remove unused GLAPI_LIB. 2013-07-22 10:48:45 -07:00
Matt Turner 3647efa5c1 build: Remove unused EGL_PLATFORMS. 2013-07-22 10:48:45 -07:00
Matt Turner 5e4e145025 build: Add tests directories to SUBDIRS
Fixes a problem with distcheck.
2013-07-22 10:48:45 -07:00
Zack Rusin 7bae56c5c2 llvmpipe: Ensure FTZ/DAZ flags are set on deferred draw flushes.
Tested-by: José Fonseca <jfonseca@vmware.com>
2013-07-22 18:11:39 +01:00
José Fonseca 2a650611be llvmpipe: Remove lp_rast_get_num_threads().
Never called.

Trivial.
2013-07-22 18:08:39 +01:00
José Fonseca 190312949e scons: Don't use -z defs ld option on Mac.
Should fix fdo bug 67098.
2013-07-21 09:55:04 +01:00
Vinson Lee cd90ebefd4 glsl: Initialize ast_function member variables.
Fixes "Uninitialized pointer field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-07-21 00:23:17 -07:00