Compare commits

...

2081 Commits

Author SHA1 Message Date
Carl Worth
12484d2582 Update version for the 10.0.1 release.
It's so nice that this is updated in just a single place now. Thanks, Emil!
2013-12-12 21:34:55 -08:00
Carl Worth
d573899b93 Makefile: Add bin/test-driver to EXTRA_FILES
I'm not sure why this change is necessary. When I've built previous tar files
(such as 9.2.4) with the "make tarballs" target, they include the
bin/test-driver file. But at my first attempt to build the tar files for the
10.0.1 release this file was not being included and the build failed.
2013-12-12 21:33:02 -08:00
Carl Worth
142144e7fd docs: Add release notes for 10.0.1 2013-12-12 21:16:37 -08:00
Ilia Mirkin
a717ae1b2d nv50: report 15 max inputs for fragment programs
First off, nv50_program only has 16 in/out varyings. However reporting
16 makes 'm' become 68 in nv50_fp_linkage_validate with the
varying-packing-simple piglit test. (Subverting the assert makes it
compile but fail.) With this patch, varying-packing-simple passes.

See: https://bugs.freedesktop.org/show_bug.cgi?id=69155

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit bad8871e52)
2013-12-12 15:35:57 -08:00
Maarten Lankhorst
a876ea4b76 nouveau: Fix compiler warning regression
cfg is now unused, remove it.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5576ad11ed)
2013-12-12 15:35:34 -08:00
Dave Airlie
d7a71b7181 swrast: fix readback regression since inversion fix
This readback from the frontbuffer with swrast was broken, that bug
just made it more obviously broken, this fixes it by inverting the
sub image gets. Also fixes a few other piglits.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=72327
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=72325

(for 9.2 the patches this depends on were asked to be backported separately
 in an email).
Cc: "9.2" "10.0" mesa-stable@lists.fedoraproject.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

(cherry picked from commit 0b16042377)
2013-12-12 15:35:04 -08:00
Axel Davy
2776a496d4 Enable throttling in SwapBuffers
flush_with_flags, when available, allows the driver to throttle.
Using this suppress input lag issues that can be observed in heavy
rendering situations on non-intel cards.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.0" mesa-stable@lists.freedesktop.org
(cherry picked from commit afcce46fd5)
2013-12-12 15:34:27 -08:00
Kristian Høgsberg
1919ec6ba4 egl/wayland: Send commit after flushing the driver context
This typically won't make a difference, since we only send the requests at
wl_display_flush() time.  There might be a small race
with another thread calling wl_display_flush() after our commit request,
but before we flush the DRI driver.  Moving the commit below the DRI
driver flush call looks more natural and eliminates the small race.

Cc: "10.0" mesa-stable@lists.freedesktop.org
(cherry picked from commit 33eb5eabee)
2013-12-12 15:33:59 -08:00
Axel Davy
188c60143b egl/wayland: Flush the wl_display at the end of SwapBuffers
We would like the compositor to receive the commited buffer
as soon as possible, so it has the time to treat it, and
release old ones. We shouldn't rely on the client
to flush the queue for us.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.0" mesa-stable@lists.freedesktop.org
(cherry picked from commit 402bf6e8d0)
2013-12-12 15:33:33 -08:00
Kristian Høgsberg
d0f606ffbd egl/wayland: Damage INT32_MAX x INT32_MAX region for eglSwapBuffers
If we're not using EGL_EXT_swap_buffers_with_damage, we have to
damage the full extent.  EGL operates on buffer coordinates, but
wl_surface.damage takes surface coordinates.  EGL doesn't know the
buffer transformation (rotated or scaled) and can't post accurate
damage in surface coordinates.  The damage event however is clipped to
the surface extents so we can just damage the maximum rectangle.

In case of EGL_EXT_swap_buffers_with_damage, the application knows
the buffer transform and is expected to pass in rectangles in
surface space.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70250
Cc: "10.0" mesa-stable@lists.freedesktop.org
Tested-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
(cherry picked from commit bce64c6c83)
2013-12-09 17:41:23 -08:00
Jordan Justen
fdede18275 dri megadriver_stub: add compatibility for older DRI loaders
To help the transition period when DRI loaders are being updated
to support the newer __driDriverExtensions_foo mechanism,
we populate __driDriverExtensions with the extensions returned
by __driDriverExtensions_foo during a library contructor
function.

We find the driver foo's name by using the dladdr function
which gives the path of the dynamic library's name that
was being loaded.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4859d492b2)
2013-12-09 17:28:20 -08:00
Tom Stellard
4cbd424631 r300/compiler/tests: Fix line length check in test parser
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

CC: "9.2" "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9a5ce0c4c9)
2013-12-09 17:28:15 -08:00
Tom Stellard
331a8a3586 r300/compiler/tests: Fix segfault
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

CC: "9.2" "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1896431f79)
2013-12-09 17:28:09 -08:00
Ilia Mirkin
f528981f1a nouveau/video: update a few more h264 picparm field names
Based on comments by Benjamin Morris <bmorris@nvidia.com> in
http://lists.freedesktop.org/archives/nouveau/2013-December/015328.html

This adds setting of is_long_term, and updates a few field names we were
unclear about.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2cd2b9705e)
2013-12-09 17:28:07 -08:00
Ilia Mirkin
d5f1a270ef nouveau/video: update h264 picparm field names based on usage
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 78525dae8a)
2013-12-09 17:28:04 -08:00
Ilia Mirkin
f4f1159716 nv50: enable h264 and mpeg4 for nv98+ (vp3, vp4.0)
Create the ref_bo without any storage type flags set for now. The issue
probably arises from our use of the additional buffer space at the end
of the ref_bo. It should probably be split up in the future.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Martin Peres <martin.peres@labri.fr>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e01ba9d6b0)
2013-12-09 17:28:01 -08:00
Ian Romanick
b531dcaec4 glsl: Don't emit empty declaration warning for a struct specifier
The intention is that things like

   int;

will generate a warning.  However, we were also accidentally emitting
the same warning for things like

  struct Foo { int x; };

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68838
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Aras Pranckevicius <aras@unity3d.com>
Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 758658850b)
2013-12-09 17:27:40 -08:00
Ilia Mirkin
b160fea306 nv50: wait on the buf's fence before sticking it into pushbuf
This resolves some rendering issues in source games.
See https://bugs.freedesktop.org/show_bug.cgi?id=64323

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 0e5bf85651)
2013-12-06 10:51:49 -08:00
Ilia Mirkin
05d2a796a0 nouveau: avoid leaking fences while waiting
This fixes a memory leak in some situations. Also avoids emitting an
extra fence if the kick handler does the call to nouveau_fence_next
itself.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ce6dd69697)
2013-12-06 10:51:45 -08:00
Ilia Mirkin
de517d2bb3 nv50: Fix GPU_READING/WRITING bit removal
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
CC: "9.1, 9.2, 10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c45cf6199f)
2013-12-06 10:51:18 -08:00
Ian Romanick
8991193f70 Remove a057b83 from the pick list
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-06 09:42:58 -08:00
Ilia Mirkin
6c00504a8a mesa: don't leak performance monitors on context destroy
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 267679be84)
2013-12-06 08:09:03 -08:00
Emil Velikov
e6710f4217 automake: include only one copy VERSION in tarball
The VERSION file is tracked by git (git ls-files), thus
adding it to EXTRA_FILES will result in a duplicate copy
within the final tarball.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72230
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reported-by: Patrick Steinhardt <ps@pks.im>
Tested-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 507c2356e3)
2013-12-06 08:08:09 -08:00
Chad Versace
31751bd40b i965: Add extra-alignment for non-msrt fast color clear for all hw (v2)
The BSpec states that the aligment for the non-msrt clear rectangle must
be doubled; the BSpec does not restricit the workaround to specific
hardware.

Commit 9a1a67b applied the workaround to Haswell GT3.  Commit 8b659ce
expanded the workaround to all Haswell variants. This commit expands it
to all hardware.

No Piglit regressions on Ivybridge 0x0166. No fixes either.

I know no Ivybridge nor Baytrail bug related to this workaround.
However, the BSpec says the extra alignment is required, so let's do it.

v2: Apply to all hardware, not just gen7.

CC: "9.2, 10.0" <mesa-stable@lists.freedesktop.org>
CC: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 998018d7be)
2013-12-06 08:08:09 -08:00
Chad Versace
edca52e6e7 i965/hsw: Apply non-msrt fast color clear w/a to all HSW GTs
Pre-patch, the workaround was applied to only HSW GT3. However, the
workaround also fixes render corruption on the HSW GT1 Chromebook,
codenamed Falco.

Also, update the BSpec quote that discusses the workaround to reflect
the latest BSpec.

The BSpec states that the workaround is required for Ivybridge and
Baytrail as well as Haswell. But, we apply the workaround to only
Haswell because (a) we suspect that is the only hardware where it is
actually required and (b) we haven't yet validated the workaround for
the other hardware.

CC: "9.2, 10.0" <mesa-stable@lists.freedesktop.org>
CC: Anuj Phogat <anuj.phogat@gmail.com>
OTC-Tracker: CHRMOS-812
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 8b659cef3a)
2013-12-06 08:08:09 -08:00
Paul Berry
2457b5bfa4 i965/gen6: Fix multisample resolve blits for luminance/intensity 32F formats.
On gen6, multisamble resolve blits use the SAMPLE message to blend
together the 4 samples for each texel.  For some reason, SAMPLE
doesn't blend together the proper samples when the source format is
L32_FLOAT or I32_FLOAT, resulting in blocky artifacts.

To work around this problem, sample from the source surface using
R32_FLOAT.  This shouldn't affect rendering correctness, because when
doing these resolve blits, the destination format is R32_FLOAT, so the
channel replication done by L32_FLOAT and I32_FLOAT is unnecessary.

Fixes piglit tests on Sandy Bridge:
- spec/ARB_texture_float/multisample-formats 2 GL_ARB_texture_float
- spec/ARB_texture_float/multisample-formats 4 GL_ARB_texture_float

No piglit regressions on Sandy Bridge.

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

Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c4cf487315)
2013-12-06 08:08:09 -08:00
Thomas Hellstrom
edb4956932 st/xa: Bump major version number to 2
For some reason this was left out when the version was changed...

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2013-12-06 06:14:37 -08:00
Ian Romanick
643f986942 docs: Add 10.0 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-30 23:29:21 -08:00
Ian Romanick
724c07ff12 mesa: Bump version to 10.0 (final)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-30 23:25:47 -08:00
Ian Romanick
56d1ba17f1 docs: Update release notes for 10.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-30 23:25:28 -08:00
Kenneth Graunke
44e38a878a i965: Always reserve binding table space for at least one render target.
In brw_update_renderbuffer_surfaces(), if there are no color draw
buffers, we always set up a null render target at surface index 0 so we
have something to use with the FB write marking the end of thread.

However, when we recently began computing surface indexes dynamically,
we failed to reserve space for it.  This meant that the first texture
would be assigned surface index 0, and our closing FB write would
clobber the texture.

Fixes Piglit's EXT_packed_depth_stencil/fbo-blit-d24s8 test on Gen4-5,
which regressed as of commit 4e5306453d
("i965/fs: Dynamically set up the WM binding table offsets.")

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70605
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Tested-by: lu hua <huax.lu@intel.com>
Cc: "10.0" mesa-stable@lists.freedesktop.org
(cherry picked from commit c4815f6cd6)
2013-11-28 08:37:40 -08:00
Ian Romanick
93dfd0522f dri: Allow __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS in driCreateContextAttribs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reported-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 73e9aa9e3f)
2013-11-28 08:37:39 -08:00
Ian Romanick
a5f78c4025 i965: Only enable __DRI2_ROBUSTNESS if kernel support is available
This is a squash of the following two cherry-picked patches:

    i965: Only enable __DRI2_ROBUSTNESS if kernel support is available

    Rather than always advertising the extension but failing to create a
    context with reset notifiction, just don't advertise it.  I don't know
    why it didn't occur to me to do it this way in the first place.

    NOTE: Kristian requested that I provide a follow-up for master that
    dynamically generates the list of DRI extensions instead of selected
    between two hardcoded lists.

    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Suggested-by: Kristian Høgsberg <krh@bitplanet.net>
    Reviewed-by: Matt Turner <mattst88@gmail.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
    Cc: "10.0" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 9b1c68638d)

and

    i965: Properly reject __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS when __DRI2_ROBUSTNESS is not enabled

    Only allow __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS in brwCreateContext if
    intelInitScreen2 also enabled __DRI2_ROBUSTNESS (thereby enabling
    GLX_ARB_create_context).

    This fixes a regression in the piglit test
    "glx/GLX_ARB_create_context/invalid flag"

    v2: Remove commented debug code.  Noticed by Jordan.

    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reported-by: Paul Berry <stereotype441@gmail.com>
    Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
    Reviewed-by: Matt Turner <mattst88@gmail.com>
    Cc: "10.0" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 53a65e547c)
2013-11-28 08:36:51 -08:00
Ian Romanick
9ec00c187c i965: Bump libdrm requirement
drm_intel_get_reset_stats is only available in libdrm-2.4.48, and
libdrm-2.4.49 contains an important bug fix in that function.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit cb728bb028)
2013-11-28 08:35:28 -08:00
Francisco Jerez
5ec641bbc9 glsl: Initialize _mesa_glsl_parse_state::atomic_counter_offsets before using it.
Cc: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6b2b4cc885)
2013-11-26 21:04:52 -08:00
Paul Berry
444a621e55 glsl: Fix lowering of direct assignment in lower_clip_distance.
In commit 065da16 (glsl: Convert lower_clip_distance_visitor to be an
ir_rvalue_visitor), we failed to notice that since
lower_clip_distance_visitor overrides visit_leave(ir_assignment *),
ir_rvalue_visitor::visit_leave(ir_assignment *) wasn't getting called.
As a result, clip distance dereferences appearing directly on the
right hand side of an assignment (not in a subexpression) weren't
getting properly lowered.  This caused an ir_dereference_variable node
to be left in the IR that referred to the old gl_ClipDistance
variable.  However, since the lowering pass replaces gl_ClipDistance
with gl_ClipDistanceMESA, this turned into a dangling pointer when the
IR got reparented.

Prior to the introduction of geometry shaders, this bug was unlikely
to arise, because (a) reading from gl_ClipDistance[i] in the fragment
shader was rare, and (b) when it happened, it was likely that it would
either appear in a subexpression, or be hoisted into a subexpression
by tree grafting.

However, in a geometry shader, we're likely to see a statement like
this, which would trigger the bug:

    gl_ClipDistance[i] = gl_in[j].gl_ClipDistance[i];

This patch causes
lower_clip_distance_visitor::visit_leave(ir_assignment *) to call the
base class visitor, so that the right hand side of the assignment is
properly lowered.

Fixes piglit test:
- spec/glsl-1.50/execution/geometry/clip-distance-itemized-copy

Cc: Ian Romanick <idr@freedesktop.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 9dfcb05fa6)
2013-11-26 21:04:52 -08:00
Paul Berry
756b4f9a8c i965/gs: Set GS prog_data to NULL if there is no GS program.
The previous commit fixes a bug wherein we would incorrectly refer to
stale geometry shader prog_data when no geometry shader was active.

This patch reduces the likelihood of that sort of bug occurring in the
future by setting prog_data to NULL whenever there is no GS program.

Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 37bdde1087)
2013-11-26 21:04:52 -08:00
Paul Berry
d963daa380 i965/gs: Properly skip GS binding table upload when no GS active.
Previously, in brw_gs_upload_binding_table(), we checked whether
brw->gs.prog_data was NULL in order to determine whether a geometry
shader was active.  This didn't work: brw->gs.prog_data starts off as
NULL, but it is set to non-NULL when a geometry shader program is
built, and then never set to NULL again.  As a result, if we called
brw_gs_upload_binding_table() while there was no geometry shader
active, but a geometry shader had previously been active, it would
refer to a stale (and possibly freed) prog_data structure.

This patch fixes the problem by modifying
brw_gs_upload_binding_table() to use the proper technique to determine
whether a geometry shader is active: by checking whether
brw->geometry_program is NULL.

This fixes the crash reported in comment 2 of bug 71870 (the incorrect
rendering remains, however).

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

Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 2714ca81b9)
2013-11-26 21:04:51 -08:00
Tom Stellard
bab6f40b29 radeon/compute: Unconditionally inline all functions v2
We need to do this until function calls are supported.

v2:
  - Fix loop conditional

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

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ddc77c5092)
2013-11-26 13:10:29 -08:00
Kenneth Graunke
c0c3fa564b i965: Use __attribute__((flatten)) on fast tiled teximage code.
The fast tiled texture upload code does not compile with GCC 4.8's -Og
optimization flag.

memcpy() has the always_inline attribute set.  This poses a problem,
since {x,y}tile_copy_faster calls it indirectly via {x,y}tile_copy,
and {x,y}tile_copy normally aren't inlined at -Og.

Using __attribute__((flatten)) tells GCC to inline every function call
inside the function, which I believe was the author's intent.

Fix suggested by Alexander Monakov.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit ad542a10c5)
2013-11-26 13:09:41 -08:00
Maarten Lankhorst
ec013f809b gbm/dri: hide extension loader symbols
They should not be exposed.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5455c818b5)
2013-11-26 13:09:29 -08:00
Ian Romanick
866ce39ca0 mesa: Bump version to 10.0.0-rc2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-23 17:23:00 -08:00
Ian Romanick
48e4daf977 Remove 068a073 from the pick list
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-23 17:20:36 -08:00
Eric Anholt
1efe2ef620 i965: Fix streamed state dumping/annotation after the blorp-flush change.
I think I was thinking of the batch command packet cache when I pasted
this in, but this counter is only used for dumping out streamed state for
INTEL_DEBUG=batch and for putting annotations in our aub files.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 5891f98145)
2013-11-23 12:55:04 -08:00
Paul Berry
47ff55fa86 mesa: Implement GL_FRAMEBUFFER_ATTACHMENT_LAYERED query.
From section 6.1.18 (Renderbuffer Object Queries) of the GL 3.2 spec,
under the heading "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is TEXTURE, then":

    If pname is FRAMEBUFFER_ATTACHMENT_LAYERED, then params will
    contain TRUE if an entire level of a three-dimesional texture,
    cube map texture, or one-or two-dimensional array texture is
    attached. Otherwise, params will contain FALSE.

Fixes piglit tests:
- spec/!OpenGL 3.2/layered-rendering/framebuffer-layered-attachments
- spec/!OpenGL 3.2/layered-rendering/framebuffertexture-defaults

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>

v2: Don't include "EXT" in the error message, since this query only
makes sensen in context versions that have adopted
glGetFramebufferAttachmentParameteriv().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit ec79c05cbf)
2013-11-23 12:55:04 -08:00
Paul Berry
8f4d95d41c mesa: Fix texture target validation for glFramebufferTexture()
Previously we were using the code path for validating
glFramebufferTextureLayer().  But glFramebufferTexture() allows
additional texture types.

Fixes piglit tests:
- spec/!OpenGL 3.2/layered-rendering/gl-layer-cube-map
- spec/!OpenGL 3.2/layered-rendering/framebuffertexture

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>

v2: Clarify comment above framebuffer_texture().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit af1471dc04)
2013-11-23 12:55:04 -08:00
Paul Berry
79d727e063 i965: Fix fast clear of depth buffers.
From section 4.4.7 (Layered Framebuffers) of the GLSL 3.2 spec:

    When the Clear or ClearBuffer* commands are used to clear a
    layered framebuffer attachment, all layers of the attachment are
    cleared.

This patch fixes the fast depth clear path.

Fixes piglit test "spec/!OpenGL 3.2/layered-rendering/clear-depth".

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 0831523350)
2013-11-23 12:55:04 -08:00
Paul Berry
7f99ae72c4 i965: Fix blorp clear of layered framebuffers.
From section 4.4.7 (Layered Framebuffers) of the GLSL 3.2 spec:

    When the Clear or ClearBuffer* commands are used to clear a
    layered framebuffer attachment, all layers of the attachment are
    cleared.

This patch fixes the blorp clear path for color buffers.

Fixes piglit test "spec/!OpenGL 3.2/layered-rendering/clear-color".

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit c1019670ea)
2013-11-23 12:55:04 -08:00
Paul Berry
e934782b2a i965: refactor blorp clear code in preparation for layered clears.
Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 1ec5365429)
2013-11-23 12:55:04 -08:00
Paul Berry
ffa073ec72 mesa: Track number of layers in layered framebuffers.
In order to properly clear layered framebuffers, we need to know how
many layers they have.  The easiest way to do this is to record it in
the gl_framebuffer struct when we check framebuffer completeness.

This patch replaces the gl_framebuffer::Layered boolean with a
gl_framebuffer::NumLayers integer, which is 0 if the framebuffer is
not layered, and equal to the number of layers otherwise.

v2: Remove gl_framebuffer::Layered and make gl_framebuffer::NumLayers
always have a defined value.  Fix factor of 6 error in the number of
layers in a cube map array.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 95140740ad)
2013-11-23 12:47:05 -08:00
Tom Stellard
620d11aed4 radeonsi/compute: Fix LDS size calculation
We need to include the number of LDS bytes allocated by the state tracker.

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1bdb99330a)
2013-11-23 12:46:59 -08:00
Tom Stellard
c8cf5dc401 r600g/compute: Add a work-around for flushing issues on Cayman
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>

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

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7a30cd7085)
2013-11-23 12:46:22 -08:00
Paul Berry
a645df0134 glsl: Fix interstage uniform interface block link error detection.
Previously, we checked for interstage uniform interface block link
errors in validate_interstage_interface_blocks(), which is only called
on pairs of adjacent shader stages.  Therefore, we failed to detect
uniform interface block mismatches between non-adjacent shader stages.

Before the introduction of geometry shaders, this wasn't a problem,
because the only supported shader stages were vertex and fragment
shaders, therefore they were always adjacent.  However, now that we
allow a program to contain vertex, geometry, and fragment shaders,
that is no longer the case.

Fixes piglit test "skip-stage-uniform-block-array-size-mismatch".

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

v2: Rename validate_interstage_interface_blocks() to
validate_interstage_inout_blocks() to reflect the fact that it no
longer validates uniform blocks.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

v3: Make validate_interstage_inout_blocks() skip uniform blocks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 544e3129c5)
2013-11-23 12:45:16 -08:00
Paul Berry
3470916d6a glsl: Fix cross-version linking between VS and GS.
Previously, when attempting to link a vertex shader and a geometry
shader that use different GLSL versions, we would sometimes generate a
link error due to the implicit declaration of gl_PerVertex being
different between the two GLSL versions.

This patch fixes that problem by only requiring interface block
definitions to match when they are explicitly declared.

Fixes piglit test "shaders/version-mixing vs-gs".

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

v2: In the interface_block_definition constructor, move the assignment
to explicitly_declared after the existing if block.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 0f4cacbb53)
2013-11-23 12:44:18 -08:00
Paul Berry
320f2fa45d glsl: Prohibit illegal mixing of redeclarations inside/outside gl_PerVertex.
From section 7.1 (Built-In Language Variables) of the GLSL 4.10
spec:

    Also, if a built-in interface block is redeclared, no member of
    the built-in declaration can be redeclared outside the block
    redeclaration.

We have been regarding this text as a clarification to the behaviour
established for gl_PerVertex by GLSL 1.50, so we apply it regardless
of GLSL version.

This patch enforces the rule by adding an enum to ir_variable to track
how the variable was declared: implicitly, normally, or in an
interface block.

Fixes piglit tests:
- gs-redeclares-pervertex-out-after-global-redeclaration.geom
- vs-redeclares-pervertex-out-after-global-redeclaration.vert
- gs-redeclares-pervertex-out-after-other-global-redeclaration.geom
- vs-redeclares-pervertex-out-after-other-global-redeclaration.vert
- gs-redeclares-pervertex-out-before-global-redeclaration
- vs-redeclares-pervertex-out-before-global-redeclaration

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

v2: Don't set "how_declared" redundantly in builtin_variables.cpp.
Properly clone "how_declared".

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 2bbcf19aca)
2013-11-23 12:42:47 -08:00
Tapani Pälli
2747e72036 mesa: enable GL_TEXTURE_LOD_BIAS set/get
Earlier comments suggest this was removed from GL core spec but it is
still there. Enabling makes 'texture_lod_bias_getter' Khronos
conformance tests pass, also removes some errors from Metro Last Light
game which is using this API.

v2: leave NOTE comment (Ian)

Cc: "9.0 9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 7e61b44dcd)
2013-11-23 12:41:46 -08:00
Dave Airlie
d4b7ff7fe0 glx: don't fail out when no configs if we have visuals
GLX 1.2 servers with no SGIX_fbconfigs exist (some citrix thing),
and we fail glxinfo completely in those cases.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit b01a3a9b72)
2013-11-23 12:41:41 -08:00
Dave Airlie
63b02533f0 mesa/swrast: fix inverted front buffer rendering with old-school swrast
I've no idea when this broke, but we have some people who wanted it fixed,
so here's my attempt.

reproducer, run readpix with swrast hit f, or run trival tri -sb things are
upside down, after this patch they aren't.

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

Cc: <mesa-stable@lists.freedesktop.org>"
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit a43b49dfb1)
2013-11-23 12:41:35 -08:00
Matt Turner
19f05b26ba i965: Link -ldl after libmesa.la
DLOPEN_LIBS is part of DRI_LIB_DEPS.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71512
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1f9092958d)
2013-11-23 12:40:34 -08:00
Brian Paul
11da04e1bb st/mesa: fix GL_FEEDBACK mode inverted Y coordinate bug
We need to check the drawbuffer's orientation before inverting Y
coordinates.  Fixes piglit feedback tests when running with the
-fbo option.

Cc: "9.2" "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 15d8e05e1e)
2013-11-23 12:40:29 -08:00
Paul Berry
989d650090 i965/vec4: Fix broken IR annotation in debug output.
Commit 70953b5 (i965: Initialize all member variables of
vec4_instruction on construction) inadvertently added a line to the
vec4_instruction constructor setting this->ir to NULL, wiping out the
previously set value.  As a result, ever since then, the output of
INTEL_DEBUG=vs and INTEL_DEBUG=gs has been missing IR annotations.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 60b1a118e1)
2013-11-23 12:40:20 -08:00
Tom Stellard
9495fb4fff r600g/compute: Fix handling of global buffers in r600_resource_copy_region()
Global buffers do not have an associate cs_buf handle, so
we can't copy them using r600_copy_buffer()

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

Reviewed-by: Marek Ol????k <marek.olsak@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1b9511d7ce)
2013-11-23 12:39:45 -08:00
Tom Stellard
521c59f132 gallium: Pass version scripts to linker using --version-script=
This fixes build failures with the gold linker.

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 17930a66aa)
2013-11-23 12:36:07 -08:00
Tom Stellard
eafb9f6756 clover: Optionally return context's devices from clGetProgramInfo()
The spec allows clGetProgramInfo() to return information about either
the devices associated with the program or the devices associated
with the context.  If there are no devices associated with the program,
then we return devices associated with the context.

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

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a84dd2398f)
2013-11-23 12:34:16 -08:00
Paul Berry
5af1fb5324 i965/gen7: Emit workaround flush when changing GS enable state.
v2: Don't go to extra work to avoid extraneous flushes.  (Previous
experiments in the kernel have suggested that flushing the pipeline
when it is already empty is extremely cheap).

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 7dfb4b2d00)
2013-11-23 12:33:17 -08:00
Emil Velikov
0040edcf9d docs: indicate GLX_MESA_query_renderer's completion
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit d33d260b90)
2013-11-23 12:32:38 -08:00
Emil Velikov
defff44e1c docs: add a note about removed state tracker/targets
The X.Org state tracker is gone, as well as the xvmc/vdpau
r300 and softpipe targets.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit ca9794658e)
2013-11-23 12:32:34 -08:00
Vadim Girlin
8f78b06dca r600g/sb: work around hw issues with stack on eg/cm
v2: make it actually work, improve condition

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68503
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
(cherry picked from commit 4cb04aa0df)
2013-11-23 12:32:28 -08:00
Vinson Lee
367241ec64 i965: Add missing break in SHADER_OPCODE_GEN7_SCRATCH_READ case.
Fixes "Missing break in switch" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b570c4229f)
2013-11-23 12:23:08 -08:00
Ian Romanick
15118b45a0 mesa: Bump version to 10.0.0-rc1 2013-11-18 12:23:56 -08:00
Aaron Watry
3fd32619d7 radeon/llvm: Free elf_buffer after use
Prevents a memory leak.

v2: Remove null check

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2be85e2492)
2013-11-15 13:39:41 -08:00
Aaron Watry
7a87dc278e r600/llvm: Free binary.code/binary.config in r600_llvm_compile
radeon_llvm_compile allocates memory for binary.code, binary.config,
or neither depending on what's being done.

We need to make sure to free that memory after it's no longer needed.

v2: Don't bother checking for null before FREE()

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 01f3622c74)
2013-11-15 13:39:41 -08:00
Aaron Watry
f843604b6a r600/llvm: initialize radeon_llvm_binary
use memset to initialize to 0's... otherwise code_size and config_size
could be uninitialized when read later in this method.

It's also hard to do NULL checks on uninitialized pointers.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

v2: Fix indentation

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit dd73b99420)
2013-11-15 13:39:41 -08:00
Brian Paul
e9f8b78278 svga: mark dest image as defined in svga_surface_copy()
After we blit/copy to a dest texture image we need to mark it as
being defined.  This fixes broken mipmap generation for quite a
few texture formats.  Mipgen involves making texture views and
svga_texture_view_surface() skips texture images that are undefined.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 3969330b47)
2013-11-15 13:39:41 -08:00
Brian Paul
dfff838429 svga: do primitive trimming in translate_indices()
The index translation code expects the number of indexes to be
consistent with the primitive type (ex: a multiple of 3 for
PIPE_PRIM_TRIANGLES).  If it's not, we can write out of bounds
in the destination buffer.

Fixes failed assertions in the pipebuffer debug code found with
Piglit primitive-restart-draw-mode test.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 79984b9928)
2013-11-15 13:39:41 -08:00
Aaron Watry
11982ca08d gallium/pipe_loader: un-reference udev resources when we're done with them.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 598f61ba28)
2013-11-15 13:39:41 -08:00
Aaron Watry
713966c82f radeonsi/compute: Dispose of LLVM module after compiling kernels
v2: Fix indentation

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4c6ac9e614)
2013-11-15 13:39:41 -08:00
Aaron Watry
3a98fc6abe radeonsi/compute: Free program and program.kernels on shutdown
v2: Fix indentation

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 35dad4a1e2)
2013-11-15 13:39:41 -08:00
Aaron Watry
531637feee radeon/llvm: Free created llvm memory buffer
v2: Fix indentation

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d41b10f811)
2013-11-15 13:39:41 -08:00
Aaron Watry
02807c06b8 radeon/llvm: Free libelf resources
v2: Fix indentation

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a2b93da84b)
2013-11-15 13:39:40 -08:00
Aaron Watry
9ed0452740 radeon/llvm: fix spelling error
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit df482fe02f)
2013-11-15 13:39:40 -08:00
Tom Stellard
ef8fcfc9cf clover: Support multiple devices in clCreateContextFromType() v2
v2:
  - Use clGetDeviceIDs to query devices.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 17af4dd52b)
2013-11-15 13:39:40 -08:00
Paul Berry
1b45f255b5 glsl: Rework interface block linking.
Previously, when doing intrastage and interstage interface block
linking, we only checked the interface type; this prevented us from
catching some link errors.

We now check the following additional constraints:

- For intrastage linking, the presence/absence of interface names must
  match.

- For shader ins/outs, the interface names themselves must match when
  doing intrastage linking (note: it's not clear from the spec whether
  this is necessary, but Mesa's implementation currently relies on
  it).

- Array vs. nonarray must be consistent, taking into account the
  special rules for vertex-geometry linkage.

- Array sizes must be consistent (exception: during intrastage
  linking, an unsized array matches a sized array).

Note: validate_interstage_interface_blocks currently handles both
uniforms and in/out variables.  As a result, if all three shader types
are present (VS, GS, and FS), and a uniform interface block is
mentioned in the VS and FS but not the GS, it won't be validated.  I
plan to address this in later patches.

Fixes the following piglit tests in spec/glsl-1.50/linker:
- interface-blocks-vs-fs-array-size-mismatch
- interface-vs-array-to-fs-unnamed
- interface-vs-unnamed-to-fs-array
- intrastage-interface-unnamed-array

v2: Simplify logic in intrastage_match() for handling array sizes.
Make extra_array_level const.  Use an unnamed temporary
interface_block_definition in validate_interstage_interface_blocks()'s
first call to definitions->store().

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit f38ac41ed4)
2013-11-15 13:39:40 -08:00
Paul Berry
1a163c0b34 i965: Fix vertical alignment for multisampled buffers.
From the Sandy Bridge PRM, Vol 1 Part 1 7.18.3.4 (Alignment Unit
Size):

    j [vertical alignment] = 4 for any render target surface is
    multisampled (4x)

From the Ivy Bridge PRM, Vol 4 Part 1 2.12.2.1 (SURFACE_STATE for most
messages), under the "Surface Vertical Alignment" heading:

    This field is intended to be set to VALIGN_4 if the surface was
    rendered as a depth buffer, for a multisampled (4x) render target,
    or for a multisampled (8x) render target, since these surfaces
    support only alignment of 4.

Back in 2012 when we added multisampling support to the i965 driver,
we forgot to update the logic for computing the vertical alignment, so
we were often using a vertical alignment of 2 for multisampled
buffers, leading to subtle rendering errors.

Note that the specs also require a vertical alignment of 4 for all
Y-tiled render target surfaces; I plan to address that in a separate
patch.

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit b4c3b833ec)
2013-11-15 13:39:40 -08:00
Paul Berry
53e681f2fe main: Fix MaxUniformComponents for geometry shaders.
For both vertex and fragment shaders we default MaxUniformComponents
to 4 * MAX_UNIFORMS.  It makes sense to do this for geometry shaders
too; if back-ends have different limits they can override them as
necessary.

Fixes piglit test:
spec/glsl-1.50/built-in constants/gl_MaxGeometryUniformComponents

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 46e9f78efc)
2013-11-15 13:39:40 -08:00
Fredrik Höglund
10c25e58ca mesa: Fix derived vertex state not being updated in glCallList()
AEcontext::NewState is not always set when the vertex array state
is changed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71492
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit ff353c218a)
2013-11-15 13:39:40 -08:00
Ian Romanick
0558e10160 dri: Change value param to unsigned
This silences some compiler warnings in i915 and i965.  See also
75982a5.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a15a19f0d1)
2013-11-15 13:39:40 -08:00
Ian Romanick
1e51d3a668 i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB
Systems with little physical memory installed will report less than
2GiB, and some systems may (hypothetically?) have a larger address space
for the GPU.  My IVB still reports 1534.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit cb6182bdfa)
2013-11-15 13:39:39 -08:00
Ian Romanick
e5839c2397 i915: Use drm_intel_get_aperture_sizes instead of drmAgpSize
Send the zombie back to the grave before it infects the townsfolk.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9fe108db09)
2013-11-15 13:39:39 -08:00
Kristian Høgsberg
7d2187176a dri: Remove redundant createNewContext function from __DRIimageDriverExtension
createContextAttribs is a superset of what createNewContext provides.
Also remove the function typedef, since createNewContext is deprecated
and no longer used in  multiple interfaces.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e048953145)
2013-11-15 13:39:39 -08:00
Kristian Høgsberg
329a75511f wayland: Use __DRIimage based getBuffers implementation when available
This lets us allocate color buffers as __DRIimages and pass them into
the driver instead of having to create a __DRIbuffer with the flink
that requires.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 68bb26bead)
2013-11-15 13:39:39 -08:00
Kristian Høgsberg
76434775e0 gbm: Add support for __DRIimage based getBuffers when available
This lets us allocate color buffers as __DRIimages and pass them into
the driver instead of having to create a __DRIbuffer with the flink
that requires.

With this patch, we can now run gbm on render-nodes.  A render-node is a
drm device that doesn't support modesetting and all the legacy DRI ioctls.
flink is also not supported, but now that gbm doesn't need flink, we can
run piglit on head-less gbm or head-less GPGPU.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 04e3ef00db)
2013-11-15 13:39:39 -08:00
Ander Conselvan de Oliveira
2365244302 dri/i915, dri/i965: Fix support for planar images
Planar images have format __DRI_IMAGE_FORMAT_NONE, but the patch that
moved the conversion from dri_format to the mesa format made it
impossible to allocate a image with that format.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5ba6be2617)
2013-11-15 13:39:39 -08:00
Eric Anholt
3e6f200250 i965/fs: Try a different pre-scheduling heuristic if the first spills.
Since LIFO fails on some shaders in one particular way, and non-LIFO
systematically fails in another way on different kinds of shaders, try
them both, and pick whichever one successfully register allocates first.
Slightly prefer non-LIFO in case we produce extra dependencies in register
allocation, since it should start out with fewer stalls than LIFO.

This is madness, but I haven't come up with another way to get unigine
tropics to not spill while keeping other programs from not spilling and
retaining the non-unigine performance wins from texture-grf.

total instructions in shared programs: 1626728 -> 1626288 (-0.03%)
instructions in affected programs:     1015 -> 575 (-43.35%)
GAINED:                                50
LOST:                                  0

Improves Unigine Tropics performance by 14.5257% +/- 0.241838% (n=38)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70445
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit e9daead784)
2013-11-15 13:39:39 -08:00
Eric Anholt
99c62ff2ea i965/fs: Do instruction pre-scheduling just before register allocation.
Long ago, the HW_REG usage in assign_curb/urb_setup() were scheduling
barriers, so we had to run scheduler before them in order for it to be
able to do basically anything.  Now that that's fixed, we can delay the
scheduling until we go to allocate (which will make the next change less
scary).

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit fbd8303a94)
2013-11-15 13:39:39 -08:00
Eric Anholt
a5a6ef9702 i965/fs: Ignore actual latency pre-reg-alloc.
We care about depth-until-program-end, as a proxy for "make sure I
schedule those early instructions that open up the other things that can
make progress while keeping register pressure low", not actual latency
(since we're relying on the post-register-alloc scheduling to actually
schedule for the hardware).

total instructions in shared programs: 1609931 -> 1609931 (0.00%)
instructions in affected programs:     0 -> 0
GAINED:                                55
LOST:                                  43

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit f72a0d99fe)
2013-11-15 13:39:39 -08:00
Eric Anholt
6640147463 i965/fs: Fix message setup for SIMD8 spills.
In the SIMD16 spilling changes, I replaced a "1" in the spill path with
"mlen", but obviously it wasn't mlen before because spills have the g0
header along with the payload. The interface I was trying to use was
asking for how many physical regs we're writing, so we're looking for "1"
or "2".

I'm guessing this actually passed piglit because the high 8 bits of the
execution mask in SIMD8 mode are all 0s.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 7c90947a0b)
2013-11-15 13:39:38 -08:00
Eric Anholt
229ee20460 i965/fs: Prefer things we know reduce reg pressure when pre-scheduling.
Previously, the best thing we had was to schedule the things unblocked by
the last chosen instruction, on the hope that it would be consuming two
values at the end of their live intervals while only producing one new
value.  But that's just a guess, and we can do counting of usage of
registers to know when an instruction would (almost surely) reduce
register pressure.

The only failure mode I know of in this new dominant heuristic is that
inside of a loop when scheduling the iterator (for example), choosing the
last use of the iterator doesn't actually reduce the live interval of the
iterator.  But it doesn't seem to matter in shader-db:

total instructions in shared programs: 1618700 -> 1618700 (0.00%)
instructions in affected programs:     0 -> 0
GAINED:                                13
LOST:                                  0

Note: The new functions are made virtual because I expect we'll soon lift
the pre-regalloc scheduling heuristic over to the vec4 backend.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit bc0e3bb4d0)
2013-11-15 13:39:38 -08:00
Eric Anholt
dbddd86cc2 i965: Fix undefined value usage in ABO setup.
Fixes a compiler warning.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 9b3e1592c2)
2013-11-15 13:39:38 -08:00
Francisco Jerez
c702f5eead clover: Fix the const variant of adaptor_range::end to deal with mismatching range sizes.
Fixes infinite loop in find_grid_optimal_factor() in cases where the
user specifies a grid size with less dimensions than the device
supports.

Reported-by: Tom Stellard <thomas.stellard@amd.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 99d447cc5d)
2013-11-15 13:39:38 -08:00
Cyril Brulebois
c4cc166abc gallium: fix build on GNU/Hurd due to missing PIPE_OS_HURD detection
Thanks to Pino Toscano.  Patch from Debian package.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 2d77e4f922)
2013-11-15 13:39:38 -08:00
Petr Sebor
2a3dcece72 meta: enable vertex attributes in the context of the newly created array object
Otherwise, the function would enable generic vertex attributes 0
and 1 of the array object it does not own. This was causing crashes
in Euro Truck Simulator 2, since the incorrectly enabled generic
attribute 0 in the foreign context got precedence before vertex
position attribute at later time, leading to NULL pointer dereference.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Signed-off-by: Petr Sebor <petr@scssoft.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit f2b844f59d)
2013-11-15 13:39:38 -08:00
Brian Paul
accc276df2 mesa: call update_array_format() after error checking
We try to do all error checking before changing any GL state.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>

Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit ce193d4f01)
2013-11-15 13:39:38 -08:00
Ilia Mirkin
afbdcdcaaf nouveau/video: mark bitstream-level acceleration as unsupported
Adding a vl_mpeg-based helper didn't seem to work, as it produced data
that the card couldn't handle. (And I didn't investigate further.) This
makes the decoding functionality only accessible via XvMC and avoids
crashes when attempting to use VDPAU.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 08122e151a)
2013-11-15 13:39:38 -08:00
Ilia Mirkin
6f2877c40d nouveau/video: don't try on nv3x
It doesn't work, I don't know why, but no point in hanging people's
displays until it gets figured out.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e8d5d3409c)
2013-11-15 13:39:38 -08:00
Tom Stellard
02d9e1be87 egl-static: Only export necessary symbols v3
This fixes a crash in glamor when mesa links against static LLVM.

v2:
  - Inline LINKER_SCRIPT variable

v3: Kai Wasserbäch
  - Fix out out-of-tree-builds

Tested-by: Kai Wasserbäch <kai@dev.carbon-project.or>
(cherry picked from commit 594fa4a208)
2013-11-15 13:39:37 -08:00
Tom Stellard
095d583e52 configure.ac: Don't require shared LLVM when building OpenCL
This works now that pipe_*.so is no longer exporting LLVM symbols.

Tested-by: Kai Wasserbäch <kai@dev.carbon-project.or>
(cherry picked from commit cb080a10b6)
2013-11-15 13:39:37 -08:00
Tom Stellard
8af132fca9 pipe-loader: Only export necessary symbols v3
This makes it possible to use clover with statically linked LLVM.

v2:
  - Inline LINKER_SCRIPT variable

v3: Kai Wasserbäch
  - Fix out out-of-tree-builds

Tested-by: Kai Wasserbäch <kai@dev.carbon-project.or>
(cherry picked from commit 6d6c749215)
2013-11-15 13:39:37 -08:00
Tom Stellard
ade312cd8a radeonsi/compute: Add Sea Islands support
(cherry picked from commit a859131003)
2013-11-15 13:39:37 -08:00
Rico Schüller
f9a74a0b4c tests: Fix make check for out of tree builds.
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
(cherry picked from commit 23afe71f44)
2013-11-15 13:39:37 -08:00
Brian Paul
0e3f5999b9 osmesa: fix broken triangle/line drawing when using float color buffer
Doesn't seem to help with bug 71363 but it fixed a failure I found in
my testing.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a66a008b17)
2013-11-15 13:39:37 -08:00
Chris Forbes
ebc460bc5f i965: convert brw_lower_offset_array_visitor to ir_rvalue_visitor
Previously, we would bogusly replace the entire statement containing the
ir_texture node with an ir_dereference_variable.

Correct this to just replace the ir_texture node itself as intended.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 5442c0eae3)
2013-11-15 13:39:37 -08:00
Chris Forbes
0010bdd54a glsl: fix missing breaks in equals(ir_texture,..)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d257350949)
2013-11-15 12:28:34 -08:00
Matt Turner
b8a631295a i965/fs: Don't perform CSE on inst HW_REG dests (unless it's null)
Commit b16b3c87 began performing CSE on CMP instructions with null
destinations. I relaxed the restrictions a bit too much, thereby
allowing CSE to be performed on instructions with, for instance, an
explicit accumulator destination.

This broke the arb_gpu_shader5/fs-imulExtended shader tests because
they emit MUL instructions with the accumulator as the destination. CSE
would instead cause the MUL to write to a GRF, which is lower precision
than the accumulator.

Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 68349e5219)
2013-11-15 12:28:34 -08:00
Ian Romanick
c94ed272eb Add .cherry-ignore file
Since we've disabled DRI3 completely in 10.0, f0f202e this commit is no
longer necessary.
2013-11-15 12:28:33 -08:00
Eric Anholt
47139b0233 glx: Back DRI3 enablement out of the stable branch.
After more testing (everyone else trying to build the stack is having as
much trouble as I had, even after the problems I had were fixed), it
really feels like dri3 is not something we're ready to support in this
stable branch.  The .c/.h code will remain here to enable easier
cherry-picking from master, and everything stays on master so we can ship
a solid DRI3 in 3 months.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-15 12:28:33 -08:00
Brian Paul
94251281b4 glx: change query_renderer_integer() value param to unsigned
When this function was added, the returned value was signed in some
places, unsigned in others.

v2: also add unsigned in the unit test, per Ian.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 75982a5df4)
2013-11-15 11:58:06 -08:00
José Fonseca
03a29306b5 glx: Fix scons build.
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6c6f4aa6fd)
2013-11-15 11:58:06 -08:00
Brian Paul
d37ea6dfec swrast: add missing notify_reset parameter to dri_create_context()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit f41c01c688)
2013-11-15 11:57:10 -08:00
José Fonseca
84ee00c1b2 scons: Add dri2_query_renderer.c to sources.
(cherry picked from commit cb3c57df3a)
2013-11-15 11:57:10 -08:00
José Fonseca
3ffcc96abc st/dri: Fix dri_create_context declaration prototype.
(cherry picked from commit caf1d96862)
2013-11-15 11:57:10 -08:00
Alexander von Gluck IV
bc94bf08c4 haiku/swrast: Inherit gl_config, fix flush
* Inherit gl_context so we always have access to it
* Thanks curro for the idea.
* Last Haiku cannidate for 10.0.0

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-11-14 12:38:27 -06:00
Alexander von Gluck IV
ce904c4caf haiku: add swrast driver
* This is pretty small and upkeep should be minimal.
* Currently fully working.
* Cannidate for 10.0.0 branch

Acked-by: Brian Paul <brianp@vmware.com>
2013-11-13 13:35:58 -06:00
Keith Packard
035cce83f7 dri3: Fix pixmap buf_id computation
Looks like some kind of rebase damage to me...

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 19:08:09 -08:00
Eric Anholt
4b5d0d10f1 glx: Add a more informative debug message in a DRI3 error path. 2013-11-07 19:08:09 -08:00
Keith Packard
2d94601582 Add DRI3+Present loader
Uses the __DRIimage loader interfaces.

v2: Fix _XIOErrors when DRI3 isn't present (change by anholt).  Apparently
    XCB just terminates your connection if you don't check for extensions
    before using them, instead of returning an error like you'd expect.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 19:08:09 -08:00
Keith Packard
442442026e dri: add __DRIimageLoaderExtension and __DRIimageDriverExtension
These provide an interface between the driver and the loader to allocate
color buffers through the DRIimage extension interface rather than through a
loader-specific extension (as is used by DRI2, for instance).

The driver uses the loader 'getBuffers' interface to allocate color buffers.

The loader uses the createNewScreen2, createNewDrawable, createNewContext,
getAPIMask and createContextAttribs APIS (mostly shared with DRI2).

This interface will work with the DRI3 loader, and should also work with GBM
and other loaders so that drivers need not be customized for each new loader
interface, as long as they provide this image interface.

v2: Fix build of i915 and i965 together (by anholt)

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 19:08:09 -08:00
Keith Packard
1f085ba18f dri/i915,dri/i965: Use driGLFormatToImageFormat and driImageFormatToGLFormat
Remove private versions of these functions

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2013-11-07 19:08:09 -08:00
Keith Packard
b7818b8c36 dri/common: Add functions mapping MESA_FORMAT_* <-> __DRI_IMAGE_FORMAT_*
The __DRI_IMAGE_FORMAT codes are used by the image extension, drivers need to
be able to translate between them. Instead of duplicating this translation in
each driver, create a shared version.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2013-11-07 19:08:09 -08:00
Keith Packard
aba6b84ce5 Define __DRI_IMAGE_FORMAT_SARGB8
This format will be used by the i965 driver

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-07 19:08:09 -08:00
Keith Packard
bf6591e948 dri/intel: Add explicit size parameter to intel_region_alloc_for_fd
Instead of assuming that the size will be height * pitch, have the caller pass
in the size explicitly.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2013-11-07 19:08:09 -08:00
Keith Packard
888533dcd6 dri/intel: Split out DRI2 buffer update code to separate function
Make an easy place to splice in a DRI3 version of this function

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-07 19:08:09 -08:00
Keith Packard
f66a6c5fe7 drivers/dri/common: A few dri2 functions are not actually DRI2 specific
This just renames them so that they can be used with the DRI3 extension
without causing too much confusion.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-11-07 19:08:09 -08:00
Roland Scheidegger
ea1f7d2894 gallivm: deduplicate some indirect register address code
There's only one minor functional change, for immediates the pixel offsets
are no longer added since the values are all the same for all elements in
any case (it might be better if those weren't stored as soa vectors in the
first place maybe).

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-11-08 03:38:32 +01:00
Ian Romanick
8c5330226f glx/tests: Add unit tests for the DRI2 part of GLX_MESA_query_renderer
After adding $(DEFINES) to AM_CPPFLAGS, the __glXGetCurrentContext
wrapper function is no longer needed and causes compile errors.  Using
the correct defines causes it to be a macro!

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 18:12:33 -08:00
Ian Romanick
0cce553867 glx/tests: Add unit tests for the GLX part of GLX_MESA_query_renderer
These tests primarilly ensure that the functions added by this extension
don't abuse other interfaces (e.g., glx_screen::query_renderer_integer)
when provided bad data.

These tests helped me find a couple small bugs in the initial
implementation.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 18:12:33 -08:00
Ian Romanick
d4cc186937 glx/tests: Add GetGLXScreenConfigs_called flag
Tests for the GLX_MESA_query_context extension will use this flag.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 18:12:33 -08:00
Ian Romanick
ee6c9fcbca docs: Import extension spec for GLX_MESA_query_renderer
The enumerated values are currently allocated from Intel's range.

v2: Fix a typo.  Update the list of functions to which the new enums can
be passed.  The "Current" versions were previously missing.  Both things
noticed by Marek.

v3: Fix typo in return type of glXQueryRendererIntegerMESA in the spec
body (noticed by Ken).  Fix typo in issue #14 referencing itself instead
of issue #13 (noticed by Dave).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Dave Airlie <airlied@redhat.com>
2013-11-07 18:12:33 -08:00
Ian Romanick
4680d237c5 glx/dri2: Add DRI2 support for GLX_MESA_query_renderer
The new functions for this extension were added to a separate file
(dri2_query_renderer.c) to facilitate unit testing.  I tried putting
them in dri2_glx.c, and it resulting in an unending chain of
dependencies.  It was the proverbial threading hanging from a sweater.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:12:33 -08:00
Ian Romanick
419684091c glx/dri2: Pull some internal structures out to a separate header file
This structures will be accessed by internal functions that will be
added in a file separate from dri2_glx.c.  The new code will be added to
a new file to facilitate unit testing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:12:32 -08:00
Ian Romanick
4944588cfd glx/tests: Silence warnings after adding fields to glx_screen_vtable
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 18:12:32 -08:00
Ian Romanick
6c28c037c4 glx: Add functions and GLX plumbing for GLX_MESA_query_renderer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:12:32 -08:00
Ian Romanick
38a1d8b14c glx: Add GLX_MESA_query_renderer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:12:32 -08:00
Ian Romanick
b3ffc5b6f4 glx: Add extension tracking GLX_MESA_query_renderer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:12:32 -08:00
Ian Romanick
1e4ce08f38 i965: Wire up initial support for DRI_RENDERER_QUERY extension
v2: Use sysconf instead of sysinfo for improved portability.  Suggested
by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:12:27 -08:00
Ian Romanick
2fe6fbd19f i915: Wire up initial support for DRI_RENDERER_QUERY extension
v2: Use sysconf instead of sysinfo for improved portability.  Suggested
by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:08:15 -08:00
Ian Romanick
9dbc14abcf dri: Add function to implement queries common to all Mesa drivers
v2: Add assertions that the version string has the expected format.
This will catch build errors (or changes to the version string format)
in debug build without exposing release builds to buffer over-runs.
Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:08:15 -08:00
Ian Romanick
83ffe47be0 i965: Refactor the renderer string creation out of intelGetString
This will soon be used in intel_screen.c from a function that doesn't
have a gl_context.

v2: Delete local variables that are now unused.  This matches v1 of the
changes to the i915 driver.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:08:15 -08:00
Ian Romanick
339f36fc5e i915: Refactor the renderer string creation out of intelGetString
This will soon be used in intel_screen.c from a function that doesn't
have a gl_context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:08:15 -08:00
Ian Romanick
18291251ec i965: Refactor the vendor string out of intelGetString
This will soon be used in intel_screen.c from a function that doesn't
have a gl_context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:08:15 -08:00
Ian Romanick
135b7e7260 i915: Refactor the vendor string out of intelGetString
This will soon be used in intel_screen.c from a function that doesn't
have a gl_context.

v2: Remove spurious break after return.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:08:15 -08:00
Ian Romanick
64bb1e857a dri: Add interface definition for DRI_RENDERER_QUERY extension
This will be used to let apps query hardware and driver limits before
creating a GL context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:08:15 -08:00
Ian Romanick
1f712bdd38 i965: Enable DRI_Robustness extension
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 17:40:25 -08:00
Ian Romanick
e8dac9632d i965: Propagate the GPU reset notifiction strategy down into the driver
If the application requests reset notifiction, connect up the reset
status query method and set gl_context::ResetStrategy.

v2: Update based on kernel interface / libdrm changes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 17:40:25 -08:00
Ian Romanick
8f2c93ff75 i965: Add function to query the GPU reset status for a context
v2: Update based on kernel interface / libdrm changes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 17:40:25 -08:00
Ian Romanick
15c3bac3d0 i965: Handle __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 17:40:25 -08:00
Ian Romanick
7b140d1bda mesa/dri: Move context flag validation down into the drivers
Soon some drivers will support a different set of flags than other
drivers.  If some flags have to be filtered in the driver, we might as
well filter all of them in the driver.

The changes in nouveau use tabs because nouveau seems to have it's own
indentation rules.

v2: Fix some rebase failures noticed by Ken (returning the wrong types,
etc.).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 17:40:05 -08:00
Ian Romanick
17c94de33b mesa/dri: Add basic plumbing for GLX_ARB_robustness reset notification strategy
No drivers advertise the DRI2 extension yet, so no driver should ever
see a value other than false for notify_reset.

The changes in nouveau use tabs because nouveau seems to have it's own
indentation rules.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 17:31:16 -08:00
Ian Romanick
916bc4491a mesa: Implement proper tracking logic for glGetGraphicsResetStatusARB
Drivers still have to implement dd_function_table::GetGraphicsResetStatus.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-07 16:41:38 -08:00
Ian Romanick
a6eb04c3d8 mesa: Add gl_shared_state::ShareGroupReset and gl_context::ShareGroupReset
These will be used to determine whether to signal a GPU reset after
another context in the share group has observed a reset.

v2: Change ShareGroupReset from GLboolean to bool.  Suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-07 16:41:38 -08:00
Ian Romanick
2fdc0ee19f mesa: Add dd_function_table::GetGraphicsResetStatus
This allows drivers to determine whether a GPU reset has occured.  It
should return non-zero status if a reset was observed by the specified
context.  Another mechanism will be used to observe resets occuring in
other contexts in the share group.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-07 16:41:38 -08:00
Ian Romanick
114d360dfa mesa: Remove gl_context::ResetStatus
This isn't going to be used in the actual implemenation of
glGetGraphicsResetStatus.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-07 16:41:38 -08:00
Matt Turner
69b425efae st/xorg: Delete.
Acked-by: Lucas Stach <l.stach@pengutronix.de>
2013-11-07 16:14:25 -08:00
Matt Turner
48f4f59dc6 xorg-nouveau: Delete. 2013-11-07 16:14:25 -08:00
Matt Turner
11ff1725cc xorg-i915: Delete.
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Acked-by: Stéphane Marchesin <stephane.marchesin@gmail.com>
2013-11-07 16:14:25 -08:00
Ian Romanick
cf0da87917 docs: Mark off ARB_shader_atomic_counters for i965
...and update relnotes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:02:03 -08:00
Francisco Jerez
597634556e i965/gen7: Expose ARB_shader_atomic_counters.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 15:56:57 -08:00
Francisco Jerez
5c114939b4 glsl: Linker support for ARB_shader_atomic_counters.
v2: Add comments on the purpose of the auxiliary data structures.
    Check for atomic counter overlaps.  Use the contains_atomic()
    convenience method.  Add static assert with the number of expected
    shader stages.
v3: Don't resize atomic arrays.
v4: Add comment on the reason why we don't resize atomic counter
    arrays.  Use 'strcmp(...) == 0' instead of '!strcmp(...)'.
v5 (idr):  Don't use STL in the linker.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 15:56:57 -08:00
Francisco Jerez
e63bb29853 glsl: Implement parser support for atomic counters.
v2: Mark atomic counters as read-only variables.  Move offset overlap
    code to the linker.  Use the contains_atomic() convenience method.
v3: Use pointer to integer instead of non-const reference.  Add
    comment so we remember to add a spec quotation from the next GLSL
    release once the issue of atomic counter aggregation within
    structures is clarified.
v4 (idr): Don't use std::map because it's overkill.  Add an assertion
    that ctx->Const.MaxAtomicBufferBindings <= MAX_COMBINED_ATOMIC_BUFFERS.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 15:56:57 -08:00
Kenneth Graunke
30f61c471d Revert "i965: Add support for GL_AMD_performance_monitor on Ironlake."
This reverts most of commit 0f2da77307.
(I chose to leave the additions to brw_defines.h.)

My previous Ironlake implementation was somewhat broken: counter data
was global, rather than per-context.  This meant that performance
monitors captured data from your compositor, 2D driver, and other 3D
programs.

Originally, I believed that Sandybridge and later had an easy way to
avoid this problem (setting per-context flags in OACONTROL), while
Ironlake did not.  So I'd intended to leave it as a known limitation of
performance monitoring support on Ironlake.  However, this turned out
not to be true.

Unfortunately, our hardware only has one set of aggregating performance
counters shared between all 3D programs, and their values are not saved
or restored by hardware contexts.  Also, at least on Sandybridge and
Ivybridge, the counters lose their values if the GPU goes to sleep.

To work around both of these problems, we have to snapshot the
performance counters at the beginning and end of each batch, similar to
how we handle query objects on platforms that don't support hardware
contexts.

For occlusion queries, this batch bookending approach is fairly simple:
only one occlusion query can be active at a time, and the result is a
single integer.  Performance monitors are more complex: an arbitrary
number of monitors can be active at a time, each monitoring some subset
of our ~30 observability counters.  Individual monitors can be started
and stopped at any point during the batch.  Tracking where each monitor
started/ended relative to batch flushes ends up being a pain.  And you
can run out of space in the buffer.

Properly supporting this required some serious rearchitecting of the
code.  Rather than writing patches to try and morph a broken system into
a working one (which operates quite differently), I decided it would be
simplest to revert the old code and start fresh.  Parts will look
familiar, but other parts are new.

I also decided it would be best to include Sandybridge and Ivybridge
support from the start, since the newer platforms have added complexity
that I wanted to make sure worked.  They're also what most people care
about these days.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 15:52:02 -08:00
Kenneth Graunke
1bd6233169 glsl: Enable dFdx, dFdy, and fwidth by default in GLSL ES 3.00.
Previously, we only exposed them in desktop GL or with:

   #extension GL_OES_standard_derivatives : enable

GLSL ES 3.00 includes these without an extension, so we need to expose
them by default.

Note that the above #extension line results in an error or desktop GL,
so we don't need to worry about this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-07 15:52:02 -08:00
Fredrik Höglund
c9ac891fa4 docs: Mark off ARB_vertex_type_10f_11f_11f_rev for r600g
...and update relnotes.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-07 23:55:46 +01:00
Fredrik Höglund
e420fb887f r600g: Add support for PIPE_FORMAT_R11G11B10_FLOAT vertex elements
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-07 23:51:44 +01:00
Fredrik Höglund
bfc28e4aff st/mesa: Add support for ARB_vertex_type_10f_11f_11f_rev
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-07 23:51:24 +01:00
Brian Paul
fe9284a7bf mesa: fix return statements in varray.c
Return false, not GL_FALSE.  Add missing return value.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71359
2013-11-07 15:23:36 -07:00
Brian Paul
6592a6d065 svga: always return 4 for PIPE_MAX_COLOR_BUFS
Even if the query returns 8, only 4 really work.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-07 15:21:40 -07:00
Brian Paul
055dbd5c3e svga: return true for the PIPE_CAP_SM3 query
This just tells the state tracker to turn on the GL_ARB_shader_texture_lod
extension.  This simply allows the GLSL compiler to emit TXL and TXD
instructions for both vertex and fragment shaders.  We already support
these opcodes in the svga driver.  Though, the shadow2DGrad() Piglit
tests are failing.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-07 15:21:40 -07:00
Matt Turner
6b990a7474 i965: Add an implementation of intel_miptree_map using streaming loads.
Improves performance of RoboHornet's 2D Canvas toDataURL benchmark
[http://www.robohornet.org/#e=canvastodataurl] by approximately 5x
on Baytrail on ChromiumOS.

Elapsed time drops by -81.4861% +/- 1.22619% (n=3 s=14.9105, confidence=95%).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-07 13:18:03 -08:00
Matt Turner
6f2e81ce4c mesa: Add a streaming load memcpy implementation.
Uses SSE 4.1's MOVNTDQA instruction (streaming load) to read from
uncached memory without polluting the cache.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-07 13:18:03 -08:00
Chris Forbes
d41084a63d docs: Mark off some more things.
These have been supported on i965/Gen7+ for a while, and are listed
in the 10.0 release notes.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2013-11-08 09:57:29 +13:00
Anuj Phogat
735a777842 i965: Fix 'SIMD16 only' dispatch of fragment shader in case of sample shading
This patch make changes to correctly set up the Dispatch GRF Start
Register in case of 'SIMD16 only' FS dispatch.

This fixes an issue of incorrect rendering on dolphin emulator with
GL_SAMPLE_SHADING enabled.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 12:20:33 -08:00
Chris Forbes
4871e7b91f docs: update relnotes 2013-11-08 09:10:06 +13:00
Chris Forbes
2973f38f1c docs: Mark off ARB_vertex_type_10f_11f_11f_rev.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-08 09:10:06 +13:00
Chris Forbes
5e61c746d5 i965: Enable ARB_vertex_type_10f_11f_11f_rev on Gen6+.
This theoretically works on earlier hardware as well, but the extension
requires at least GL3.0.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-08 09:10:06 +13:00
Chris Forbes
7a95bb0a80 i965: add support for UNSIGNED_INT_10F_11F_11F_REV vertex attribs
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-08 09:10:06 +13:00
Chris Forbes
48b6d70bef vbo: add 10_11_11 support to vbo_attrib_tmp
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-08 09:10:06 +13:00
Chris Forbes
fa14f8afa0 mesa: Add support to _mesa_bytes_per_vertex_attrib for 10_11_11 format.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-08 09:10:06 +13:00
Chris Forbes
1f092a9594 mesa: add varray support for UNSIGNED_INT_10F_11F_11F_REV type
V2: fix interaction with VertexAttribFormat, since that landed after
this was originally written

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-08 09:09:43 +13:00
Chris Forbes
aba355b463 mesa: Add extension scaffolding for ARB_vertex_type_10f_11f_11f_rev
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-08 09:00:47 +13:00
Matthew McClure
f9e2c24326 draw,llvmpipe,util: add depth bias calculation for arb_depth_buffer_float
With this patch, the llvmpipe and draw modules will calculate the depth bias
according to floating point depth buffer semantics described in the
arb_depth_buffer_float specification, when the driver has a z buffer bound
with a format type of UTIL_FORMAT_TYPE_FLOAT.

By default, the driver will use the existing UNORM calculation for depth bias.

A new function, draw_set_zs_format, was added to calculate the Minimum
Resolvable Depth value and floating point depth sense for the draw module.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-07 18:32:54 +00:00
Eric Anholt
185b5a54c9 i965: Avoid flushing the batch for every blorp op.
This brings over the batch-wrap-prevention and aperture space checking
code from the normal brw_draw.c path, so that we don't need to flush the
batch every time.

There's a risk here if the intel_emit_post_sync_nonzero_flush() call isn't
high enough up in the state emit sequences -- before, we implicitly had
one at the batch flush before any state was emitted, so Mesa's workaround
emits didn't really matter.  Since the SNB fixes by Ken, I didn't see any
regressions after 3 piglit runs.

Improves cairo-gl performance by 13.7733% +/- 1.74876% (n=30/32)
Improves minecraft apitrace performance by 1.03183% +/- 0.482297% (n=90).
Reduces low-resolution GLB 2.7 performance by 1.17553% +/- 0.432263% (n=88)
Reduces Lightsmark performance by 3.70246% +/- 0.322432% (n=126)
No statistically significant performance difference on unigine tropics
(n=10)
No statistically significant performance difference on openarena (n=755)

The two apps that are hurt happen to include stalls on busy buffer
objects, so I think this is an effect of missing out on an opportune
flush.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-07 10:20:33 -08:00
Matt Turner
fd03dd6ddd build: Build gen_matypes and matypes.h from src/mesa.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 10:00:25 -08:00
Matt Turner
d8abd6710e build: Change HAVE_X86_ASM to mean x86 or x86-64 asm.
I want a conditional that says generally "we have x86 assembly" in the
next patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 10:00:25 -08:00
Matt Turner
957c7570ea configure.ac: Test $asm_arch directly.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 10:00:25 -08:00
Fredrik Höglund
23e69ad6ec docs: Mark ARB_vertex_attrib_binding as done, update relnotes
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 16:21:43 +01:00
Fredrik Höglund
d2ac5d9a13 mesa: Enable ARB_vertex_attrib_binding
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 16:20:45 +01:00
Fredrik Höglund
193e8b4b93 mesa: Optimize rebinding the same VBO
Check if the new buffer object has the same name as the current
buffer object before looking it up.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 16:20:45 +01:00
Fredrik Höglund
965900e830 mesa: Handle zero-stride arrays in _mesa_update_array_max_element()
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:20:45 +01:00
Fredrik Höglund
fb370f89db mesa: Add Get* support for ARB_vertex_attrib_binding
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:20:45 +01:00
Fredrik Höglund
59b01ca252 mesa: Add ARB_vertex_attrib_binding
update_array() and update_array_format() are changed to update the new
attrib and binding states, and the client arrays become derived state.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 16:20:45 +01:00
Fredrik Höglund
bb2d02c7b5 glapi: Add infrastructure for ARB_vertex_attrib_binding
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:20:45 +01:00
Fredrik Höglund
ccb6286707 mesa: Make handle_bind_buffer_gen() non-static
...and rename it to _mesa_bind_buffer_gen().

This is so the function can be called from _mesa_BindVertexBuffer().

This patch also adds a caller parameter so we can report the right
entry point in error messages.

Based on a patch by Eric Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:20:45 +01:00
Fredrik Höglund
12cbe995ed mesa: Rename gl_array_object::VertexAttrib to _VertexAttrib
This will become derived state as part of the ARB_vertex_attrib_binding
support.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:20:45 +01:00
Fredrik Höglund
d5543213f2 mesa: Split out the format code from update_array()
Split out the code for updating the array format into a new function
called update_array_format(). This function will be called by both
update_array() and the new glVertexAttrib*Format() entry points in
ARB_vertex_attrib_binding.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:20:44 +01:00
Fredrik Höglund
6a650fa787 mesa: Restore gl_array_object::NewArray
This will be used by the ARB_vertex_attrib_binding implementation.
This reverts commit db38e9a0e1.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:20:44 +01:00
Kenneth Graunke
c6a3fb69c6 i965: Use has_surface_tile_offset in depth/stencil alignment workaround.
Currently, has_surface_tile_offset is equivalent to gen == 4 && !is_g4x.

We already use it for related checks in brw_wm_surface_state.c, so it
makes sense to use it here too.  It's simpler and more future-proof.

Broadwell also lacks surface tile offsets.  With this patch, I won't
need to update any generation checking; I can simply not set the flag.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 00:17:53 -08:00
Fabio Pedretti
110009302b gallium: fix build on GNU/kFreeBSD
Patch from Debian package

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-11-06 22:08:26 +01:00
Fabio Pedretti
4f4da81dc8 configure.ac: fix build on GNU/kFreeBSD
Based on existing patch from Debian package.

Debian bug: http://bugs.debian.org/524690

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-11-06 22:08:26 +01:00
Fabio Pedretti
9d805c96eb mesa: add arm64 support
Patch from Ubuntu package

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-11-06 22:08:26 +01:00
Fabio Pedretti
da7daade92 r600/compute: silence unused var warning
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-11-06 22:07:58 +01:00
Paul Berry
2fd785ac49 i965/gen6: Don't allow SIMD16 dispatch in 4x PERPIXEL mode with computed depth.
Hardware docs say we can only use SIMD8 dispatch in this condition.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2013-11-06 11:58:42 -08:00
Matt Turner
4e84f394e9 configure.ac: Drop no-out-of-tree notice.
We do support out of tree builds now.

Tested-by: Colin Walters <walters@verbum.org>
2013-11-06 11:26:19 -08:00
Matt Turner
5ca3926442 mesa: Build program as part of libmesa. 2013-11-06 11:26:19 -08:00
Matt Turner
b0bfb7c41e mesa: Clean up use of top_srcdir/top_builddir. 2013-11-06 11:26:19 -08:00
Matt Turner
8bc126cd37 i965: Use unreachable() to silence a compiler warning.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-11-06 11:26:18 -08:00
Matt Turner
3a5223c24c mesa: Add unreachable() macro.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-11-06 11:26:18 -08:00
Roland Scheidegger
b35ea09349 gallivm: fix indirect addressing of inputs
We weren't adding the soa offsets when constructing the indices
for the gather functions. That meant that we were always returning
the data in the first element.
(Copied straight from the same fix for temps.)
While here fix up a couple of broken comments in the fetch functions,
plus don't name a straight float type float4 which is just confusing.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-11-06 18:20:54 +01:00
Vincent Lejeune
08556073d1 r600/llvm: Fix isampleBuffer on preEG 2013-11-06 17:36:22 +01:00
Vincent Lejeune
1184f8fd34 r600/llvm: Fix texbuf for pre EG gen 2013-11-06 17:36:22 +01:00
Brian Paul
36f1c6e3db mesa: for GLSL_DUMP_ON_ERROR, also dump the info log
Since it's helpful to know why the shader did not compile.
Also, call fflush() for Windows.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-11-06 09:04:16 -07:00
Grigori Goronzy
5580ff818e st/vdpau: resolve delayed rendering for GL interop v2
Otherwise OutputSurface interop has funny results sometimes.
This fixes interop with the mpv media player.

v2 (chk): add proper locking

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-11-06 08:45:57 +01:00
Chris Forbes
3785fe2715 docs: Mark off ARB_sample_shading; minor tidyup.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2013-11-06 19:36:27 +13:00
Chris Forbes
f7e15fcf56 i965/fs: Gen4-5: Implement alpha test in shader for MRT
V2: Add comment explaining what emit_alpha_test() is for;
    fix spurious temp and bogus whitespace.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-06 19:29:52 +13:00
Chris Forbes
ca82ba90dd i965/fs: Gen4-5: Setup discard masks for MRT alpha test
The same setup is required here as when the user-provided shader
explicitly uses KIL or discard.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-06 19:29:49 +13:00
Chris Forbes
1080fc610e i965: Gen4-5: Include alpha func/ref in program key
V2: Better explanation of the rationale for doing this.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-06 19:29:46 +13:00
Chris Forbes
dbcd633040 i965: Gen4-5: Don't enable hardware alpha test with MRT
We have to do this in the shader instead, since these gens lack an
independent RT0 alpha value in their render target write messages.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-06 19:29:36 +13:00
Kenneth Graunke
39ebb72e52 i965: Combine {brw,gen7}_update_texture_buffer_surface() functions.
Now that brw_update_texture_buffer_surface() uses the virtual
emit_buffer_surface_state() function, it works for Gen7+ too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-05 17:59:53 -08:00
Kenneth Graunke
7a974a645e i965: Unvirtualize brw_create_constant_surface; delete Gen7+ variant.
Now that brw_create_constant_surface uses a virtual function internally,
it doesn't need to be virtual itself.  We can delete the Gen7+ variant
and simplify things.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-05 17:59:51 -08:00
Kenneth Graunke
ee23dd139a i965: Use the new emit_buffer_surface_state() vtable entry.
This will allow us to combine the Gen4-6 and Gen7 variants of these
functions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-05 17:59:50 -08:00
Kenneth Graunke
ba836e02a3 i965: Virtualize emit_buffer_surface_state().
This entails adding "mocs" and "rw" parameters to the Gen4-5 version.
I made it actually pay attention to the rw flag (even though it is
always false), but mocs is always ignored.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-05 17:59:39 -08:00
Courtney Goeltzenleuchter
e3854fe194 i965: Fix compiler warning.
fix: intel_screen.c:1320:4: warning: initialization from
incompatible pointer type [enabled by default]

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-05 17:59:38 -08:00
Eric Anholt
ff337bc800 i965: Tell the unit states how many binding table entries we have.
Before the series with 3c9dc2d31b to
dynamically assign our binding table indices, we didn't really track our
binding table count per shader, so we never filled in these fields.

Affects cairo-gl trace runtime by -2.47953% +/- 1.07281% (n=20)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-05 15:39:45 -08:00
Eric Anholt
3f319eef76 i965: Fix context initialization after 2f89662717
You can't return stack-initialized values and expect anything good to
happen.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-05 15:39:44 -08:00
Roland Scheidegger
5ae31d7e1d gallivm: optimize lp_build_minify for sse
SSE can't handle true vector shifts (with variable shift count),
so llvm is turning them into a mess of extracts, scalar shifts and inserts.
It is however possible to emulate them in lp_build_minify with float muls,
which should be way faster (saves over 20 instructions per 8-wide
lp_build_minify). This wouldn't work for "generic" 32bit shifts though
since we've got only 24bits of mantissa (actually for left shifts it would
work by using sse41 int mul instead of float mul but not for right shifts).
Note that this has very limited scope for now, since this is only used with
per-pixel lod (otherwise we're avoiding the non-constant shift count by doing
per-quad shifts manually), and only 1d textures even then (though the latter
should change).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-11-05 23:32:24 +01:00
Ian Romanick
7df7e730fb nouveau: Use _NEW_SCISSOR instead of hooking through dd_function_table
This will enable removing the dd_function_table::Scissor hook in the
near future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-11-05 07:50:19 -08:00
Ian Romanick
3f30425424 nouveau: Use _NEW_VIEWPORT instead of hooking through dd_function_table
This will enable removing the dd_function_table::DepthRange hook in the
near future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-11-05 07:50:19 -08:00
Ian Romanick
3a5b84cece radeon / r200: Don't pass unused parameters to radeon_viewport
The x, y, width, and height parameters aren't used by radeon_viewport,
so don't pass them.  This should make future changes to the
dd_function_table::Viewport interface a little easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jljusten@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Courtney Goeltzenleuchter <courtney@lunarg.com>
2013-11-05 07:50:12 -08:00
Ian Romanick
619a9bee7d i915: Bring sanity to the Viewport function
The i830 and the i915 driver have the same dd_function_table::Viewport
function... it just has two names and lives in two places.  Using a
single implementation allows cleaning up the saved_viewport nonsense
too.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jljusten@gmail.com>
Cc: Courtney Goeltzenleuchter <courtney@lunarg.com>
2013-11-05 07:50:04 -08:00
Ian Romanick
abd962f1d5 i965: Eliminate the saved_viewport wrapper
The i965 driver never installed a dd_function_table::Viewport function,
so this wrapper never actually did anything.

No piglit regressions on IVB on DRI2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jljusten@gmail.com>
Cc: Courtney Goeltzenleuchter <courtney@lunarg.com>
2013-11-05 07:49:54 -08:00
Alexander von Gluck IV
1c7605685d mesa: Remove last BEOS checks
* Goodbye BeOS, we hardly knew thee
* As BeOS was gcc2 only, there was little chance
  of this being useful.
* Doesn't effect Haiku in any meaningful way

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-05 09:37:58 -06:00
José Fonseca
c883ee4498 util/u_format: take normalized flag in consideration in util_format_is_rgba8_variant
Just happened to notice it was missing while looking at it.
2013-11-05 14:05:41 +00:00
Paul Berry
86cdff5635 glsl: Don't generate misleading debug names when packing gs inputs.
Previously, when packing geometry shader input varyings like this:

    in float foo[3];
    in float bar[3];

lower_packed_varyings would declare a packed varying like this:

    (declare (shader_in flat) (array ivec4 3) packed:foo[0],bar[0])

That's confusing, since the packed varying acutally stores all three
values of foo and all three values of bar.

This patch causes it to generate the more sensible declaration:

    (declare (shader_in flat) (array ivec4 3) packed:foo,bar)

Note that there should be no functional change for users of geometry
shaders, since the packed name is only used for generating debug
output.  But this should reduce confusion when using INTEL_DEBUG=gs.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-04 19:04:29 -08:00
Vinson Lee
749cb89097 gallivm: Remove llvm::DisablePrettyStackTrace for LLVM >= 3.4.
LLVM 3.4 r193971 removed llvm::DisablePrettyStackTrace and made the
pretty stack trace opt-in rather than opt-out.

The default value of DisablePrettyStackTrace has changed to true in LLVM
3.4 and newer.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60929
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-04 18:22:04 -08:00
Alexander von Gluck IV
e759f1c111 target/haiku-softpipe: Fix viewport issues
* Call mesa viewport call on winndow resize
* Add initial postprocessing code
* Pass hgl_context to private statetracker
  as it is more useful than GalliumContext
* Use Lock and Unlock functions to standardize
  GalliumContext locking
* Create texture resources in texture validation

Acked-by: Brian Paul <brianp@vmware.com>
2013-11-05 01:17:55 +00:00
Brian Paul
faaf568cfb mesa: remove __alpha__ && CCPML check
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-04 18:09:57 -07:00
Brian Paul
2671b576b2 mesa: remove OPENSTEP stuff
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-04 18:09:57 -07:00
Brian Paul
32577fc0ad mesa: remove macintosh preprocessor stuff
IIRC, this is MacOS 9.x stuff.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-04 18:09:57 -07:00
Brian Paul
5a5d2d2db8 mesa: remove __QUICKDRAW__ tests
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-04 18:09:57 -07:00
Brian Paul
9bdc94b94d mesa: remove WGLAPI macro
WGLAPI was defined in glheader.h but wasn't used anywhere.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-04 18:09:57 -07:00
Kenneth Graunke
7b4b94a956 i965: Expose brw_reg_from_fs_reg() to other files.
This will be useful for Broadwell code as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-04 16:51:22 -08:00
Kenneth Graunke
10cb91d7fb i965: Combine gen6_clip_state.c and gen7_clip_state.c.
The changes between Gen6-7 are minimal, and can easily be solved with
an extra generation check.  This cuts a lot of duplicated code.

It also helps prevent even more duplication for Broadwell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-04 16:44:42 -08:00
Francisco Jerez
67b8f4c569 dri/nouveau: Fix nouveau_init_screen2 breakage.
Fix incorrect init ordering in nouveau_init_screen2 caused by
083f66fdd6.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71172
2013-11-04 12:17:37 -08:00
Francisco Jerez
35fe7ed7d3 i965/gen7: Add instruction latency estimates for untyped atomics and reads.
The latency information has been obtained empirically from
measurements taken on Haswell and Ivy Bridge.

Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-11-04 12:12:38 -08:00
Francisco Jerez
ba885c30c7 i965/gen7: Handle atomic instructions from the VEC4 back-end.
This can deal with all the 15 32-bit untyped atomic operations the
hardware supports, but only INC and PREDEC are going to be exposed
through the API for now.

v2: Represent atomics as GLSL intrinsics.  Add support for variably
    indexed atomic counter arrays.
v3: Add comment on why we don't need to assign uniform storage for
    atomic counters.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-04 12:12:38 -08:00
Francisco Jerez
764f40d92e i965/gen7: Handle atomic instructions from the FS back-end.
This can deal with all the 15 32-bit untyped atomic operations the
hardware supports, but only INC and PREDEC are going to be exposed
through the API for now.

v2: Represent atomics as GLSL intrinsics.  Add support for variably
    indexed atomic counter arrays.  Fix interaction with fragment
    discard.
v3: Add comment on why we don't need to assign uniform storage for
    atomic counters.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-04 12:12:37 -08:00
Francisco Jerez
34fe051e21 i965: Add a 'has_side_effects' back-end instruction predicate.
This patch fixes the three dead code elimination passes and the
VEC4/FS instruction scheduling passes so they leave instructions with
side effects alone.

At some point it might be interesting to have the instruction
scheduler calculate the exact memory dependencies between atomic ops,
but they're rare enough that it seems unlikely that it will make any
practical difference.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-04 12:12:37 -08:00
Francisco Jerez
bf045bf9b4 clover: Calculate optimal work group size when it's not specified by the user.
Inspired by a patch sent to the mailing list by Tom Stellard, but
using a different algorithm to calculate the optimal block size that
has been found to be considerably more effective.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-11-04 12:12:37 -08:00
Francisco Jerez
67a3037444 clover: Constify some command_queue arguments. 2013-11-04 12:12:37 -08:00
Francisco Jerez
6e9206bdcc clover: Workaround compiler bug present in GCC 4.7.0-4.7.2.
Variadic template aliases make these versions of GCC very confused,
write down the full type spec instead.
2013-11-04 12:12:37 -08:00
Emil Velikov
0a2bdbb76f st/xorg: handle updates to DamageUnregister API
xserver 1.14.99.2 simplified the DamageUnregister API, by
dropping the drawable argument.
Follow xf86-video-intel and xf86-video-vmware approach and
handle the new API by checking XORG_VERSION_CURRENT.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71110
Reported-by: Michał Górny <mgorny@gentoo.org>
Reported-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-04 19:49:26 +00:00
Brian Paul
4e0ed59959 mesa: remove Watcom C support
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-04 12:23:09 -07:00
Brian Paul
2a1f74e7d9 mesa: remove Centerline C support from gl.h
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-04 12:23:09 -07:00
Brian Paul
61ec037c61 mesa: remove BUILD_FOR_SNAP bits
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-04 12:23:09 -07:00
Brian Paul
5d5d63d63c mesa: remove SciTech stuff from gl.h
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-04 12:23:09 -07:00
Marek Olšák
6463b94973 r600g: properly unbind a DSA state being deleted in r600_delete_dsa_state
Tested-by: Christian König <christian.koenig@amd.com>
2013-11-04 19:07:57 +01:00
Marek Olšák
f0733479f0 docs/GL3: document radeonsi support, minor cleanup
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-04 19:07:57 +01:00
Marek Olšák
a767f57a7d radeonsi: implement ARB_vertex_type_2_10_10_10_rev 2013-11-04 19:07:57 +01:00
Marek Olšák
6a250877ea r600g,radeonsi: properly expose texture buffer formats
This exposes GL_ARB_texture_buffer_object_rgb32.
2013-11-04 19:07:57 +01:00
Marek Olšák
dbeedbb7ab radeonsi: implement texture buffer objects
GLSL 1.40 is done.
2013-11-04 19:07:57 +01:00
Marek Olšák
164de0d2a5 radeonsi: report our border color behavior 2013-11-04 19:07:57 +01:00
Marek Olšák
4569bf9199 radeonsi: bind a dummy constant buffer in place of NULL buffers 2013-11-04 19:07:57 +01:00
Marek Olšák
2fd4200123 radeonsi: implement uniform buffer objects 2013-11-04 19:07:57 +01:00
Marek Olšák
d0cf73a408 tgsi/scan: set maximum index for each constant buffer 2013-11-04 19:07:57 +01:00
Marek Olšák
e5f0080d91 radeonsi: try to fix IA_MULTI_VGT_PARAM programming
This doesn't make any difference on Bonaire, but it might help on Hawaii.
2013-11-04 19:07:57 +01:00
Marek Olšák
5e43819475 winsys/radeon: use type-3 NOPs for CS padding on CIK
The type-2 NOPs are said to be unstable. It doesn't make a difference here.
2013-11-04 19:07:56 +01:00
Aaron Watry
1b2c6cd205 clover: fix build with LLVM 3.4
dso_list was added as an argument for createInternalizePass in 3.4, and then
it was removed again in the same llvm version.

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-11-04 08:51:57 -08:00
Brian Paul
9fc41e2eea draw: move type construction out of loop
We can create clip_ptr_type once instead of n times inside the loop.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-11-04 07:12:14 -07:00
Chad Versace
2f89662717 i965: Add driconf option clamp_max_samples
The new option clamps GL_MAX_SAMPLES to a hardware-supported MSAA mode.
If negative, then no clamping occurs.

v2: (for Paul)
  - Add option to i965 only, not to all DRI drivers.
  - Do not realy on int->uint cast to convert negative
    values to large positive values. Explicitly check for
    clamp_max_samples < 0.
v3: (for Ken)
   - Don't allow clamp_max_samples to alter context version.
   - Use clearer for-loop and correct comment.
   - Rename variables.
v4: (for Ken)
   - Merge identical if-branches.

Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-11-03 15:55:18 -08:00
Vinson Lee
68f1b274b0 i965: Fix logic_op check.
Fixes "Macro compares unsigned to 0" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-03 14:45:59 -08:00
Vinson Lee
9943b6612b i915: Fix logic_op check.
Fixes "Macro compares unsigned to 0" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-03 14:45:56 -08:00
Vinson Lee
14ddc83346 i965: Initialize vec4_visitor member variables.
Fixes "Uninitialized pointer field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-03 14:36:27 -08:00
Marek Olšák
fa8b1514d3 gallium/targets: remove vdpau-softpipe
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-11-02 23:34:01 +01:00
Marek Olšák
7c2531847f gallium/targets: remove xvmc-softpipe
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-11-02 23:34:01 +01:00
Marek Olšák
0e17c12fa7 gallium/targets: remove r300/vdpau
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-11-02 23:34:01 +01:00
Marek Olšák
5f7233c8ea gallium/targets: remove r300/xvmc
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-11-02 23:34:00 +01:00
Marek Olšák
be331e82d1 gallium/targets: remove radeonsi/xorg
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-11-02 23:34:00 +01:00
Marek Olšák
da82d7b6ba gallium/targets: remove r600/xorg
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-11-02 23:34:00 +01:00
Rob Clark
f407ea1f1c freedreno/a3xx/texture: min/max lod
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-11-01 20:22:40 -04:00
Rob Clark
2d10e22f8b freedreno/a3xx: update envytools headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-11-01 20:22:28 -04:00
Rob Clark
f16b084bb9 freedreno/a3xx: fix VS out / FS in linking
Actually link VS out / FS in based on semantic info, keeping in mind
that position/pointsize can also be an input to the FS.  This fixes a
few fragment shaders which were using gl_Position.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-11-01 20:20:47 -04:00
Rob Clark
83318d6511 freedreno/a3xx: allow num_samplers != num_textures
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-11-01 20:20:29 -04:00
Rob Clark
a53fe2221c freedreno/a3xx/compiler: highp frag shader
Fixes use of full-precision in fragment shader (ie. don't clobber r0.x
since that can be used by future bary instructions for varying fetch).
And makes use of full-precision the default in fragment shader (but can
be overriden via FD_MESA_DEBUG=fraghalf).

Seems like half precision is often not enough for texture coordinates.
The blob compiler is clever enough to keep texture coords in full
precision registers while using half precision for everything else.  But
we aren't quite that clever yet, so better to default to full precision.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-11-01 20:19:42 -04:00
Rob Clark
310fd5839c freedreno/a3xx/compiler: relative addressing fixes.
Handle some relative addressing constraints: cannot handle const or
relative in cat5 and src2 of cat3.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-11-01 20:18:44 -04:00
Rob Clark
4ddd4e83c7 freedreno: we do actually support sqrt
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-11-01 20:17:56 -04:00
Anuj Phogat
625a631383 i965: Enable ARB_sample_shading on intel hardware >= gen6
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ken Graunke <kenneth@whitecape.org>
2013-11-01 16:01:49 -07:00
Anuj Phogat
e7393260be i965/gen7: Enable the features required for GL_ARB_sample_shading
- Enable GEN7_WM_MSDISPMODE_PERSAMPLE, GEN7_WM_POSOFFSET_SAMPLE,
  GEN7_WM_OMASK_TO_RENDER_TARGET as per extension's specification.
- Only enable one of GEN7_WM_8_DISPATCH_ENABLE or GEN7_WM_16_DISPATCH_ENABLE
  when GEN7_WM_MSDISPMODE_PERSAMPLE is enabled. Refer IVB PRM Vol. 2, Part 1,
  Page 288 for details.

V2:
    - Use shared function _mesa_get_min_invocations_per_fragment().
    - Use brw_wm_prog_data variables: uses_pos_offset, uses_omask.

V3:
    - Enable simd16 dispatch with per sample shading.
    - Make changes to give preference to 'simd16 only' mode over
      'simd8 only' mode in case of non 1x per sample shading.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 16:01:49 -07:00
Anuj Phogat
8d7a934d09 i965/gen6: Enable the features required for GL_ARB_sample_shading
- Enable GEN6_WM_MSDISPMODE_PERSAMPLE, GEN6_WM_POSOFFSET_SAMPLE,
  GEN6_WM_OMASK_TO_RENDER_TARGET as per extension's specification.
- Only enable one of GEN6_WM_8_DISPATCH_ENABLE or GEN6_WM_16_DISPATCH_ENABLE
  when GEN6_WM_MSDISPMODE_PERSAMPLE is enabled.
  Refer SNB PRM Vol. 2, Part 1, Page 279 for details.

V2:
    - Use shared function _mesa_get_min_invocations_per_fragment().
    - Use brw_wm_prog_data variables: uses_pos_offset, uses_omask.

V3:
    - Enable simd16 dispatch with per sample shading.
    - Make changes to give preference to 'simd16 only' mode over
      'simd8 only' mode in case of non 1x per sample shading.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 16:01:48 -07:00
Anuj Phogat
e26bdf56a4 i965: Add FS backend for builtin gl_SampleMask[]
V2:
   - Update comments
   - Add a special backend instructions to compute sample_mask.
   - Add a new variable uses_omask in brw_wm_prog_data.

V3:
   - Make changes to support simd16 mode.
   - Delete redundant AND instruction and handle the register
     stride in FS backend instruction.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 16:01:48 -07:00
Anuj Phogat
e12bbb503f i965: Add FS backend for builtin gl_SampleID
V2:
   - Update comments
   - Add compute_sample_id variables in brw_wm_prog_key
   - Add a special backend instruction to compute sample_id.

V3:
   - Make changes to support simd16 mode.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 16:01:48 -07:00
Anuj Phogat
65d0452bbc i965: Add FS backend for builtin gl_SamplePosition
V2:
   - Update comments.
   - Add compute_pos_offset variable in brw_wm_prog_key.
   - Add variable uses_pos_offset in brw_wm_prog_data.

V3:
   - Make changes to support simd16 mode.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 16:01:48 -07:00
Anuj Phogat
81f5fb352a i965: Don't do vector splitting for ir_var_system_value
This is required while adding builtin system value vec{2, 3, 4}
variables. For example:
(declare (sys) vec2 gl_SamplePosition)

Without this patch above glsl ir splits in to:
(declare (temporary) float gl_SamplePosition_x)
(declare (temporary) float gl_SamplePosition_y)

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-01 16:01:48 -07:00
Anuj Phogat
627b2692e9 mesa: Add a helper function _mesa_get_min_invocations_per_fragment()
This function is used to test if we need to do per sample shading or
per fragment shading.

V2: Use MAX2() to make sure the function returns a number >= 1.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 16:01:48 -07:00
Anuj Phogat
e849511c78 glsl: Add new builtins required by GL_ARB_sample_shading
New builtins added by GL_ARB_sample_shading:
in vec2 gl_SamplePosition
in int gl_SampleID
in int gl_NumSamples
out int gl_SampleMask[]

V2: - Use SWIZZLE_XXXX for STATE_NUM_SAMPLES.
    - Use "result.samplemask" in arb_output_attrib_string.
    - Add comment to explain the size of gl_SampleMask[] array.
    - Make gl_SampleID and gl_SamplePosition system values.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-01 16:01:48 -07:00
Anuj Phogat
0d69e8c813 mesa: Pass number of samples as a program state variable
Number of samples will be required in fragment shader program by new
GLSL builtin uniform "gl_NumSamples".

V2: Use "state.numsamples" in place of "state.num.samples"
    Use _NEW_BUFFERS flag in place of _NEW_MULTISAMPLE

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Ken Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 16:01:47 -07:00
Anuj Phogat
77b440e42d mesa: Add new functions and enums required by GL_ARB_sample_shading
New functions added by GL_ARB_sample_shading:
glMinSampleShadingARB()

New enums:
GL_SAMPLE_SHADING_ARB
GL_MIN_SAMPLE_SHADING_VALUE_ARB

V2: Update comments.
    Create new GL4x.xml.
    Remove redundant code in get.c.
    Update the API_XML list in Makefile.am.
    Add extra_gl40_ARB_sample_shading predicate to get.c.

V3:
   Fix make check failure.
   Add checks for desktop GL.
   Use GLfloat in place of GLclampf in glMinSampleShading().
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ken Graunke <kenneth@whitecape.org>
2013-11-01 16:01:47 -07:00
Anuj Phogat
e919e5ee4e mesa: Add infrastructure for GL_ARB_sample_shading
This patch implements the common support code required for the
GL_ARB_sample_shading extension.

V2: Move GL_ARB_sample_shading to ARB extension list.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Ken Graunke <kenneth@whitecape.org>
2013-11-01 16:01:47 -07:00
Matt Turner
3c28b2c09f i965/fs: Optimize saturating SEL.G(E) with imm val <= 0.0f.
Only one program's instruction count is changed, but a shader in Tropics
is also affected.

instructions in affected programs:     326 -> 320 (-1.84%)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 15:21:07 -07:00
Matt Turner
ca675b73d3 i965/fs: Optimize saturating SEL.L(E) with imm val >= 1.0.
total instructions in shared programs: 1409124 -> 1406971 (-0.15%)
instructions in affected programs:     158376 -> 156223 (-1.36%)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 15:21:07 -07:00
Matt Turner
a8f76d829b i965/fs: Optimize OR with identical sources into a MOV.
Helps a lot of Steam games.

total instructions in shared programs: 1409360 -> 1409124 (-0.02%)
instructions in affected programs:     20842 -> 20606 (-1.13%)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 15:21:07 -07:00
Eric Anholt
fd05ede0d0 glsl: Add a CSE pass.
This only operates on constant/uniform values for now, because otherwise I'd
have to deal with killing my available CSE entries when assignments happen,
and getting even this working in the tree ir was painful enough.

As is, it has the following effect in shader-db:

total instructions in shared programs: 1524077 -> 1521964 (-0.14%)
instructions in affected programs:     50629 -> 48516 (-4.17%)
GAINED:                                0
LOST:                                  0

And, for tropics, that accounts for most of the effect, the FPS
improvement is 11.67% +/- 0.72% (n=3).

v2: Use read_only field of the variable, manually check the lod_info union
    members, use get_num_operands(), rename cse_operands_visitor to
    is_cse_candidate_visitor, move all is-a-candidate logic to that
    function, and call it before checking for CSE on a given rvalue, more
    comments, use private keyword.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 10:25:33 -07:00
Eric Anholt
3641b97bdc i965/vec4: Don't overwrite op[1] when doing a UBO load.
Prior to the GLSL CSE pass, all of our testing happened to have a freshly
computed temporary in op[1], from the multiply by 16 to get a byte offset.
As of CSE you'll get var_refs of a reused value when you've got multiple
loads from the same offset.

Make a proper temporary for computing our temporary value, to avoid
shifting the value farther and farther down.  Avoids a regression in
gs-float-array-variable-index

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-11-01 10:25:33 -07:00
Brian Paul
2197967cd4 st/mesa: fix _mesa_init_transform_feedback_object() argument
Need to pass a pointer of the base type, not the st type.
Fixes a compiler warning.
2013-11-01 08:43:25 -06:00
Kenneth Graunke
723f047a3b i965: Fix brw_store_register_mem64 to stay within a single batch.
Previously, the write of each 32-bit half might land in separate batch
buffers, which is insane.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2013-10-31 12:11:52 -07:00
Kenneth Graunke
5eb0835b91 docs: List transfom_feedback{2,3,instanced} for i965 in release notes. 2013-10-31 11:11:01 -07:00
Kenneth Graunke
0eeaf11edf i965: Enable the ARB_transform_feedback_instanced extension on Gen7+.
This depends on ARB_transform_feedback2, so I've predicated it on the
ability to do register writes.

It also depends on ARB_transform_feedback3, which is the only reason we
couldn't expose it previously.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
c4ec0ad8a9 i965: Enable the ARB_transform_feedback3 extension on Gen7+.
This extension is written a bit strangely.  Although it introduces the
concept of multiple transform feedback streams, it doesn't actually
provide more than a single stream.

The ARB_gpu_shader5 extension is what introduces the ability to write to
streams other than stream #0 and increases the required number of streams.

Since we don't yet support ARB_gpu_shader5, we can safely enable
ARB_transform_feedback3 even though we only support a single stream.
This does provide some useful functionality: applications can now use
more than one interleaved transform feedback buffer.

v2: Only expose the extension if ARB_transform_feedback2 is also
    available, to avoid confusing applications (suggested by Ian).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
066fb237e6 i965: Add support for gl_SkipComponents[1234].
ARB_transform_feedback3 allows applications to insert blank space
between interleaved varyings by adding fake 1, 2, 3, or 4-component
varyings named gl_SkipComponents[1234].

Mesa's core data structures don't explicitly track these, instead simply
tracking the buffer offset for each real varying.  If there is padding
due to gl_SkipComponents, these will not be contiguous.

Our hardware takes the specification quite literally.  Instead of
specifying offsets for each varying, it assumes they're all contiguous
and requires you to program fake varyings for each "hole".

This patch adds support for emitting SO_DECL structures for these holes.
Although we've lost the information about exactly how the application
specified their padding (i.e. gl_SkipComponents2, gl_SkipComponents2
vs. a single gl_SkipComponents4), it shouldn't matter.  We just need to
emit the right amount of space.  This patch emits the minimal number of
hole SO_DECL structures.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
7232e8bea7 i965: Explicitly maintain a count of SO_DECL structures emitted.
Currently, we emit one SO_DECL structure per output, so we use the index
in the Outputs[] array as the index into the so_decl[] array as well.

In order to support the fake "gl_SkipComponents[1234]" varyings from
ARB_transform_feedback3, we'll need to emit SO_DECLs to fill in the
holes between successive outputs.  This means we'll likely emit more
SO_DECLs than there are outputs, so we need to count it explicitly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
e095434e52 i965: Create a temporary for transform feedback output components.
This is a bit shorter.

v2: Mark the temporary const (requested by Ian).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
129da5b1c8 i965: Enable ARB_transform_feedback2 on Gen7+ if register writes work.
With Linux 3.12, register writes work on Ivybridge and Baytrail, but not
Haswell.  That will be fixed in a future kernel revision, at which point
this extension will automatically be enabled.

v2: Use I915_GEM_DOMAIN_INSTRUCTION for the register read, and also
    correctly set the writeable flag when mapping (caught by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
46d3c2bf4d i965: Initialize batchbuffer and state modules before extensions.
We only want to enable ARB_transform_feedback2 if we can write to
registers from batchbuffers.  In order to test that, we need to be able
to submit batches.  And for batches to work, we need to program the
initial pipeline state (like PIPELINE_SELECT), which is done from
brw_state_init().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
82a5ee6be4 i965: Implement glDrawTransformFeedback().
Implementing the GetTransformFeedbackVertexCount() driver hook allows
the VBO module to call us with the right number of vertices.

The hardware doesn't directly count the number of vertices written by
SOL, so we instead use the SO_NUM_PRIMS_WRITTEN(n) counters and multiply
by the number of vertices per primitive.

Unfortunately, counting the number of primitives generated is tricky:
a program might pause a transform feedback operation, start a second one
with a different object, then switch back and resume.  Both transform
feedback operations share the SO_NUM_PRIMS_WRITTEN counters.

To work around this, we save the counter values at Begin, Pause, Resume,
and End.  This "bookends" each section where transform feedback is
active for the current object.  Adding up differences of pairs gives
us the number of primitives generated.  (This is similar to what we
do for occlusion queries on platforms without hardware contexts.)

v2: Fix missing parenthesis in assertion (caught by Eric Anholt).
v3: Reuse prim_count_bo rather than freeing it and immediately
    allocating a new one (suggested by Topi Pohjolainen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
b2ff11618f i965: Mark brw_draw_prims tfb_vertcount parameter as unused.
Renaming it makes it obvious that it isn't used, and the assertion
verifies that the VBO module never passes us such an object.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
ded34f65ad mesa: Add a new GetTransformFeedbackVertexCount() driver hook.
DrawTransformFeedback() needs to obtain the number of vertices written
to a particular stream during the last Begin/EndTransformFeedback block.
The new driver hook returns exactly that information.

Gallium drivers already implement this by passing the transform feedback
object to the drawing function, counting the number of vertices written
on the GPU, and using draw indirect.  This is efficient, but doesn't
always work:

If vertex data comes from user arrays, then the VBO module needs to
know how many vertices to upload, so we need to synchronously count.
Gallium drivers are currently broken in this case.

It also doesn't work if primitive restart is done in software.  For
normal drawing, vbo_draw_arrays() performs software primitive restart,
splitting the draw call in two.  vbo_draw_transform_feedback() currently
doesn't because it has no idea how many vertices need to be drawn.

The new driver hook gives it that information, allowing us to reuse
the existing vbo_draw_arrays() code to do everything right.

On Intel hardware (at least Ivybridge), using the draw indirect approach
is difficult since the hardware counts primitives, rather than vertices,
which requires doing some simple math.  So we always use this hook.

Gallium drivers will likely want to use this hook in some cases, but
want to use the existing draw indirect approach where possible.  Hence,
I've added a flag to allow drivers to opt-in to this call.

v2: Make it possible to implement this hook but only use this path
    when necessary (suggested by Marek).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
684958d1e7 i965: Implement Pause/ResumeTransformfeedback driver hooks on Gen7+.
The ARB_transform_feedback2 extension introduces the ability to pause
and resume transform feedback sessions.  Although only one can be active
at a time, it's possible to switch between multiple transform feedback
objects while paused.

In order to facilitate this, we need to save/restore the SO_WRITE_OFFSET
registers so that after resuming, the GPU continues writing where it
left off.

This functionality also exists in ES 3.0, but somehow we completely
forgot to implement it.

v2: Reduce alignment from 4096 to 64 (it seemed excessive).
v3: Use I915_GEM_DOMAIN_INSTRUCTION instead of RENDER, for consistency
    with other writes.  It shouldn't matter on IVB+.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
0d7033c394 i965: Create a new brw_transform_feedback_object subclass.
This adds the basic driver hooks to allocate/free the brw variant.
It doesn't contain any additional information yet, but it will soon.

v2: Use the new _mesa_init_transform_feedback_object helper function
    (requested by Eric and Ian).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
be6227d29d st/mesa: Use the new _mesa_init_transform_feedback_object() helper.
This picks up a missing obj->EverBound = GL_FALSE line, and will catch
any new fields that get added in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-31 11:04:37 -07:00
Kenneth Graunke
f02ee3044f mesa: Separate transform feedback object initialization from allocation.
Both Gallium and i965 subclass gl_transform_feedback_object, which
requires implementing a custom NewTransformFeedback hook.  Creating a
helper function to initialize the fields avoids code duplication and
divergence.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-31 11:04:36 -07:00
Brian Paul
0e2f0baa43 vbo: fix MSVC double->float conversion warnings 2013-10-31 08:21:58 -06:00
Brian Paul
83f276ab05 swrast: fix MSVC double->float conversion warnings 2013-10-31 08:21:58 -06:00
Brian Paul
717621acff mesa: fix some MSVC signed/unsigned compiler warnings 2013-10-31 08:21:58 -06:00
Brian Paul
010f8762e8 meta: fix assorted MSVC int/float conversion warnings 2013-10-31 08:21:58 -06:00
Brian Paul
e4d4ec9ddf glsl: fix MSVC int->bool conversion warning 2013-10-31 08:21:58 -06:00
Brian Paul
3c11bc6a5a st/draw: silence Mingw warning in pointer_to_offset()
Fixes "warning: cast from pointer to integer of different size" for
64-bit builds.
2013-10-31 08:21:58 -06:00
Matt Turner
b16b3c8703 i965/fs: Perform CSE on CMP(N) instructions.
Optimizes

      cmp.ge.f0(8)  null     g45<8,8,1>F  0F
(+f0) sel(8)        g50<1>F  g40<8,8,1>F  g10<8,8,1>F
      cmp.ge.f0(8)  null     g45<8,8,1>F  0F
(+f0) sel(8)        g51<1>F  g41<8,8,1>F  g11<8,8,1>F
      cmp.ge.f0(8)  null     g45<8,8,1>F  0F
(+f0) sel(8)        g52<1>F  g42<8,8,1>F  g12<8,8,1>F
      cmp.ge.f0(8)  null     g45<8,8,1>F  0F
(+f0) sel(8)        g53<1>F  g43<8,8,1>F  g13<8,8,1>F

into

      cmp.ge.f0(8)  null     g45<8,8,1>F  0F
(+f0) sel(8)        g50<1>F  g40<8,8,1>F  g10<8,8,1>F
(+f0) sel(8)        g51<1>F  g41<8,8,1>F  g11<8,8,1>F
(+f0) sel(8)        g52<1>F  g42<8,8,1>F  g12<8,8,1>F
(+f0) sel(8)        g53<1>F  g43<8,8,1>F  g13<8,8,1>F

total instructions in shared programs: 1644938 -> 1638181 (-0.41%)
instructions in affected programs:     574955 -> 568198 (-1.18%)

Two more 16-wide programs (in L4D2). Some large (-9%) decreases in
instruction count in some of Valve's Source Engine games. No
regressions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 19:49:27 -07:00
Matt Turner
219b43c612 i965/fs: Don't emit null MOVs in CSE.
We'd like to CSE some instructions, like CMP, that often have null
destinations. Instead of replacing them with MOVs to null, just don't
emit the MOV.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 19:49:27 -07:00
Matt Turner
a93d54eb68 i965/fs: Use reads_flag and writes_flag methods in the scheduler.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 19:49:27 -07:00
Matt Turner
20d0297ff2 i965/fs: Add reads_flag() and writes_flag() to fs_inst.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 19:49:27 -07:00
Matt Turner
f768f998e0 i965/fs: Add is_null() method to fs_reg.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 19:49:27 -07:00
Eric Anholt
8dfc9f038e i965/fs: Use the gen7 scratch read opcode when possible.
This avoids a lot of message setup we had to do otherwise.  Improves
GLB2.7 performance with register spilling force enabled by 1.6442% +/-
0.553218% (n=4).

v2: Use BRW_PREDICATE_NONE, improve a comment (by Paul).

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 17:51:19 -07:00
Eric Anholt
6032261682 i965: Merge together opcodes for SHADER_OPCODE_GEN4_SCRATCH_READ/WRITE
I'm going to be introducing gen7 variants, and the previous naming was
going to get confusing.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 17:51:17 -07:00
Eric Anholt
32182bb004 i965/fs: Fix register unspills from a reg_offset.
We were clearing the reg_offset before trying to use it.  Oops.  Fixes
glsl-fs-texture2drect with the reg spilling debug enabled.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 17:51:15 -07:00
Eric Anholt
0e20051f54 i965/fs: Fix register spilling for 16-wide.
Things blew up when I enabled the debug register spill code without
disabling 16-wide, so I decided to just fix 16-wide spilling.

We still don't generate 16-wide when register spilling happens as part of
allocation (since we expect it to be slower), but now we can experiment
with allowing it in some cases in the future.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 17:51:10 -07:00
Eric Anholt
537f183fe6 i965/fs: Exit the compile if spilling would overwrite in-use MRFs.
I believe this will never happen in SIMD8 mode, but it could for SIMD16
when we fix it.

v2: Fix off-by-one in my register counting comment (caught by Paul).

Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
2013-10-30 17:51:02 -07:00
Eric Anholt
44ec2f1751 i965/fs: Fix broken register spilling debug code.
Now that reg spilling generates new vgrfs, we were looping forever if you
ever turned it on.

Instead, move the debug code into the register allocator right near where
we'd be doing spilling anyway, which should more accurately reflect how
register spilling occurs in the wild.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 17:50:59 -07:00
Eric Anholt
b3f6690406 i965/fs: Split "find what MRFs were used" to a helper function.
I'm going to need to reuse this for fixing register spilling on SIMD16.
Note that BRW_MAX_MRF is 16, which is the same as BRW_MAX_GRF -
GEN7_MRF_HACK_START.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 17:50:56 -07:00
Eric Anholt
32ac5634d6 i965/fs: Update an ancient, wrong comment about reg_offset.
This hasn't been true since SIMD16 mode was added.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 17:50:51 -07:00
Kai Wasserbäch
bbb77fc2f1 radeonsi: Allow longer intrinsic names
Fixes a boat load of Piglit tests for me, which crashed like fdo#70913
before.

Thanks to Michel Dänzer for the tip.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70913
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-30 16:40:06 -07:00
Tom Stellard
193594a1b8 clover: Don't install headers when using the icd
The ICD loader should be responsible for installing headers.

Reviewed and Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-10-30 16:40:06 -07:00
Tom Stellard
6f3465f340 radeon/llvm: Specify the DataLayout when running optimizations
Without DataLayout, a lot of optimization passes aren't run and the ones
that are don't work as well.
2013-10-30 16:40:06 -07:00
Eric Anholt
20dbeadd83 i965/fs: Prefer more-critical instructions of the same age in LIFO scheduling.
When faced with a million instructions that all became candidates at the
same time (none of which individually reduce register pressure), the ones
on the critical path are more likely to be the ones that will free up some
candidates soon.

shader-db:
total instructions in shared programs: 1681070 -> 1681070 (0.00%)
instructions in affected programs:     0 -> 0
GAINED:                                40
LOST:                                  74

Fixes indistinguishable-from-hanging behavior in GLES3conform's
uniform_buffer_object_max_uniform_block_size test, regressed by
c3c9a8c857.  Given that
93bd627d5a was unlocked by that commit, the
net effect on 16-wide program count is still quite positive, and I think
this should give us more stable scheduling (less dependency on original
instruction emit order).

v2: Comment suggestions by Paul

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70943
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 15:46:54 -07:00
Eric Anholt
017361dd37 i965: Compute the node's delay time for scheduling.
This is a step in doing scheduling as described in Muchnick (p538).  A
difference is that our latency function is only specific to one
instruction (it doesn't describe, for example, the different latency
between WAR of a send's arguments and RAW of a send's destination), but
that's changeable later.  We also don't separately compute the postorder
traversal of the graph, since we can use the setting of the delay field as
the "visited" flag.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 15:46:48 -07:00
Emil Velikov
9eb3de1ce7 automake: handle expat version pre 2.1
Commit aec20d66d9
(automake: properly handle non-default expat installation),
assumed that up-to date distributions use a recent version
of expat that handles security vunerabilities CVE-2012-1147
and CVE-2012-1148. Seems like this is not always the case
and they prefer to backport only the fix, rather than use
the updated library.

This commit adds a default case -lexpat whenever expat is
not found, while properly handling expat.pc if present.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71022
Reported-By: Bryce Harrington <b.harrington@samsung.com>
Reported-By: Vinson Lee <vlee@freedesktop.org>
Tested-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-30 22:05:42 +00:00
Ian Romanick
5cb80f0314 glsl: Move layout(location) checks to AST-to-HIR conversion
This will simplify the addition of layout(location) qualifiers for
separate shader objects.  This was validated with new piglit tests
arb_explicit_attrib_location/1.30/compiler/not-enabled-01.vert and
arb_explicit_attrib_location/1.30/compiler/not-enabled-02.vert.

v2: Refactor error checking to check_explicit_attrib_location_allowed
and eliminate the gotos.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 13:49:30 -07:00
Ian Romanick
9d6294f5a2 glsl: Slightly restructure error generation in validate_explicit_location
Use mode_string to get the name of the variable mode.  Slightly change
the control flow.  Both of these changes make it easier to support
separate shader object location layouts.

The format of the message changed because mode_string can return a
string like "shader output".  This would result in an awkward message
like "vertex shader shader output..."

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 13:49:30 -07:00
Ian Romanick
f8c579dc0f glsl: Make mode_string function globally available
I made this a function (instead of a method of ir_variable) because it
made the change set smaller, and I expect that there will be an overload
that takes an ir_var_mode enum.  Having both functions used the same way
seemed better.

v2: Add missing case for ir_var_system_value.

v3: Change the ir_var_mode_count case to just break.  Move the assertion
and the return outside the switch-statment.  In the unlikely event that
var->mode is an invalid value other than ir_var_mode_count, the
assertion will still fire, and in release builds we won't wind up
returning a garbage pointer.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 13:49:30 -07:00
Ian Romanick
2cb760d994 glsl: Eliminate the global check in validate_explicit_location
Since the separation of ir_var_function_in and ir_var_shader_in (similar
for out), this check is no longer necessary.  Previously, global_scope
was the only way to tell which was which.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 13:49:29 -07:00
Ian Romanick
8f00a77fbc glsl: Extract explicit location code from apply_type_qualifier_to_variable
Future patches will add some extra code to this path, and some of that
code will want to exit from the explicit location code early.

v2: Change a geometry shader "break" to a "return" so that try to apply
a bogus geometry shader location qualifier (which could cause cascading
errors).  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-30 13:49:29 -07:00
Gregory Hainaut
0059d1948e mesa: Drop unused return value from use_shader_program
The return value has been unused since commit d348b0c.  This was
originally included in another patch, but it was split out by Ian
Romanick.

v2: Drop unnecessary final return.  Suggested by Paul.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
2013-10-30 13:49:29 -07:00
Fabio Pedretti
103824dc24 wayland: silence unused var warning
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-30 12:50:09 -07:00
Johannes Obermayr
5e162566db ilo: Fix out-of-tree build.
[olv: use $(srcdir) instead of $(top_srcdir)]
2013-10-30 21:17:10 +08:00
José Fonseca
26a8f76ba1 scons: Add missing dependencies to src/mapi/glapi/gen/*.xml
Incremental builds were failing because not all generated source files
were missing dependencies to src/mapi/glapi/gen/*.xml.

Hopefully this change will be the end of these incremental build
failures.
2013-10-30 12:21:54 +00:00
Marek Olšák
e929e27737 glsl: fix crash introduced by the previous commit 2013-10-30 00:14:35 +01:00
Marek Olšák
7e414b5864 glsl: break the gl_FragData array into separate gl_FragData[i] variables
This avoids a defect in lower_output_reads.

The problem is lower_output_reads treats the gl_FragData array as a single
variable. It first redirects all output writes to a temporary variable (array)
and then writes the whole temporary variable to the output, generating
assignments to all elements of gl_FragData.

BTW this pass can be modified to lower all arrays, not just inputs and outputs.
The question is whether it is worth it.

Reviewed-by: Paul Berry <stereotype441@gmail.com>

v2: addressed Paul Berry's comments
2013-10-29 23:50:01 +01:00
Emil Velikov
aec20d66d9 automake: properly handle non-default expat installation
Use PKG_CHECK_MODULE over requesting the user to setup the
option at configure time. Drop unused EXPAT_INCLUDE and
update all targets.

NOTE: The this commit removes the --with-expat configure
option. One should ensure that the expat they wish to use
has expat.pc file accessible by pkg-config.

v2:
* Add note about the removal of --with-expat
(per Tom Stellard)
* Drop EXPAT_CFLAGS for targets that do not build DRI_COMMON
(spotted by Matt Turner)
v3:
* Rebase on top of megadrivers (drop EXPAT_CFLAGS from swrast)

Acked-by: Matt Turner <mattst88@gmail.com> (v2)
Reviewed-by: Tom Stellard <thomas.stellard@amd.com> (v2)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Conflicts:
	configure.ac
	src/mesa/drivers/dri/common/Makefile.am
2013-10-29 21:14:41 +00:00
Emil Velikov
0828ad4e63 configure: use PKG_CONFIG variable over hardcoded pkg-config
Already available and used in other places of configure.ac.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-29 21:04:38 +00:00
Emil Velikov
2a87647c6a targets/xorg-nouveau: drop usage of dri1 function DRICreatePCIBusID
The function should have never used it in the first place as it was
a left over from the DRI1 days of the nouveau ddx. While we're around
check if KMS is supported before opening the nouveau device, and
add support for Fermi & Kepler cards.

Compile tested only due to the lack of a Fermi/Kepler card.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-29 21:04:38 +00:00
Emil Velikov
c9e6e6382f gallium/targets/xorg: drop set but unused variable entity
The function xf86GetEntityInfo() retrieves the entity rather than
doing any changes. Remove this no-op code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-29 21:04:38 +00:00
Emil Velikov
ba3efd6b42 st/xorg: drop set but unsused variables dxo, dyo
Commit a9f8baf00b removed the first and only use of the variables
but forgot to remove them.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-29 21:04:38 +00:00
Emil Velikov
2b7ffde8bd st/xorg: add sanity checks after malloc
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-29 21:04:37 +00:00
Emil Velikov
5c398e243c st/xorg: remove unnecessary headers
v2: Remove xf86PciInfo.h, all drivers provide their own PCI ID list

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-29 21:04:37 +00:00
Rob Clark
2bc1fc2fb6 freedreno: emulated unsupported primitive types
Use u_primconvert to convert unsupported primitives into supported
primitive plus index buffer.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-10-29 16:49:43 -04:00
Rob Clark
b881917088 gallium/auxiliary/indices: add u_primconvert
A convenient front end to indices generate/translate code, for emulating
primitives which are not supported natively by the driver.

This handles saving/restoring index buffer state, etc.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-29 16:49:43 -04:00
Rob Clark
28f3f8d413 gallium/auxiliary/indices: add start param
Add 'start' parameter to generator/translator.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-29 16:49:43 -04:00
Rob Clark
5127436a4a freedreno: update generated headers
pull in some fixes to draw-initiator/prim-type.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-10-29 16:49:43 -04:00
Eric Anholt
774b787d6b i965/fs: Drop our dead push constants before overflowing to pull constants.
The idea of the original order was that you'd dead code eliminate accesses
to push constants.  But I've never seen a case of that (nor has
shader-db), while we frequently see sparse accesses of large constant
arrays that would overflow into pull constants.

Cuts pull constant use on csgo, serious sam, planeshift, and the cave:

total instructions in shared programs: 1695103 -> 1688795 (-0.37%)
instructions in affected programs:     92024 -> 85716 (-6.85%)
GAINED:                                339
LOST:                                  0

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-29 13:43:01 -07:00
Alexander von Gluck IV
9a9fb94ca9 haiku-softpipe: Minor cleanup and color space fixes
* Use more consistant data sources
* Fix improper color space assignments
* Remove unnecessary comments and code
* Drop unnecessary round_up function (this was leftover
  from moving winsys code out of renderer)

Acked-by: Brian Paul <brianp@vmware.com>
2013-10-29 15:27:43 -05:00
Alexander von Gluck IV
439dd0e20a winsys: Correct Haiku winsys display target code
* Instead of assuming the displaytarget is the same
  stride / colorspace as the destination, lets
  actually check the source bitmap.
* Fixes random stride issues in rendering

Acked-by: Brian Paul <brianp@vmware.com>
2013-10-29 15:27:40 -05:00
Francisco Jerez
b8f89fc5cb clover: Use context device list for error checking in clGetProgramBuildInfo.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=70891.

Reported-by: Bruno Jiménez <brunojimen@gmail.com>
2013-10-29 12:40:56 -07:00
Francisco Jerez
e515dcbf96 i965: Simplify the shader time code by using atomic counter helpers.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-29 12:40:56 -07:00
Francisco Jerez
d58bd75263 i965: Add brw_reg constructors taking a dynamically determined vector width.
The MRF variant is going to be used extensively by the atomic counter
intrinsics to assemble untyped atomic and surface read messages
easily.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-29 12:40:56 -07:00
Francisco Jerez
5e621cb9fe i965/gen7: Implement code generation for untyped surface read instructions. 2013-10-29 12:40:56 -07:00
Francisco Jerez
cfaaa9bbb7 i965/gen7: Implement code generation for untyped atomic instructions.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-29 12:40:56 -07:00
Francisco Jerez
5809512b17 i965: Implement ABO surface state emission.
The maximum number of atomic buffer objects is somewhat arbitrary, we
can change it in the future easily if it turns out it's not enough...

v2: Add comments with the relevant mesa dirty bits.  Fix usage of
    BRW_NEW_UNIFORM_BUFFER in the GS ABO state atom.
v3: Update binding table layout diagrams.
v4: Resolve conflicts with the recent dynamic surface index assignment changes.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-29 12:40:56 -07:00
Francisco Jerez
c4e730e218 i965: Define vtbl method that initializes an untyped R/W surface.
And add Gen7 implementation.

v2: Fix off by one error in buffer size calculation.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-29 12:40:55 -07:00
Francisco Jerez
7a54db9ce5 glsl: Fix the function inlining pass to deal with general opaque arguments.
Almost a trivial change, it boils down to renaming a few identifiers
so their names still make sense for opaque types other than sampler.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-29 12:40:55 -07:00
Francisco Jerez
bbded5b5fe glsl: Add built-in functions and constants required for ARB_shader_atomic_counters.
v2: Represent atomics as GLSL intrinsics.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-29 12:40:55 -07:00
Francisco Jerez
9562922376 glsl: Basic support for built-in intrinsics.
Fix the linker to deal with intrinsic functions which are undefined
all the way down to the driver back-end, and introduce intrinsic
definition helpers in the built-in generator.

We still need to figure out what kind of interface we want for drivers
to communicate to the GLSL front-end which of the supported intrinsics
should use a default GLSL implementation and which should use a
hardware-specific override.  As there's no default GLSL implementation
for atomic ops, this seems like something we can worry about later on.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

v2: Define local helper function to generate ir_call nodes in the
    builtin generator.
2013-10-29 12:40:55 -07:00
Francisco Jerez
cc744a0947 glsl: Add type predicate to check whether a type contains any opaque types.
And use it to forbid comparisons of opaque operands.  According to the
GL 4.2 specification:

> Except for array indexing, structure member selection, and
> parentheses, opaque variables are not allowed to be operands in
> expressions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-29 12:40:55 -07:00
Francisco Jerez
26db3b933f glsl: Add new atomic_uint built-in GLSL type.
v2: Fix GLSL version in which the type became available.  Add
    contains_atomic() convenience method.  Split off atomic counter
    comparison error checking to a separate patch that will handle all
    opaque types.  Include new ir_variable fields for atomic types.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-29 12:40:55 -07:00
Francisco Jerez
0bed1ab73b glsl: Add extension enables for ARB_shader_atomic_counters.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-29 12:40:55 -07:00
Francisco Jerez
1c7dcfed7c mesa: Add support for ARB_shader_atomic_counters.
This patch implements the common support code required for the
ARB_shader_atomic_counters extension.  It defines the necessary data
structures for tracking atomic counter buffer objects (from now on
"ABOs") associated with some specific context or shader program, it
implements support for binding buffers to an ABO binding point and
querying the existing atomic counters and buffers declared by GLSL
shaders.

v2: Fix extension checks.  Drop unused MAX_ATOMIC_BUFFERS constant.

Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-29 12:40:55 -07:00
Francisco Jerez
e3fd31dc41 glapi: Add support for ARB_shader_atomic_counters.
Add XML file for the dispatch code generator, update the
dispatch_sanity test and add stub definition for the new entry point.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-29 12:40:55 -07:00
Francisco Jerez
db47074ac0 i965: Handle deallocation of some private ralloc contexts explicitly.
These ralloc contexts belong to a specific object and are being
deallocated manually from the class destructor.  Now that we've hooked
up destructors to ralloc there's no reason for them to be children of
any other context, and doing so might to lead to double frees under
some circumstances.  The class destructor has all the responsibility
of freeing class memory resources now.
2013-10-29 12:40:55 -07:00
Francisco Jerez
d18477deea ralloc: Hook up C++ destructors to ralloc when necessary.
This patch makes sure that class destructors are called as they should
be when a C++ object allocated by ralloc is released.

Based on a previous patch by Kenneth Graunke, but it doesn't exhibit
the ~0.8% performance regression in shader compilation times because
we now use the HAS_TRIVIAL_DESTRUCTOR() macro to detect the typical
case where the indirect function call can be avoided because the
object's destructor doesn't need to do anything.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-29 12:40:55 -07:00
Francisco Jerez
98ab905af0 mesa: Define introspection macro to determine whether a type is trivially destructible.
Only implemented on GCC and Clang for now.  Other compilers use a
dummy implementation that always returns false, which should be a safe
[but slightly inefficient] assumption in all cases.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-29 12:40:55 -07:00
Paul Berry
be63803b0c glsl: Generalize MSVC fix for strcasecmp().
This will let us use strcasecmp() from anywhere inside Mesa without
having to worry about the fact that it doesn't exist in MSVC.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-29 11:10:56 -07:00
Roland Scheidegger
e4195acab5 llvmpipe: fix bogus layer clamping in setup
The layer coming from GS needs to be clamped (not sure if that's actually
the correct error behavior but we need something) as the number can be higher
than the amount of layers in the fb. However, this code was using the layer
calculation from the scene, and this was actually calculated in
lp_scene_begin_rasterization() hence too late (so setup was using the value
from the _previous_ scene or just zero if it was the first scene).
Since the value is used in both rasterization and setup, move calculation up
to lp_scene_begin_binning() though it's a bit more inconvenient to calculate
there. (Theoretically could move _all_ code which was in
lp_scene_begin_rasterization() to there, because ever since we got rid of
swizzled render/depth buffers our "map" functions preparing the fb data for
render don't actually change the data in there at all, but it feels like
it would be a hack.)

v2: improve comments

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-10-29 17:54:03 +01:00
Matthew McClure
be0b67a143 util,llvmpipe: correctly set the minimum representable depth value
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-10-29 15:53:48 +00:00
Brian Paul
d0eaf6752d st/mesa: move out of memory check in st_draw_vbo()
Before we were only checking the st->vertex_array_out_of_memory flag
after updating array state.  But if there's two consecutive glDrawArrays
calls and the first one is skipped because of OOM, the second one should
be skipped too.

Cc: 9.2 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-10-29 08:09:34 -06:00
Brian Paul
ea9fe9ebdb svga: reindent drawing code 2013-10-29 08:09:34 -06:00
Eric Anholt
415d6dc5bd i965/vec4: Reduce working set size of live variables computation.
Orbital Explorer was generating a 4000 instruction geometry shader, which
was taking 275 trips through dead code elimination and register
coalescing, each of which updated live variables to get its work done, and
invalidated those live variables afterwards.

By using bitfields instead of bools (reducing the working set size by a
factor of 8) in live variables analysis, it drops from 88% of the profile
to 57%, and reduces overall runtime from I-got-bored-and-killed-it (Paul
says 3+ minutes) to 10.5 seconds.

Compare to f179f419d1 on the FS side.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-29 00:27:35 -07:00
Vadim Girlin
8bd4476010 r600g/sb: fix value::is_fixed()
This prevents unnecessary (and wrong) register allocation in the
scheduler for preloaded values in fixed registers.

Fixes interpolation-mixed.shader_test on rv770
(and probably on all other pre-evergreen chips).

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-10-29 05:49:21 +04:00
Eric Anholt
08bf52712e glsl: Drop no-op shifts involving 0.
I noticed this in a shader in Unigine Heaven that was spilling.  While it
doesn't really reduce register pressure, it shaves a few instructions
anyway (7955 -> 7882).

v2: Fix turning "0 >> x" into "x" instead of "0" (caught by Erik
    Faye-Lund).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-28 14:07:31 -07:00
Eric Anholt
3a0fdf2ab6 glsl: Use ir_builder more in opt_algebraic.
While ir_builder is slightly less efficient, we're only increasing the
work when there's actual optimization being done, and it's way more
readable code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-28 14:07:31 -07:00
Eric Anholt
27bcb5063f glsl: Move common code out of opt_algebraic's handle_expression().
Matt and I had each screwed up these common required patterns recently, in
ways that wouldn't have been noticed for a long time if not for code
review.  Just enforce it in the caller so that we don't rely on code
review catching these bugs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-28 14:07:31 -07:00
Carl Worth
29996e2199 Remove error when calling glGenQueries/glDeleteQueries while a query is active
There is nothing in the OpenGL specification which prevents the user from
calling glGenQueries to generate a new query object while another object is
active. Neither is there anything in the Mesa implementation which prevents
this. So remove the INVALID_OPERATION errors in this case.

Similarly, it is explicitly allowed by the OpenGL specification to delete an
active query, so remove the assertion for that case, replacing it with the
necesssary state updates to end the query, (clear the bindpt pointer and call
into the driver's EndQuery hook).

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
2013-10-28 12:56:49 -07:00
Kenneth Graunke
5563dfabc8 i965: Also emit HiZ and Stencil packets when disabling depth on Gen6.
The normal drawing path does this, and it's necessary on Ivybridge,
so let's try it on Sandybridge too.  It's not explicitly documented
as necessary, but might help with hangs.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Xinkai Chen <yeled.nova@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-10-28 11:29:36 -07:00
Kenneth Graunke
29e5d5db51 i965: Also emit HIER_DEPTH and STENCIL packets when disabling depth.
From the documentation:
"[DevIVB] 3DSTATE_DEPTH_BUFFER must always be programmed along with the
 other Depth/Stencil state commands(i.e. 3DSTATE_CLEAR_PARAMS,
 3DSTATE_STENCIL_BUFFER, or 3DSTATE_HIER_DEPTH_BUFFER)."

We normally do this, but BLORP was failing to do so in the case where it
disables depth.

Not observed to fix anything yet.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Xinkai Chen <yeled.nova@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-10-28 11:29:33 -07:00
Kenneth Graunke
65b1f642ac i965: Move post-sync non-zero flush for 3DSTATE_MULTISAMPLE.
For some reason, we put the flush in the caller, rather than just before
emitting the packet.  This is more than a cosmetic problem: BLORP calls
gen6_emit_3dstate_multisample() directly, and so it missed the flush.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Xinkai Chen <yeled.nova@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-10-28 11:29:32 -07:00
Kenneth Graunke
10a918e52c i965: Also guard 3DSTATE_DRAWING_RECTANGLE with a flush in blorp.
Non-pipelined commands need this flush.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Xinkai Chen <yeled.nova@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-10-28 11:29:31 -07:00
Kenneth Graunke
3aef1fefb4 i965: Emit post-sync non-zero flush before 3DSTATE_DRAWING_RECTANGLE.
This is another non-pipelined command that needs a flush on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Xinkai Chen <yeled.nova@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-10-28 11:29:29 -07:00
Kenneth Graunke
436e815a25 i965: Emit post-sync non-zero flush before 3DSTATE_GS_SVB_INDEX.
From the comments above intel_emit_post_sync_nonzero_flush:
"[DevSNB-C+{W/A}] Before any depth stall flush (including those
 produced by non-pipelined state commands), software needs to first
 send a PIPE_CONTROL with no bits set except Post-Sync Operation != 0."

This suggests that every non-pipelined (0x79xx) command needs a
post-sync non-zero flush before it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Xinkai Chen <yeled.nova@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-10-28 11:29:27 -07:00
Daniel Vetter
32a3f5f6d7 i965: CS writes/reads should use I915_GEM_INSTRUCTION
Otherwise the gen6 w/a in the kernel won't kick in and the write will
land nowhere.

Inspired by a patch Ken pointed me at which had the same issue (but
isn't yet merged and also for a gen7+ feature). An audit of the entire
driver didn't reveal any other case than the one in in the write_reg
helper used by the gen6 queryobj code.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Xinkai Chen <yeled.nova@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-10-28 11:29:15 -07:00
Anuj Phogat
f278d49c4b i965: Do not set bilinear_filter flag in case of multisample blits
Setting bilinear_filter flag in case of multisample blits with
GL_LINEAR filter causes incorrect behavior in translate_dst_to_src()
function. This broke Modern Warfare (1, 2 and 3) on SNB, IVB and HSW.

Tested on SNB and IVB, no Piglit regressions. Trace file of the game
(taken with apitrace) works fine with this patch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69078
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reported-by: Armin K <krejzi@email.com>
Tested-by: Armin K <krejzi@email.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-28 09:33:01 -07:00
Rico Schüller
14f02cdee8 mesa: Remove trailing whitespace in texparam.c
Signed-off-by: Rico Schüller <kgbricola@web.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
2013-10-28 08:43:40 -06:00
Brian Paul
0ce3bfbd40 mesa: use void in _mesa_VDPAUFiniNV() as in the header file 2013-10-28 08:37:39 -06:00
Timothy Arceri
b59c5926cb glsl: Add check for unsized arrays to glsl types
The main purpose of this patch is to increase readability of
the array code by introducing is_unsized_array() to glsl_types.
Some redundent is_array() checks are also removed, and small number
of other related clean ups.

The introduction of is_unsized_array() should also make the
ARB_arrays_of_arrays code simpler and more readable when it arrives.

V2: Also replace code that checks for unsized arrays directly with the
length variable

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

v3 (Paul Berry <stereotype441@gmail.com>): clean up formatting.
Separate whitespace cleanups to their own patch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-28 06:06:04 -07:00
Timothy Arceri
5cd7eb9f07 glsl: whitespace cleanups.
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

v2 (Paul Berry <stereotype441@gmail.com>): Separate from "glsl: Add
check for unsized arrays to glsl types".

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-28 06:06:04 -07:00
Timothy Arceri
e14abf566b glsl: Fix comment
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-28 06:05:51 -07:00
Christian König
925ffa8c4a vl/h264: split fields into SPS/PPS
Add alot of missing fields as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-28 11:08:12 +01:00
Christian König
6f2410c9aa radeon/uvd: fix H264 chroma format handling
Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-28 11:06:37 +01:00
Christian König
cc49baeedc vl: add 400 chroma format as well
Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-28 11:06:18 +01:00
Chia-I Wu
d2fdc0d634 ilo: minor cleanups for recent interface changes
Kill ilo_bind_sampler_states2 and ilo_set_sampler_views2.  Map
PIPE_FORMAT_R10G10B10A2_UINT to BRW_SURFACEFORMAT_R10G10B10A2_UINT.
2013-10-28 11:40:41 +08:00
Timothy Arceri
d1d3b1e361 glsl: Move error message inside validation check reducing duplicate message handling
v2 (Paul Berry <stereotype441@gmail.com): Fix precedence error in call
to _mesa_glsl_error().

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-27 10:23:52 -07:00
Paul Berry
e79e6c5911 i965: Make fs gl_PrimitiveID input work even when there's no gs.
When a geometry shader is present, the fragment shader gl_PrimitiveID
input acts like an ordinary varying, receiving data from the gs
gl_PrimitiveID output.  When there's no geometry shader, we have to
ask the fixed function SF hardware to provide the primitive ID to the
fragment shader instead.

Previously, the SF setup code would handle this situation by
recognizing that the FS gl_PrimitiveID input didn't match to any VS
output; since normally an FS input with no corresponding VS output
leads to undefined data, the SF setup code used to just arbitrarily
assign it to receive data from attribute 0.

This patch changes the SF setup code so that instead of arbitrarily
using attribute 0, it assigns the unmatched FS input to receive
gl_PrimitiveID.  In the case where the FS input really is
gl_PrimitiveID, this produces the intended result.  In all other
cases, no harm is done since GL specifies that the behaviour is
undefined.

Fixes piglit test primitive-id-no-gs.

v2: If an attribute is already being overridden with point
coordinates, don't try to also override it with gl_PrimitiveID.  This
is necessary to avoid regressing piglit tests such as
shaders/glsl-fs-pointcoord.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-27 10:23:39 -07:00
Vinson Lee
7f76368305 mesa: Add GL_NV_vdpau_interop functions to dispatch_sanity.cpp.
Fixes 'make check' failures introduced with commit
80964226e9.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70900
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-10-26 23:13:51 -07:00
Brian Paul
bc23944091 mesa: add vdpau.c and st_vdpau.c to src/mesa/SConscript
Fixes SCons build.
2013-10-26 07:24:17 -06:00
Christian König
80964226e9 implement NV_vdpau_interop v7
v2: Actually implement interop between the gallium
    state tracker and the VDPAU backend.

v3: Make it also available in non legacy contexts,
    fix video buffer sharing.

v4: deny interop if we don't have the same screen object

v5: rebased on upstream changes

v6: implemented VDPAUGetSurfaceivNV, improved error handling,
    unregister all surfaces in VDPAUFiniNV

v7: squash merge with Mareks changes

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-26 12:13:36 +02:00
Christian König
3d3a0b9b67 winsys/radeon: make radeon_drm_winsys_create public
Otherwise OpenGL/VDPAU interop won't work as expected.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-26 12:13:36 +02:00
Chris Forbes
598ca510b8 i965: Remove ir_txf coord+offset special case in visitors
Just let it be handled by the lowering pass.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:56:27 +13:00
Chris Forbes
06de9f8ff1 i965: Generalize coord+offset lowering pass for ir_txf
ir_txf expects an ivec* coordinate, and may be larger than ivec2;
shuffle things around so that this will work.

V2: Fix style nits, use ir_builder

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:56:25 +13:00
Chris Forbes
72b5e9c42a i965: Add lowering pass to fold offset into unnormalized coords
It turns out that nonzero offsets with gsampler2DRect don't work -- they
just return garbage. Work around this by folding the offset into the
coord.

Done as an IR pass rather than yet another hack in the visitors because
it's clear what's going on this way. Can possibly reuse this to replace
the existing txf coord+offset hacks.

V2: Use ir_builder

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:56:09 +13:00
Chris Forbes
a936000db6 i965: Add lowering pass for splitting textureGatherOffsets
Rewrites textureGatherOffsets(s, p, offsets) into

   gvec4(
      textureGatherOffset(s, p, offsets[0]).w,
      textureGatherOffset(s, p, offsets[1]).w,
      textureGatherOffset(s, p, offsets[2]).w,
      textureGatherOffset(s, p, offsets[3]).w
      )

V2: Use ir_builder to be slightly clearer.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:28:26 +13:00
Chris Forbes
4c1eae5395 i965: Add asserts to ensure that ir_tg4 offset arrays are lowered
We don't have a message that does 4 independent offsets; a lowering
pass needs to lower it to 4 normal gather4s before reaching this
point.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:28:05 +13:00
Chris Forbes
de8948a0b6 glsl: add signatures for textureGatherOffsets()
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:28:03 +13:00
Chris Forbes
a9de744a26 glsl: add support for texture functions with offset arrays
This is needed for textureGatherOffsets()

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:27:37 +13:00
Chris Forbes
3c98d77460 i965/fs: Add support for shadow comparitors with gather4
Note that gather4_po_c's parameters are too long for SIMD16. It might be
worth emitting 2xSIMD8 messages in this case at some point.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:16:32 +13:00
Chris Forbes
32f898a71c i965/vs: Add support for shadow comparitors with gather4
gather4_c's argument layout is straightforward -- refz just goes on the
end.

gather4_po_c's layout however -- the array index is replaced with refz.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:16:28 +13:00
Chris Forbes
070c841111 i965: Add Gen7 gather4_c and gather4_po_c message types
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:16:27 +13:00
Chris Forbes
43e3ae112f glsl: Add new textureGather[Offset]() overloads for shadow samplers
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:16:24 +13:00
Chris Forbes
af1dfd99b7 glsl: Add support for separate reference Z for shadow samplers
ARB_gpu_shader5's textureGather*() functions which take shadow samplers
have a separate `refz` parameter rather than adding it to the
coordinate.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:16:19 +13:00
Chris Forbes
fb08769bb6 i965/vs: add support for gather4 with nonconstant offsets
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2013-10-26 22:10:02 +13:00
Chris Forbes
938d909894 i965/fs: add support for gather4 with nonconstant offsets
V3: fixup crazy check for whether we need to emit the coordinate after
    custom handling.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-26 22:08:51 +13:00
Chris Forbes
bdcacaed9c i965: relax brw_texture_offset assert
Some texturing ops are about to have nonconstant offset support; the
offset in the header in these cases should be zero.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-26 21:54:15 +13:00
Chris Forbes
6bb2cf2107 i965: Add SHADER_OPCODE_TG4_OFFSET for gather with nonconstant offsets.
The generator code ends up clearer this way than if we had to sniff
via the message length. Implemented via the gather4_po message in
hardware, which is present in Gen7 and later.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-26 21:54:15 +13:00
Chris Forbes
cd8505bfb8 i965: add missing tg4 case in brw_instruction_name
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-26 21:54:15 +13:00
Chris Forbes
4fa123deac glsl: relax const offset requirement for textureGatherOffset
Prior to ARB_gpu_shader5 / GLSL 4.0, the offset is required to be
a constant expression.

With that extension, it is relaxed to be an arbitrary expression.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-26 21:54:15 +13:00
Chris Forbes
00235402a0 glsl: Add ARB_gpu_shader5 textureGatherOffset signatures
- gsampler2DRect
- optional `comp` parameter

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-26 21:54:15 +13:00
Kenneth Graunke
d07d38e696 i965: Weaken the flushing in gen7_end_transform_feedback().
Since 062317d667 (i965: Go back to using the kernel SOL reset feature.)
we've been flushing the batch on BeginTransformFeedback().  So it's not
necessary to do it on EndTransformFeedback().  A PIPE_CONTROL will work.

This makes gen7_end_transform_feedback() exactly the same as the gen6
variant.  However, they'll diverge again shortly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-25 22:25:38 -07:00
Eric Anholt
93bd627d5a i965/fs: Stop trying to hack around MRF dep chains on gen7+ LIFO scheduling.
This was a hack to avoid choosing to schedule all texturing before
consumption of any texture results due to the way dependency chains worked
out in the presence of MRFs.  On gen7, we don't have MRFs, so the problem
doesn't apply, and this was just badly constraining our scheduling.

total instructions in shared programs: 1615306 -> 1612534 (-0.17%)
instructions in affected programs:     9958 -> 7186 (-27.84%)
GAINED:                                259
LOST:                                  9

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-25 16:45:30 -07:00
Eric Anholt
c3c9a8c857 i965: Try not to reverse-schedule things when doing LIFO scheduling.
The LIFO plan was simple: Take the most recently made available
instructions, and pick those first.

But because of the order we were pushing things onto our list of
available-to-schedule instructions, it meant that when a set of
instructions was made available at the same time (for example, everything
at the start of the program that didn't depend on other instructions) we'd
schedule them in reverse order.

If you had 10 texture calls in a row in your program, each with
independent argument setup, we'd set up the last texture call's args and
execute it first, even though we wouldn't be able to consume its results
until we'd finished the other 9 texture calls (assuming consumption of
texture results happens near each texture call, and combines it with
another texture result, which is normal for a convolution shader).

To fix this, walk the list for doing LIFO in the order that instructions
were originally generated in the program, but choose to push
newly-made-available instructions to the other end of the list instead.

total instructions in shared programs: 1587242 -> 1586290 (-0.06%)
instructions in affected programs:     7801 -> 6849 (-12.20%)
GAINED:                                76
LOST:                                  67

Thanks to Chia-I Wu for pointing out the bug in my first version of the
patch that made it a huge loss.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-25 16:45:30 -07:00
Ilia Mirkin
a7ce1fef27 mesa/st: disable ARB_framebuffer_object when no driver support.
When PIPE_CAP_MIXED_FRAMEBUFFER_SIZES is not provided, parts of
ARB_framebuffer_object can't be supported, such as on NV30.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-10-26 01:36:07 +02:00
Ilia Mirkin
12d39b4fa8 gallium: add PIPE_CAP_MIXED_FRAMEBUFFER_SIZES
This CAP will determine whether ARB_framebuffer_object can be enabled.
The nv30 driver does not allow mixing swizzled and linear zsbuf/cbuf
textures.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-10-26 01:36:07 +02:00
Adam Jackson
1090eb5755 glx: Fix return value from indirect_bind_context
_XReply returns 1 on success, but indirect_bind_context returns 0 on
success.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70486
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-25 16:49:28 -04:00
Matt Turner
64c081e8b7 glsl: Optimize (not A) and (not B) into not (A or B).
No shader-db changes, but seems like a good idea.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-25 10:35:18 -07:00
Matt Turner
65a600f58a glsl: Optimize (not A) or (not B) into not (A and B).
A few Serious Sam 3 shaders affected:

instructions in affected programs:     4384 -> 4344 (-0.91%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-25 10:35:13 -07:00
Matt Turner
e52959e961 i965/fs: Match commutative expressions with reversed arguments.
total instructions in shared programs: 1645011 -> 1644938 (-0.00%)
instructions in affected programs:     17543 -> 17470 (-0.42%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-25 10:34:02 -07:00
Matt Turner
503fe278b0 i965: s/Muchnik/Muchnick/.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-25 10:34:02 -07:00
Marek Olšák
9807556e86 r600g,radeonsi: use fences provided by the winsys 2013-10-25 11:55:55 +02:00
Marek Olšák
6067a30838 winsys/radeon: add the implementation of fences from r300g 2013-10-25 11:55:55 +02:00
Marek Olšák
48784f3591 radeonsi: add the vertex shader position output if it's missing
This fixes a lockup in piglit/spec/glsl-1.40/execution/tf-no-position.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-10-25 11:55:55 +02:00
Marek Olšák
94715130e6 radeonsi: respect semantic indices for COLOR[i] fragment shader outputs
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-10-25 11:55:55 +02:00
Paul Berry
e8f6f244bb glsl: When disabling gl_PerVertex variables, check that mode matches.
In commit 1b4a737 (glsl: Support redeclaration of VS and GS
gl_PerVertex output), I added code to ensure that when an unnamed
gl_PerVertex interface block is redeclared, any ir_variables that
weren't included in the redeclaration are removed from the IR (and the
symbol table).  This ensures that only those variables that were
explicitly redeclared may be used.

However, when I wrote this code, I neglected to match the variable
mode when finding variables to remove.  This meant that redeclaring a
built-in output block might cause the built-in input gl_in to be
accidentally removed.

Fixes piglit test gs-redeclares-pervertex-out-only.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:01:30 -07:00
Paul Berry
719bf30165 glsl: Remove unused gl_PerVertex interface blocks.
The GLSL 4.10 rules for redeclaration of built-in interface blocks
(which we've chosen to regard as clarifications of GLSL 1.50) only
require gl_PerVertex blocks to match in shaders that actually use
those blocks.  The easiest way to implement this is to detect
situations where a compiled shader doesn't refer to any elements of
gl_PerVertex, and remove all the associated ir_variables from the
shader at the end of ast-to-ir conversion.

Fixes piglit tests
linker/interstage-{pervertex,pervertex-in,pervertex-out}-redeclaration-unneeded.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:01:27 -07:00
Paul Berry
37d97668ae glsl: Call check_builtin_array_max_size when redeclaring gl_in.
Normally when a built-in array (such as gl_ClipDistance) is
redeclared, we call get_variable_being_redeclared() to do the
redeclaration, and it in turn calls check_builtin_array_max_size() to
make sure that the redeclared array size isn't too large.

However when a built-in array is redeclared as part of redeclaring
gl_in, we don't call get_variable_being_redeclared() (since the
individual built-ins aren't each represented by their own ir_variable
anymore).  So we need to add an explicit call to
check_builtin_array_max_size() to make sure the new array size isn't
too large.

Note: at the moment this is redundant with a test that's done at link
time, so there's no change to piglit results.  But the patch that
follows will prevent link errors from being reported if gl_PerVertex
isn't used, so in order to prevent that patch from causing
regressions, we need to add the compile check now.  Besides, it's
nicer to report this error at compile time anyhow.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:01:24 -07:00
Paul Berry
156b31c5be mesa: Fix geometry shader program queries.
The queries GEOMETRY_VERTICES_OUT, GEOMETRY_INPUT_TYPE, and
GEOMETRY_OUTPUT_TYPE (defined by GL 3.2) differ from the corresponding
queries in ARB_geometry_shader4 in the following ways:

- They use different enum values

- They can only be queried; they cannot be set.

- Attempting to query them yields INVALID_OPERATION if the program is
  not linked, or lacks a geometry shader.

This patch switches us over from the ARB_geometry_shader4 behaviour to
the GL 3.2 behaviour.

Fixes piglit test query-gs-prim-types.

v2: Improve comment above has_core_gs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:01:22 -07:00
Paul Berry
a49830b8f5 glsl: Account for interface block lowering in program_resource_visitor.
When program_resource_visitor visits variables that were created by
lower_named_interface_blocks, it needs to do extra work to un-do the
effects of lower_named_interface_blocks and construct the proper API
names.

Fixes piglit test
spec/glsl-1.50/execution/interface-blocks-api-access-members.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:01:19 -07:00
Paul Berry
4b97c581b4 glsl: mark variables produced by lower_named_interface_blocks.
These variables will need to be treated specially by
program_resource_visitor, so that they can be addressed through the
API using their interface block name (and array index, for interface
block arrays).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:01:14 -07:00
Paul Berry
99512dc40d glsl: Keep track of centroid/interpolation mode for interface block members.
Fixes piglit tests:
- interface-block-interpolation-{array,named,unnamed}
- glsl-1.50-interface-block-centroid {array,named,unnamed}

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:01:10 -07:00
Paul Berry
e17d671d9f glsl: Pass variable mode into ast_process_structure_or_interface_block().
Later patches will use this information to do proper error checking of
interpolation qualifiers that appear inside of interface blocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:01:07 -07:00
Paul Berry
81a5067966 glsl: Extract interpretation of interpolation to its own function.
In future patches, we will need this in order to interpret
interpolation qualifiers that appear inside interface blocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:01:04 -07:00
Paul Berry
f65feb5335 glsl: Pull interpolation_string() out of ir_variable.
Future patches will need to call this function when there isn't an
ir_varible present to refer to.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:00:59 -07:00
Paul Berry
1e3e72e305 i965: Reduce gl_MaxGeometryInputComponents to 64.
Although in principle there is no hardware limitation that prevents
gl_MaxGeometryInputComponents from being set to 128 on Gen7, we have
the following limitations in the vec4 compiler back end:

- Registers assigned to geometry shader inputs can't be spilled or
  later re-used for any other purpose.

- The last 16 registers are set aside for the "MRF hack", meaning they
  can only be used to send messages, and not for general purpose
  computation.

- Up to 32 registers may be reserved for push constants, even if there
  is sufficient register pressure to make this impractical.

A shader using 128 geometry input components, and having an input type
of triangles_adjacency, would use up:

- 1 register for r0 (which holds URB handles and various pieces of
  control information).

- 1 register for gl_PrimitiveID.

- 102 registers for geometry shader inputs (17 registers per input
  vertex, assuming DUAL_INSTANCED dispatch mode and allowing for one
  register of overhead for gl_Position and gl_PointSize, which are
  present in the URB map even if they are not used).

- Up to 32 registers for push constants.

- 16 registers for the "MRF hack".

That's a total of 152 registers, which is well over the 128 registers
the hardware supports.

Fortunately, the GLSL 1.50 spec allows us to reduce
gl_MaxGeometryInputComponents to 64.  Doing that frees up 48
registers, brining the total down to 104 registers, leaving 24
registers available to do computation.

Fixes piglit test
spec/glsl-1.50/execution/geometry/max-input-components.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:00:57 -07:00
Paul Berry
3c2feb1969 i965/gs: If a DUAL_OBJECT gs would spill, fall back to DUAL_INSTANCED.
This is similar to what we do for 16-wide vs 8-wide fragment shaders.
First we try compiling the geometry shader in DUAL_OBJECT mode.  If we
can't do that without spilling, we fall back on DUAL_INSTANCED mode,
which should require less spilling (since it uses an interleaved
layout of payload registers).

In an ideal world we'd fall back to SINGLE mode, which would allow us
to interleave general-purpose registers too (resulting in even less
likelihood of spilling).  But at the moment, the vec4 generator and
visitor classes don't have the infrastructure to interleave general
purpose registers, so DUAL_INSTANCED is the best we can do.

As a side benefit this paves the way for implementing instanced
geometry shaders (which are incompatible with DUAL_OBJECT mode).

Since most geometry shaders used in piglit testing are small,
DUAL_INSTANCED mode won't get exercised very much in a normal piglit
run.  To force DUAL_INSTANCED mode to be used for all geometry
shaders, set INTEL_DEBUG=nodualobj.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-24 22:00:53 -07:00
Paul Berry
03ac2c7223 i965/gs: Fix up gl_PointSize input swizzling for DUAL_INSTANCED gs.
Geometry shaders that run in "DUAL_INSTANCED" mode store their inputs
in vec4's.  This means that when compiling gl_PointSize input
swizzling (a MOV instruction which uses a geometry shader input as
both source and destination), we need to do two things:

- Set force_writemask_all to ensure that the MOV happens regardless of
  which channels are enabled.

- Set the source register region to <4;4,1> (instead of <0;4,1> to
  satisfy register region restrictions.

v2: move the source register region fixup to the top of
vec4_generator::generate_vec4_instruction(), so that it applies to all
instructions rather than just MOV.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-24 22:00:50 -07:00
Paul Berry
a05589ea0b i965/gs: Add the ability to compile a DUAL_INSTANCED geometry shader.
Not yet enabled.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-24 22:00:46 -07:00
Paul Berry
34cba13ef8 i965/vec4: Add the ability to suppress register spilling.
In future patches, this will allow us to first try compiling a
geometry shader in DUAL_OBJECT mode (which is more efficient but uses
more registers) and then if spilling is required, fall back on
DUAL_INSTANCED mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-24 22:00:43 -07:00
Paul Berry
89647cffb3 i965/vec4: if register allocation fails, don't try to schedule.
Otherwise the scheduler would be invoked with prog_data->total_grf ==
0, causing havoc.

In a future patch, this will allow us to try compiling a geometry
shader in DUAL_OBJECT mode with spilling disabled, and then fall back
to DUAL_INSTANCED mode if that failed.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-24 22:00:40 -07:00
Paul Berry
8bb15813e3 i965/vec4: Add the ability for attributes to be interleaved.
When geometry shaders are operated in "single" or "dual instanced"
mode, a single set of geometry shader inputs is interleaved into the
thread payload (with each payload register containing a pair of
inputs) in order to save register space.

This patch modifies vec4_visitor::lower_attributes_to_hw_regs so that
it can handle the interleaved format.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-24 22:00:37 -07:00
Paul Berry
3da2c5123d i965/gs: Set force_writemask_all when setting up g0.
All geometry shaders begin this instruction:

    mov(1) g0.2<1>:ud 0x0:ud { align1 }

which sets up GRF0 properly for scratch reads and writes.  Since this
instruction has a SIMD size of 1, it will only have an effect if the
first channel is enabled.  In practice, the hardware seems to always
dispatch geometry shaders with the first channel enabled, but I can't
find anything in the docs to guarantee that.

So to be on the safe side, set force_writemask_all on the instruction,
which guarantees that it will have the desired effect regardless of
which channels are enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-24 22:00:37 -07:00
Paul Berry
172aec281d glsl: set explicit_location correctly in lower_named_interface_blocks.
When lower_named_interface_blocks lowers a built-in interface block
member to an ir_variable, it needs to set explicit_location in the
ir_variable.  Otherwise the linker gets confused and treats the
variable as a generic varying.

Fixes the following piglit tests, which were regressed by commit
63974c0 (glsl: Simplify the interface to
link_invalidate_variable_locations):
- clip-distance-bulk-copy
- clip-distance-in-bulk-read
- clip-distance-in-explicitly-sized
- clip-distance-in-param
- clip-distance-in-values
- core-inputs
- gs-redeclares-both-pervertex-blocks
- gs-redeclares-pervertex-in-only
- redeclare-pervertex-subset-vs-to-gs
- unsized-in-named-interface-block-gs
- unsized-in-named-interface-block-multiple
- unsized-in-unnamed-interface-block-gs
- unsized-in-unnamed-interface-block-multiple

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:00:32 -07:00
Paul Berry
85db1326a2 i965/gs: Precompile geometry shaders.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:00:28 -07:00
Paul Berry
e0f34301b2 i965/vec4: Extract function to set up vec4 prog key for precompiling.
This will allow us to re-use it for precompiling geometry shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:00:25 -07:00
Paul Berry
068df64ba6 i965/vec4: Remove uses_clip_distance from program key.
This should never have been in the program key in the first place,
since it's determined by the shader source, not by GL state.  Change
the code to just refer to gl_program::UsesClipDistanceOut directly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:00:22 -07:00
Paul Berry
11634e491b glsl: Move UsesClipDistance from gl_{vertex,geometry}_program into gl_program.
This will make it easier for back-ends to share code between geometry
shader and vertex shader compilation.  Also, it is renamed to
"UsesClipDistanceOut" to clarify that (a) in geometry shaders, it
refers to the gl_ClipDistance output rather than the gl_ClipDistance
input, and (b) it is irrelevant in fragment shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 22:00:13 -07:00
Paul Berry
44b7ebe52d glsl/gs: Fix transform feedback of gl_ClipDistance.
Since gl_ClipDistance is lowered from an array of floats to an array
of vec4's during compilation, transform feedback has special logic to
keep track of the pre-lowered array size so that attempting to perform
transform feedback on gl_ClipDistance produces a result with the
correct size.

Previously, this special logic always consulted the vertex shader's
size for gl_ClipDistance.  This patch fixes it so that it uses the
geometry shader's size for gl_ClipDistance when a geometry shader is
in use.

Fixes piglit test spec/glsl-1.50/transform-feedback-type-and-size.

v2: Change the type of LastClipDistanceArraySize to "unsigned", and
clarify the comment above it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 21:59:39 -07:00
Paul Berry
fe36154ff3 i965: Fix gl_MaxCombinedTextureImageUnits.
We've always overriden
ctx->Const.{Vertex,Fragment}Program.MaxTextureImageUnits to reflect
the number of texture image units supported by the hardware (rather
than using the default values assigned by Mesa core) so it seems
sensible to do that for GeometryProgram.MaxTextureImageUnits too.  We
set it to 0 if geometry shaders aren't supported.

Once that is done, we can just unconditionally add
GeometryProgram.MaxTextureImageUnits to MaxCombinedTextureImageUnits.

Fixes piglit test "spec/glsl-1.50/built-in
constants/gl_MaxCombinedTextureImageUnits".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-24 21:14:26 -07:00
Rob Clark
a453242fda freedreno/a3xx/compiler: relative addressing
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-10-24 20:21:08 -04:00
Rob Clark
4317c4e6e0 freedreno/a3xx: fix const/rel/const-rel encoding
The encoding of constant, relative, and relative-const src registers is
a bit more complex than originally thought, which gives an extra bit to
encode const reg # at expense of taking a bit from relative offset.

In most cases a3xx seems to actually use a scheme whereby it can encode
an extra bit for const register.  You have three possible encodings in
thirteen bits:

   register:  (11 bits for N.c)
     00........... rN.c

   relative:  (10 bits for N)
     010.......... r<a0.x + N>
     011.......... c<a0.x + N>

   const:     (12 bits for N.c)
     1............ cN.c

Which means we can deal w/ more consts than previously thought.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-10-24 20:21:08 -04:00
Rob Clark
bfd30935c9 freedreno/a3xx: add blend state
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-10-24 20:21:08 -04:00
Rob Clark
0a1e4361e8 freedreno/resource: fail more gracefully
Fail more gracefully when buffer allocation/import fails.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-10-24 20:21:08 -04:00
Roland Scheidegger
2b2fc03beb gallivm: implement fully accurate corner filtering for seamless cube maps
d3d10 requires that cube corners are filtered with accurate weights (that
is, the weight of the non-existing corner texel should be evenly distributed
to the other 3 texels). OpenGL does not require this (but recommends it).
This requires us to use different filtering code, since we need per-texel
weights which our 2d lerp doesn't (and can't) do. And of course the (now
per element) weights need to be adjusted too for it to work.
Invoke the new filtering code whenever there's an edge to keep things simpler,
as it will work for edges too not just corners but of course it's only needed
with corners.
More ugly code for not much gain but at least a hacked up cubemap demo
shows very nice corners now... Not sure yet if and how this should be
configurable...

v2: incorporate feedback from Jose, only use special corner filtering code
when there's a corner not when there's only an edge (as corner filtering code
is slower, though a perf difference was only measureable when always
forcing edge code). Plus some minor style fixes.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-10-25 01:29:14 +02:00
Eric Anholt
dde9260fdc mesa: Remove dricore from the build.
No driver uses it any more, and it's been replaced by megadrivers.

v2: Remove always-on conditional for NEED_LIBPROGRAM (review by Emil)

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:13:09 -07:00
Eric Anholt
bdcee13ca3 swrast: Build the driver into the shared mesa_dri_drivers.so.
v2: drop dridir now that it's unused.
v3: Fix linking after rebase when building just swrast from classic but a
    drm-using gallium driver.
v4: Consistently put spaces around += in the updated Makefile.am block.
v5: Set a global driverAPI variable so loaders don't have to update to
    createNewScreen2() (though they may want to for thread safety).

Reviewed-by: Matt Turner <mattst88@gmail.com> (v3)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:13:09 -07:00
Eric Anholt
86d50c2f15 radeon: Build the driver into the shared mesa_dri_drivers.so.
This required some reordering of headers to ensure that the symbol name
redefines happened before any prototypes.

v2: drop dridir now that it's unused.
v3: Consistently put spaces around += in the updated Makefile.am blocks.
v4: Set a global driverAPI variable so loaders don't have to update to
    createNewScreen2() (though they may want to for thread safety).

Reviewed-by: Matt Turner <mattst88@gmail.com> (v2)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:13:09 -07:00
Eric Anholt
6665b71b22 i915: Build the driver into the shared mesa_dri_drivers.so.
i915 has symbols for formerly-shared code that conflict with i965, so we
define them away using gen-symbol-redefs.py.  Options considered:

- This option.  Downsides: The symbols in profiling and debugging don't
  match the source.  The symbol list may change in the future and we won't
  notice without manually running the tool again.

- Use objcopy --localize-hidden to automatically demote our symbols to
  locals.  This didn't work on i965 due to c++ weak symbols (which can't
  be localized), but could work on i915.  We could do it on i915 only, but
  it does produce libtool warnings at link time due to libtool not knowing
  if the resulting .o file is safe to link (stupid libtool).  Plus you end
  up with different symbols of the same name, which is confusing for
  debugging too.  On the other hand, no future symbol conflicts long term.

- Write our own libelf tool that handles c++ weak symbols like we want and
  apply it to all drivers.  All the downsides of above, but applies
  uniformly across drivers.

- Edit the files to just rename all the i915 or i965 symbols that
  conflict.  There are on the order of 100 that have a prefix we used to
  share, so it would take a bit of typing.  Fewest downsides, but still
  can have conflicts long term.

Ultimately, this is the least invasive change at the moment, and we can
see if the "more symbol conflicts appear later" thing is a real concern or
not.

Note that the ability to compile a version of i915 without INTEL_DEBUG env
support is dropped.  It's too useful.

v2: drop dridir now that it's unused.
v3: Consistently put spaces around += in the updated Makefile.am block.
v4: Set a global driverAPI variable so loaders don't have to update to
    createNewScreen2() (though they may want to for thread safety).

Reviewed-by: Matt Turner <mattst88@gmail.com> (v2)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:13:09 -07:00
Eric Anholt
ba10d79cca dri: Add a tool for generating #defines to namespace driver global symbols.
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:13:09 -07:00
Eric Anholt
ead86e378f nouveau: Build the driver into the shared mesa_dri_drivers.so.
v2: drop dridir now that it's unused.
v3: Consistently put spaces around += in the updated Makefile.am block.
v4: Set a global driverAPI variable so loaders don't have to update to
    createNewScreen2() (though they may want to for thread safety).
v5: Fix missed public symbol in nouveau. (caught by Emil)

Reviewed-by: Matt Turner <mattst88@gmail.com> (v2)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:13:08 -07:00
Eric Anholt
1925a9aebd i965: Build the driver into a shared mesa_dri_drivers.so .
Previously, we've split things such that mesa core is in libdricore,
exposing the whole Mesa core interface in the global namespace, and the
i965_dri.so code all links against that.  Along with polluting application
namespace terribly, it requires extra PLT indirections and prevents LTO.

Instead, we can build all of the driver contents into the same .so with
just a few symbols exposed to be referenced from the actual driver .so
file, allowing LTO and reducing our exposed symbol count massively.

FPS improvement on GLB2.7 with INTEL_NO_HW=1: 2.61061% +/- 1.16957% (n=50)
(without LTO, just the PLT reductions from this commit)

Note that the X Server requires commit
7ecfab47eb221dbb996ea6c033348b8eceaeb893 to successfully load this driver!

v2: Set a global driverAPI variable so loaders don't have to update to
    createNewScreen2() (though they may want to for thread safety).
v3: Drop AM_CPPFLAGS addition (Emil pointed out I'd missed some cflags
    that would be necessary, though only if we actually relied on them).
v4: Fix install with DESTDIR set.

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (v2)
2013-10-24 14:12:58 -07:00
Eric Anholt
4e54751624 dri: Implement a DRI vtable extension to replace the global driDriverAPI.
As we move to megadrivers, we are unable to build multiple drivers with
the same public global symbol per driver (Think an X Server with an intel
and a nouveau driver, and the X Server implementing indirect for both --
we have to actually talk to the right driver).  By slipping the
driDriverAPI vtable into the driver's extension list, we can replace the
usage of the global symbol with usage of the loader-dlsym()ed driver
information.

v2: Pull in the hunk to avoid crashing on null driver_extensions.  Thanks,
    Emil!

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:04:20 -07:00
Eric Anholt
f93533d118 dri: Pass in the dlsym()ed driver extension to screen creation.
This will allow a megadrivers build to reference the actual driver being
loaded from the shared dri_util screen creation code.

v2: Fix indentation, fallback case in EGL (review by Emil).

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:04:20 -07:00
Eric Anholt
67caf36489 gbm: Add support for the new __driDriverGetExtensions interface.
v2: Fix uninitialized variable use in the old-ABI case.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:04:20 -07:00
Eric Anholt
a64bb7553a egl: Add an optional function call for getting the DRI driver interface.
v2: Fix asprintf error checking.

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:04:20 -07:00
Eric Anholt
fcb57a8210 glx: Add an optional function call for getting the DRI driver interface.
The previous interface relied on a static struct, which meant that the
driver didn't get a chance to edit the struct before the struct got used.
For megadrivers, I want struct specific to the driver being loaded.

v2: Fix the prototype in the docs (caught by Marek).  Since the driver
    name was in the function, we didn't need to also pass it in.
v3: Fix asprintf error checking (caught by Matt's gcc).

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:04:20 -07:00
Eric Anholt
6868923702 dri: Move driver config options to dri driver extensions.
This way they aren't all sitting in the global namespace (with the same
name per driver).

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:04:20 -07:00
Eric Anholt
cf5d8fc310 dri: Allow config options to be passed to the loader through extensions.
Turns out already we have this nice mechanism for providing optional
things from the driver to the loader, and I was going to have to rename
the public global symbol to avoid conflicts when doing megadrivers.

While the former __driConfigOptions is technically loader interface, this
is the only loader that made use of that symbol.  Continue paying
attention to it if we can't find the new option, to retain compatibility
with old drivers.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:04:20 -07:00
Eric Anholt
80806c98ef glx: Move the driver extension-loading to a helper function.
I'm planning on doing driver extension parsing from 3 places, and making
the extension loading step a bit longer.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:04:20 -07:00
Francisco Jerez
7463abd37d clover: Query maximum kernel block size from the device instead of the kernel object.
Based on a similar fix from Aaron Watry.  It seems unlikely that we
will ever need a kernel-specific setting for this, and the Gallium API
doesn't support it.  Remove kernel::max_block_size() altogether.
2013-10-24 13:33:41 -07:00
Brian Paul
b8d7a97fad glsl: silence unused 'var' variable warning
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-24 10:45:47 -06:00
Brian Paul
8d7b913e4e svga: remove user-space vertex/index buffer code
The gallium vbuf module, which we've been using for some time now, takes
care of uploading user-space vertex/index data into real buffers.  The
upload code in the svga driver was unused.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-10-24 10:45:47 -06:00
Chad Versace
2f6a315085 i965: Print more debuginfo in intel_texsubimage_memcpy()
Print info about packing, format, type, and tiling. This will help debug
future issues with this fastpath.

Reviewed-by: Frank Henigman <fjhenigman@google.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-24 09:25:45 -07:00
Chad Versace
c4205590e7 i965: Fix glTexImage when packing alignment != cpp
Fixes texture corruption of Weston clients on cairo-glesv2 backend.
Commit 49ed599 introduced the bug.

Corruption occured when glTexSubImage called
intel_texsubimage_tiled_memcpy() with:
  x,y=10,9
  w,h=7,7
  format=GL_ALPHA(0x1906)
  type=GL_UNSIGNED_BYTE(0x1401)
  gl_format=MESA_FORMAT_A8(0x18)
  packing.alignemnt=4

The function miscalculated the source image's stride as w*cpp=7 without
taking into account the packing alignment. The actual stride was 8.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70435
Reported-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by:Frank Henigman <fjhenigman@google.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-24 09:25:24 -07:00
Rob Clark
a6e45b6a17 freedreno: fix compile error
Small typo introduced in a3ed98f.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-10-23 18:38:05 -06:00
Paul Berry
4df56177ed i965/fs: Only unroll high-accuracy dFdy() from SIMD16 to SIMD8 on gen4 and IVB.
In commit 800610f (i965/fs: Improve accuracy of dFdy() to match
dFdx()) I unrolled the high-accuracy dFdy() computation from a single
SIMD16 instruction to two SIMD8 instructions because of text I found
in the i965 (gen4) PRM saying that instruction compression could not
be used in align16 mode.  I couldn't find similar text in later
hardware docs, and I observed problems trying to use instruction
compression on align16 mode on Ivy Bridge, so I assumed that the
restriction still applied and the associated documentation had simply
been lost.

After consultation with the hardware engineers, it turns out this is
not the case.  In point of fact, the restriction was dropped in gen5,
re-introduced in Ivy Bridge, and dropped again in Haswell.  The reason
I didn't notice this is that in the Ivy Bridge documentation, the
restriction was in a different section, and described using different
language.

Now that we know that the restriction only applies to Gen4 and Ivy
Bridge, we can limit the unrolling to those platforms.

Tested on gen5, gen6, and gen7 (both Ivy Bridge and Haswell).

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-23 16:51:15 -07:00
Paul Berry
8e15207c9d glsl/gs: Prevent illegal input/output primitive types.
From the GLSL 1.50 spec, section 4.3.8.1 (Input Layout Qualifiers):

    The layout qualifier identifiers for geometry shader inputs are

        layout-qualifier-id
            points
            lines
            lines_adjacency
            triangles
            triangles_adjacency

And from section 4.3.8.2 (Output Layout Qualifiers)

    The layout qualifier identifiers for geometry shader outputs are

        layout-qualifier-id
            points
            line_strip
            triangle_strip
            max_vertices = integer-constant

We were erroneously allowing line_strip and triangle_strip to be used
as input qualifiers, and we were allowing lines, lines_adjacency,
triangles, and triangles_adjacency to be used as output qualifiers.

Fixes piglit tests "glsl-1.50-gs-{input,output}-layout-qualifiers *".

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-23 16:51:05 -07:00
Eric Anholt
867d0cc1fe i965: Add perf debug hint when the app makes us do index buffer scanning.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-23 15:33:46 -07:00
Eric Anholt
c298f5ff56 i965: Try to avoid stalls on the GPU when doing glBufferSubData().
On DOTA2, framerate on dota2-de1.dem in windowed mode on my laptop
improves by 7.69854% +/- 0.909163% (n=3).  In a microbenchmark hitting
this code path (wall time of piglit vbo-subdata-many), runtime decreases
from 0.8 to 0.05 seconds.

v2: Use out of range start/end instead of separate bool for the active
    flag (suggestion by Jordan), fix double-upload in the stalling path.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-23 15:33:19 -07:00
Eric Anholt
3b58e0ed64 i965: Be sure to reset brw->vb.buffers[] when trying to redo vertex setup.
The brw_prepare_vertices that sets up buffers[] depends on these
parameters, so don't let brw_prepare_vertices() skip it.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-23 15:33:16 -07:00
Eric Anholt
a5e2e7f9a4 i965: Add support for GL_ARB_texture_buffer_range.
Supporting this extension turns out to simplify our code a bit over not
supporting this extension, once the glBufferSubData() synchronization code
lands.

v2: Use 16 byte alignment like we do for uniform buffers, due to unaligned
    access penalties.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> (v1)
2013-10-23 15:33:10 -07:00
Eric Anholt
b37f7e0160 i965: Add a note about the late-allocation in intel_bufferobj_buffer().
This was mostly for the i915 system-memory VBO code, which we don't have
any more, but since that existed we've ended up producing dependencies on
it being there.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-23 15:33:06 -07:00
Eric Anholt
060a49a896 i965: Drop intel_bufferobj_source().
Since src_offset was always 0, it wasn't doing anything for us beyond
intel_bufferobj_buffer().

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-23 15:33:03 -07:00
Eric Anholt
c0a9436d19 i965: Fix texture buffer rendering after a whole buffer replacement.
If glBufferData(), glBufferSubData(0, obj->Size), or similar happens, we
get a new drm_intel_bo for the buffer object, and thus need to re-upload
texture buffer state so we point at the new data.

Fixes the new piglit GL_ARB_texture_buffer_object/data-sync

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-23 15:31:44 -07:00
David Heidelberger
2901e2efcd clover: fix build after a3ed98f7aa 2013-10-23 13:13:36 -07:00
Brian Paul
c1345720c8 nv50: clamp PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS to PIPE_MAX_SAMPLERS
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70212
Tested-by: Aaron Watry <awatry@gmail.com>
2013-10-23 13:43:18 -06:00
Brian Paul
ef98e2ee61 radeonsi: remove unused si_set_cs_sampler_view()
Fixes build breakage.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70804

Tested-by: Vinson Lee <vlee@freedesktop.org>
2013-10-23 13:42:51 -06:00
Brian Paul
a3ed98f7aa gallium: new, unified pipe_context::set_sampler_views() function
The new function replaces four old functions: set_fragment/vertex/
geometry/compute_sampler_views().

Note: at this time, it's expected that the 'start' parameter will
always be zero.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-23 10:15:38 -06:00
Brian Paul
b11fc226e6 svga: remove unneeded include of u_double_list.h 2013-10-23 10:15:38 -06:00
Kenneth Graunke
30bb170479 i965: Expose write_reg() as brw_store_register_mem64().
Writing a 64-bit register value to memory is sufficiently complicated
that it makes sense to reuse this function rather than duplicating it.

Exposing it outside of gen6_queryobj.c means it needs a more descriptive
function name.  It could probably be moved to brw_util.c or somewhere
else, but this works too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-23 01:06:26 -07:00
Kenneth Graunke
d5db3ece0a i965: Move flushing out of write_reg and into the callers.
The current callers just want to write a single register, so combining
the register read with a pipeline flush made sense.  However, in the
future we'll want to do multiple register reads back to back, and we'll
only want to flush once.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-23 01:06:26 -07:00
Ian Romanick
63974c0f5b glsl: Simplify the interface to link_invalidate_variable_locations
The unit tests added in the previous commits prove some things about the
state of some internal data structures.  The most important of these is
that all built-in input and output variables have explicit_location
set.  This means that link_invalidate_variable_locations doesn't need to
know the range of non-generic shader inputs or outputs.  It can simply
reset location state depending on whether explicit_location is set.

There are two additional assumptions that were already implicit in the
code that comments now document.

  - ir_variable::is_unmatched_generic_inout is only used by the linker
    when connecting outputs from one shader stage to inputs of another
    shader stage.

  - Any varying that has explicit_location set must be a built-in.  This
    will be true until GL_ARB_separate_shader_objects is supported.

As a result, the input_base and output_base parameters to
link_invalidate_variable_locations are no longer necessary, and the code
for resetting locations and setting is_unmatched_generic_inout can be
simplified.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-22 15:23:30 -07:00
Ian Romanick
1eee0a9f01 glsl/tests: Unit test vertex shader in / out with link_invalidate_variable_locations
Validates:

  - ir_variable::explicit_location should not be modified.

  - If ir_variable::explicit_location is not set, ir_variable::location,
    ir_variable::location_frac, and
    ir_variable::is_unmatched_generic_inout must be reset to 0.

  - If ir_variable::explicit_location is set, ir_variable::location
    should not be modified.  ir_variable::location_frac, and
    ir_variable::is_unmatched_generic_inout must be reset to 0.
    Previous unit tests have shown that all non-generic inputs / outputs
    have explicit_location set.

v2: Split the link_invalidate_variable_locations interface change out to
a separate patch.  Remove the vertex_in_builtin_without_explicit and
vertex_out_builtin_without_explicit tests.  There was a lot of good
discussion about this on the mailing list to which I refer the
interested reader.  Both changes suggested by Paul.

    http://lists.freedesktop.org/archives/mesa-dev/2013-October/046652.html

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-22 15:23:30 -07:00
Ian Romanick
cf8b14ce6d glsl: Modify interface to link_invalidate_variable_locations
This will make it easier to unit test this function in successive
patches.  Also, correct the prototype in linker.h.  It was... wrong.

v2: Split the interface change from adding the unit tests.  Suggested by
Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-22 15:23:30 -07:00
Ian Romanick
af229c94e3 glsl/tests: Verify geometry shader built-ins generated by _mesa_glsl_initialize_variables
Checks that the variables generated meet certain criteria.

 - Geometry shader inputs have an explicit location.

 - Geometry shader outputs have an explicit location.

 - Fragment shader-only varying locations are not used.

 - Geometry shader uniforms and system values don't have an explicit
   location.

 - Geometry shader constants don't have an explicit location and are
   read-only.

 - No other kinds of geometry variables exist.

It does not verify that an specific variables exist.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-22 15:23:30 -07:00
Ian Romanick
f094a0f825 glsl/tests: Verify fragment shader built-ins generated by _mesa_glsl_initialize_variables
Checks that the variables generated meet certain criteria.

 - Fragment shader inputs have an explicit location.

 - Fragment shader outputs have an explicit location.

 - Vertex / geometry shader-only varying locations are not used.

 - Fragment shader uniforms and system values don't have an explicit
   location.

 - Fragment shader constants don't have an explicit location and are
   read-only.

 - No other kinds of fragment variables exist.

It does not verify that an specific variables exist.

v2: Use _mesa_varying_slot_in_fs in
fragment_builtin.inputs_have_explicit_location.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-22 15:23:30 -07:00
Ian Romanick
d05202900b glsl/tests: Verify vertex shader built-ins generated by _mesa_glsl_initialize_variables
Checks that the variables generated meet certain criteria.

 - Vertex shader inputs have an explicit location.

 - Vertex shader outputs have an explicit location.

 - Fragment shader-only varying locations are not used.

 - Vertex shader uniforms and system values don't have an explicit
   location.

 - Vertex shader constants don't have an explicit location and are
   read-only.

 - No other kinds of vertex variables exist.

It does not verify that an specific variables exist.

v2: Fix memory management mistakes in
common_builtin::string_starts_with_prefix.  Clean up error message
reporting in common_builtin::no_invalid_variable_modes.  Both suggested
by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-22 15:23:30 -07:00
Ian Romanick
78b70ceae1 glsl: When constructing a variable with an interface type, set interface_type
Ever since the addition of interface blocks with instance names, we have
had an implicit invariant:

    var->type->is_interface() ==
        (var->type == var->interface_type)

The odd use of == here is intentional because !var->type->is_interface()
implies var->type != var->interface_type.

Further, if var->type->is_array() is true, we have a related implicit
invariant:

    var->type->fields.array->is_interface() ==
        (var->type->fields.array == var->interface_type)

However, the ir_variable constructor doesn't maintain either invariant.
That seems kind of silly... and I tripped over it while writing some
other code.  This patch makes the constructor do the right thing, and it
introduces some tests to verify that behavior.

v2: Add general-ir-test to .gitignore.  Update the description of the
ir_variable invariant for arrays in the commit message.  Both suggested
by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-22 15:23:30 -07:00
Ian Romanick
09ceed7587 mesa/tests: Add simple, dumb test for _mesa_program_state_string
After some discussions about the correct way to update
_mesa_program_state_string, I decided to make a unit test for the
function.  It turns out that the function didn't work quite the way I
thought.  The unit test proves that the code was already correct.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Anuj Phogat <anuj.phogat@gmail.com>
2013-10-22 15:23:30 -07:00
Ander Conselvan de Oliveira
98b359bd1b wayland: Don't leak wl_drm global when unbinding display 2013-10-22 14:57:03 -07:00
Scott Graham
dafa97fed9 mesa: fixes for MSVC 2013
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-22 08:39:40 -06:00
Brian Paul
65ee044a97 st/mesa: minor whitespace, comment changes in st_draw.c 2013-10-22 08:20:45 -06:00
Brian Paul
f166fbae36 st/dri: minor formatting clean-ups in dri_context.c 2013-10-22 08:20:45 -06:00
Brian Paul
f0d4636d9c mesa: fix a couple issues with U_FIXED, I_FIXED macros
Silence a bunch of MSVC type conversion warnings.

Changed return type of S_FIXED to int32_t (signed).  The result
is the same.  It just seems more intuitive that a signed conversion
function should return a signed value.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-10-22 08:20:45 -06:00
Brian Paul
6767c56e6d mesa: remove GL_MESA_program_debug bits from gl.h
The code for this was removed from Mesa some time ago.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-22 08:20:45 -06:00
Brian Paul
971c74309e mesa: remove remnants of GL_MESA_shader_debug
This extension never saw any real use so remove it.

v2: also update tests/num_strings.cpp for 'make check'

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-22 08:20:45 -06:00
Kenneth Graunke
43b05b8fac i965: Only emit interpolation setup if there are actual FS inputs.
Dead code elimination would get rid of the extra instructions, but
skipping this saves iterations through the optimization loop.

From shader-db:

      N     Min     Max        Median           Avg        Stddev
x 14672       3      16             3     3.1334515    0.59904168
+ 14672       1      16             3     2.8955153    0.77732963
Difference at 95.0% confidence
        -0.237936 +/- 0.0158798
        -7.59342% +/- 0.506783%
        (Student's t, pooled s = 0.693935)

Embarassingly, the classic shadow mapping shader:

   void main() { }

used to require three iterations through the optimization loop.
With this patch, it only requires one (which makes no progress).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-21 23:31:15 -07:00
Chris Forbes
c4de86fd26 i965/fs: Fix accidental type conversion in header setup
Previously one side could be UD while the other was float.

V2: Prefer float; apparently IVB can dispatch float ops faster. (Thanks
Eric)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-22 18:56:14 +13:00
Chris Forbes
b38af01ccf i965/fs: Fix handling of sampler messages with header but zero offset
Gather unconditionally uses a header, but in some cases the
texture_offset value will be zero.

V2: Don't introduce a bogus conversion.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-22 18:56:14 +13:00
Matt Turner
f1e605f1ad glsl: Optimize -(-expr) into expr.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-21 22:53:36 -07:00
Matt Turner
963df4d37d glsl: Optimize abs(-expr) and abs(abs(expr)) into abs(expr).
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-21 22:53:36 -07:00
Matt Turner
5b3aec412e glsl: Use saved values instead of recomputing them.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-21 22:53:36 -07:00
Matt Turner
6aeb7514c3 docs: Mark GLSL 1.50, 3.30, and geometry shaders done for i965.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-21 22:53:36 -07:00
Rico Schüller
aab03f75f3 docs: Update docs for ARB_texture_mirror_clamp_to_edge.
Signed-off-by: Rico Schüller <kgbricola@web.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-21 21:02:51 -07:00
Kenneth Graunke
2d3282188e i965: Implement ARB_texture_mirror_clamp_to_edge.
This passes Piglit's texwrap tests.

v2: Remove _EXT suffix.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Rico Schüller <kgbricola@web.de>
2013-10-21 21:02:51 -07:00
Kenneth Graunke
cc2f87891b i965: Drop unused simple_list.h includes.
These don't appear to be necessary.  Everything compiles just fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-21 21:02:51 -07:00
Kristian Høgsberg
1a2a30ba20 gbm-dri: Support importing RGB565 buffers 2013-10-21 20:56:17 -07:00
Paul Berry
672fab0b1b glsl/linker: Allow mixing of desktop GLSL versions.
Previously, Mesa followed the linkage rules outlined in the GLSL
1.20-1.40 specs, which (collectively) said that GLSL versions 1.10 and
1.20 could be linked together, but no other versions could be linked.

In GLSL 4.30, the linkage rules were relaxed so that any two desktop
GLSL versions can be linked together.  This change was made because it
reflected the behaviour of nearly all existing implementations (see
Khronos bug 8463).  Mesa was one of the few (perhaps the only)
exceptions to prohibit cross-linking of some GLSL versions.

Since the GLSL linkage rules were deliberately relaxed in order to
match the behaviour of existing implementations, it seems appropriate
to relax the rules in Mesa too (even though Mesa doesn't support GLSL
4.30 yet).

Note that linking ES and desktop shaders is still prohibited, as is
linking ES shaders having different GLSL versions.

Fixes piglit tests "shaders/version-mixing {interstage,intrastage}".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-21 17:27:41 -07:00
Francisco Jerez
e26ed75066 clover: Improve region and pitch argument handling in memory transfer APIs.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:04 -07:00
Francisco Jerez
adefa84d66 clover: Add a pixel_size() method to the image class.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:04 -07:00
Francisco Jerez
6230f77232 clover: Implement support for the ICD extension.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
9a5afd0dbd clover: Make sure hidden is the default symbol visibility.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Tom Stellard
07567c17f1 clover: Prepare the build system for ICD support.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2013-10-21 10:47:03 -07:00
Francisco Jerez
9e0b7f76f9 clover: Fix memory leak when initializing a device object fails.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
1d741e3ac0 clover: Tidy up resource::mapping.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
6db102597a clover: Simplify command_queue::flush().
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
7a9bbff7d6 clover: Clean up the kernel and program object interface.
[ Tom Stellard: Make sure to bind global arguments before retrieving handles. ]
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
10284b1d2d clover: Clean up the interface of the context object slightly.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
5226eacf8d clover: Delete copy constructors and assignment operators in all non-copiable objects.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
369419f761 clover: Define a few convenience equality operators.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
c6e7a0d0d3 clover: Simplify the platform object by using util/range.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
e5fc61fa3f clover: Add property list helpers with a syntax consistent with other API objects.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
04d0ab9f64 clover: Switch samplers to the new model.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
d6f7afc3ed clover: Switch memory objects to the new model.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
35307f540f clover: Switch kernel and program objects to the new model.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
9968d9daf2 clover: Switch command queues to the new model.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:03 -07:00
Francisco Jerez
257781f243 clover: Switch event objects to the new model.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
9d06fb8fa8 clover: Switch context objects to the new model.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
c9e009b74d clover: Switch device objects to the new model.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
49a49e0742 clover: Switch platform objects to the new model.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
bff60c894a clover: Define helper classes for the new object model.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
d8b4994281 clover: Clean up property query functions by using a new property_buffer helper class.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
7d61769e44 clover: Switch to the new utility code.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
099d281b38 clover: Name include guards consistently.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
8e14b82fd2 clover: Replace a bunch of double underscores with single underscores.
Identifiers with double underscores are reserved, and using them has
undefined behavior according to the C++ spec.  It's unlikely to make
any difference, but...

Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
ebfdce079b clover: Clean up the event profiling code.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
e93efa0d50 clover: Import new utility library.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Francisco Jerez
7baad4b996 clover: Require GCC 4.7 or higher to build.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-21 10:47:02 -07:00
Tom Stellard
4f49c97afe clover: Use std::numeric_limits<std::size_t>::max() instead of SIZE_MAX
This prevents a build failure on some systems.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-10-21 10:47:02 -07:00
Roland Scheidegger
ac81b6f2be llvmpipe: enable seamless cube filtering
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-21 15:42:04 +02:00
Roland Scheidegger
3bdd1074e1 gallivm: implement seamless cube filtering
For seamless cube filtering it is necessary to determine new faces and new
coords per sample. The logic for this is _seriously_ complex (what needs
to happen is very "asymmetric" wrt face, x/y under/overflow), further
complicated by the fact that if the 4 samples are in a corner (meaning we
only have actually 3 samples, and all 3 are on different faces) then
falling off the edge is happening _both_ on x and y axis simultaneously.
There was a noticeable performance hit in mesa's cubemap demo when seamless
filtering was forced on (just below 10 percent or so in a debug build, when
disabling all filtering hacks, otherwise it would probably be a bit more) and
when always doing the logic, hence use a branch which it only does it if any
of the pixels in a quad (or in two quads) actually hit this. With that there
was no measurable performance hit in the cubemap demo (neither in a debug nor
release buidl), but this will vary (cubemap demo very rarely hits edges).
Might also be different on other cpus, as this forces SoA sampling path which
potentially can be quite a bit slower.
Note that as for corners, this code gets all the 3 samples which actually
exist right, and the 4th texel will simply be the same as one of the others,
meaning that filter weights will be a bit wrong. This however should be
enough for full OpenGL (but not d3d10) compliance.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-21 15:42:04 +02:00
Christian König
21a57f9040 winsys/radeon: cleanup CS offloading
Using atomic function for ncs is superfluous since it is
protected by a mutex anyway. Also lock the mutex only once
while retrieving the next CS for submission.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-10-21 10:20:18 +02:00
Rico Schüller
14429295e1 radeon: Enable ARB_texture_mirror_clamp_to_edge.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
2013-10-20 20:12:39 -07:00
Rico Schüller
5da618c20e r200: Enable ARB_texture_mirror_clamp_to_edge.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
2013-10-20 20:12:39 -07:00
Rico Schüller
e487948bef gallium: Enable ARB_texture_mirror_clamp_to_edge.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
2013-10-20 20:12:39 -07:00
Rico Schüller
a59ae25d81 swrast: Enable ARB_texture_mirror_clamp_to_edge.
v2: fix commit message

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
2013-10-20 20:12:39 -07:00
Rico Schüller
1bbd3bb98a mesa: Add infrastructure for GL_ARB_texture_mirror_clamp_to_edge.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Rico Schüller <kgbricola@web.de>
2013-10-20 20:12:08 -07:00
Alexander von Gluck IV
50370e483b scons: Fix Haiku missing library
* The softpipe add-on needs libtranslation
  due to the use of BTranslatorRoster

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-20 19:20:59 -05:00
Alexandre Demers
24fd074ce7 docs: Updating forgotten GL feature completion for r600 2013-10-21 01:35:08 +02:00
David Heidelberger
c948aab96c r300g/compiler: Fix unsigned comparison with less than zero
rc_find_free_temporary_list() returns signed integer
(in case of lack of free temporary registers returns -1),
so new_index in radeon_rename_regs() should be signed.

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

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-10-21 01:31:51 +02:00
Vinson Lee
c325aa5d80 r600g/sb: Initialize shader::dce_flags.
Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-10-20 00:38:40 -07:00
Kenneth Graunke
00b5d8aeae i965: Mark G45 as having surface tile offset support.
Fixes a regression since 02b632d8e8.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-19 18:43:09 -07:00
Vinson Lee
37cd9ac6df glsl: Initialize per_vertex_accumulator::fields.
Fixes "Uninitialized pointer field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-18 18:29:18 -07:00
Vinson Lee
136a12ac98 mesa: Remove GLXContextID typedef from glx.h.
Fixes this build error.

  CC     clientattrib.lo
In file included from ../../include/GL/glx.h:333,
                 from glxclient.h:45,
                 from clientattrib.c:32:
../../include/GL/glxext.h:275: error: redefinition of typedef ‘GLXContextID’
../../include/GL/glx.h:171: note: previous declaration of ‘GLXContextID’ was here

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70591
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-10-18 18:08:31 -07:00
Carl Worth
bf7b425083 docs: Import 9.2.2 release notes, add news item. 2013-10-18 17:19:31 -07:00
Kenneth Graunke
653cc008a8 docs: Note that we support OpenGL 3.3 in the release notes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-18 15:24:18 -07:00
Kenneth Graunke
567445e2b9 i965: Enable OpenGL 3.3 and GLSL 3.30.
Everything necessary for these appears to be implemented.  We'll want to
add more tests to guard against bugs, but it should be functionally
complete.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-18 15:24:18 -07:00
Jon TURNEY
cedfd79be2 translate_sse: Fix generated code argument handling for msabi on x86_64
translate_sse.c contains code for msabi on x86_64, but it appears to be
untested.

Currently arguments 1 and 2 passed to the generated code are moved as 32-bit
quantities into the registers used by sysvabi, irrespective of the architecture.
Since these may be pointers, they must be moved as 64-bit quantities to avoid
truncation.

Commit f4dd099171 disabled tranlate_sse.c on MinGW
x86_64, I don't know if was due to this issue, or a different one...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-18 14:17:15 +01:00
Jon TURNEY
72a0f832ec rtasm: Cygwin uses the msabi calling convention on x86_64
Cygwin also uses the msabi calling convention on x86_64, not the sysvabi calling
convention

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>

ignored, and an empty message aborts the commit.
2013-10-18 14:16:56 +01:00
Jon TURNEY
87e84acbfd rtasm: The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation which uses mmap()
The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation
which uses mmap() to allocate an anonymous page with execute permission, rather
than the one which just uses malloc().

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-18 14:16:27 +01:00
Alexander von Gluck IV
9aad1ba70f scons: Simplified fix of llvm cxxflags for rtti
* Based on ideas of Jose Fonseca
* A rework of ce8eadb6e8

Tested-by: Vinson Lee <vlee@freedesktop.org>
2013-10-17 20:33:05 -05:00
Paul Berry
b08195faec glsl: Fix MSVC build (missing strcasecmp())
MSVC doesn't have a strcasecmp() function; it uses _stricmp() instead.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-10-17 18:11:22 -07:00
Kenneth Graunke
b3360d23ac i965: Fold brwInitVtbl() into brwCreateContext().
With most of the virtual functions gone, brwInitVtbl() is now tiny.

Merging it into the caller allows us to delete the entire file.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-17 14:27:03 -07:00
Kenneth Graunke
f8fef8ee92 i965: Merge brw_destroy_context() into intelDestroyContext().
Now that i915 and i965 have been split, the separation between
intelDestroyContext and brw_destroy_context is kind of arbitrary.

This patch replaces the only brw->vtbl.destroy() call with the body
of brw_destroy_context (the only implementation of that virtual
function).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-17 14:27:03 -07:00
Kenneth Graunke
7601ba649f i965: Replace dri_bo_release with drm_intel_bo_unreference.
dri_bo_release is a helper function that calls drm_intel_bo_unreference
but then also sets the pointer to NULL.  This is unnecessary, since
brw_destroy_context is called from intelDestroyContext, which also frees
brw completely.

If you're still trying to access them, you've got bigger problems.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-17 14:27:03 -07:00
Kenneth Graunke
5f76bc37ab i965: Unindent the body of intelDestroyContext.
Having almost the entire body of the function indented one level for a
check that should never happen seems silly.  Just early return.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-17 14:27:03 -07:00
Kenneth Graunke
80a9c42e9e i965: Un-virtualize brw_new_batch().
Since the i915/i965 split, there's only one implementation of this
virtual function.  We may as well just call it directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-17 14:27:03 -07:00
Kenneth Graunke
6613f346ac i965: Un-virtualize brw_finish_batch().
Since the i915/i965 split, there's only one implementation of this
virtual function.  We may as well just call it directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-17 14:27:03 -07:00
Paul Berry
e2d1eaa32a glsl: In update_max_array_access, fix interface instance check.
In commit f878d20 (glsl: Update ir_variable::max_ifc_array_access
properly), I accidentally used the wrong kind of check to determine
whether the variable being accessed was an interface instance (I used
var->get_interface_type() != NULL when I should have used
var->is_interface_instance()).  As a result, if an unnamed interface
block contained a struct which contained an array,
update_max_array_access() would mistakenly interpret the struct as a
named interface block and try to dereference a null
var->max_ifc_array_access.

This patch corrects the check, fixing the null dereference.

Fixes piglit test interface-block-struct-nesting.

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

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-17 11:51:06 -07:00
Paul Berry
79e835a712 glsl: Treat layout-qualifier-id's as case-insensitive in desktop GLSL.
In desktop GLSL, location qualifiers are case-insensitive.  In GLSL
ES, they are case-sensitive.  This patch handles the difference by
using a new function to match layout qualifiers,
match_layout_qualifier(), which calls either strcmp() or strcasecmp()
as appropriate.

Fixes piglit tests:
- layout-not-case-sensitive-in.geom
- layout-not-case-sensitive-max-vert.geom
- layout-not-case-sensitive-out.geom
- layout-not-case-sensitive.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-17 11:51:01 -07:00
Brian Paul
a36f7e651e mesa: remove PFNGLBLENDCOLORPROC, PFNGLBLENDEQUATIONPROC typedefs in gl.h
Fixes error about duplicated typedefs (also in glext.h) reported on
NetBSD 6.1

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70546
Tested-by:  Vinson Lee <vlee@freedesktop.org>
2013-10-17 12:10:39 -06:00
Brian Paul
282bb87366 st/mesa: add a few comments in st_create_context_priv() 2013-10-17 09:28:17 -06:00
Dave Airlie
530afc82a1 st/mesa: handle layer and primitive id output and point size input
This fixes a number of piglit crashes when running on a hacked up llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-17 08:35:42 +01:00
Dave Airlie
038a9aab33 st/mesa: add geometry shader ubo support
This just adds the missing bits so the ubo tests don't crash.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-17 08:35:42 +01:00
Fabian Bieler
20cad7fd6f mesa/st: Allow geometry shaders without gl_Position export.
From the ARB_geometry_shader4 spec (section Geometry Shader outputs):
"The built-in special variable gl_Position is intended to hold the
homogeneous vertex position. Writing gl_Position is optional."

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-17 08:35:42 +01:00
Bryan Cain
9bfa475684 st/mesa, glsl_to_tgsi: add support for geometry shaders
v2 (Bryan Cain <bryancain3@gmail.com>): fix 2D array indexing order.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-17 08:35:42 +01:00
Bryan Cain
6b0df34ae5 mesa/st: Add VARYING_SLOT_TEX[1-7] to st_translate_geometry_program().
v2 (Paul Berry <stereotype441@gmail.com>: Split out to separate patch
(previously this was part of "glsl: add builtins for geometry
shaders.")

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-17 08:35:42 +01:00
Kristian Høgsberg
4ef1c8fb4c Revert "i965: Create ARGB2101010 DRI configs"
Exposing 10-bit color configs confuses too many applications that try to
use the chooser to pick an 8 bit config.  The chooser consider an fbconfig
with more bits a better match and will thus give a 10 bit config when an
application asks for a config with GLX_RED_SIZE 1 or 8.

One key example is glxinfo, which does this, and then doesn't specify that
it needs a config where GLX_DRAWABLE_TYPE has the GLX_WINDOW_BIT set.
This way it ends up with a 10 bit config that it can't use to create a
GLX window and fails to log extensions.

This reverts commit f354bcc177.

https://bugs.freedesktop.org/show_bug.cgi?id=70557
2013-10-16 22:22:45 -07:00
Vadim Girlin
62c8149472 r600g/sb: fix issue with DCE between GVN and GCM (v2)
We can't perform DCE using the liveness pass between GVN and GCM
because it relies on the correct schedule, but GVN doesn't care about
preserving correctness - it's rescheduled later by GCM.

This patch makes dce_cleanup pass perform simple DCE
between GVN and GCM instead of relying on liveness pass.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=70088

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-10-17 07:57:49 +04:00
Matt Turner
38fe3bd5f2 glapi: Add missing XML files to Makefile dependencies.
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-10-16 20:49:43 -07:00
Matt Turner
a360ca7476 glsl: Optimize mul(a, -1) into neg(a).
Two extra instructions in some heroesofnewerth shaders, but a win for
everything else.

total instructions in shared programs: 1531352 -> 1530815 (-0.04%)
instructions in affected programs:     121898 -> 121361 (-0.44%)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-16 20:49:43 -07:00
Matt Turner
197f3a33fb i965/fs: Handle printing HW_REGS in dump_instruction().
Scheduling debugging now prints:

Instructions before scheduling (reg_alloc 1)
0: linterp vgrf20, hw_reg2, hw_reg3, hw_reg4,
1: linterp vgrf21, hw_reg2, hw_reg3, hw_reg4+16,

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-16 20:49:43 -07:00
Matt Turner
7d0519c082 i965: Print instructions' children during scheduling debugging.
Useful for tracking down problems in dependency calculations.

Scheduling debugging now prints:

clock    2, scheduled: linterp vgrf5, hw_reg2, hw_reg3, hw_reg0,
        child 0, 53 parents: fb_write (null), (null), (null), (null),
        child 1, 2 parents: tex vgrf4, vgrf5, (null), (null),
        child 2, 52 parents: placeholder_halt (null), (null), (null), (null),
clock    4, scheduled: linterp vgrf5+1, hw_reg2, hw_reg3, hw_reg0+16,
        child 0, 52 parents: fb_write (null), (null), (null), (null),
        child 1, 1 parents: tex vgrf4, vgrf5, (null), (null),
                now available
        child 2, 51 parents: placeholder_halt (null), (null), (null), (null),

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-16 20:49:43 -07:00
José Fonseca
40ddd8b659 Revert "scons: Fix build when rtti is disabled"
This reverts commit 94d05bf87a as it has a
few problems:

- it breaks windows builds becuase env[LLVM_CXXFLAGS] is never set there

- it is merging not only rtti, but the whole cxxflags (defines etc)
  which has proven to be a source of troubles (breaks debugging etc.)
2013-10-16 15:05:51 -07:00
Tom Stellard
9da4021626 radeonsi: Use 'SI' as the LLVM processor for CIK on LLVM <= 3.3
LLVM 3.3 does not know about CIK processors, and the codes paths for SI
and CIK are the same.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-10-16 12:55:30 -04:00
Tom Stellard
13ac38b4ef r600g/compute Improve debugging output 2013-10-16 09:39:31 -07:00
Tom Stellard
de1de88dfc clover: Link libclc before running any optimizations
This is required in order for clang to correctly handle the OpenCL C
barrier() builtin which has the following restrictions acording to
the OpenCL 1.1 Specification:

If barrier is inside a conditional statement, then all work-items must
enter the conditional if any work-item enters the conditional statement
and executes the barrier.

If barrier is inside a loop, all work-items must execute the barrier for
each iteration of the loop before any are allowed to continue execution
beyond the barrier.

By linking before otimizations, we can replace calls to barrier() with
calls to a target specific intrinsic which has the noduplicate attribute
This attribute prevents clang from performing optimizations which could
violate the above rules.

This attribute must be applied to the call instruction that invokes
the function, so it is not enough to add this attribute the barrier()
declaration.

As a bonus this will probably speed up compile times since we will no
longer need to run link-time optimizations.
2013-10-16 09:39:15 -07:00
Brian Paul
2273b04c61 mesa: change glTexImage[23]DMultisample() internalformat to GLenum
To match glext.h and the GL_ARB_texture_multisample extension.
However, the GL 4.0 spec and man page say it's GLint.
An OpenGL spec bug will be filed.
2013-10-16 08:43:23 -06:00
Brian Paul
4f08cdefda svga: minor fix-ups in svga_get_shader_param()
Fix debug error message.  Add switch case for PIPE_SHADER_COMPUTE.
Trivial.
2013-10-16 08:26:45 -06:00
Brian Paul
e96c55ff49 cso: fix incorrect sampler view count in cso_restore_sampler_views()
During the recent bind_sampler_states() interface change in gallium
we changed the CSO single_sampler_done() function so that if we were
decreasing the number of sampler states bound in the driver, we'd
null-out the "extra/old" sampler states to unbind them.  See commit
1e2fbf265.

However, we didn't make the corresponding fix for sampler views.
This caused an assertion to fail in the svga driver which checked
that the number of sampler views matched the number of sampler states.

This patch fixes cso_restore_sampler_views() so that it nulls-out
the extra/old sampler views if the number of new views is less than
the number of current/old views.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-10-16 08:13:47 -06:00
Brian Paul
0d1011638b mesa: update glxext.h to version 20131008
The diff is huge but the actual changes are few:
* Whitespace changes
* Items are reordered
* extern qualifiers dropped
2013-10-16 08:13:46 -06:00
Brian Paul
4d9e61c046 mesa: update glext.h to version 20131008
Only two notable changes in this revision:
* GLvoid has been replaced by void.
* Added the GL_NV_blend_equation_advanced extension.
2013-10-16 08:13:45 -06:00
Brian Paul
3c074e4d4d vbo: access VBO memory more efficiently when building display lists
Use GL_MAP_INVALIDATE_RANGE, UNSYNCHRONIZED and FLUSH_EXPLICIT flags
when mapping VBOs during display list compilation.  This mirrors what
we do for immediate-mode VBO building in vbo_exec_vtx_map().

This improves performance for applications which interleave display
list compilation with execution.  For example:

glNewList(A);
glBegin/End prims;
glEndList();
glCallList(A);
glNewList(B);
glBegin/End prims;
glEndList();
glCallList(B);

Mesa's vbo module tries to combine the vertex data from lists A and B
into the same VBO when there's room.  Before, when we mapped the VBO for
building list B, we did so with GL_MAP_WRITE_BIT only.  Even though we
were writing to an unused part of the buffer, the map would stall until
the preceeding drawing call finished.

Use the extra map flags and FlushMappedBufferRange() to avoid the stall.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-10-16 08:13:45 -06:00
Brian Paul
fa9c702164 mesa: consolidate cube width=height error checking
Instead of checking width==height in four places, just do it in
_mesa_legal_texture_dimensions() where we do the other width, height,
depth checks.  Similarly, move the check that cube map array depth is
a multiple of 6.

This change also fixes some missing cube dimension checks for the
glTexStorage[23]D() functions.

Remove width==height assertion in _mesa_get_tex_max_num_levels() since
that's called before the other size checks for glTexStorage.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-10-16 08:13:45 -06:00
Kristian Høgsberg
6e444a72c1 gbm: Add support for gbm bos and surfaces using GBM_FORMAT_ARGB2101010
We can now add GBM support for the 10 bit/channel formats which lets us
create a gbm surface that we can use with KMS for display hardware that
support the format.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2013-10-15 22:07:52 -07:00
Kristian Høgsberg
3160ec353e dri: Add __DRIimage support for the ARGB2101010 format
We add support for the ARGB2101010 color format to the DRI image extension,
which allows DRI loaders to create a __DRIimage with this color format.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2013-10-15 22:07:52 -07:00
Kristian Høgsberg
f354bcc177 i965: Create ARGB2101010 DRI configs
This commit enables ARGB2101010 system framebuffers (that is, DRI drawables)
for the i965 drivers.  This is done by generating DRI configs that advertise
this color format as well as teaching intelCreateBuffer to pick the right
color format when it sees such a DRI config.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2013-10-15 22:07:52 -07:00
Kristian Høgsberg
afda76cc0d dri/common: Add support for creating ARGB2101010 configs
This extends the common dri driver infrastructure with the ability to create
__DRIconfigs for 10 bits/channel + 2 bit alphs formats.  This still has
to be supported and requested by a driver, so this doesn't enable anthing yet.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2013-10-15 22:07:52 -07:00
Kristian Høgsberg
df479cffcc egl_dri2: Set NativeVisualID to the matching GBM config for the gbm platform
The EGLConfig doesn't have the rgba masks, only the rgba sizes.  To
make sure a config is usable with a given GBM/KMS format, we need a way
to make sure the formats really match.
2013-10-15 22:07:52 -07:00
Kristian Høgsberg
44e584a73a egl_dri2: Remove depth argument from dri2_add_config()
All callers now use the more correct rgba mask mechanism for filtering
out mathcing DRI configs.  Even if depth and buffer size match, the
color component layout can be different, or in case or ARGB8888 and
ARGB2101010 the color components can even be different sizes.

Since anything that the depth check would reject is also rejected by
the rgba mask comparison, the depth parameter is redundant and not
specific enough.  We should probably have removed it when the rgba
masks argument was introduced, but better late than never.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2013-10-15 22:07:52 -07:00
Kristian Høgsberg
e3d0a0eac7 egl_dri2: Match X11 visuals using rgba masks instead of depth
Matching on visual depth to buffer size makes 8 bpc RGBA look similar to
10 bit RGB with 2 bit alphs - both have buffer size 32.  Instead, build
the rgba masks from the visual data and use that for finding matching
DRI configs.

We need to keep the special case that allows us to match 24 bit visuals
to DRI configs with buffer size 32.  We do that by creating an alpha
mask of "all the non-rgb bits" for 24 bit visuals and matching a second
time with that.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2013-10-15 22:06:46 -07:00
Singh, Satyeshwar
e2620c1a74 i965: Add support for RGB565 __DRIimage
Add information for RGB565 to the table of image formats so that we can
create a __DRIimage for that format.  This in turn enables RGB565
wayland clients.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2013-10-15 21:30:49 -07:00
Singh, Satyeshwar
2efc97d513 egl-wayland: Add support for RGB565 pixel format for Wayland clients
With this patch Wayland clients can now ask EGL for RGB 565 format buffers
and attach them to a Wayland compositor.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2013-10-15 21:26:56 -07:00
Alexander von Gluck IV
94d05bf87a scons: Fix build when rtti is disabled
* The rtti fix actually dug up a bug in the scons build scripts.
* Autotools took the LLVM cpp and cxx flags, while scons only took
  the cpp flags.
* This grabs the cxx flags and applies them where needed. We may
  want to make the same change for the llvm cpp flags in scons.
* The only linux platform I can find with LLVM no-rtti is Ubuntu.
* Fixes bug #70471

Tested-by: Vinson Lee <vlee@freedesktop.org>
2013-10-15 22:12:18 -05:00
José Fonseca
85d7f6779f llvmpipe: Advertise PIPE_CAP_DEPTH_CLIP_DISABLE.
Actually implemented by draw module.

Tested piglit ARB_depth_clamp tests, which pass 100%.

Trivial.
2013-10-15 18:22:57 -07:00
José Fonseca
3b3591cd15 draw: make vs_slot signed.
Otherwise (vs_slot < 0) will never be true.

Trivial.
2013-10-15 18:22:57 -07:00
Emil Velikov
b1e7cd037e configure.ac: drop obsolete variable HAVE_COMMON_DRI
The original intent of the variable was to prevent adding
libdrm dependency for non drm drivers (swrast). This is
already handled with __NOT_HAVE_DRM_H, and with the recent
merge of the dri_util and drisw_util code this variable has
started causing build issues.

Eg. the following will fail
$ ./autogen.sh --with-dri-drivers=swrast --with-gallium-drivers=
$ make

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-10-15 21:54:20 +02:00
Emil Velikov
cd3fa176a8 swrast: add correct include for out-of-tree builds
The xmlpool/options.h file was not accessible when building
out-of-tree leading to failure.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70378
Reported-by: Fabio Pedretti <fabio.ped@libero.it>
Tested-by: Fabio Pedretti <fabio.ped@libero.it>
Tested-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-10-15 21:50:09 +02:00
Bryan Cain
467e3aa3de mesa: fix transform feedback when a geometry shader is active.
When a geometry shader is active, the transform feedback primitive
type ("mode") needs to be validated against the geometry shader output
primitive type, not the primitive type passed to the glDraw*()
function.

Fixes the following piglit tests:
- glsl-1.50-geometry-primitive-types GL_LINES
- glsl-1.50-geometry-primitive-types GL_LINES_ADJACENCY
- glsl-1.50-geometry-primitive-types GL_LINE_STRIP
- glsl-1.50-geometry-primitive-types GL_LINE_STRIP_ADJACENCY
- glsl-1.50-geometry-primitive-types GL_TRIANGLES
- glsl-1.50-geometry-primitive-types GL_TRIANGLES_ADJACENCY
- glsl-1.50-geometry-primitive-types GL_TRIANGLE_FAN

Exposes previously hidden failures in the following piglit tests:
- glsl-1.50-geometry-primitive-id-restart GL_LINES other
- glsl-1.50-geometry-primitive-id-restart GL_LINES_ADJACENCY other
- glsl-1.50-geometry-primitive-id-restart GL_LINE_LOOP ffs
- glsl-1.50-geometry-primitive-id-restart GL_LINE_LOOP other
- glsl-1.50-geometry-primitive-id-restart GL_LINE_STRIP other
- glsl-1.50-geometry-primitive-id-restart GL_LINE_STRIP_ADJACENCY other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLES other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLES_ADJACENCY other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_FAN ffs
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_FAN other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_STRIP other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_STRIP_ADJACENCY other

(These failures were previously hidden due to a flaw in the test: it
doesn't check for GL errors.  I'll fix the test shortly).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-15 11:40:43 -07:00
Paul Berry
afccf3d8e7 i965/gs: Set the REORDER bit in 3DSTATE_GS.
Ivy Bridge's "reorder enable" bit gives us a binary choice for the
order in which vertices from triangle strips are delivered to the
geometry shader.  Neither choice follows the OpenGL spec, but setting
the bit is better, because it gets triangle orientation correct.

Haswell replaces the "reorder enable" bit with a new "reorder mode"
bit (which occupies the same location in the command packet).  This
bit gives us a different binary choice, which affects both triangle
strips and triangle strips with adjacency.  Setting the bit ("reorder
trailing") gives the proper order according to the OpenGL spec.

So in either case we want to set the bit.

On Ivy Bridge, fixes piglit test "triangle-strip-orientation".

On Haswell, fixes piglit tests "glsl-1.50-geometry-primitive-types
{GL_TRIANGLE_STRIP,GL_TRIANGLE_STRIP_ADJACENCY}" and
"glsl-1.50-geometry-tri-strip-ordering-with-prim-restart *".

v2: Rename the bit to "REORDER_TRAILING" for consistency with Haswell
docs.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-15 11:40:32 -07:00
Paul Berry
caf9cef7ee i965/fs: Remove bogus field prog_data->dispatch_width.
Despite the name, this field wasn't being set to the dispatch width at
all; it was always 8.  The only place it was used was that the
constant buffer read length was aligned to it, and as far as I can
tell from the docs, there is no need to align this value to the
dispatch width; aligning it to a multiple of 8 is sufficient.  So I've
just replaced it with a hardcoded 8.

v2: In gen6_wm_state, use brw->wm.base.push_const_size for consistency
with VS and GS state upload.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-15 11:34:30 -07:00
Paul Berry
2910a82eb4 glsl: Add new GLSL 1.50 constants.
This patch populates the following built-in GLSL 1.50 variables based
on constants stored in ctx->Const:

- gl_MaxVertexOutputComponents
- gl_MaxGeometryInputComponents
- gl_MaxGeometryOutputComponents
- gl_MaxFragmentInputComponents
- gl_MaxGeometryTextureImageUnits
- gl_MaxGeometryOutputVertices
- gl_MaxGeometryTotalOutputComponents
- gl_MaxGeometryUniformComponents
- gl_MaxGeometryVaryingComponents

On i965/gen7, fixes all Piglit tests in "spec/glsl-1.50/built-in
constants/*" except for gl_MaxCombinedTextureImageUnits and
gl_MaxGeometryUniformComponents.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-15 11:34:30 -07:00
Eric Anholt
705a90e304 i965: Move the common binding table offset code to brw_shader.cpp.
Now that both vec4 and fs are dynamically assigning offsets, a lot of the
code is the same.

v2: Avoid passing around the next offset through the class.  (Review by
    Paul)

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-15 10:18:50 -07:00
Eric Anholt
d395485e1d i965/vec4: Dynamically assign the VS/GS binding table offsets.
Note that the dropped comment in brw_context.h is mostly (better written)
in brw_binding_table.c as well.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-15 10:18:48 -07:00
Eric Anholt
4e5306453d i965/fs: Dynamically set up the WM binding table offsets.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-15 10:18:45 -07:00
Eric Anholt
3c9dc2d31b i965: Make a brw_stage_prog_data for storing the SURF_INDEX information.
It would be nice to be able to pack our binding table so that programs
that use 1 render target don't upload an extra BRW_MAX_DRAW_BUFFERS - 1
binding table entries.  To do that, we need the compiled program to have
information on where its surfaces go.

v2: Rename size to size_bytes to be more explicit.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-15 10:18:42 -07:00
Eric Anholt
5463b5bbbd i965: Always have the struct gl_program * in the backend visitor.
vec4 already had it, so put it in the FS, too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-15 10:18:40 -07:00
Eric Anholt
2788798388 i965: Drop a couple of unused defines.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-15 10:18:37 -07:00
Eric Anholt
fbc088ee49 i965: Remove dead arguments from prog_data_compare.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-15 10:18:32 -07:00
Alexander von Gluck IV
ce8eadb6e8 build: remove forced -fno-rtti
* As discussed on the mailing list,
  forced no-rtti breaks C++ public
  API's such as the Haiku C++ libGL.so
* -fno-rtti *can* be still set however
  instead of blindly forcing -fno-rtti,
  we can rely on the llvm-config
  --cppflags output.
  If the system llvm is built without
  rtti (default), the no-rtti flag will be
  present in llvm-config --cppflags
  (which we pick up on)
  If llvm is built with rtti
  (REQUIRES_RTTI=1), then -fno-rtti is
  removed from llvm-config --cppflags.
* We could selectively add / remove rtti
  from various components, however mixing
  rtti and non-rtti code is tricky and
  could introduce missing symbols.
* This needs impact tested.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-10-14 23:00:55 -05:00
Matt Turner
7a2e9f9778 configure.ac: Don't check for awk, grep, nm.
Not used since d53901c6.
2013-10-14 11:13:09 -07:00
Matt Turner
9ae1f0bad6 configure.ac: Don't check for cross compiling.
Dead since c845140a.
2013-10-14 11:13:09 -07:00
Matt Turner
a5ec01fb1b i965: Don't copy prop source mods into instructions that can't take them. 2013-10-14 11:13:09 -07:00
Constantin Baranov
53904c64da mesa: Add missing switch break in invalidate_framebuffer_storage()
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70411
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-14 09:06:07 -06:00
Grigori Goronzy
e6c2afa9ce st/vdpau: add format conversions for GetBitsYCbCr
Add simple plain C routines for NV12<->YV12 and YUYV<->UYVY
conversions. The NV12->YV12 conversion is commonly used, for instance
by VLC.

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-13 20:09:38 +02:00
Grigori Goronzy
f250fd59c4 radeon: use staging for mapping linear textures
Textures that likely reside in VRAM, are mapped for reading and
don't require direct mapping should be staged into GTT, to avoid bad
performance. This fixes readback performance of VDPAU surfaces.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-10-13 20:09:34 +02:00
Grigori Goronzy
270fab5164 radeon/uvd: use PIPE_BIND_LINEAR for video surfaces
This new bind flag forces linear storage, but does not have other
side effects like R600_RESOURCE_FLAG_TRANSFER.

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-13 20:09:02 +02:00
Vincent Lejeune
6e51c2a941 radeonsi: Allow Sinking pass to move preloaded const/res/sampl
This fixes a crash in Unigine Heaven 3.0, and probably in some
others apps.
2013-10-13 20:03:42 +02:00
Vadim Girlin
453ea2d309 radeonsi: pass alpha_ref value to PS in the user sgpr
Currently it's hardcoded in the shader, so every change requires
compilation of the shader variant, killing the performance
in Serious Sam 3 and probably other apps.

This patch passes alpha_ref in the user sgpr and removes it from
the shader key.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-10-13 20:03:35 +04:00
Vadim Girlin
10ddeb910b r600g: fix tgsi_op2_s with trans-only instructions
This fixes the issue when dst and src is the same reg and operation on one
channel overwrites the source for other channels, e.g.:

UMUL TEMP[2].xyz, TEMP[0].xyzz, TEMP[2].xxxx

In this example the result of the operation on channel x is written in
TEMP[2].x and then used as a second source operand for channels y and z
instead of original value in TEMP[2].x.

This patch stores the results in temp reg and moves them to
dst after performing operation on all channels.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=70327

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-10-13 20:03:35 +04:00
Kenneth Graunke
8958741e5a i965: Merge intel_context.h into brw_context.h.
v2: Keep the random 32-bit only version of memcpy, since Ian says I
    can't delete it without data proving it isn't useful.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
3dda3ebec9 i965: Delete our copy of likely/unlikely macros.
brw_context.h includes imports.h which includes compiler.h which already
defines these.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
67601da24c mesa: Move U_FIXED/S_FIXED macros from i965 to macros.h.
These make it easy to convert a floating point value to a fixed point
numbers.  The second parameter is the number of bits used for the
fractional part of the number.

It looks like core Mesa has similar functions already, but none that
allows an arbitrary number of fractional bits.  The more generic version
is probably useful to everyone.

r600g apparently has an identical copy of the S_FIXED macro, but doesn't
include this file.  I'm not sure what to do about that, so I'm just
going to leave it for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
1a82081db6 mesa: Move ROUND_DOWN_TO() macro from i915/i965 to macros.h.
This seems generally useful, so it may as well live in core Mesa.

In fact, the comment for ALIGN() in macros.h actually says to "see also"
ROUND_DOWN_TO, which...was in a driver somewhere.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
50c9f04c5f i965: Move need_workaround_flush = true to intel_batchbuffer_init.
intel_batchbuffer_init() sets up initial batchbuffer state; it seems
like a reasonable place to initialize this flag.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
ddc8decdb2 i965: Move DriverFlag initialization to brw_init_state().
Configuring which dirty flags we want sounds like a job for
brw_init_state().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
ba0cc79ab9 i965: Merge intelInitContext into brwCreateContext.
The split here was completely arbitrary.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
90d52d2c76 i965: Move viewport driver hook setup to brw_init_driver_functions.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
f118fc26e1 i965: Make brwInitFunctions take brw_context rather than intel_screen.
It actually just wants generation checking, and brw->gen is the usual
way of doing that.  In the future, we'll also want to check brw->hw_ctx,
which isn't available from the screen.

While we're changing the function signature, convert from camel case to
our usual naming conventions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
9848a42287 i965: Merge intelInitFunctions() and brwInitFunctions().
They do exactly the same thing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
0138fd4610 i965: Merge intel_context.c into brw_context.c.
There's no point in having two files for context functions.  This patch
moves the code from intel_context.c into brw_context.c unmodified
(other than whitespace fixes).

Right now, this looks silly; future patches will merge functions and
tidy things up.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
8d315b2583 i965: Move memset of TextureFormatSupported to brw_init_surface_formats.
brw_init_surface_formats already sets entries in TextureFormatsSupported
to true; it may as well take care of initializing it to false too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
fc5b865cec i965: Remove has_aa_line_parameters.
This flag is only used in one place, and is only set on one platform.
Just check for original Gen4 in the relevant function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
220c1e5610 i965: Move state setup from brwCreateContext to brw_init_state().
This seems like a better place for it, and helps clean up
brwCreateContext (which is full of a lot of random stuff).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
d31b928b93 i965: Remove the brw_context::emit_state_always flag.
This was always set to false, and is only used for debugging.
To enable it, simply change the if (0) block and recompile.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
02b632d8e8 i965: Move hardware feature flags to brw_device_info.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:44 -07:00
Kenneth Graunke
ea890c031d i965: Move device quirks to brw_device_info.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
d76f6c7ae4 i965: Move hardware limits to brw_device_info.
Since each kind of device has its own brw_device_info structure, we can
simply store the URB and thread limits there.  This eliminates all the
large if-ladders, and simplifies the context initialization code quite a
bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
afe05e7193 i965: Replace some intel_screen fields with brw_device_info references.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
9d490c172b i965: Delete the INTEL_SEPARATE_STENCIL override.
This option was useful during initial development, but it's been ages
since I've heard of anyone using it.  Plus, Gen7+ mandates separate
stencil, so it was really only useful on Sandybridge anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
6e9f427ed8 i965: Add a new brw_device_info structure.
The idea is that struct brw_device_info should store statically-known
information about hardware features.  Using the new family name in the
PCI ID table, we can easily grab the right structure.

This is basically the equivalent of intel_device_info in the kernel.

This patch also makes the new structure available from intel_screen, but
nothing uses it.  Right now, it looks very redundant with existing
fields, but that will change.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
4a29b9a066 i965: Add the family name to the PCI ID table.
I removed this a while ago, since we never used it, but I'm finally
resurrecting the idea in the next commits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
8d4ecbccd6 i965: Remove #define name from PCI ID table.
Nothing uses the #define name, and it's not terribly useful - the
numerical ID serves the same purpose.  The only thing we could really do
with it is generate slightly prettier preprocessed code.  But who looks
at that?

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
90511faedd i965: Pull most driconf option handling into a centralized function.
Using a helper function clarifies the context initialization code.

I would've liked to completely centralize it, but moving the optionCache
code from intelInitExtensions into here would've required setting flags
in the context, which seems like a waste.

v2: Rebase for the introduction of disable_derivative_optimization.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
0fb525b87c i965: Move a bunch of code from intelInitContext to brwCreateContext.
Now that intelInitContext isn't shared between i915 and i965, the split
is fairly arbitrary.  This patch moves a bunch of the basic context
creation and generation checking code up to the top-level function
(and slightly earlier).

More will follow.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
a25caad9e4 i965: Update the comment about viewport hacks.
It wasn't clear that this was necessary for EGL, or why.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
832bcc3613 i965: Pull out INTEL_DEBUG handling into new intel_debug.[ch] files.
Now that there isn't an intel_context structure, the split between
brw_context.[ch] and intel_context.[ch] is rather awkward and arbitrary.
Removing intel_context.[ch] seems desirable, but not everything really
belongs in brw_context.[ch], either.

Moving INTEL_DEBUG handling into separate intel_debug.[ch] files should
make them relatively easy to find.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Kenneth Graunke
3f7b4e5d04 i965: Rename brwCreateContext's error parameter to dri_ctx_error.
"error" is a very generic name.  dri_ctx_error is the name used in
intelInitContext(), which is more specific.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-13 00:10:43 -07:00
Eric Anholt
95bd8a332d dri: Move i965-specific context flag logic to dri common.
Nobody else yet can do a forward context anyway, but others should be able
to do debug contexts, and those would have just had no effect currently.
2013-10-13 00:10:43 -07:00
Stephane Marchesin
5ceeeb360e i915g: Fix assert
Now that we support start, assert on start + num < max samplers

Reported by xexaxo
2013-10-12 11:40:54 -07:00
Paul Berry
975c6ce605 mesa: Bump version to 10.0.0.
Mesa now supports OpenGL 3.2 and GLSL 1.50, so bump the Mesa major
version from 9 to 10 to reflect this.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-12 08:58:18 -07:00
Paul Berry
200f9a0576 mesa: Remove warning that geometry shader support is experimental.
Geometry shader support is now working well, and adequately piglit
tested.  There are just a few piglit failures left to fix.  So there's
no need for an "experimental" warning anymore.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-12 08:58:02 -07:00
Paul Berry
b6d6ea396c i965: Turn on GLSL 1.50 and GL 3.2 support for i965 gen7.
Geometry shaders were the last thing we needed to finish before
turning on GLSL 1.50 and GL 3.2 support.  They are now working well,
with just a few piglit failures left to fix.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-12 08:57:45 -07:00
Jay Cornwall
d7d539a1cb radeon/llvm: show LLVM disassembly when available
With code dump enabled LLVM may generate disassembly during compilation.
Show this disassembly when available and prefer it to SI bytecode dump.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Jay Cornwall <jay@jcornwall.me>
2013-10-12 00:03:58 -04:00
Roland Scheidegger
7681beedd1 softpipe: fix seamless cube filtering
Fix coord wrapping (and face selection too) in case of edges.
Unfortunately, the coord wrapping is way more complicated than what
the code did, as it depends on the face and the direction where the
texel falls off the face (the logic needed to get this right in fact
seems utterly ridiculous).
Also fix a bug in (y direction under/overflow) face selection.
And get rid of complicated cube corner handling. Just like edge case,
the coord wrapping was wrong and it seems very difficult to fix.
I'm near certain it can't always work anyway (though ordinary seamless
filtering on edge has actually a similar problem but not as severe)
because we don't have per-pixel face, hence could have multiple corner
texels which would make it very difficult to average the remaining texels
correctly. Hence simply pick a texel which would only have fallen off one
edge but not both instead, which is not quite accurate but actually I think
should be enough to meet OpenGL (but not d3d10) requirements.

v2: small fixes suggested by Brian, add some comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-12 04:05:57 +02:00
Roland Scheidegger
75f1fea14f llvmpipe: increase fs shader variant instruction cache limit by factor 4
The previous limit of of 128*1024 was reported to cause frequent recompiles
in some apps due to shader variant thrashing on IRC in some apps leading
to noticeable lags.
Note that the LP_MAX_SHADER_VARIANTS limit (1024) was more or less impossible
to reach, since even simple fragment shaders without texturing (glxgears) used
more than twice than 128 instructions, hence the instruction limit would have
always been reached first (excluding things like trivial shaders not writing
color). Even with the new limit it is VERY likely the instruction limit is hit
first.
Should help with such lags due to recompiles (though other shader types have
their own limits, LP_MAX_SETUP_VARIANTS and DRAW_MAX_SHADER_VARIANTS, in
particular the latter seems a bit small (128)).

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-12 04:05:57 +02:00
Vinson Lee
a9a78640d9 mesa: Do not use newlocale on NetBSD.
Fixes this build error.

  CC       imports.lo
../../src/mesa/main/imports.c: In function '_mesa_strtof':
../../src/mesa/main/imports.c:570:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'loc'
../../src/mesa/main/imports.c:570:20: error: 'loc' undeclared (first use in this function)
../../src/mesa/main/imports.c:570:20: note: each undeclared identifier is reported only once for each function it appears in
../../src/mesa/main/imports.c:572:7: error: implicit declaration of function 'newlocale'
../../src/mesa/main/imports.c:572:23: error: 'LC_CTYPE_MASK' undeclared (first use in this function)
../../src/mesa/main/imports.c:574:4: error: implicit declaration of function 'strtof_l'
../../src/mesa/main/imports.c:580:1: warning: control reaches end of non-void function

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-10-11 17:04:54 -07:00
Brian Paul
1737189f0a svga: s/0/FALSE/ 2013-10-11 17:07:44 -06:00
Brian Paul
6f1b5052ec mesa: add comment to clarify ctx->Driver.MapBufferRange() return value 2013-10-11 17:07:44 -06:00
Brian Paul
3710b65823 st/mesa: whitespace fixes in st_cb_bufferobjects.c 2013-10-11 17:07:44 -06:00
Brian Paul
ffe529352b vbo: assorted minor clean-ups
Use GL_TRUE/FALSE instead of 1/0.  Remove extraneous parentheses.
Remove trailing whitespace.
2013-10-11 17:07:44 -06:00
Brian Paul
2a429f9d9c glsl: fix signed/unsigned comparison warning 2013-10-11 17:07:44 -06:00
Kristian Høgsberg
1d34927061 wayland: Only pass wl_drm instance to gbm when using gbm platform 2013-10-11 15:30:09 -07:00
Kristian Høgsberg
360a141f24 wayland: Don't rely on static variable for identifying wl_drm buffers
Now that libEGL has been fixed to not leak all kinds of symbols, gbm
links to its own copy of the libwayland-drm.a helper library.  That means
we can't rely on comparing the addresses of a static vtable symbol in that
library to determine if a wl_buffer is a wl_drm_buffer.  Instead, we
move the vtable into the wl_drm struct and use that for comparing.

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

Cc: 9.2 <mesa-stable@lists.freedesktop.org>
2013-10-11 15:14:35 -07:00
Vinson Lee
fe6974382b glapi: Do not use backtrace on NetBSD.
execinfo.h is not available on NetBSD.

Fixes this bulid error.

  CC       glapi_gentable.lo
glapi_gentable.c:44:22: fatal error: execinfo.h: No such file or directory

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-10-11 14:48:45 -07:00
Ian Romanick
59f18340c3 glsl: Remove extraneous .dir-locals.el
This was overriding the top-level .dir-locals.el causing some settings
(like forcing spaces instead of tabs!) to be lost.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-11 10:43:37 -07:00
Grigori Goronzy
3de7e11f58 r600g: fix crash in set_framebuffer_state
We should be able to safely set the framebuffer state without a
fragment shader bound. bind_ps_state will take care of updating the
necessary state bits later.

v2: check in update_db_shader_control
2013-10-11 17:33:18 +02:00
Topi Pohjolainen
396c69bf5d mesa: Allow external textures to use fallback (0, 0, 0, 1)
Fixes GL2ExtensionTests/egl_image_external/TestSimpleUnassociated.test
which is part of gles2/3 conformance suite. Here image external
textures are switched to be treated the same as 2D textures. These
can be associated with the fallback texture providing fixed sample
values of (0, 0, 0, 1).

The OES_EGL_image_external spec says:

  "Sampling an external texture which is not associated with any EGLImage
   sibling will return a sample value of (0,0,0,1)."

  "External textures cannot be used with TexImage2D, TexSubImage2D,
   CompressedTexImage2D, CompressedTexSubImage2D, CopyTexImage2D, or
   CopyTexSubImage2D, and an INVALID_ENUM error will be generated if
   this is attempted."

And quoting Chad:

  "That's enforced in _mesa_TexImage*() by calling
   legal_teximage_target(), and enforced in _mesa_TexSubImage*() by
   calling legal_texsubmimage_target(). Each of the
   legal_tex*image_target() functions reject external textures.
   Therefore, allowing GL_TEXTURE_EXTERNAL_OES in store_texsubimage()
   won't violate the above spec quote.

   I think it's safe to allow GL_TEXTURE_EXTERNAL_OES in
   store_texsubimage(), as long as the texture has only a single
   plane. Luckily, that's the only type of external textures that
   Mesa currently supports."

CC: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2013-10-11 09:59:01 +03:00
Chad Versace
9cb8f7a126 doxygen: Add i965 to list of modules in html header
Signed-off-by: Chad Versace <Chad Versace chad@chad-versace.us>
2013-10-10 22:20:39 -07:00
Frank Henigman
49ed5991ee i965: extend fast texture upload
Extend the fast texture upload from BGRA X-tiled to include RGBA,
Alpha/Luminance, and Y-tiled.  Speed improvements, measured with
mesa demos teximage program, on 256 x 256 texture, in MB/s, on a
Sandy Bridge (Ivy is comparable):

              before  after   increase
BGRA/X-tiled   3266    4524    1.39x
BGRA/Y-tiled   1739    3971    2.28x
RGBA/X-tiled    474    4694    9.90x
RGBA/Y-tiled    477    3368    7.06x
   L/X-tiled   1268    1516    1.20x
   L/Y-tiled   1439    1581    1.10x

v2: Cosmetic changes only: reformat and reword comments, make doxygen-friendly,
    rename variables, use existing macros, add an assert.

Signed-off-by: Frank Henigman <fjhenigman@google.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-10 18:16:41 -07:00
Alexander von Gluck IV
0fda1cb498 haiku: Fix llvmpipe and clean up softpipe tracing
* Fix LLVM library and defines
* Only enable tracing when scons build=debug

Acked-by: Brian Paul <brianp@vmware.com>
2013-10-10 19:28:23 -05:00
Alexander von Gluck IV
69508950da haiku: Remove common directory search path
* /boot/common no longer exists in Haiku as of
  a few days ago (and this is undefined)

Acked-by: Brian Paul <brianp@vmware.com>
2013-10-10 19:28:23 -05:00
Eric Anholt
8821e9d108 dri: Reference the global driver vtable once at screen init..
This is part of the prep for megadrivers, which won't allow using a single
global symbol due to the fact that there will be multiple drivers built
into the same dri.so file.  For that, we'll need screen init to take a
reference to the driver to set up this vtable.

v2: Fix two missed references to driDriverAPI.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2013-10-10 16:34:30 -07:00
Eric Anholt
ee8983becc i965: Clean up error handling for context creation.
The intel_screen.c used to be a dispatch to one of 3 driver functions, but
was down to 1, so it was kind of a waste.  In addition, it was trying to
free all of the data that might have been partially freed in the kernel
3.6 check (which comes after intelInitContext, and thus might have had
driverPrivate set and result in intelDestroyContext() doing work on the
freed data).  By moving the driverPrivate setup earlier, we can use
intelDestroyContext() consistently and avoid such problems in the future.

v2: Adjust the prototype of brwCreateContext to use the proper enum
    (fixing a compiler warning in some builds)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2013-10-10 16:34:30 -07:00
Eric Anholt
18a8f31070 intel: Remove silly check for !bufmgr.
If bufmgr didn't get created, then screen creation failed, and we never
should have got here in the first place.  This was added by Chris Wilson
in 2010 with no explanation for why it would be needed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-10 16:34:30 -07:00
Eric Anholt
083f66fdd6 dri: Move API version validation into dri/common.
i965, i915, radeon, r200, swrast, and nouveau were mostly trying to do the
same logic, except where they failed to.  Notably, swrast had code that
appeared to try to enable GLES1/2 but forgot to set api_mask (thus
preventing any gles context from being created), and the non-intel drivers
didn't support MESA_GL_VERSION_OVERRIDE.

nouveau still relies on _mesa_compute_version(), because I don't know what
its limits actually are, and gallium drivers don't declare limits up front
at all.  I think I've heard talk about doing so, though.

v2: Compat max version should be 30 (noted by Ken)
    Drop r100's custom max version check, too (noted by Emil Velikov)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-10 16:34:30 -07:00
Eric Anholt
d81632fb1e dri: Merge drisw_util.c into dri_util.c
The only important difference was not calling drmGetVersion, and making
the swrast extension vtable.  That doesn't justify duplicating the other
330 lines of code.

v2: fix the scons build (code by Emil Velikov)
v3: fix scons build with swrast-only (code by Emil Velikov)
v4: Drop the new define I added, when we already have __NOT_HAVE_DRM_H.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-10 16:34:30 -07:00
Eric Anholt
683f6daa97 dri: Add an explanatory comment for an important driver entrypoint.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-10 16:34:30 -07:00
Eric Anholt
7f3a131b6e dri: Remove dead comment.
The code it was referencing was removed in 2010.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-10 16:34:30 -07:00
Eric Anholt
36fbe66d3a i965/fs: Convert gen7 to using GRFs for texture messages.
Looking at Lightsmark's shaders, the way we used MRFs (or in gen7's
case, GRFs) was bad in a couple of ways.  One was that it prevented
compute-to-MRF for the common case of a texcoord that gets used
exactly once, but where the texcoord setup all gets emitted before the
texture calls (such as when it's a bare fragment shader input, which
gets interpolated before processing main()).  Another was that it
introduced a bunch of dependencies that constrained scheduling, and
forced waits for texture operations to be done before they are
required.  For example, we can now move the compute-to-MRF
interpolation for the second texture send down after the first send.

The downside is that this generally prevents
remove_duplicate_mrf_writes() from doing anything, whereas previously
it avoided work for the case of sampling from the same texcoord twice.
However, I suspect that most of the win that originally justified that
code was in avoiding the WAR stall on the first send, which this patch
also avoids, rather than the small cost of the extra instruction.  We
see instruction count regressions in shaders in unigine, yofrankie,
savage2, hon, and gstreamer.

Improves GLB2.7 performance by 0.633628% +/- 0.491809% (n=121/125, avg of
~66fps, outliers below 61 dropped).

Improves openarena performance by 1.01092% +/- 0.66897% (n=425).

No significant difference on Lightsmark (n=44).

v2: Squash in the fix for register unspilling for send-from-GRF, fixing a
    segfault in lightsmark.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Matt Turner <mattst88@gmail.com>
2013-10-10 15:54:16 -07:00
Eric Anholt
ee21c8b1e6 i965/fs: Allocate more register classes on gen7.
For texturing from GRFs, we now have payloads of arbitrary sizes up to the
message length limit.

v2 (Kenneth Graunke): Rebase on intel_context -> brw_context change.
v3: Add some comment text.
v4: Change some magic 16s to BRW_MAX_MRF (noted by Ken).  Leave the 11,
    which is the magic "max sampler message length".  BRW_MAX_MRF sizing
    on the little int arrays is retained because I could see us needing to
    extend in the future if we move to GRFs for FB writes (those go to at
    least 12 long in a quick scan of the specs)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
Acked-by: Matt Turner <mattst88@gmail.com>
2013-10-10 15:54:16 -07:00
Eric Anholt
b6af650a09 i965/fs: Use per-channel interference for register_coalesce_2().
This will let us coalesce into texture-from-GRF arguments, which would
otherwise be prevented due to the live interval for the whole vgrf
extending across all the MOVs setting up the channels of the message

v2 (Kenneth Graunke): Rebase for renames.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-10 15:54:16 -07:00
Eric Anholt
3093085847 i965/fs: Use the new per-channel live ranges for dead code elimination.
v2 (Kenneth Graunke): Rebase on s/live_variables/live_intervals/g.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-10 15:54:16 -07:00
Eric Anholt
b4d676d710 i965/fs: Keep a copy of the live variables class around.
Now optimization passes will be able to look at the per-channel ranges.

v2: Rebase on various optimization pass changes.
v3 (Kenneth Graunke): Rename live_variables to live_intervals; split
   introduction of invalidate_live_intervals() into a separate patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-10 15:54:15 -07:00
Kenneth Graunke
3ea84beb16 i965/fs: Invalidate live intervals when compacting; don't fix them.
When compacting the list of VGRFs, we patch up the live interval ranges
(which are indexed by VGRF number).  Unfortunately, once we make
per-component data available, this will become too complicated to
maintain.  Instead, simply invalidate them.

This was pulled out of a patch by Eric Anholt.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-10 15:54:15 -07:00
Kenneth Graunke
939b0f2c2f i965/fs: Remove start/end aliases in compute_live_intervals().
In compute_live_intervals(), start and end are shorter names for
the virtual_grf_start and virtual_grf_end class members.

Now that the fs_live_intervals class has arrays named start and end
which are indexed by var, rather than VGRF, reusing the name is
confusing.  Plus, most of the code has been factored out, so using the
long names isn't as inconvenient.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-10 15:54:15 -07:00
Eric Anholt
398656d97e i965/fs: Track live variable ranges on a per-channel level.
This is the information we'll actually use to replace the
virtual_grf_start[]/end[] arrays.

No change in shader-db.

v2 (Kenneth Graunke): Rebase; minor comment updates.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-10 15:54:15 -07:00
Eric Anholt
097bf101c3 i965/fs: Factor def[]/use[] setup out to a separate function.
These blocks are about to grow some more code, and the indentation was
getting out of hand.

v2 (Kenneth Graunke): Rebase, minor typo fixes and style changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-10 15:54:15 -07:00
Kenneth Graunke
4b821a97b5 i965/fs: Create a helper function for invalidating live intervals.
For now, this simply sets live_intervals_valid = false, but in the
future it will do something more sophisticated.

Based on a patch by Eric Anholt.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-10 15:54:15 -07:00
Eric Anholt
45ffaeccaf i965/fs: Do live variables dataflow analysis on a per-channel level.
This significantly improves our handling of VGRFs of size > 1.

Previously, we only marked VGRFs as def'd if the whole register was
written by a single instruction.  Large VGRFs which were written
piecemeal would not be considered def'd at all, even if they were
ultimately completely written.

Without being def'd, these were then marked "live in" to the basic
block, often extending the range to preceding blocks and sometimes
even the start of the program.

The new per-component tracking gives more accurate live intervals,
which makes register coalescing more effective.

In the future, this should help with texturing from GRFs on Gen7+.
A sampler message might be represented by a 2-register VGRF which
holds the texture coordinates.  If those are incoming varyings,
they'll be produced by two PLN instructions, which are piecemeal writes.

No reduction in shader-db instruction counts.  However, code which
prints the live interval ranges does show that some VGRFs now have
smaller (and more correct) live intervals.

v2: Rebase on current send-from-GRF code requiring adding extra use[]s.
v3: Rebase on live intervals fix to include defs in the end of the
    interval.
v4 (Kenneth Graunke): Rebase; split off a few preparatory patches;
    add lots of comments; minor style changes; rewrite commit message.
v5 (Eric Anholt): whitespace nit.

Written-by: Eric Anholt <eric@anholt.net> [v1-3]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> [v4]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> (v4)
2013-10-10 15:54:14 -07:00
Kenneth Graunke
5af8388110 i965/fs: Rename num_vars to num_vgrfs in live interval analysis.
num_vars was shorthand for the number of virtual GRFs.  num_vgrfs is a
bit clearer.  Plus, the next patch will introduce "vars" which are
distinct from vgrfs.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-10 15:54:14 -07:00
Kenneth Graunke
701e9af15f i965/fs: Short-circuit a loop in live variable analysis.
This has no functional effect, but should make subsequent changes a
little simpler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-10 15:54:14 -07:00
Paul Berry
8cb9cce040 glsl: Don't allow gl_PerVertex to be redeclared after it's been used.
Fixes piglit tests:
- spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-after-other-usage.geom
- spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-other-usage.geom
- spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-usage.geom
- spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-after-other-usage.vert
- spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-after-usage.vert

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:40 -07:00
Paul Berry
84b9fa83a0 glsl: Support redeclaration of GS gl_PerVertex input.
Fixes piglit test
spec/glsl-1.50/execution/redeclare-pervertex-subset-vs-to-gs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:38 -07:00
Paul Berry
fc2330b0be glsl: Catch redeclaration of interface block instance names at compile time.
From section 4.1.9 (Arrays) of the GLSL 4.40 spec (as of revision 7):

    However, unless noted otherwise, blocks cannot be redeclared;
    an unsized array in a user-declared block cannot be sized
    through redeclaration.

The only place where the spec notes that interface blocks can be
redeclared is to allow for redeclaration of built-in interface blocks
such as gl_PerVertex.  Therefore, user-defined interface blocks can
never be redeclared.  This is a clarification of previous intent (see
Khronos bug 10659).

We were already preventing interface block redeclaration using the
same block name at compile time, but we weren't preventing interface
block redeclaration using the same instance name (and different block
names) at compile time.  And we weren't preventing an instance name
from conflicting with a previously-declared ordinary variable.

In practice the problem would be caught at link time, but only because
of a coincidence: since ast_interface_block::hir() wasn't doing any
checking to see if the instance name already existed in the shader, it
was creating a second ir_variable in the shader having the same name
but a different type.  Coincidentally, when the linker checked for
intrastage consistency of global variable declarations, it treated the
two declarations from the same shader as a conflict, so it reported a
link error.

But it seems dangerous to rely on that linker behaviour to catch
illegal redeclarations that really ought to be detected at compile
time.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:35 -07:00
Paul Berry
1b4a7378e9 glsl: Support redeclaration of VS and GS gl_PerVertex output.
Fixes piglit tests:
- spec/glsl-1.50/execution/redeclare-pervertex-out-subset-gs
- spec/glsl-1.50/execution/redeclare-pervertex-subset-vs

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:33 -07:00
Paul Berry
79f515251a glsl: Error check redeclarations of gl_PerVertex.
This patch verifies that:

- The gl_PerVertex input interface block may only be redeclared in a
  geometry shader, and that it may only be redeclared as gl_in[].

- The gl_PerVertex output interface block may only be redeclared in a
  vertex or geometry shader, and that it may only be redeclared as a
  non-array without an interface name.

- gl_PerVertex may not be redeclared as any other type of interface
  block (i.e. as a uniform interface block).

As a side-effect, the code now keeps track of what the previous
declaration of gl_PerVertex was--this will be needed in future
patches.

Fixes piglit tests:
- spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-with-incorrect-name.geom
- spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-as-array.geom
- spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-with-instance-name.geom

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:31 -07:00
Paul Berry
3c83c96dcd glsl: Make it possible to disable a variable in the symbol table.
In later patches, we'll use this in order to implement the required
behaviour that after the gl_PerVertex interface block has been
redeclared, only members of the redeclared interface block may be
used.

v2: Update the function name and comment to clarify that we aren't
actually removing the variable from the symbol table, just disabling
it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:27 -07:00
Paul Berry
24b9bba19b glsl: Add an ir_variable::reinit_interface_type() function.
This will be used by future patches to change an ir_variable's
interface type when the gl_PerVertex built-in interface block is
redeclared.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:22 -07:00
Paul Berry
3699ff4dd1 glsl: Generalize processing of variable redeclarations.
This patch modifies the get_variable_being_redeclared() function so
that it no longer relies on the ast_declaration for the variable being
redeclared.  In future patches, this will allow
get_variable_being_redeclared() to be used for processing
redeclarations of the built-in gl_PerVertex interface block.

v2: Also make get_variable_being_redeclared() static.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:20 -07:00
Paul Berry
78b072b2bc glsl: Don't allow invalid identifiers as struct names.
Fixes piglit test
spec/glsl-1.10/compiler/struct/struct-name-uses-gl-prefix.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:17 -07:00
Paul Berry
9fb6f59552 glsl: Don't allow invalid identifiers as interface block instance names.
Note: we need to make an exception for the gl_PerVertex interface
block, since in geometry shaders it is allowed to be redeclared with
the instance name gl_in.  Future patches will make redeclaration of
gl_PerVertex work properly.

Fixes piglit test
spec/glsl-1.50/compiler/interface-block-instance-name-uses-gl-prefix.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:15 -07:00
Paul Berry
9b5b0320b6 glsl: Don't allow invalid identifier names in struct/interface fields.
Note: we need to make an exception for the gl_PerVertex interface
block, since built-in variables are allowed to be redeclared inside
it.  Future patches will make redeclaration of gl_PerVertex work
properly.

Fixes piglit tests:
- spec/glsl-1.50/compiler/interface-block-array-elem-uses-gl-prefix.vert
- spec/glsl-1.50/compiler/named-interface-block-elem-uses-gl-prefix.vert
- spec/glsl-1.50/compiler/unnamed-interface-block-elem-uses-gl-prefix.vert

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:12 -07:00
Paul Berry
f2dd3a04ce glsl: Don't allow invalid identifiers as interface block names.
Note: we need to make an exception for the gl_PerVertex interface
block, since this is allowed to be redeclared.  Future patches will
make redeclaration of gl_PerVertex work properly.

Fixes piglit test
spec/glsl-1.50/compiler/interface-block-name-uses-gl-prefix.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:10 -07:00
Paul Berry
9bb60a155f glsl: Don't allow unnamed interface blocks to redeclare variables.
Note: some limited amount of redeclaration is actually allowed,
provided the shader is redeclaring the built-in gl_PerVertex interface
block.  Support for this will be added in future patches.

Fixes piglit tests
spec/glsl-1.50/compiler/unnamed-interface-block-elem-conflicts-with-prev-{block-elem,global}.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:08 -07:00
Paul Berry
1838df97a2 glsl: Refactor code to check that identifier names are valid.
GLSL reserves identifiers beginning with "gl_" or containing "__", but
we haven't been consistent about enforcing this rule.  This patch
makes a new function to check whether identifier names are valid.  In
the process it closes a loophole where we would previously allow
function argument names to contain "__".

v2: Rename check_valid_identifier() -> validate_identifier().  Add
curly braces in validate_identifier().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:05 -07:00
Paul Berry
6a157f2e33 glsl: Account for location field when comparing interface blocks.
In commit e2660770731b018411fbe1620cacddaf8dff5287 (glsl: Keep track
of location for interface block fields), I neglected to update
glsl_type::record_key_compare to account for the fact that interface
types now contain location information.  As a result, interface types
that differ only by their location information would not be properly
distinguished.

At the moment this is not a problem, because the only interface block
in which location information != -1 is gl_PerVertex, and gl_PerVertex
is always created in the same way.  However, in the patches that
follow, we'll be adding new ways to create gl_PerVertex (by
redeclaring it), so we'll need location information to be handled
properly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:03 -07:00
Paul Berry
5a234d92af glsl: Construct gl_PerVertex interfaces for GS and VS outputs.
Although these interfaces can't be accessed directly by GLSL (since
they don't have an instance name), they will be necessary in order to
allow redeclarations of gl_PerVertex.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:27:00 -07:00
Paul Berry
fb41f2c531 glsl: Refactor code for creating gl_PerVertex interface block.
Currently, we create just a single gl_PerVertex interface block for
geometry shader inputs.  In later patches, we'll also need to create
an interface block for geometry and vertex shader outputs.  Moving the
code into its own class will make reuse easier.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:26:58 -07:00
Paul Berry
d2e66b953e glsl: Fix block name of built-in gl_PerVertex interface block.
Previously, we erroneously used the name "gl_in" for both the block
name and the instance name.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:26:56 -07:00
Paul Berry
192d05f277 glsl: Construct gl_in with a location of -1.
We use a location of -1 for variables which don't have their own
assigned locations--this includes ir_variables which represent named
interface blocks.  Technically the location assigned to gl_in doesn't
matter, since gl_in is only accessed via its members (which have their
own locations).  But it's nice to be consistent.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-10 14:26:53 -07:00
Christian König
8bc7673ef8 radeon/winsys: fix handling in radeon_drm_cs_flush v2
Calling radeon_drm_cs_flush from multiple threads might cause deadlocks,
fix this by immediately signaling the semaphore after waiting for it.

This is a candidate for the stable branch(es).

Partially fixes: https://bugs.freedesktop.org/show_bug.cgi?id=70123

v2: some fixes on commit message

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-10 11:50:38 +02:00
José Fonseca
a922d3413f util: Fix MinGW build.
_GNU_SOURCE appears to not be used reliably.  Use _MSC_VER instead so
that MSVC alone is affected.
2013-10-09 21:17:53 -07:00
José Fonseca
1aef0ef277 llvmpipe: We don't use the draw pipeline for offset_point/line.
Unless the polygon fill mode is different from PIPE_POLYGON_MODE_FILL,
so checking the the polygon mode is sufficient.

Testing done: no regression in polygon-mode-offset
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-10-09 21:09:07 -07:00
Roland Scheidegger
9b3dbaf396 gallivm: kill old per-quad face selection code
Not used since ages, and it wouldn't work at all with explicit derivatives now
(not that it did before as it ignored them but now the code would just use
the derivs pre-projected which would be quite random numbers).

v2: also get rid of 3 helper functions no longer used.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-10-10 04:32:57 +02:00
Roland Scheidegger
47d0613eb7 gallivm: handle explicit derivatives for cubemaps
They need some special handling. Quite complicated.
Additionally, use the same code for implicit derivatives too if no_rho_approx
and no_quad_lod is set, because it seems while generally it should be ok
to use per quad lod for implicit derivatives there's at least some test which
insists that in case of cubemaps the shared lod value MUST come from a pixel
inside the primitive (due to the derivatives becoming different if a different
larger major axis is chosen).

v2: based on Brian's feedback, clean up code a bit.
And use sign bit of major axis instead of pre-select s/t/r sign for coord
mirroring (which should be the same in the end, saves 2 ands).
Also fix two bugs with select/mirror of derivatives, the minor axes need to
use major axis sign as well (instead of major derivative axis sign), and
don't mistakenly use absolute values of major derivative and inverse major
values.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-10-10 04:32:57 +02:00
Roland Scheidegger
ce1d8634aa gallivm: ignore rho approximation for cube maps
There's two reasons for this:
1) even when ignoring rho approximation for cube maps, the result is still
not correct, but it's better as the max error at edges is now sqrt(2) instead
of 2 (which was a full mip level), same as it is for ordinary 2d maps when
doing rho approximations (so the error actually goes from factor 2 at edges and
sqrt(2) completely inside a face to sqrt(2) at edges and 0 inside a face).
2) I want to repurpose rho_no_approx for cubemaps for fully correct cubemap
derivatives (so don't need yet another debug var).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-10 04:32:57 +02:00
Paul Berry
15e05b999b glsl: Modify array_sizing_visitor to handle unnamed interface blocks.
We were already setting the array size of unsized arrays that appeared
inside unnamed interface blocks, but we weren't updating
ir_variable::interface_type to reflect the new array size, causing
bogus link errors.

This patch causes array_sizing_visitor to keep track of all the
unnamed interface types it sees, and the ir_variables corresponding to
each one.  After the visitor runs, a new function,
fixup_unnamed_interface_types(), adjusts each unnamed interface type
to correctly correspond with the array sizes in the ir_variables.

Fixes piglit tests:
- spec/glsl-1.50/execution/unsized-in-unnamed-interface-block-gs
- spec/glsl-1.50/execution/unsized-in-unnamed-interface-block-multiple

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-09 16:49:48 -07:00
Paul Berry
45e46b2e37 glsl: Update call_link_visitor to update max_ifc_array_access.
When multiple shaders of the same type access an interface block
containing an unsized array, we need to set the array size based on
the maximum array element accessed across all the shaders.  This is
similar to what we already do with unsized arrays occurring outside of
interface blocks.

Note: one corner case is not yet addressed by these patches: the case
where one compilation unit defines an interface block containing
unsized arrays and another compilation unit defines the same interface
block containing sized arrays.

Fixes piglit test:
- spec/glsl-1.50/execution/unsized-in-named-interface-block-multiple

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-09 16:49:46 -07:00
Paul Berry
e226669eea glsl/linker: Modify array_sizing_visitor to handle named interface blocks.
Unsized arrays appearing inside named interface blocks now get a
proper size assigned by the array_sizing_visitor.

Fixes piglit tests:
- spec/glsl-1.50/execution/unsized-in-named-interface-block
- spec/glsl-1.50/execution/unsized-in-named-interface-block-gs
- spec/glsl-1.50/linker/unsized-in-named-interface-block
- spec/glsl-1.50/linker/unsized-in-named-interface-block-gs
- spec/glsl-1.50/linker/unsized-in-unnamed-interface-block-gs (*)

(*) is fixed by dumb luck--support for unsized arrays in unnamed
interface blocks will come in a later patch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-09 16:49:41 -07:00
Paul Berry
f878d2060c glsl: Update ir_variable::max_ifc_array_access properly.
This patch modifies update_max_array_access() so that it updates
ir_variable::max_ifc_array_access to reflect the shader's use of
arrays appearing within interface blocks.

v2: Use an ordinary function in ast_array_index.cpp rather than a
virtual function in ir_rvalue.  Avoid dereferencing NULL when handling
accesses to ordinary structs.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-09 16:49:38 -07:00
Paul Berry
ca8a5ce919 glsl: Sanity check max_ifc_array_access in ir_validate::visit(ir_variable *).
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-09 16:49:36 -07:00
Paul Berry
3f4292a6e3 glsl: Add an ir_variable::max_ifc_array_access field.
For interface blocks that contain arrays, this field will contain the
maximum element of each contained array that is accessed by the
shader.  This is a first step toward supporting unsized arrays in
interface blocks.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-09 16:49:31 -07:00
Paul Berry
22d3ef2df1 glsl: Make accessor functions for ir_variable::interface_type.
In a future patch, this will allow us to enforce invariants when the
interface type is updated.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-09 16:49:26 -07:00
Paul Berry
6f19e552af glsl: Move update of max_array_access into a separate function.
Currently, when converting an access to an array element from ast to
IR, we need to see if the array is an ir_dereference_variable, and if
so update the variable's max_array_access.

When we add support for unsized arrays in interface blocks, we'll also
need to account for cases where the array is an ir_dereference_record
and the record is an interface block.

To make this easier, move the update into its own function.

v2: Use an ordinary function in ast_array_index.cpp rather than a
virtual function in ir_rvalue.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-09 16:49:23 -07:00
Paul Berry
2f2f39c389 glsl: Add parser support for unsized arrays in interface blocks.
Although it's not explicitly stated in the GLSL 1.50 spec, unsized
arrays are allowed in interface blocks.

section 1.2.3 (Changes from revision 5 of version 1.5) of the GLSL
1.50 spec says:

    * Completed full update to grammar section.  Tested spec examples
      against it:

      ...

      * add unsized arrays for block members

And section 7.1 (Vertex and Geometry Shader Special Variables)
includes an unsized array in the built-in gl_PerVertex interface
block:

    out gl_PerVertex {
        vec4 gl_Position;
        float gl_PointSize;
        float gl_ClipDistance[];
    };

Furthermore, GLSL 4.30 contains an example of an unsized array
occurring inside an interface block.  From section 4.3.9 (Interface
Blocks):

    uniform Transform {  // API uses "Transform[2]" to refer to instance 2
        mat4           ModelViewMatrix;
        mat4           ModelViewProjectionMatrix;
        vec4           a[];  // array will get implicitly sized
        float          Deformation;
    } transforms[4];

This patch adds the parser rule to support unsized arrays inside
interface blocks.  Later patches in the series will add the
appropriate semantics to handle them.

Fixes piglit tests:
- spec/glsl-1.50/execution/unsized-in-unnamed-interface-block
- spec/glsl-1.50/linker/unsized-in-unnamed-interface-block

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-09 16:49:21 -07:00
Paul Berry
8cf35c3d2f glsl: Rename the fourth argument to get_interface_instance.
Interface declarations have two names associated with them: the block
name and the instance name.  It's the block name that needs to be
passed to get_interface_instance().  This patch renames the argument
so that there's no confusion.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-09 16:49:16 -07:00
Kenneth Graunke
b330125790 i965/blorp: Allow format conversions for CopyTexSubImage.
BLORP performs blits by drawing a rectangle with a shader that samples
from the source texture, and writes color data to the destination.

The sampler always returns 32-bit RGBA float data, regardless of the
source format's component ordering or data type.  Likewise, the render
target write message takes 32-bit RGBA float data, and converts it
appropriately.  So the bulk of the work is already taken care of for us.

This greatly accelerates a lot of CopyTexSubImage calls, and makes
Legends of Aethereus playable on Ivybridge.  At the default settings,
LOA continually blits between SRGBA8888 (the window format) and
RGBA16_FLOAT.  Since neither BLORP nor our BLT paths supported this,
it fell back to meta, spending 33% of the CPU in floorf() converting
between floats and half-floats.

v2: Use != instead of ^ (suggested by Ian).  Note that only
    CopyTexSubImage is affected by this patch (caught by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-09 16:36:50 -07:00
Kenneth Graunke
72aade48fe i965/blorp: Rework sRGB override behavior.
The previous code for sRGB overrides assumes that the source and
destination formats are equal, other than the color space.  This won't
be feasible when we add support for format conversions.

Here are a few cases, and how the old code handled them:

1.  RGB8 -> SRGB8, MSAA     ==>   SRGB8 -> SRGB8
2.  RGB8 -> SRGB8, single   ==>    RGB8 -> RGB8
3. SRGB8 ->  RGB8, MSAA     ==>    RGB8 -> RGB8
4. SRGB8 ->  RGB8, single   ==>   SRGB8 -> SRGB8

Apparently, preserving the behavior of #1 is important.  When doing a
multisample to single-sample resolve, blending the samples together in
an sRGB correct fashion results in a noticably higher quality image.
It also is necessary to pass Piglit's EXT_framebuffer_multisample
accuracy color tests.

Paul, Eric, Anuj, and I talked about this, and aren't sure that it
matters in the other cases.

This patch preserves the behavior of #1, but otherwise reverts to
doing everything in linear space, changing the behavior of case #4.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-09 16:36:50 -07:00
Kenneth Graunke
0589eaecde i965/blorp: Explain why Z24 can't use a sensible format.
We could conceivably use BRW_SURFACEFORMAT_R24_UNORM_X8_TYPELESS for
Z24 source images, allowing conversions from Z24 to either Z16 or Z32F.

Unfortunately, we can't use it for destination images since it isn't
supported as a render target.

Using different formats for sources or destinations would be painful,
so for now, punt.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-09 16:36:50 -07:00
Kenneth Graunke
590d71791a i965/blorp: Use R32_FLOAT for Z32F surfaces.
Currently, all that matters is that we copy the correct number of bits,
so any format that has 32-bits of data will work fine.

Once BLORP begins handling format conversions, the sampler will need to
correctly interpret the data.  We don't need a depth format, but we do
need the right number of components and data type (FLOAT).

For Z32F, this means using R32_FLOAT.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-09 16:36:49 -07:00
Kenneth Graunke
4dc25b7615 i965/blorp: Use R16_UNORM for Z16 surfaces.
Currently, all that matters is that we copy the correct number of bits,
so any format that has 16-bits of data will work fine.

Once BLORP begins handling format conversions, the sampler will need to
correctly interpret the data.  We don't need a depth format, but we do
need the right number of components and data type (UNORM).

For Z16, this means using R16_UNORM.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-09 16:36:49 -07:00
Kenneth Graunke
6f7c41dd1d i965/blorp: Add support for non-render-target formats.
Once blorp gains the ability to do format conversions, it's conceivable
that the source format may be texturable but not supported as a render
target.  This would break Paul's code, which assumes that it can use the
render_target_format array even for the source format.

There are three ways to convert MESA_FORMAT enums to BRW_SURFACEFORMAT
enums:

1. brw_format_for_mesa_format()

   This translates the Mesa format to the most equivalent BRW format.

2. brw->render_target_format[]

   This is used for renderbuffers, and handles the subset of formats
   that are renderable.  However, it's not always equivalent, since
   it overrides a few non-renderable formats.  For example, it
   converts B8G8R8X8_UNORM to B8G8R8A8_UNORM so it can be rendered to.

3. translate_tex_format()

   This is used for textures.  It wraps brw_format_for_mesa_format(),
   but overrides depth textures, and one sRGB case on Gen4.

BLORP has a fourth function, which uses brw->render_target_format[]
and overrides depth formats (differently than translate_tex_format).

This patch makes the BLORP function to use brw_format_for_mesa_format()
for textures/source data, since not everything will be a render target.
It continues using brw->render_target_format[] for render targets, since
it needs the format overrides that provides.

We don't use translate_tex_format() since the additional overrides are
not useful or simply redundant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-09 16:36:49 -07:00
Kenneth Graunke
4b2e819e10 i965/blorp: Add an is_render_target parameter to surface_info::set.
This allows us to determine whether we're setting up a format for
the source (as a texture) or destination (as a render target).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-09 16:36:49 -07:00
José Fonseca
dbc1f3677c util/u_math: Fix C++ include of u_math.h on MSVC.
GNU C++ compiler declares the C99 lrint, etc. when _GNU_SOURCE is
defined, but MSVC does not.

Trivial.
2013-10-10 00:31:53 +01:00
Zack Rusin
edde6c77bd llvmpipe: abstract the code to set number of subpixel bits
As we're moving towards expanding the number of subpixel
bits and the width of the variables used in the computations
we need to make this code a bit more centralized.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-09 18:30:31 -04:00
Zack Rusin
87fe4a33d3 llvmpipe: implement 64 bit mul opcodes in llvmpipe
Both the imul_hi and umul_hi are working with this patch.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-09 18:30:27 -04:00
Zack Rusin
6905698fc2 gallium: Add support for 32x32 muls with 64 bit results
The code introduces two new 32bit integer multiplication opcodes which
can be used to produce correct 64 bit results. GLSL, OpenCL and D3D10+
require them. We use two seperate opcodes, because they match the
behavior of GLSL and OpenCL, are a lot easier to add than a single
opcode with multiple destinations and because there's not much (any)
difference wrt code-generation.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-09 18:30:20 -04:00
Zack Rusin
c01c6a95b4 gallivm: support printing of 64 bit integers
only 8 and 32 bit integers were supported before.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-10-09 18:29:05 -04:00
Eric Anholt
58bab95c95 i965/blorp: Fix the register types on blorp's push constants.
The UD values were getting set up as floats.  This happened to work out
because they were used as the second argument where the first was a dword,
and gen6+ doesn't do source conversions.  But it did trigger fulsim
warnings, and it meant if you used the push constant as the first operand
you would have been disappointed.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-09 11:43:46 -07:00
Eric Anholt
8da15d7544 i965: Fix 3D texture layout by more literally copying from the spec.
Fixes 3 texelFetch tests in piglit all.tests on ivb, and cubemap npot on gm45.

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

Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
2013-10-09 11:28:19 -07:00
Eric Anholt
bfe6e5dda5 mesa: Fix compiler warnings when ALIGN's alignment is "1 << value".
We hadn't run into order of operation warnings before, apparently, since
addition is so low on the order.

Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-09 11:28:19 -07:00
Eric Anholt
791550aa8e i965: Don't forget the cube map padding on gen5+.
We had a fixup for gen4's 3d-layout cubemaps (which, iirc, we'd
experimentally found to be necessary!), but while the spec still requires
it on gen5, we'd been missing it in the array-layout cubemaps.

Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-09 11:28:19 -07:00
Gaetan Nadon
e6fb744141 egl/main: remove undefined X11_LIBS automake variable
The EGL library has some references to x11 but it gets the link flags
from the XCB_DRI2_LIBS if and only if HAVE_EGL_PLATFORM_X11 is true.

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

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

Reported-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-10-09 10:36:01 -04:00
Gaetan Nadon
bc93c3798a gallium/state_trackers/glx: X11/Xlib.h: No such file or directory
The compiler cannot find the Xlib.h in the installed system headers.
All supplied include directives point to inside the mesa module.
The X11_CFLAGS variable is undefined (not defined in config.status).

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

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

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

Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-10-09 10:28:12 -04:00
Gaetan Nadon
54b028ba89 gallium/targets/libgl-xlib: X11/Xlib.h: No such file or directory
The compiler cannot find the Xlib.h in the installed system headers.
All supplied include directives point to inside the mesa module.
The X11_CFLAGS variable is undefined (not defined in config.status).

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

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

Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-10-09 10:24:35 -04:00
Gaetan Nadon
d901d7e08e gallium/state_trackers/egl: use X11_INCLUDES rather than X11_CFLAGS
The X11_CFLAGS variable is undefined (not defined in config.status).
It appears the intent was to use X11_INCLUDES defined in configure.ac.
It is used for building the code in the x11 subdir.

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

Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-10-09 10:23:00 -04:00
Grigori Goronzy
bd19e25703 st/vdpau: really block until surface is idle
pipe_screen::fence_finish with zero timeout returns quickly and
doesn't wait at all. Fix that, and also delete the fence afterwards,
so that QuerySurfaceStatus returns the right state later.

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

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-09 13:02:40 +02:00
Grigori Goronzy
48563bd45c st/vdpau: add new formats to OutputSurface rendering
OutputSurfaces have simple YCbCr rendering functionality built in,
but so far only 4:2:0 subsampling worked correctly. This fixes 4:2:2
and 4:4:4 formats.

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-09 13:02:40 +02:00
Grigori Goronzy
1a5bac2149 st/vdpau: fix GenerateCSCMatrix with NULL procamp
As per API specification, it is legal to supply a NULL procamp. In this
case, a CSC matrix according to the colorspace should be generated,
but no further adjustments are made.

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

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-09 13:02:40 +02:00
Grigori Goronzy
5b4e2db12d radeon/uvd: disable VC-1 simple/main profile
It doesn't work (decodes to garbage) with most videos on UVD 3.0. Worse
yet, it often results in random memory corruption or GPU hangs. Rumor
has it only the newest UVD hardware could do it anyway.

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-09 13:02:40 +02:00
Grigori Goronzy
5403dd4b68 radeon/uvd: try to fix VC-1 decoding
The DPB size calculations seem to be off; there is various random
corruption happening, even with advanced profile. Always assuming
a minimum number of references appears to fix it, similarly to
H.264. This might overallocate the DPB.  Also clean up the SPS/PPS
field setup so that it matches VC-1 specifications better.

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

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-09 13:02:40 +02:00
Grigori Goronzy
0bb05484bf radeon/uvd: fix video format reporting
UVD can only support NV12 in the case of hardware decoding, but we
can still use all other formats for software decoding. Use the UNKNOWN
profile to signal that we're not interesting in hardware decoding.

v2: use profile instead of entrypoint

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-09 13:02:40 +02:00
Marek Olšák
c207fa6c18 gallium/dri targets: use DRI_DRIVER_LDFLAGS
which contains -Wl,-Bsymbolic. If I understand it correctly, it prevents
symbols from clashing if multiple drivers are loaded at the same time.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-09 12:04:38 +02:00
Marek Olšák
6b7c039dc2 radeonsi: fix occlusion queries for CIK
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-10-09 11:44:48 +02:00
Marek Olšák
ec922ef987 radeonsi: draw register fixes for CIK
This doesn't fix any known issue. I'm just following the docs.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-10-09 11:44:48 +02:00
Chia-I Wu
a26e17a365 i965: keep SecHalf flag after register coalescing
Copy sechalf to the new register, otherwise we would read wrong HW registers.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-09 14:49:11 +08:00
Chia-I Wu
3db52b6e36 i965: allow SIMD8 sampler messages in SIMD16 mode
When the instruction to send the sampler message is forced uncompressed or
sechalf, send SIMD8 one even in SIMD16 mode.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-09 14:49:11 +08:00
Chia-I Wu
44f0777f17 i965: make BRW_COMPRESSION_2NDHALF valid for brw_SAMPLE
SIMD8 sampler messages are allowed in SIMD16 mode, and they could not work
without BRW_COMPRESSION_2NDHALF.  Later PRMs (gen5 and later) do not
explicitly state whether BRW_COMPRESSION_2NDHALF is allowed, but they do have
examples using send with SecHalf.  It should be safe to assume SecHalf is
valid.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-09 14:49:11 +08:00
Vinson Lee
1176a3aac6 i965: Initialize brw_blorp_const_color_program::prog_data.
Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-08 22:10:46 -07:00
Eric Anholt
8c197d4aae i965: Fix a compiler warning about conservative depth enums.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2013-10-08 14:34:35 -07:00
Paul Berry
d14fcd7db7 i965/gs: Fixup gl_PointSize on entry to geometry shaders.
gl_PointSize is stored in the w component of VARYING_SLOT_PSIZ, but
the geometry shader infrastructure assumes that it should look for all
geometry shader inputs of type float in the x component.  So when
compiling a geomtery shader that uses a gl_PointSize input, fix it up
during the shader prolog by moving the w component to the x component.

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

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-08 12:44:24 -07:00
Bryan Cain
8f758b0b92 glsl/gs: handle gl_ClipDistance geometry input in lower_clip_distance.
This corresponds to the lowering of gl_ClipDistance to
gl_ClipDistanceMESA for vertex and geometry shader outputs.  Since
this lowering pass occurs after lower_named_interface blocks, it deals
with 2D arrays (gl_ClipDistance[vertex][clip_plane]) rather than 1D
arrays in an interface block
(gl_in[vertex].gl_ClipDistance[clip_plane]).

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

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

v3 (Paul Berry <stereotype441@gmail.com>): Add comments and assertions
to clarify that the 2D version of clip distance is only used for
geometry shader inputs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-08 12:44:21 -07:00
Paul Berry
c09adcb21b glsl/gs: add gl_in support to builtin_variables.cpp.
Previously, builtin_variables.cpp was written assuming that we
supported ARB_geometry_shader4 style geometry shader inputs, meaning
that each built-in varying input to a geometry was supplied via an
array variable whose name ended in "In", e.g. gl_PositionIn or
gl_PointSizeIn.

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

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-08 12:44:19 -07:00
Paul Berry
378ff1dbac glsl: Keep track of location for interface block fields.
This patch adds a "location" element to struct glsl_struct_field, so
that we can keep track of the gl_varying_slot associated with each
built-in geometry shader input.

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-08 12:44:01 -07:00
Adam Jackson
e166a58c43 glx: Generate fewer errors in MakeContextCurrent
For a few reasons.

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

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

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

Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-08 13:24:20 -04:00
Adam Jackson
d101204c23 glx: Propagate failures from SendMakeCurrentRequest where possible
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-08 13:24:20 -04:00
Adam Jackson
68412d5006 glx: Hide xGLXMakeCurrentReply inside SendMakeCurrentRequest
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-08 13:24:20 -04:00
Marek Olšák
15a201c610 st/dri: don't export any private symbols
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-08 16:23:52 +02:00
Marek Olšák
085e5adede gallium/swrast: don't export any private symbols
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-08 16:23:52 +02:00
Marek Olšák
c787a9767c gallium/radeon: don't export any private symbols
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-08 16:23:52 +02:00
Marek Olšák
790c8a2405 configure.ac: report an error if LLVM shared libs are disabled and CL is enabled
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-08 16:23:52 +02:00
Marek Olšák
e9c9d28203 st/mesa: improve format selection for GLES
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
2013-10-08 16:23:04 +02:00
Stéphane Marchesin
20bf508a42 i915g: Rename sampler to fragment_sampler
Otherwise it is fairly confusing.
2013-10-07 20:53:55 -07:00
Stéphane Marchesin
8c6594074e i915g: Fix the sampler bind function
The new sampler bind sends us NULL samplers, so we need to count
the number of valid samplers ourselves. This fixes ~500 piglit
regressions from the sampler rework.

While we're at it, let's also support start.
2013-10-07 20:51:53 -07:00
Chad Versace
6cd1da8377 gen7: Use logical, not physical, dims in 3DSTATE_DEPTH_BUFFER (v2)
In 3DSTATE_DEPTH_BUFFER, we set Width and Height to the miptree slice's
physical dimensions. (Logical and physical dimensions may differ for
multisample surfaces).

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

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

v2: No Piglit regressions, for real this time.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-07 11:55:24 -07:00
Chad Versace
ccad802ed5 doxygen: Generate Doxygen for i965
Now, one can do the following to generate and read the i965 Doxygen:

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

Reviewed-by: Frank Henigman <fjhenigman@google.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-07 11:55:16 -07:00
Matt Turner
b645913ff6 i965: Remove the "ARF" register file.
The registers in the architecture register file don't share much in
common, so there's no point in grouping them together. Use the HW_REG
class instead. The vec4 backend already does this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 11:38:52 -07:00
Matt Turner
e7dc88026a i965: Fixup for don't dead-code eliminate instructions that write to the accumulator.
Accidentally pushed an old version of the patch.

v2: Set destination register using brw_null_reg().
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 11:38:15 -07:00
Matt Turner
c4e6569fc8 i965: Generate code for ir_binop_imul_high.
v2: Make accumulator's type match the type of the operation. Noticed by
    Ken.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:43:19 -07:00
Matt Turner
85154241d6 i965: Use the multiplication result's type for the accumulator.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-07 10:43:19 -07:00
Matt Turner
6ff8f06308 i965/fs: Disable CSE on instructions writing to HW_REG.
CSE would otherwise combine the two mul(8) emitted by [iu]mulExtended:

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

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

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-07 10:43:19 -07:00
Matt Turner
06e41a02a3 glsl: Implement [iu]mulExtended() built-ins for ARB_gpu_shader5.
These built-ins have two "out" parameters, which makes implementing them
efficiently with our current compiler infrastructure difficult. Instead,
implement them in terms of the existing ir_binop_mul IR (to return the
low 32-bits) and a new ir_binop_mul64 which returns the high 32-bits.

v2: Rename mul64 -> imul_high as suggested by Ken.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:43:19 -07:00
Matt Turner
69909c866b i965: Add Gen assertion checks for newer instructions.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:43:19 -07:00
Matt Turner
92dc16c3e2 i965: Don't dead-code eliminate instructions that write to the accumulator.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:41:17 -07:00
Matt Turner
014cce3dc4 i965: Generate code for ir_binop_carry and ir_binop_borrow.
Using the ADDC and SUBB instructions on Gen7.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:41:17 -07:00
Matt Turner
4ec37317c5 i965: Add UD null register helpers.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:41:16 -07:00
Matt Turner
6f9428eb68 glsl: Implement usubBorrow() built-in for ARB_gpu_shader5.
i965 implements this with a single (multiple destination) instruction,
SUBB. Emitting SUBB directly from usubBorrow() would be ideal, but our
optimization passes don't know how to copy with expressions with
side-effects.

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-07 10:41:16 -07:00
Matt Turner
6c125973f3 glsl: Implement uaddCarry() built-in for ARB_gpu_shader5.
i965 implements this with a single (multiple destination) instruction,
ADDC. Emitting ADDC directly from uaddCarry() would be ideal, but our
optimization passes don't know how to copy with expressions with
side-effects.

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-07 10:41:16 -07:00
Matt Turner
499d7a7f6e glsl: Add ir_binop_carry and ir_binop_borrow.
Calculates the carry out of the addition of two values and the
borrow from subtraction respectively. Will be used in uaddCarry() and
usubBorrow() built-in implementations.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-07 10:41:16 -07:00
Ian Romanick
ae514416b2 glsl_compiler: Enable any extension that any Mesa driver enables
The only GLSL extension that is not enabled is AMD_vertex_shader_layer.
I think the standalone-compiler could enable this (as shading language
support is complete), but no driver enables it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick
136568ea18 glsl_compiler: Sort extensions by name
Makes it a little easier to see which ones are missing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick
587cd971c8 glsl_compiler: Always log the compiler diagnostics
Not just when there's an error.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick
3646d65f6a glsl_compiler: Set max GLSL version on the command line
Infer whether or not to use ES based on the GLSL version (100 or 300 are
for ES).  This replaces the --glsl-es command line option.  Set various
compiler limits based on the minimums required for the specified GLSL
version.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick
257db619c6 glsl_compiler: Use no_argument instead of 0 in getopt_long options
The choices aren't just 0 and 1, so using the enum names is much more
clear.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick
75e9bd13c4 glsl_compiler: Re-enable building glsl_compiler
This allows application developers to use Mesa's compiler as a
standalone validator for their shaders.

This is mostly a revert of commit 569f0e4.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick
5d6b0e7f1b glsl: Remove glsl_parser_state MaxVaryingFloats field
Pull the data directly from the context like the other varying related
limits.  The parser state shadow copies were added back when the parser
state didn't have a pointer to the context.  There's no reason to do it
now days.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-07 09:59:23 -07:00
Ian Romanick
7db50171be glsl: Set gl_MaxVertexOutputs from VertexProgram.MaxOutputComponents etc
gl_MaxVertexOutputVectors => ctx->Const.VertexProgram.MaxOutputComponents
gl_MaxFragmentInputVectors => ctx->Const.FragmentProgram.MaxInputComponents

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

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

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> [v2]
Reviewed-by: Marek Olšák <marek.olsak@amd.com> [v2]
Reviewed-by: Paul Berry <stereotype441@gmail.com> [v2]
2013-10-07 09:59:23 -07:00
Ian Romanick
42305fb502 glsl: Count shader inputs and outputs separately
Starting with OpenGL 3.2 input limits and output limits for stages may
not match.  This means they need to be accounted separately.

No piglit regressions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-07 09:59:23 -07:00
Emilio Pozuelo Monfort
d4b5bc62af glapi: add output info to GetProgramiv's params
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-07 09:06:33 -07:00
Laurent Carlier
72465fcf57 clover: fix building with llvm-3.4 since rev191922
http://llvm.org/viewvc/llvm-project?view=revision&revision=191922
2013-10-07 08:41:02 -07:00
Brian Paul
e58dd465f0 st/mesa: silence warning about unhandled ir_query_levels in switch 2013-10-07 09:08:16 -06:00
Christian König
289d928c8e radeon/vdpau: only export necessary symbols
Export only the absolutely necessary symbols in radeon vdpau targets.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-07 11:16:53 +02:00
Christian König
731f5471fb radeon/uvd: optimize message handling a bit
No need to keep a copy of the message in system memory anymore,
since it should now be in GART memory on newer chips.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-07 11:16:53 +02:00
Kenneth Graunke
cfbfb50cb8 docs: Mark a few more things as "in progress" in GL3.txt. 2013-10-06 13:58:53 -07:00
Ilia Mirkin
7178d6ac59 dri/nouveau: add AllocTextureImageBuffer implementation
This fixes issues where get_rt_format would see a 0 format because the
nouveau_surface had not been properly initialized. Fixes crash on
supertuxkart startup (which still fails due to out-of-vram issues).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2013-10-06 12:59:18 -07:00
Francisco Jerez
b3c04362b4 glsl: Fix usage of the wrong union member in program_resource_visitor::recursion.
In the array-of-struct case, recursion() takes the row_major flag for
each iteration from 't->fields.structure[i]', but 't' is not a record
type.  Inherit the array declaration row_major flag instead.

This mistake was found by running piglit on valgrind.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69449
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-06 12:55:14 -07:00
Marek Olšák
373f8670d1 Revert "r600g: only flush the caches that need to be flushed during CP DMA operations"
This reverts commit 7948ed1250.

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

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

Conflicts:
	src/gallium/drivers/r600/evergreen_hw_context.c
	src/gallium/drivers/r600/r600_hw_context.c
	src/gallium/drivers/r600/r600_pipe.h
2013-10-06 03:13:48 +02:00
Chris Forbes
2656c6118b i965/ivb: Flag RG32F quirk for texture gather regardless of swizzles
As of ARB_gpu_shader5, textureGather doesn't always read the
post-swizzle RED channel -- so we can't just look at the red swizzle
state.

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

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-06 11:25:14 +13:00
Chris Forbes
e8ec2e0344 i965/vs: Add support for textureGather(.., comp)
- For HSW: Select the channel based on the component selected (swizzle
  is done in HW)
- For IVB: Select the channel based on the swizzle state for the
  component selected. Only apply the RG32F w/a if we actually want
  green -- we're about to flag it regardless of swizzle state.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-06 11:25:11 +13:00
Chris Forbes
09c6fd450d i965/fs: Add support for textureGather(.., comp)
- For HSW: Select the channel based on the component selected (swizzle
  is done in HW)
- For IVB: Select the channel based on the swizzle state for the
  component selected. Only apply the RG32F w/a if we actually want
  green -- we're about to flag it regardless of swizzle state.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-06 11:25:03 +13:00
Chris Forbes
7335bc7526 glsl: add ARB_gpu_shader5's additional textureGather signatures
- gsampler2DRect support
- optional `comp` parameter

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

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-06 11:13:17 +13:00
Chris Forbes
88ee9bc9d1 glsl: Add support for specifying the component in textureGather
ARB_gpu_shader5 introduces new variants of textureGather* which have an
explicit component selector, rather than relying purely on the sampler's
swizzle state.

This patch adds the GLSL plumbing for the extra parameter.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-06 11:12:29 +13:00
Chris Forbes
f93a63bfcc docs: mark ARB_conservative_depth done on i965
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2013-10-06 11:05:37 +13:00
Chris Forbes
7ec4668696 i965: Enable ARB_conservative_depth for Gen7+.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-06 11:05:35 +13:00
Chris Forbes
4697955c5b i965/wm: Program correct conservative depth modes
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-06 11:05:10 +13:00
Brian Paul
64b1a1d459 docs: rephrase 9.2.1, 9.1.7 news item
Both are bug-fix releases, not new development releases.
2013-10-05 14:25:25 -06:00
Brian Paul
21315bfb71 docs: add the MD5 sums for the 9.2.1 and 9.1.7 releases 2013-10-05 14:20:37 -06:00
Timothy Arceri
c70e2471dc docs: Mark off KHR_debug, update relnotes
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-05 11:41:05 -07:00
Chris Forbes
84e1a396ec i965/vs: add missing break between ir_query_levels and ir_tg4 cases
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2013-10-05 23:18:45 +13:00
Chris Forbes
2beb60c4e7 docs: Mark off ARB_texture_query_levels, update relnotes
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2013-10-05 19:16:33 +13:00
Chris Forbes
317e172677 i965: enable ARB_texture_query_levels on Gen6+
Theoretically would work on Gen5 as well but requires GLSL 1.30, which
is not (yet) enabled by default there.

V2: Enable for Gen5 conditionally on GLSL version.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-05 19:16:33 +13:00
Chris Forbes
4be21a07ea i965/vs: implement ir_query_levels
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-05 19:16:33 +13:00
Chris Forbes
fa6440acdb i965/fs: implement ir_query_levels
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-05 19:16:33 +13:00
Chris Forbes
7480ae3cb8 i965: ignore all texturing opcodes without a coordinate, for cubemap normalize
Previously we special-cased textureSize() but this is the more correct
condition.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-05 19:16:33 +13:00
Chris Forbes
7a4754d7d9 glsl: add plumbing for GL_ARB_texture_query_levels
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-05 19:16:32 +13:00
Chris Forbes
6ce4e7672e mesa: add plumbing for GL_ARB_texture_query_levels
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-05 19:16:32 +13:00
Carl Worth
30e6501820 docs: Add release notes for 9.1.7 release
Including a news item.
2013-10-04 21:58:51 -07:00
Carl Worth
058fa59d6b docs: Add release notes and NEWS item for 9.2.1 release
Better late than never, right?
2013-10-04 21:58:51 -07:00
Alexander von Gluck IV
765baec8f7 haiku: Ensure correct libraries are referenced. 2013-10-04 18:20:09 -05:00
Alexander von Gluck IV
a4144af400 haiku: Clean up code, use target-helpers
* Thanks for the help xexaxo!
2013-10-04 18:20:09 -05:00
Alexander von Gluck IV
4d15ef5121 haiku: Drop haiku-softpipe.c; fix extern C
* It isn't needed any longer as we're
  moving in the code that called it.
* The winsys code is C, so make sure
  we include the header in the extern C
2013-10-04 18:20:09 -05:00
Alexander von Gluck IV
bc2fb19773 haiku: Correct Haiku softpipe library
* Use LoadableModule vs SharedLibrary
2013-10-04 18:20:09 -05:00
Alexander von Gluck IV
8730236d1a haiku: Add first Haiku renderer (softpipe)
* This shared library gets parsed by the
  system as a system "add-on"
2013-10-04 18:20:09 -05:00
Alexander von Gluck IV
c9f1217e1f haiku: Build Haiku's libGL from within Mesa
* This in essence means that Mesa would be
  taking control of Haiku's OpenGL kit.
* This works by dispatching renderers from the
  OpenGL add-ons directory
2013-10-04 18:20:09 -05:00
Vinson Lee
1349766612 glsl: Define isnormal for Oracle Solaris Studio.
This patch fixes this Oracle Solaris Studio build error.

"../../src/glsl/ir_constant_expression.cpp", line 1398: Error: The function "isnormal" must have a prototype.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-10-04 15:37:33 -07:00
Grigori Goronzy
8419c5c3ce r600g: texture offsets for non-TXF instructions
All texture instructions can use offsets, not just TXF. Offsets into
the literals array were wrong, too.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-10-04 22:44:47 +02:00
Marek Olšák
c04b8d1dab r600g: remove an assertion causing a crash at context cleanup
Compute samplers are advertised, but not implemented.
I think that's intentional.
2013-10-04 20:01:51 +02:00
Marek Olšák
eda1f2aa12 r300g: remove unused function r300_lacks_vertex_textures 2013-10-04 20:01:48 +02:00
Ian Romanick
0667e2c969 mesa: Don't return any data for GL_SHADER_BINARY_FORMATS
We return 0 for GL_NUM_SHADER_BINARY_FORMATS, so
GL_SHADER_BINARY_FORMATS should not write any data to the application
buffer.

Fixes piglit test 'arb_get_program_binary-overrun shader'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-10-04 10:08:45 -07:00
Brian Paul
a50c5f8d24 svga: fix incorrect memcpy src in svga_buffer_upload_piecewise()
As we march over the source buffer we're uploading in pieces, we
need to memcpy from the current offset, not the start of the buffer.
Fixes graphical corruption when drawing very large vertex buffers.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2013-10-04 10:25:37 -06:00
Matthew McClure
d164d50a85 util: when packing depth values, round to nearest.
This patch adds the lrint, lrintf, llrint, and llrintf rounding utility
functions. When packing unorm depth values, we will round to nearest.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-10-04 10:55:51 +01:00
Tom Stellard
b280516e11 radeonsi/compute: Fix segfault caused by recent refactoring
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-10-03 17:29:54 -07:00
Brian Paul
b181be6266 radeonsi: Fix build
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

https://bugs.freedesktop.org/show_bug.cgi?id=70106
2013-10-03 17:29:42 -07:00
Emil Velikov
757ec72b23 configure: set HAVE_COMMON_DRI when building only swrast
With commit cb1febb07, I have incorrectly removed HAVE_COMMON_DRI
assuming that swrast does not need to build the translations for
driconf options, as effectively swrast/drisw does not use them.

With the incoming unification work of dri and drisw, it makes
sense just to revert the offending hunk.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70057
Reported-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-03 16:52:38 -07:00
Brian Paul
99a471c67b radeonsi/compute: fix bind_compute_sampler_states() breakage
Remove the assignment and the no-op function.
2013-10-03 17:32:40 -06:00
Paul Berry
800610f9eb i965/fs: Improve accuracy of dFdy() to match dFdx().
Previously, we computed dFdy() using the following instruction:

  add(8) dst<1>F src<4,4,0)F -src.2<4,4,0>F { align1 1Q }

That had the disadvantage that it computed the same value for all 4
pixels of a 2x2 subspan, which meant that it was less accurate than
dFdx().  This patch changes it to the following instruction when
c->key.high_quality_derivatives is set:

  add(8) dst<1>F src<4,4,1>.xyxyF -src<4,4,1>.zwzwF { align16 1Q }

This gives it comparable accuracy to dFdx().

Unfortunately, align16 instructions can't be compressed, so in SIMD16
shaders, instead of emitting this instruction:

  add(16) dst<1>F src<4,4,1>.xyxyF -src<4,4,1>.zwzwF { align16 1H }

We need to unroll to two instructions:

  add(8) dst<1>F src<4,4,1>.xyxyF -src<4,4,1>.zwzwF { align16 1Q }
  add(8) (dst+1)<1>F (src+1)<4,4,1>.xyxyF -(src+1)<4,4,1>.zwzwF { align16 2Q }

Fixes piglit test spec/glsl-1.10/execution/fs-dfdy-accuracy.

Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-03 13:49:15 -07:00
Brian Paul
9267565ee4 gallium/tests: fix SHADER typo 2013-10-03 14:24:55 -06:00
Emil Velikov
13895abd86 gallium-egl: use standard variable types over EGLBoolean/EGLint
The inferface/prototype in native_wayland_bufmgr.h uses boolean/int, as
well as the rest of the file. Convert to improve consistency and to
prevent gcc compiler warnings due to type miss-match.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-03 14:05:29 -06:00
Brian Paul
379deaf5c6 gallium: remove old bind_*_sampler_states() functions
The new bind_sampler_states() function takes a shader argument to
specify the shader stage.
2013-10-03 14:05:29 -06:00
Brian Paul
55e81b06e7 gallium/docs: update bind_sampler_states() documentation 2013-10-03 14:05:28 -06:00
Brian Paul
1e2fbf2657 cso: make sure all sampler states are set/cleared 2013-10-03 14:05:28 -06:00
Brian Paul
7d7a9714d2 freedreno: use new bind_sampler_states() function 2013-10-03 14:05:28 -06:00
Brian Paul
88b17a15f3 svga: don't hook in old bind_fragment_sampler_states() functions 2013-10-03 14:05:28 -06:00
Brian Paul
27c054edf0 radeon: don't use old bind_vertex/fragment_sampler_states() hooks 2013-10-03 14:05:28 -06:00
Brian Paul
1e8d3eb08d i915g: remove old bind_vertex/fragment_sampler_states() hooks 2013-10-03 14:05:28 -06:00
Brian Paul
edd9af675c noop: remove old bind_*_sampler_states() functions 2013-10-03 14:05:28 -06:00
Brian Paul
f233ee0cd6 galahad: remove old bind_*_sampler_states() functions 2013-10-03 14:05:28 -06:00
Brian Paul
d0520d5bf6 vl: remove old bind_fragment_sampler_states() calls 2013-10-03 14:05:28 -06:00
Brian Paul
3925e521d6 util: remove old bind_fragment_sampler_states() calls from blitter code 2013-10-03 14:05:28 -06:00
Brian Paul
9fa6722a68 draw: remove use of old bind_fragment_sampler_states() 2013-10-03 14:05:28 -06:00
Brian Paul
7478236da9 nouveau: remove old bind_*_sampler_states() functions 2013-10-03 14:05:28 -06:00
Brian Paul
1446600d1a cso: remove use of old bind_*_sampler_states() functions 2013-10-03 14:05:28 -06:00
Brian Paul
bcf7508a7d rbug: remove old bind_*_sampler_states() functions 2013-10-03 14:05:28 -06:00
Brian Paul
22480c5b5b identity: remove old bind_*_sampler_states() functions 2013-10-03 14:05:28 -06:00
Brian Paul
dd4816e3fd trace: remove old bind_*_sampler_states() functions 2013-10-03 14:05:28 -06:00
Brian Paul
5807105ad7 ilo: don't hook up old bind_*_sampler_states() functions 2013-10-03 14:05:28 -06:00
Brian Paul
2d0effaa10 llvmpipe: remove old bind_*_sampler_states() functions 2013-10-03 14:05:27 -06:00
Brian Paul
6e640545ac softpipe: remove old bind_*_sampler_states() functions 2013-10-03 14:05:27 -06:00
Brian Paul
93e6694f2c clover: remove bind_compute_sampler_states() calls 2013-10-03 14:05:27 -06:00
Brian Paul
a5350a9f3e gallium/tests: use pipe_context::bind_sampler_states() 2013-10-03 14:05:27 -06:00
Brian Paul
bc367ab54d gallium/tools: update dump_state.py to use bind_sampler_states() 2013-10-03 14:05:27 -06:00
Brian Paul
3f0627c2ad nouveau: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:27 -06:00
Brian Paul
550f9ee64c softpipe: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
8280b29d7c radeon: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
0de99d52b7 svga: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
6ef9fc791e trace: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
e64112b1f9 rbug: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
bd1514849b noop: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
c772338488 llvmpipe: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
41a9be70e4 ilo: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
9564ec8317 identity: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
aec11d48cf i915g: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
e5d000c3f1 galahad: implement pipe_context::bind_sampler_states() 2013-10-03 14:05:26 -06:00
Brian Paul
4bdf7d3842 clover: use pipe_context::bind_sampler_states() if non-null 2013-10-03 14:05:26 -06:00
Brian Paul
96b9c09495 vl: use pipe_context::bind_sampler_states() if non-null 2013-10-03 14:05:26 -06:00
Brian Paul
bbc1fd8c80 util: use pipe_context::bind_sampler_states() if non-null 2013-10-03 14:05:26 -06:00
Brian Paul
27d500a844 draw: use pipe_context::bind_sampler_states() if non-null 2013-10-03 14:05:26 -06:00
Brian Paul
5cba8725a4 cso: use pipe_context::bind_sampler_states() if non-null 2013-10-03 14:05:26 -06:00
Brian Paul
755d788fe2 gallium: add pipe_context::bind_sampler_states()
The bind_vertex/geometry/fragment/compute_sampler_states() functions
will be replaced by a single functions.
2013-10-03 14:05:26 -06:00
Brian Paul
9b99451da2 r300g: rename r300_bind_sampler_states to r300_bind_fragment_sampler_states 2013-10-03 14:05:26 -06:00
Brian Paul
c368479e38 draw: rename bind_sampler_states variables
Put 'fragment' in the names.  In preparation for upcoming function
renaming.
2013-10-03 14:05:25 -06:00
Marek Olšák
c7d91a6f13 r600g: fix ínitialization of non_disp_tiling flag
This fixes a regression caused by e64633e8c3
2013-10-03 18:30:49 +02:00
Marek Olšák
b893bbf438 r600g,radeonsi: create aux_context last
This fixes a regression caused by 68f6dec32e.
2013-10-03 18:30:49 +02:00
Marek Olšák
52bfe8e0f6 r300g/swtcl: don't call draw_prepare_shader_outputs 2013-10-03 18:30:49 +02:00
Brian Paul
bde5b626c2 st/mesa: silence warning about unhandled enum in switch statement 2013-10-03 09:14:03 -06:00
Chris Forbes
d133592619 mesa: fix make check for ARB_texture_gather
Clean up inconsistency in enum decoration:
- Use the undecorated enums where possible.
- MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB remains decorated, since it
  has no undecorated equivalent in GL4.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70054
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 21:38:48 +13:00
Chris Forbes
61519f15ac docs: Mark off ARB_texture_gather 2013-10-03 07:58:12 +13:00
Chris Forbes
88f196ab6e i965/hsw: Apply gather4 RG32F w/a using SCS instead of shader.
The new surface channel select bits allow us to avoid having to
recompile the shader for this workaround.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:56:40 +13:00
Chris Forbes
7df985ad47 i965: Enable ARB_texture_gather on Gen7
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:56:37 +13:00
Chris Forbes
dd4c2a516c i965: use gather slots in the binding table for gather4.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:56:34 +13:00
Chris Forbes
c08f2083ee i965: Emit a second set of SURFACE_STATE for gather4 from textures.
This allows us to use a different surface format for gather4, which is
required for R32G32_FLOAT to work on Gen7.

V4: - Only emit alternate surface state for shaders which will actually
      use it.
    - Pass a simple 'for_gather' flag rather than a function pointer.
      The callee can decide what w/a to apply.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:56:29 +13:00
Chris Forbes
5901d48b41 i965: make room in the binding table for a full alternate set of surface_states
Worst-case is that *every* texunit uses a format that needs overriding.

V4: Place the gather slots last, so shaders which don't use gather don't
    get penalized by having a huge binding table.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:56:26 +13:00
Chris Forbes
855b2a8f4a i965: Add BRW_SURFACEFORMAT_R32G32_FLOAT_LD, required for IVB gather4 w/a
gather4 GREEN channel against a surface with format R32G32_FLOAT doesn't work
correctly on IVB. w/a from bspec:

   - use R32G32_FLOAT_LD = 0x97 instead, for gather4 only.
   - select BLUE channel to read GREEN

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:56:23 +13:00
Chris Forbes
cfa3c8a0d3 i965: w/a for gather4 green RG32F
V4: Only flag quirks if there are any uses of gather in the shader,
    to avoid spurious recompiles just because someone happened to use
    RG32F.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:56:20 +13:00
Chris Forbes
36e25ccd29 glsl: flag shaders which use gather4 at all
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:56:02 +13:00
Chris Forbes
4ed3930f97 i965/vs: Add support for ir_tg4
Pretty much the same as the FS case. Channel select goes in the header,

V2: Less mangling.
V3: Avoid sampling at all, for degenerate swizzles.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:55:59 +13:00
Chris Forbes
942a4ec18f i965/fs: Add support for ir_tg4
Lowers ir_tg4 (from textureGather and textureGatherOffset builtins) to
SHADER_OPCODE_TG4.

The usual post-sampling swizzle workaround can't work for ir_tg4,
so avoid doing that:

* For R/G/B/A swizzles use the hardware channel select (lives in the
   same dword in the header as the texel offset), and then don't do
   anything afterward in the shader.
* For 0/1 swizzles blast the appropriate constant over all the output
   channels instead of sampling.

V2: Avoid duplicating header enabling block
V3: Avoid sampling at all, for degenerate swizzles.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:55:56 +13:00
Chris Forbes
fb455500bf i965: add SHADER_OPCODE_TG4
Adds the Gen7 message IDs, a new SHADER_OPCODE_TG4 pseudo-op, and
low-level support for emitting it via generate_tex().

V3: Updated for changes in master.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:55:55 +13:00
Maxence Le Dore
18002d9eda glsl: add texture gather changes
V2 [Chris Forbes]:
   - Add new pattern, fixup parameter reading.

V3: Rebase onto new builtins machinery

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-03 07:55:54 +13:00
Maxence Le Dore
d3575622b7 mesa: add texture gather changes
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-03 07:55:51 +13:00
Chris Forbes
0d7fc10bcd i965: fix bogus swizzle in brw_cubemap_normalize
When used with a cube array in VS, failed assertion in ir_validate:

   Assignment count of LHS write mask channels enabled not
   matching RHS vector size (3 LHS, 4 RHS).

To fix this, swizzle the RHS correctly for the writemask.

This showed up in the ARB_texture_gather tests, which exercise cube
arrays in the VS.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-03 07:54:53 +13:00
Vincent Lejeune
4e4c32ba11 r600/llvm: Adds support for MSAA 2013-10-02 17:30:21 +02:00
Vincent Lejeune
8edbd7609b r600g/llvm: Undef z and w component of 2D TXP inst 2013-10-02 17:30:14 +02:00
Vincent Lejeune
9f183eb7de r600g/llvm: fix txq for texture buffer 2013-10-02 17:30:07 +02:00
Chia-I Wu
848c0e72f3 i965: compute DDX in a subspan based only on top row
Consider only the top-left and top-right pixels to approximate DDX in a 2x2
subspan, unless the application requests a more accurate approximation via
GL_FRAGMENT_SHADER_DERIVATIVE_HINT or this optimization is disabled from the
new driconf option disable_derivative_optimization.

This results in a less accurate approximation.  However, it improves the
performance of Xonotic with Ultra settings by 24.3879% +/- 0.832202% (at 95.0%
confidence) on Haswell.  No noticeable image quality difference observed.

The improvement comes from faster sample_d.  It seems, on Haswell, some
optimizations are introduced to allow faster sample_d when all pixels in a
subspan have the same derivative.  I considered SAMPLE_STATE too, which allows
one to control the quality of sample_d on Haswell.  But it gave much worse
image quality without giving better performance comparing to this change.

No piglit quick.tests regression on Haswell (tested with v1).

v2: better guess for precompile program key

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2013-10-02 15:26:40 +08:00
Chris Forbes
72edba1659 i965/blorp: Use passed in framebuffer rather than ctx->DrawBuffer
We have the destination framebuffer object passed in; there's no need to
go digging around in the context.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-02 18:31:24 +13:00
Francisco Jerez
ef8cc3e51f ralloc: Remove the rzalloc-based new/delete operator definition macro.
Using it encourages the (IMHO worrying) practice of leaving member
variables uninitialized in constructor definitions.  This macro
shouldn't be necessary anymore after the last patch series fixing all
its users to initialize all member variables from the class
constructor.  Remove it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:39:45 -07:00
Francisco Jerez
fcbbecb9bc st/mesa: Switch glsl_to_tgsi_instruction to the non-zeroing allocator.
All member variables of glsl_to_tgsi_instruction are already being
initialized from its implicitly defined constructor, it's not
necessary to use rzalloc to allocate its memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:52 -07:00
Francisco Jerez
03d46344df mesa/program: Switch ir_to_mesa_instruction to the non-zeroing allocator.
All member variables of ir_to_mesa_instruction are already being
initialized from its implicitly defined constructor, it's not
necessary to use rzalloc to allocate its memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:52 -07:00
Francisco Jerez
23e8673afb i965: Switch vec4_live_variables to the non-zeroing allocator.
All member variables of vec4_live_variables are already being
initialized from its constructor, it's not necessary to use rzalloc to
allocate its memory, and doing so makes it more likely that we will
start relying on the allocator to zero out all memory if the class is
ever extended with new member variables.

That's bad because it ties objects to some specific allocation scheme,
and gives unpredictable results when an object is created with a
different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:52 -07:00
Francisco Jerez
c307d27c5e i965: Switch fs_live_variables to the non-zeroing allocator.
All member variables of fs_live_variables are already being
initialized from its constructor, it's not necessary to use rzalloc to
allocate its memory, and doing so makes it more likely that we will
start relying on the allocator to zero out all memory if the class is
ever extended with new member variables.

That's bad because it ties objects to some specific allocation scheme,
and gives unpredictable results when an object is created with a
different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:52 -07:00
Francisco Jerez
ced327ec64 i965: Switch fs_inst to the non-zeroing allocator.
All member variables of fs_inst are already being initialized from its
constructor, it's not necessary to use rzalloc to allocate its memory,
and doing so makes it more likely that we will start relying on the
allocator to zero out all memory if the class is ever extended with
new member variables.

That's bad because it ties objects to some specific allocation scheme,
and gives unpredictable results when an object is created with a
different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:51 -07:00
Francisco Jerez
a5d843ebdf i965: Switch ip_record to the non-zeroing allocator.
All member variables of ip_record are already being initialized from
its constructor, it's not necessary to use rzalloc to allocate its
memory, and doing so makes it more likely that we will start relying
on the allocator to zero out all memory if the class is ever extended
with new member variables.

That's bad because it ties objects to some specific allocation scheme,
and gives unpredictable results when an object is created with a
different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:51 -07:00
Francisco Jerez
ddd694293a i965: Initialize all member variables of cfg_t on construction.
The cfg_t object relies on the memory allocator zeroing out its
contents before it's initialized, which is quite an unusual practice
in the C++ world because it ties objects to some specific allocation
scheme, and gives unpredictable results when an object is created with
a different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.  Initialize all fields from the
constructor and stop using the zeroing allocator.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:51 -07:00
Francisco Jerez
fde23b61a9 i965: Initialize all member variables of bblock_t on construction.
The bblock_t object relies on the memory allocator zeroing out its
contents before it's initialized, which is quite an unusual practice
in the C++ world because it ties objects to some specific allocation
scheme, and gives unpredictable results when an object is created with
a different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.  Initialize all fields from the
constructor and stop using the zeroing allocator.

v2: Use zero initialization for numeric types instead of default construction.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:51 -07:00
Francisco Jerez
58d772cb41 glsl: Switch ast_type_qualifier to the non-zeroing allocator.
All member variables of ast_type_qualifier are already being
initialized from its implicitly defined constructor, it's not
necessary to use rzalloc to allocate its memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:51 -07:00
Francisco Jerez
8bd1c69f3b glsl: Switch ast_node to the non-zeroing allocator.
All member variables of ast_node are already being initialized from
its constructor, but some of its derived classes were leaving members
uninitialized -- Fix them.

Using rzalloc makes it more likely that we will start relying on the
allocator to zero out all memory if the class is ever extended with
new member variables.  That's bad because it ties objects to some
specific allocation scheme, and gives unpredictable results when an
object is created with a different allocator -- Stack allocation,
array allocation, or aggregation inside a different object are some of
the useful possibilities that come to my mind.

v2: Use NULL initialization instead of default construction for pointers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:51 -07:00
Francisco Jerez
70953b5fea i965: Initialize all member variables of vec4_instruction on construction.
The vec4_instruction object relies on the memory allocator zeroing out
its contents before it's initialized, which is quite an unusual
practice in the C++ world because it ties objects to some specific
allocation scheme, and gives unpredictable results when an object is
created with a different allocator -- Stack allocation, array
allocation, or aggregation inside a different object are some of the
useful possibilities that come to my mind.  Initialize all fields from
the constructor and stop using the zeroing allocator.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:51 -07:00
Francisco Jerez
43bf36b080 glsl: Initialize all member variables of _mesa_glsl_parse_state on construction.
The _mesa_glsl_parse_state object relies on the memory allocator
zeroing out its contents before it's initialized, which is quite an
unusual practice in the C++ world because it ties objects to some
specific allocation scheme, and gives unpredictable results when an
object is created with a different allocator -- Stack allocation,
array allocation, or aggregation inside a different object are some of
the useful possibilities that come to my mind.  Initialize all fields
from the constructor and stop using the zeroing allocator.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 17:30:51 -07:00
Francisco Jerez
0e72db9f97 mesa: Fix misplaced includes of "main/uniforms.h".
Several C++ source files include "main/uniforms.h" from an extern "C"
block, which is both unnecessary, because "uniforms.h" already checks
for a C++ compiler and sets the right linkage, and incorrect, because
the header file includes other C++ headers ("glsl_types.h" and
"ir_uniform.h") that are supposed to get C++ linkage.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-01 17:30:51 -07:00
Grigori Goronzy
6349b3235c st/egl: flush resources before presentation
Fixes regression on r600g due to fast clear introduced by commit
edbbfac6.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-10-01 21:42:02 +02:00
Paul Berry
d99b5b2d82 i965/gs: Fix incorrect numbering of DWORDs in 3DSTATE_GS
In commit 247f90c77e (i965/gs: Set
control data header size/format appropriately for EndPrimitive()), I
incorrectly numbered the DWORDs in the 3DSTATE_GS command starting
from 1 instead of starting from 0.  This caused the control data
format to be programmed into the wrong DWORD, resulting in corruption
in some geometry shaders that used an output type of points.

This patch numbers the DWORDs starting from 0, as we do for all other
commands, which causes the control data format to be programmed into
the correct DWORD.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-01 11:06:17 -07:00
Brian Paul
6659131be3 mesa: check for bufSize > 0 in _mesa_GetSynciv()
The spec doesn't say GL_INVALID_VALUE should be raised for bufSize <= 0.
In any case, memcpy(len < 0) will lead to a crash, so don't allow it.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-01 10:10:01 -06:00
Brian Paul
755602df12 mesa: minor fix-ups for _mesa_validate_sync()
Return bool instead of int.  Const-qualify the syncObj.  Add some comments.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-01 10:10:01 -06:00
Brian Paul
79a03068cd mesa: add missing error checks in _mesa_GetObject[Ptr]Label()
Error checking bufSize isn't mentioned in the spec, but it is in the
man pages.  However, I believe the man page is incorrect.  Typically,
GL functions that take GLsizei parameters check that they're positive
or non-negative.  Negative values don't make sense here.

A spec bug has been filed with Khronos/ARB.

v2: check for negative values, not <= 0.
2013-10-01 10:10:01 -06:00
Brian Paul
69daf335a0 mesa: use caller string in error message in get_label_pointer()
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2013-10-01 10:10:00 -06:00
Brian Paul
ecd155a428 mesa: asst. clean-ups in copy_label()
This incorporates Vinson's change to check for a null src pointer as
detected by coverity.

Also, rename the function params to be src/dst, const-qualify src,
and use GL types to match the calling functions.  And add some more
comments.

Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2013-10-01 10:10:00 -06:00
Alex Deucher
d2eb281fb2 st/xorg: Include u_surface.h for u_copy_rect
Fixes build errors.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-10-01 11:49:08 -04:00
Emil Velikov
9c446afb18 winsys/freedreno/drm: drop obsolete .gitignore
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:52 -07:00
Emil Velikov
16661a9d84 winsys/freedreno/drm: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:52 -07:00
Emil Velikov
5d7690991a winsys/nouveau/drm: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:52 -07:00
Emil Velikov
0d36f5c3be winsys/i915/sw: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:52 -07:00
Emil Velikov
56dfbbd24a st/xvmc: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-01 07:29:52 -07:00
Emil Velikov
10bd3a3f71 st/xorg: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:52 -07:00
Emil Velikov
556207e579 st/xa: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:52 -07:00
Emil Velikov
f7df719b39 st/wgl: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:51 -07:00
Emil Velikov
9f03c763e9 st/vega: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:51 -07:00
Emil Velikov
bfbbc7c8c8 st/vdpau: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-10-01 07:29:51 -07:00
Emil Velikov
c0024c4548 st/osmesa: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:51 -07:00
Emil Velikov
921fdf1429 st/glx: consolidate C sources list into Makefile.sources
Move glx/{,xlib/}Makefile.am to preserve file list

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:51 -07:00
Emil Velikov
760c1a6e66 st/gbm: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:51 -07:00
Emil Velikov
4e9028b638 st/egl: consolidate C sources lists into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:51 -07:00
Emil Velikov
edd11ece38 st/dri/sw: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:51 -07:00
Emil Velikov
f9ddeac213 st/dri: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:50 -07:00
Emil Velikov
d8afbc6177 st/clover: consolidate CPP sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:50 -07:00
Emil Velikov
1918c37008 galahad: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:50 -07:00
Emil Velikov
38d80c01d0 noop: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:50 -07:00
Emil Velikov
d7c66ff59e identity: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:50 -07:00
Emil Velikov
959ed5c163 freedreno: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:50 -07:00
Emil Velikov
b91a9cdeaa trace: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:50 -07:00
Emil Velikov
e369126709 llvmpipe: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:49 -07:00
Emil Velikov
2234e187c6 rbug: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:49 -07:00
Emil Velikov
9bc5ced1c7 softpipe: consolidate C sources list into Makefile.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:49 -07:00
Emil Velikov
6ea73bb395 r600: use NEED_RADEON_LLVM over R600_NEED_RADEON_GALLIUM
libllvmradeon.la is available whenever NEED_RADEON_LLVM is set, using
R600_NEED_RADEON_GALLIUM is rather ambiguous and unnecessary. Drop it
in favour of NEED_RADEON_LLVM.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:49 -07:00
Emil Velikov
4334666b47 gallium/radeon: drop unused variable LIBGALLIUM_LIBS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:49 -07:00
Emil Velikov
e11ff60e28 mesa/drivers: drop HAVE_*_DRI from individual makefiles
The mesa/drivers/dri/Makefile.am already guards the individual
targets/subdirs with HAVE_*_DRI before including them. Thus making
the additional check within each Makefile.am unnecessary.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-01 07:29:49 -07:00
Johannes Obermayr
cb1febb074 gallium/targets: Make use of prebuilt libdricommon.la.
libdricommon.la is available whenever a non swrast driver is built.
All the classic dri drivers make use of the prebuild library but all
of the gallium ones rebuild it explicitly.

While we're here gallium/{llvm,soft}pipe does not require HAVE_COMMON_DRI
thus do not set in during configure.

v2: [Emil] Add commit message and drop HAVE_COMMON_DRI from configure.ac
v3: [Emil] Rebase and resolve targets/r*/dri conflicts

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-01 07:29:49 -07:00
Vinson Lee
eb0a57acaa i915: Fix memory leak in do_blit_readpixels.
Fixes "Resource leak" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-30 22:08:48 -07:00
Vinson Lee
76df7edacf llvmpipe: Remove unnecessary null check of shader.
shader has already been dereferenced earlier so cannot be null here.

Fixes "Dereference before null check" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-30 22:00:54 -07:00
Vinson Lee
ac82495d6d util/u_format: Assert that format block size is at least 1 byte.
The block size for all formats is currently at least 1 byte. Add an
assertion for this.

This should silence several Coverity "Division or modulo by zero"
defects.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-30 21:53:04 -07:00
Vinson Lee
505a6de7fc draw: Add a null check for draw.
There is an earlier null check for draw so draw could be null here as
well.

Fixes "Dereference after null check" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-30 21:46:42 -07:00
Vinson Lee
9b388c66fc st/vdpau: Include u_surface.h for u_copy_rect.
Fix build errors.

  CC     surface.lo
surface.c: In function 'vlVdpVideoSurfaceGetBitsYCbCr':
surface.c:247:10: error: implicit declaration of function 'util_copy_rect' [-Werror=implicit-function-declaration]

  CC     output.lo
output.c: In function 'vlVdpOutputSurfaceGetBitsNative':
output.c:216:4: error: implicit declaration of function 'util_copy_rect' [-Werror=implicit-function-declaration]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-09-30 20:49:38 -07:00
Vinson Lee
05474ac9c4 st/vdpau: Include u_format.h for util_format_description.
Fix build error.

  CC     device.lo
device.c: In function 'vlVdpDefaultSamplerViewTemplate':
device.c:251:4: error: implicit declaration of function 'util_format_description' [-Werror=implicit-function-declaration]
device.c:251:9: warning: assignment makes pointer from integer without a cast [enabled by default]
device.c:252:12: error: dereferencing pointer to incomplete type
device.c:252:28: error: 'UTIL_FORMAT_SWIZZLE_0' undeclared (first use in this function)
device.c:252:28: note: each undeclared identifier is reported only once for each function it appears in
device.c:254:12: error: dereferencing pointer to incomplete type
device.c:256:12: error: dereferencing pointer to incomplete type
device.c:258:12: error: dereferencing pointer to incomplete type

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-09-30 20:38:06 -07:00
Vinson Lee
14442c46fb st/xvmc: Include u_surface.h for u_copy_rect.
This patch fixes the build error introduced with commit
81bb98e928.

  CC     subpicture.lo
subpicture.c: In function 'upload_sampler':
subpicture.c:181:4: error: implicit declaration of function 'util_copy_rect' [-Werror=implicit-function-declaration]
subpicture.c: In function 'XvMCClearSubpicture':
subpicture.c:304:21: error: storage size of 'uc' isn't known
subpicture.c:328:4: error: implicit declaration of function 'util_fill_rect' [-Werror=implicit-function-declaration]
subpicture.c:304:21: warning: unused variable 'uc' [-Wunused-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-09-30 20:15:53 -07:00
Brian Paul
9f6e76a91e st/egl: include u_format.h for util_format_get_blocksize() 2013-09-30 19:02:27 -06:00
Brian Paul
1d05caf9f2 svga: fix pixel center integer
The svga/d3d9 convention is that pixel centers are at integer coordinates.
Fixes piglit glsl-arb-fragment-coord-conventions test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-09-30 18:50:37 -06:00
Brian Paul
360610c89e svga: return 0 for PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER
Using the map/unmap path for glTexImage is a little bit faster
than blitting.  Also, this fixes about 50 assorted piglit failures
that seem to be related to the blit version of glReadPixels.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-09-30 18:50:37 -06:00
Brian Paul
395fac25a6 svga: we don't support TGSI_OPCODE_CONT
So return PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED = 0.
2013-09-30 18:50:37 -06:00
Brian Paul
81bb98e928 gallium: include u_surface.h instead of u_rect.h
u_rect.h was including u_surface.h just to avoid touching a bunch
of other source files after some functions were moved from u_rect.h
to u_surface.h.  This patch cleans up that hack.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-30 18:50:37 -06:00
Eric Anholt
48b9720272 i965: Reenable glBitmap() after the sRGB winsys enabling.
The format of the window system framebuffer changed from ARGB8888 to
SARGB8, but we're still supposed to render to it the same as ARGB8888
unless the user flipped the GL_FRAMEBUFFER_SRGB switch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for stable branches.
2013-09-30 16:49:43 -07:00
Ian Romanick
3e1fdf3899 mesa: Remove all traces of GL_OES_matrix_get
I believe this extension was enabled by accident.  As far as I can tell,
there has never been any code in Mesa to actually support it.  Not only
that, this extension is only useful in the common-lite profile, and Mesa
does the common profile.

This "fixes" the piglit test oes_matrix_get-api.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-30 16:40:00 -07:00
Carl Worth
9baf35de5c Use -Bsymbolic when linking libEGL.so
For some reason that I don't yet fully understand, Glaze does not work with
libEGL unless libEGL is linked with -Bsymbolic.[*]

Beyond that specific reason, all of the reasons for which libGL.so is linked
with -Bsymbolic, (see the commit history), should also apply here.

[*] The specific behavior I am seeing is that when Glaze calls dlopen for
libEGL.so, ifunc resolvers within Glaze for EGL functions are called before
the dlopen returns. These resolvers cannot succeed, as they need the return
value from dlopen in order to find the functions to resolve to. I don't know
what's causing these resolvers to be called, but I have verified that linking
libEGL with -Bsymbolic causes this problematic behavior to stop.

CC: "9.1 and 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 15:49:16 -07:00
Paul Berry
4c4934636c i965/blorp: retype destination register for texture SEND instruction to UW.
From the bspec documentation of the SEND instruction:

    "destination region cannot cross the 256-bit register boundary."

To avoid violating this restriction when executing SIMD16 texturing
operations (such as those used by blorp), we need to ensure that the
destination of the SEND instruction doesn't exceed 256 bits in size.
An easy way to do this is to set the type of the destination register
to UW (unsigned word), since 16 unsigned words can fit inside a
256-bit register.  Fortunately, this has no effect on the sampling
operation, since the sampler always infers the destination data type
from the sampler message rather than from the type of the instruction
operand.

Previously, we did this for texturing operations issued by the vec4
and fs back-ends, but not for blorp.  This patch makes blorp use the
same trick.

I haven't observed any behavioural difference on actual hardware due
to this patch, but it avoids a warning from the simulator so it seems
like the right thing to do.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 15:16:44 -07:00
Eric Anholt
1c7f75e45e i965: Add a real native TexStorage path.
We originally had a path just did the loop and called
ctx->Driver.AllocTextureImageBuffer(), which I moved into Mesa core.  But
we can do better, avoiding incorrect miptree size guesses and later
texture validations by just directly allocating the miptree and setting it
to all the images.

v2: drop debug printf.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 14:35:42 -07:00
Eric Anholt
aff7f335c1 i965: Add missing license to intel_tex_validate.c.
I've rewritten a lot of this file.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 14:35:42 -07:00
Eric Anholt
8037c0b69c i965: Always allocate validated miptrees from level 0.
No change in copies during a piglit run, but it's one less first_level !=
0 in our codebase.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 14:35:42 -07:00
Eric Anholt
16060c5adc i965: Don't relayout a texture just for baselevel changes.
As long as the baselevel, maxlevel still sit inside the range we had
previously validated, there's no need to reallocate the texture.

I also hope this makes our texture validation logic much more obvious.
It's taken me enough tries to write this change, that's for sure.  Reduces
miptree copy count on a piglit run by 1.3%, though the change in amount of
data moved is much smaller.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 14:35:42 -07:00
Eric Anholt
97bdb4c039 i965: Don't allocate a 1-level texture when GL_GENERATE_MIPMAP is set.
Given that a teximage that calls us with this flag set will immediately
proceed to allocate the other levels, we can probably just go ahead and
allocate those levels now.

Reduces miptree copies in piglit by about .05%.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 14:35:42 -07:00
Eric Anholt
6ca9b532d8 i965: Stop allocating miptrees with first_level != 0.
If the caller shows up with GL_BASE_LEVEL != 0, it doesn't mean that the
texture will over the course of its lifetime have that nonzero baselevel,
it means that the caller is filling the texture from the bottom up for
some reason (one could imagine demand-loading detailed texture layers at
runtime, for example).  If we allocate from just the current baselevel, it
means when they come along with the next level up, we'll have to allocate
a new miptree and copy all of our bits out of the first miptree.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 14:35:42 -07:00
Eric Anholt
3b9a2dc938 i965: Drop a special case for guessing small miptree levels.
Let's say you started allocating your 2D texture with level 2 of a tree as
a 1x1 image.  The driver doesn't know if this means that level 0 is 4x4 or
4x1 or 1x4, so we would just allocate a single 1x1 and let it get copied
in to the real location at texture validate time later.

Since this is just a temporary allocation that *will* get copied, the
extra space allocation of just taking the normal path which will happen to
producing a 4x1 level 0, 2x1 level 1, and 1x1 level 2 is the right way to
go, to reduce complexity in the normal case.

No change in miptree copies over the course of a piglit run.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 14:35:42 -07:00
Eric Anholt
7de88ac380 i965: Totally switch around how we handle nonzero baselevel-first_level.
This has no effect currently, because intel_finalize_mipmap_tree() always
makes mt->first_level == tObj->BaseLevel.

The change I made before to handle it
(b1080cfbdb) got very close to working, but
after fixing some unrelated bugs in the series, it still left
tex-miplevel-selection producing errors when testing textureLod().  The
problem is that for explicit LODs, the sampler's LOD clamping is ignored,
and only the surface's MIP clamping is respected.  So we need to use
surface mip clamping, which applies on top of the sampler's mip clamping,
so the sampler change gets backed out.

Now actually tested with a non-regressing series producing a non-zero
computed baselevel.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 14:35:42 -07:00
Eric Anholt
9c116d5eac i965: Always look up from the object's mt when setting up texturing state.
We know that the object's mt is equal to the firstimage's mt because it's
gone through intel_finalize_mipmap_tree().  Saves a lookup of firstimage
on pre-gen7.

v2: Merge in the warning fix that appeared later in the series (noted by
    Chad)

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-30 14:35:42 -07:00
Vinson Lee
114ae47475 r600g/sb: Move variable dereference after null check.
Fixes "Deference before null check" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-09-30 10:27:52 -07:00
Brian Paul
0d441aac3d st/mesa: fix comment typo 2013-09-30 09:06:52 -06:00
Marek Olšák
7b25f52a95 r600g,radeonsi: workaround for late shared screen initialization
Accidentally broken by the consolidation.
2013-09-30 13:01:13 +02:00
Laurent Carlier
868791f0ba r600g: Fix build failure introduced with r600_texture.c consolidation
It seems that case with opencl enabled was forgotten

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-09-29 22:01:04 +02:00
Marek Olšák
4e9aa6711f radeon: make texture logging more useful
This has been very useful for tracking down bugs in libdrm.

The *_PRINT_TEXDEPTH environment variables were probably never used,
so I removed them.
2013-09-29 15:18:10 +02:00
Marek Olšák
e64633e8c3 r600g,radeonsi: share r600_texture.c
The function r600_choose_tiling is new and needs a review.

The only change in functionality is that it enables 2D tiling for compressed
textures on SI. It was probably accidentally turned off.

v2: don't make scanout buffers linear
2013-09-29 15:18:10 +02:00
Marek Olšák
4069d39465 r600g: remove compute_global_transfer_* calls from texture_transfer_map/unmap
Textures can never have target==PIPE_BUFFER.
2013-09-29 15:18:10 +02:00
Marek Olšák
ef6680d3ee r600g: move the low-level buffer functions for multiple rings to drivers/radeon
Also slightly optimize r600_buffer_map_sync_with_rings.
2013-09-29 15:18:09 +02:00
Marek Olšák
1bb77f81db r600g,radeonsi: consolidate tiling_info initialization
and the util_format_s3tc_init calls too.
2013-09-29 15:18:09 +02:00
Marek Olšák
09fc5d6e26 radeonsi: implement clear_buffer using CP DMA, initialize CMASK with it
More work needs to be done for this to be entirely shared with r600g.
I'm just trying to share r600_texture.c now.

The reason I put the implementation to si_descriptors.c is that the emit
function had already been there.
2013-09-29 15:18:09 +02:00
Marek Olšák
68f6dec32e r600g: move aux_context and r600_screen_clear_buffer to drivers/radeon
This will be used in the next commit.
2013-09-29 15:18:09 +02:00
Marek Olšák
0cb9de1dd0 radeonsi: move debug options to R600_DEBUG 2013-09-29 15:18:09 +02:00
Marek Olšák
ba650ccf91 r600g: move some debug options to drivers/radeon 2013-09-29 15:18:09 +02:00
Marek Olšák
2814202ef4 r600g,radeonsi: share the async dma interface
r600_texture.c is one step closer to r600g.
2013-09-29 15:18:09 +02:00
Marek Olšák
e916267285 radeonsi: move radeonsi-specific functions out of r600_texture.c 2013-09-29 15:18:08 +02:00
Marek Olšák
31169400a0 r600g,radeonsi: remove unused code 2013-09-29 15:18:08 +02:00
Marek Olšák
6f21009cb3 r600g: move r600g-specific functions out of r600_texture.c 2013-09-29 15:18:08 +02:00
Marek Olšák
bfea9c498d r600g,radeonsi: consolidate r600_texture structures 2013-09-29 15:18:08 +02:00
Marek Olšák
4ea2e5a4e7 r600g: get rid of r600_texture::is_rat
It's always 0.
2013-09-29 15:18:08 +02:00
Marek Olšák
ba29324dba r600g: get rid of r600_texture::array_mode 2013-09-29 15:18:08 +02:00
Marek Olšák
39801d4ba7 r600g,radeonsi: consolidate transfer, cmask, and fmask structures 2013-09-29 15:18:08 +02:00
Marek Olšák
a62cd6949c radeon drivers: handle PIPE_CAP_MAX_VIEWPORTS 2013-09-29 15:18:07 +02:00
Marek Olšák
900b1863c8 radeon/llvm: fix TGSI_OPCODE_UCMP
This doesn't fix any known issue (I haven't run piglit with this yet),
but the code was obviously completely wrong. It looks like copy-pasted from CMP.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-09-29 14:49:23 +02:00
Marek Olšák
2bda5f3298 st/mesa: fix GLSL mix(.., .., bvecN)
v2: use CMP on drivers without native integer support
2013-09-29 14:42:42 +02:00
Tom Stellard
a64d3dd135 configure.ac: Add a more informative warning when libclc.pc is not found v2
v2:
  - Don't display an error message when the user doesn't ask for libclc.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-09-27 20:20:35 -07:00
Vinson Lee
b2d5757831 mesa: Include stdint.h in mtypes.h for uint32_t symbol.
This patch fixes the MSVC build error introduced with commit
b2e327e08f.

api_arrayelt.c
src\mesa\main/mtypes.h(1809) : error C2061: syntax error : identifier 'uint32_t'
src\mesa\main/mtypes.h(1810) : error C2059: syntax error : '}'
src\mesa\main/mtypes.h(1825) : error C2079: 'Minimum' uses undefined union 'gl_perf_monitor_counter_value'
src\mesa\main/mtypes.h(1828) : error C2079: 'Maximum' uses undefined union 'gl_perf_monitor_counter_value'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-09-26 20:48:47 -07:00
Kenneth Graunke
aac75f877d i965/fs: Don't double-accept operands of logical and/or/xor operations.
If the argument to emit_bool_to_cond_code() is an ir_expression, we
loop over the operands, calling accept() on each of them, which
generates assembly code to compute that subexpression.  We then emit
one or two final instruction that perform the top-level operation on
those operands.

If it's not an expression (say, a boolean-valued variable), we simply
call accept() on the whole value.

In commit 80ecb8f1 (i965/fs: Avoid generating extra AND instructions on
bool logic ops), Eric made logic operations jump out of the expression
path to the non-expression path.

Unfortunately, this meant that we would first accept() the two operands,
skip generating any code that used them, then accept() the whole
expression, generating code for the operands a second time.

Dead code elimination would always remove the first set of redundant
operand assembly, since nothing actually used them.  But we shouldn't
generate it in the first place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-09-26 16:55:18 -07:00
Kenneth Graunke
e5c49bc25b i965: Add #define for MI_REPORT_PERF_COUNT on Gen6+.
This appears in Volume 1 Part 1 of the Sandybridge PRM on page 48.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-26 16:55:18 -07:00
Kenneth Graunke
0f2da77307 i965: Add support for GL_AMD_performance_monitor on Ironlake.
Ironlake's counters are always enabled; userspace can simply send a
MI_REPORT_PERF_COUNT packet to take a snapshot of them.  This makes it
easy to implement.

The counters are documented in the source code for the intel-gpu-tools
intel_perf_counters utility.

v2: Adjust for core data structure changes.  Add a table mapping buffer
    object offsets to exposed counters (which changes each generation).
    Finally, add report ID assertions to sanity check the BO layout
    (thanks to Carl Worth).

v3: Update for core BeginPerfMonitor hook changes (requested by Brian).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-26 16:55:18 -07:00
Kenneth Graunke
b2e327e08f mesa: Add core support for the GL_AMD_performance_monitor extension.
This 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.  Counters are also
organized into groups.

Applications create "performance monitor" objects, select the counters
they want to track, and Begin/End monitoring, much like OpenGL's query
API.  Multiple monitors can be in flight simultaneously.

v2: Pass ctx to all driver hooks (suggested by Christoph), and attempt
    to fix overallocation of bitsets (caught by Christoph).  Incomplete.

v3: Significantly rework core data structures.  Store counters in groups
    rather than in a global list.  Use their array index in the group's
    counter list as the ID rather than trying to store a globally unique
    counter ID.  Use bitsets for active counters within a group, and
    also track which groups are active so that's easy to query.

v4: Remove _mesa_ prefix on static functions; detect out of memory
    conditions in new_performance_monitor(); make BeginPerfMonitor hook
    return a boolean rather than setting m->Active or raising an error.
    Switch to GLuint/unsigned for NumGroups, NumCounters, and
    MaxActiveCounters (which also means switching a bunch of temporary
    variable types).  All suggested by Brian Paul.  Also, remove
    commented out code at the bottom of the block.  Finally, fix the
    dispatch sanity test (noticed by Ian Romanick).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com> [v3]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-26 16:55:18 -07:00
Kenneth Graunke
f91475d4ab glsl: Create and use a has_uniform_buffer_objects() helper.
This is better than overriding the extension enable based on the
language version; it's robust against shaders that do:

   #version 140
   #extension GL_ARB_uniform_buffer_object : disable

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-26 16:55:18 -07:00
Kenneth Graunke
e4af55c78f glsl: Create and use a has_explicit_attrib_location() helper.
Explicit attribute locations are supported with GLSL 3.30, GLSL ES 3.00,
or "#extension GL_ARB_explicit_attrib_location: enable".  Using a helper
function makes it easy to check for this.

This enables support in GLSL 3.30, which was previously missing.

Previously, we overrode the extension enable flag for ES 3.00.  This is
not robust against a shader such as:

   #version 330
   #extension GL_ARB_explicit_attrib_location : disable

Disabling extensions should not remove core language functionality.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-26 16:55:18 -07:00
Kenneth Graunke
e9b410b54d mesa: Remove 'invalidate_state' parameter to _mesa_dirty_texobj().
Every caller passed true.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-26 16:55:18 -07:00
Eric Anholt
1c904466aa mesa: Remove some remaining FEATURE_* detritus.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-26 16:29:39 -07:00
Chris Forbes
fe2528c0b6 i965: Fix cube array coordinate normalization
Hardware requires the magnitude of the largest component to not exceed
1; brw_cubemap_normalize ensures that this is the case.

Unfortunately, we would previously multiply the array index for cube
arrays by the normalization factor. The incorrect array index would then
cause the sampler to attempt to access either the wrong cube, or memory
outside the cube surface entirely, resulting in garbage rendering or in
the worst case, hangs.

Alter the normalization pass to only multiply the .xyz components.

Fixes broken rendering in the arb_texture_cube_map_array-cubemap piglit,
which was recently adjusted to provoke this behavior.

V2: Fix indent.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "9.2" mesa-stable@lists.freedesktop.org
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-26 18:24:22 +12:00
Zack Rusin
d83ef680e2 draw/clip: don't emit so many empty triangles
Compress empty triangles (don't emit more than one in a row) and
never emit empty triangles if we already generated a triangle
covering a non-null area. We can't skip all null-triangles
because c_primitives expects ones that were generated from vertices
exactly at the clipping-plane, to be emitted.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-25 19:42:22 -04:00
Zack Rusin
60c448faea llvmpipe: count c_primitives before discarding null prims
We need to count the clipper primitives before the rasterizer
discards one it considers to be null.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-25 19:41:02 -04:00
Zack Rusin
1291e833e7 llvmpipe: we need to subdivide if fb is bigger in either direction
We need to subdivide triangles if either of the dimensions is
larger than the max edge length, not when both of them are larger.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-25 19:38:21 -04:00
Marek Olšák
028b26e2ef radeon/llvm: fix shadow cube texturing for GL3.0
The fix is at the end (TGSI_TEXTURE_SHADOWCUBE handling), but I also
restructured the code for it to be more readable.

Fixes spec/!OpenGL 3.0/sampler-cube-shadow.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-25 20:45:23 +02:00
Marek Olšák
57f38e9f92 radeonsi: fix blitting the last 2 mipmap levels of compressed textures
This fixes compressedteximage piglit tests.

+10 piglits

Evergreen and Cayman have the same issue. R600 and R700 don't.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-25 20:45:22 +02:00
Marek Olšák
296adb6de9 radeonsi: add missing colorbuffer formats (rework format translation)
This fixes some piglits, e.g:
  spec/!OpenGL 3.0/required-renderbuffer-attachment-formats.

This can be ported to r600g.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-25 20:45:22 +02:00
Marek Olšák
f9ea435ebc radeonsi: bypass alpha-test for integer colorbuffers
Fixes spec/EXT_texture_integer/fbo-blending.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-25 20:45:22 +02:00
Marek Olšák
f7d004b9ad r600g: fix texture buffer object cache flushing
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-09-25 20:45:22 +02:00
Marek Olšák
6317a3fb31 r600g: fix constant buffer cache flushing
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-09-25 20:45:22 +02:00
Christian König
4871128e58 radeon/winsys: keep screen pointer in winsys v2
Only create one screen for each winsys instance.
This helps with buffer sharing and interop handling.

v2: rebased and some minor cleanup

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-25 19:41:31 +02:00
Christian König
f6e2aa0e12 build/radeonsi: group all targets in common subdir
Allows us to share more code between different targets.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
2013-09-25 19:41:27 +02:00
Christian König
015853b568 build/r600: group all targets in common subdir
Allows us to share more code between different targets.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
2013-09-25 19:41:23 +02:00
Christian König
533e9a04b4 build/r300: group build target in common subdir
Allows us to share more code between different targets.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
2013-09-25 19:41:03 +02:00
Christian König
1c57d9a6c6 radeon/uvd: try to place msg/fb buffer into GART
This is only supported on NI+, but the kernel takes care of those limitations.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-09-25 10:59:03 +02:00
Christian König
f9f14201c1 radeon/uvd: move alignment to winsys
Similar to GFX and DMA.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-25 10:58:58 +02:00
Christian König
5f6ae61e69 st/vdpau: use a separate lock per decoder
Signed-off-by: Christian König <christian.koenig@amd.com>
2013-09-25 10:58:58 +02:00
Christian König
34b5a4e0d8 st/vdpau: use new vlc function to serach for VC-1 start codes
Signed-off-by: Christian König <christian.koenig@amd.com>
2013-09-25 10:58:58 +02:00
Christian König
eb1cb253b7 vl/mpeg12: use new vlc function to search for start codes
Signed-off-by: Christian König <christian.koenig@amd.com>
2013-09-25 10:58:58 +02:00
Christian König
e3ecea9ddf vl/vlc: add fast forward search for byte value
Commonly used to find start codes and has far less overhead
to searching manually.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-09-25 10:58:58 +02:00
Vinson Lee
59157d1c96 glsl: Initialize ir_lower_jumps_visitor member variables.
Fixes "Unintialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-24 22:54:25 -07:00
Vinson Lee
94e3ecae2d glsl: Initialize lower_vector_visitor::dont_lower_swz.
Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-24 22:51:23 -07:00
Vinson Lee
74b02b8e3f glsl: Initialize assignment_generator member variables.
Fixes "Uninitialized pointer field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-24 22:16:39 -07:00
Vinson Lee
6128c226b4 glsl: Remove unused pointer value.
Silences "Unused pointer value" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-24 22:10:36 -07:00
Zack Rusin
71ecc2cf71 Revert "llvmpipe: increase number of subpixel bits to eight"
This reverts commit 755c11dc5e.
We agreed that this is band-aid that's not very useful and
the proper solution is to rewrite the rasterization algo
so that it operates on 64 bit values.

Signed-off-by: Zack Rusin <zackr@vmware.com>
2013-09-24 15:10:02 -04:00
Dylan Noblesmith
49f8fc64de mesa: remove handcounted magic number
Also make it a compile-time error with STATIC_ASSERT.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-24 11:29:17 -07:00
Dylan Noblesmith
ea3847b12e mesa: remove outdated comment
No such argument exists since this commit:

commit 92f3fca0ea
Author:     Ian Romanick <ian.d.romanick@intel.com>
AuthorDate: Sun Aug 21 17:23:58 2011 -0700
Commit:     Ian Romanick <ian.d.romanick@intel.com>
CommitDate: Tue Aug 23 14:52:09 2011 -0700

    mesa: Remove target parameter from dd_function_table::BufferSubData

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-24 11:27:12 -07:00
Dylan Noblesmith
2f5d41ce79 mesa: remove stale comment
This line stopped making sense in the great sed
replace of commit f9995b3075

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-24 11:27:03 -07:00
Zack Rusin
e5ec5aef2b llvmpipe: align the array used for subdivived vertices
When subdiving a triangle we're using a temporary array to store
the new coordinates for the subdivided triangles. Unfortunately
the array used for that was not aligned properly causing
random crashes in the llvm jit code which was trying to load
vectors from it.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-23 18:10:51 -04:00
Vinson Lee
f036d55515 glapi: Move declaration before code.
This patch fixes the MSVC build error introduced by commit
673129e0b9.

enums.c
mesa\main\enums.c(3776) : error C2143: syntax error : missing ';' before 'type'
mesa\main\enums.c(3781) : error C2065: 'elt' : undeclared identifier
mesa\main\enums.c(3781) : warning C4047: '!=' : 'int' differs in levels of indirection from 'void *'
mesa\main\enums.c(3782) : error C2065: 'elt' : undeclared identifier
mesa\main\enums.c(3782) : error C2223: left of '->offset' must point to struct/union
mesa\main\enums.c(3782) : warning C4033: '_mesa_lookup_enum_by_nr' must return a value

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-09-23 14:14:32 -07:00
Eric Anholt
11e494a572 mesa: Use -Bsymbolic in the linker to locally resolve Mesa-internal symbols.
Normally, LD_PRELOAD will take precedence over your own symbols, which you
want for things like malloc() in libc.  But we don't have any local
symbols we would want overridden (like hash_table_insert(), for example!),
so tell the linker to resolve them internally.  This also avoids calls
through the PLT.

Saves almost 100k on libdricore's size, and gets us a bunch of the
performance back that we had with non-dricore.

Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
2013-09-23 12:45:22 -07:00
Eric Anholt
10ef949424 glsl: Hide many classes local to individual .cpp files in anon namespaces.
This gives the compiler the chance to inline and not export class symbols
even in the absence of LTO.  Saves about 60kb on disk.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
2013-09-23 12:45:22 -07:00
Eric Anholt
07572621bc mesa: Drop an extra copy-and-pasted copy in the program clone function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
2013-09-23 12:45:22 -07:00
Eric Anholt
669b88eb12 mesa: Convert some runtime asserts to static asserts.
Noticed while grepping through the code for something else.

v2: Don't convert really-runtime asserts to static asserts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
2013-09-23 12:45:22 -07:00
Eric Anholt
673129e0b9 mesa: Shrink the size of the enum string lookup struct.
Since it's only used for debug information, we can misalign the struct and
save the disk space.  Another 19k on a 64-bit build.

v2: Make a compiler.h macro to only use the attribute if we know we can.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
2013-09-23 12:45:22 -07:00
Eric Anholt
c0378b6400 mesa: Remove the extra enum strings and extra lookup table.
Now that there's no name -> enum direction, we can drop the extra strings,
and merge the offsets table and the reduced_enums table.

Between the previous commit and this one, Mesa core drops by 30k.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
2013-09-23 12:45:22 -07:00
Eric Anholt
3b29a6ec91 mesa: Remove _mesa_lookup_enum_by_name().
It's been unused for a long time.  I stopped digging through git history
as of 2009.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@.intel.com>
2013-09-23 12:45:22 -07:00
Zack Rusin
755c11dc5e llvmpipe: increase number of subpixel bits to eight
Unfortunately d3d10 requires a lot higher precision (e.g.
wgf11clipping tests for it). The smallest number of precision
bits with which it passes is 8. That means that we need to
decrease the maximum length of an edge that we can handle without
subdivision by 4 bits. Abstracted the code a bit to make it easier
to change once to switch to 64bit rasterization.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-23 14:53:07 -04:00
Vinson Lee
6d29db715b glsl: Define isnormal and copysign for MSVC to fix build.
This patch fixes these MSVC build errors.

ir_constant_expression.cpp
src\glsl\ir_constant_expression.cpp(564) : warning C4244: '=' : conversion from 'int' to 'float', possible loss of data
src\glsl\ir_constant_expression.cpp(1384) : error C3861: 'isnormal': identifier not found
src\glsl\ir_constant_expression.cpp(1385) : error C3861: 'copysign': identifier not found

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69541
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Matt Turner <mattst88@gmail.com>
2013-09-22 16:11:36 -07:00
Johannes Obermayr
6016dabfa2 Suppress clang's warnings about unused CFLAGS and CXXFLAGS.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-22 13:10:43 -07:00
Christian König
8bbcc43ad9 radeon/uvd: async flush the UVD cs
No need to block for the CS thread here.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-22 10:33:20 +02:00
Christian König
01a0dbcb96 winsys/radeon: share winsys between different fd's
Share the winsys between different fd's if they point to the same device.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-22 10:33:20 +02:00
Christian König
0653c66ef4 winsys/radeon: remove cs_queue_empty
Waiting for an empty queue is nonsense and can lead to deadlocks if we have
multiple waiters or another thread that continuously sends down new commands.

Just post the cs to the queue and immediately wait for it to finish.

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-22 10:33:20 +02:00
Christian König
f7ccb84aa1 winsys/radeon: fix killing the CS thread
Kill the thread only after we checked that it's not used any more, not before.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-22 10:33:20 +02:00
Eric Anholt
938956ad52 i965/gen4: Fix fragment program rectangle texture shadow compares.
The rescale_texcoord(), if it does something, will return just the
GLSL-sized coordinate, leaving out the 3rd and 4th components where we
were storing our projected shadow compare and the texture projector.
Deref the shadow compare before using the shared rescale-the-coordinate
code to fix the problem.

Fixes piglit tex-shadow2drect.shader_test and txp-shadow2drect.shader_test

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69525
NOTE: This is a candidate for stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-21 16:48:58 -07:00
Abdiel Janulgue
1266f01dc7 i965/gen7.5: Fix missing Shader Channel Select entries on Haswell
Probably non-intentional, but the SURFACE_STATE setup refactoring
for buffer surfaces had missed the scs bits when creating constant
surface states.

Fixes broken GLB 2.5 on Haswell where the knight's textures are missing

Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-21 12:53:13 -07:00
Kenneth Graunke
4f1ebb8ddd i965, mesa: Use the new DECLARE_R[Z]ALLOC_CXX_OPERATORS macros.
These classes declared a placement new operator, but didn't declare a
delete operator.  Switching to the macro gives them a delete operator,
which probably is a good idea anyway.

This also eliminates a lot of boilerplate.

v2: Properly use RZALLOC in Mesa IR/TGSI translators.  Caught by Eric
    and Chad.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-21 09:17:21 -07:00
Kenneth Graunke
81a3759bb5 glsl: Use the new DECLARE_R[Z]ALLOC_CXX_OPERATORS in a bunch of places.
This eliminates a lot of boilerplate and should be 100% equivalent.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-21 09:17:06 -07:00
Kenneth Graunke
bfbad9d1a8 ralloc: Introduce new macros for defining C++ new/delete operators.
Most of our C++ classes define placement new and delete operators so we
can do convenient allocation via:

   thing *foo = new(mem_ctx) thing(...)

Currently, this is done via a lot of boilerplate.  By adding simple
macros to ralloc, we can condense this to a single line, making it
trivial to add this feature to a new class.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-21 09:16:02 -07:00
Grigori Goronzy
edbbfac6cf r600g: fast color clears for single-sample buffers
Allocate a CMASK on demand and use it to fast clear single-sample
colorbuffers. Both FBOs and window system colorbuffers are fast
cleared. Expand as needed when colorbuffers are mapped or displayed
on screen.

v2: cosmetics, move transfer expansion into dma_blit

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-09-20 20:35:55 +02:00
Grigori Goronzy
56d9a397aa r600g: add support for separately allocated CMASKs
v2: check for NULL cbufs

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-09-20 20:35:55 +02:00
Marek Olšák
419cd5f2a2 gallium: add flush_resource context function
r600g needs explicit flushing before DRI2 buffers are presented on the screen.

v2: add (stub) implementations for all drivers, fix frontbuffer flushing
v3: fix galahad

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-09-20 20:35:55 +02:00
Marek Olšák
d2bd63433a radeonsi: simplify and fix MSAA texture sampling for array textures
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-20 20:35:55 +02:00
Marek Olšák
defedc0f61 radeonsi: fix textureOffset and texelFetchOffset GLSL functions
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-20 20:35:55 +02:00
José Fonseca
1569b3e536 llvmpipe: Fix rendering to PIPE_FORMAT_R10G10B10A2_UNORM.
We must take rounding in consideration when re-scaling to narrow
normalized channels, such as 2-bit normalized alpha.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-20 17:34:57 +01:00
José Fonseca
2ab4e1d1e6 draw: Ensure draw_pt_middle_end::bind_parameters is never NULL.
Prevents calling NULL pointer with softpipe in certain cases.

Trivial.
2013-09-20 17:34:57 +01:00
José Fonseca
75c394f567 tools/trace: Simple script to compare two traces.
Based on the earlier apitrace tracediff.sh script.
2013-09-20 17:34:57 +01:00
Ian Romanick
1cc3b90d47 mesa: Silence GCC warning 'comparison between signed and unsigned integer expressions'
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-19 17:15:09 -05:00
Ian Romanick
7db6b5aa91 mesa: Fix broken call to print_table_stats
The function takes a parameter, but none was given.  Also, in the
non-GET_DEBUG case, silence the unused parameter warning.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-19 17:15:09 -05:00
Ian Romanick
b4cf56cdf8 glsl: Set VertexProgram.MaxOutputComponents and FragmentProgram.MaxInputComponents in standalone scaffolding
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-19 17:14:49 -05:00
Ian Romanick
be8963a18f mesa: Allow several ARB_geometry_shader4 queries in OpenGL 3.2
GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, GL_MAX_GEOMETRY_OUTPUT_VERTICES,
GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, and
GL_MAX_GEOMETRY_UNIFORM_COMPONENTS all have the same enum value and
meaning as their _ARB counterparts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-19 16:29:44 -05:00
Ian Romanick
df371e2b1b mesa: Expose MAX_GEOMETRY_{INPUT,OUTPUT}_COMPONENTS on OpenGL 3.2
The comment '# GL 3.0 / GLES3' was incorrect.  The
MAX_VERTEX_OUTPUT_COMPONENTS and MAX_FRAGMENT_INPUT_COMPONENTS queries
were added in OpenGL 3.2 (with geometry shaders) and OpenGL ES 3.0.
This just fixes that comment.

v2: Add the GEOMETRY queries in the existing '# GL 3.2' section since
they have nothing to do with GLES3.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-19 16:29:44 -05:00
Ian Romanick
965d9e649d mesa: Get GL_MAX_FRAGMENT_INPUT_COMPONENTS from FragmentProgram.MaxInputComponents
In OpenGL ES 3.0 the minimum-maximum for GL_MAX_VERTEX_OUTPUT_VECTORS is 16,
but the minimum-maximum for GL_MAX_FRAGMENT_INTPUT_VECTORS is 15.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-19 16:29:44 -05:00
Ian Romanick
d1ade4eaf1 mesa: Get GL_MAX_VERTEX_OUTPUT_COMPONENTS from VertexProgram.MaxOutputComponents
In OpenGL ES 3.0 the minimum-maximum for GL_MAX_VERTEX_OUTPUT_VECTORS is 16,
but the minimum-maximum for GL_MAX_FRAGMENT_INTPUT_VECTORS is 15.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-19 16:29:44 -05:00
Ian Romanick
67a2d31735 i915: Set VertexProgram.MaxOutputComponents and FragmentProgram.MaxInputComponents
This was the only remaining place in Mesa that sets MaxVaryings without
also setting these values.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-19 16:29:44 -05:00
Ian Romanick
e1f8c58590 i965: Set *Program.Max{Input,Output}Components
Now that MaxVaryings is > 16, VertexProgram.MaxOutputComponents,
GeometryProgram.MaxInputComponents, GeometryProgram.MaxOutputComponents,
and FragmentProgram.MaxInputComponents also need to be set.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Paul Berry <stereotype441@gmail.com>
2013-09-19 16:29:44 -05:00
Ian Romanick
d358c6b700 mesa: Set default values for Max{Input,Output}Components in init_program_limits
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-19 16:29:44 -05:00
Ian Romanick
052c9ae1f3 mesa: Remove gl_constants::MaxVaryingComponents
There are no longer any users.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: Zack Rusin <zackr@vmware.com>
2013-09-19 16:29:44 -05:00
Ian Romanick
d91249df1a mesa: Use correct data for MAX_{VERTEX,GEOMETRY}_VARYING_COMPONENTS_ARB queries
Previously gl_constants::MaxVaryingComponents was used.  Now
gl_constants::VertexProgram::MaxOutputs and
gl_constants::GeometryProgram::MaxOutputs are used.

This means that st_extensions.c had to be updated to set these fields
instead of MaxVaryingComponents.  It was previously the only place that
set MaxVaryingComponents.

I believe that the structure is allocated by calloc, so the value should
be initialized to zero in non-Gallium drivers before and after my
change.  Right now nobody enables GL_ARB_geometry_shader4, so it's
pretty much dead code anyway.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: Zack Rusin <zackr@vmware.com>
2013-09-19 16:29:44 -05:00
Ian Romanick
a384238c3d mesa: Track per-stage shader input and output limits independently
In OpenGL 3.2 these are independently queryable.  In addition, the spec
has different minimum-maximums for various values.
GL_MAX_VERTEX_OUTPUT_COMPONENTS is 64, but
GL_MAX_GEOMETRY_OUTPUT_COMPONENTS (and GL_MAX_FRAGMENT_INPUT_COMPONENTS)
is 128.

In OpenGL ES 3.0 these are also independently queryable.  The spec has
different minimum-maximums for various values.
GL_MAX_VERTEX_OUTPUT_VECTORS is 16, but GL_MAX_FRAGMENT_INTPUT_VECTORS
is 15.

None of these values are used yet.  I have just added space to the
structures.  Future patches will add users and eventually remove some
old fields.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: Zack Rusin <zackr@vmware.com>
2013-09-19 16:29:43 -05:00
Ian Romanick
d38765f3c8 mesa: Support GL_MAX_VERTEX_OUTPUT_COMPONENTS query with ES3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
2013-09-19 16:29:43 -05:00
Kenneth Graunke
b6b549ccfc i965: Refactor Gen4-6 SURFACE_STATE setup for buffer surfaces.
This was an embarassingly large amount of copy and pasted code,
and it wasn't particularly simple code either.  By factoring it out
into a helper function, we consolidate the complexity.

v2: Properly NULL-check bo.  Caught by Eric Anholt.
v3: Do the subtraction by 1 in gen7_emit_buffer_surface_state, rather
    than making callers do it.  This makes the buffer_size parameter
    the actual size of the buffer.  Suggested by Paul Berry.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-19 10:52:58 -07:00
Kenneth Graunke
e114cbff96 i965: Refactor Gen7+ SURFACE_STATE setup for buffer surfaces.
This was an embarassingly large amount of copy and pasted code,
and it wasn't particularly simple code either.  By factoring it out
into a helper function, we consolidate the complexity.

v2: Properly NULL-check bo.  Caught by Eric Anholt.
v3: Do the subtraction by 1 in gen7_emit_buffer_surface_state, rather
    than making callers do it.  This makes the buffer_size parameter
    the actual size of the buffer.  Suggested by Paul Berry.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-19 10:52:58 -07:00
Kenneth Graunke
35a54ad02f i965: Fix off by one errors in texture buffer size calculations.
The value that's split into width/height/depth needs to be the size of
the buffer minus one.  This makes it consistent with the constant buffer
and shader time SURFACE_STATE setup code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-19 10:52:58 -07:00
Kenneth Graunke
34b11334d4 i965: Fix writemask != 0 assertions on Sandybridge.
This fixes myriads of regressions since commit 169f9c030c
("i965: Add an assertion that writemask != NULL for non-ARFs.").

On Sandybridge, our control flow handling (such as brw_IF) does:

   brw_set_dest(p, insn, brw_imm_w(0));
   insn->bits1.branch_gen6.jump_count = 0;

This results in a IMM destination with zero for the writemask.  IMM
destinations are rather bizarre, but the code has been working for ages,
so I'm loathe to change it.

Fixes glxgears on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-19 10:52:58 -07:00
Kenneth Graunke
d2d90d66d8 glsl: Delete builtin_builder::shader when destroying built-ins.
I would use _mesa_delete_shader, but it's declared static, and we don't
really need any of the stuff in it anyway.

This fixes a memory leak caught by Valgrind.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-19 10:52:58 -07:00
Kenneth Graunke
9f64bb2312 i965: Fix brw_gs_prog_data_compare to actually check field members.
&a and &b are the address of the local stack variables, not the actual
structures.  Instead of comparing the fields of a and b, we compared
...some stack memory.

Not a candidate for stable since GS code doesn't exist in 9.2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-19 10:52:57 -07:00
Kenneth Graunke
4e4b079916 i965: Fix brw_vs_prog_data_compare to actually check field members.
&a and &b are the address of the local stack variables, not the actual
structures.  Instead of comparing the fields of a and b, we compared
...some stack memory.

Caught by Valgrind on Piglit's glsl-lod-bias test (among many others).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68233
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: mesa-stable@lists.freedesktop.org
2013-09-19 10:52:57 -07:00
Kenneth Graunke
feaad189b4 i965: Move binding table code to a new file, brw_binding_tables.c.
The code to upload the binding tables for each stage was scattered
across brw_{vs,gs,wm}_surface_state.c and brw_misc_state.c, which also
contain a lot of code to populate individual SURFACE_STATE structures.

This patch brings all the binding table upload code together, and splits
it out from the code which fills in SURFACE_STATE entries.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-19 10:52:57 -07:00
Kenneth Graunke
113a75ff2d i965: Use brw_upload_binding_table() for the pixel shader as well.
This is not quite the same: brw_upload_binding_table() also has code to
early-return if there are no entries, while the existing code did not.

The PS binding table is unlikely to be empty since it will have at least
one color buffer.  If it ever is empty, early returning seems wise.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-19 10:52:57 -07:00
Kenneth Graunke
72340839ca i965: Generalize brw_vec4_upload_binding_table() beyond vec4 stages.
Instead of passing in a brw_vec4_prog_data structure, we can simply
pass the one field it needs: the number of entries in the binding table.

We also need to pass in the shader time surface index rather than
hardcoding SURF_INDEX_VEC4_SHADER_TIME.

Since the resulting function is stage-agnostic, this patch removes
"vec4_" from the name.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-19 10:52:57 -07:00
Kenneth Graunke
254891b3fc i965: Convert loop to memcpy in brw_vec4_upload_binding_table().
This is probably more efficient.  At any rate, it's less code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-19 10:52:57 -07:00
Kenneth Graunke
0532b200f3 i965: Update comments in brw_vec4_upload_binding_table().
The first comment was a bit stale; there are more kinds of surfaces than
textures and pull constants.

The second was a leftover "to do" comment for something I already did.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-19 10:52:57 -07:00
Gaetan Nadon
79930c6027 winsys/sw/xlib: fix compile error in xlib_sw_winsys.c.
xlib_sw_winsys.h:5:22: fatal error: X11/Xlib.h: No such file or directory

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

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

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

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-19 10:49:57 -07:00
Gaetan Nadon
092f2e8336 glx: fix compile error in egl_glx.c.
egl_glx.c:40:22: fatal error: X11/Xlib.h: No such file or directory

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

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

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

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-19 10:49:47 -07:00
Rob Clark
7dab097a51 freedreno/a3xx: fix typo mixup w/ mipfilter
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-19 11:47:40 -04:00
Rob Clark
575a6e7ec5 freedreno: fix glReadPixels
duh, we still need to flush if there are pending draws and it isn't an
unsynchronized case.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-19 11:45:01 -04:00
Roland Scheidegger
532dc8939f gallivm: adjust wrap mode to CLAMP_TO_EDGE always for cube maps.
Technically without seamless filtering enabled GL allows any wrap mode, which
made sense when supporting true borders (can get seamless effect with border
and CLAMP_TO_BORDER), but gallium doesn't support borders and d3d9 requires
wrap modes to be ignored and it's a pain to fix up the sampler state (as it
makes it texture dependent). It is difficult to imagine a situation where an
app really wants another behavior so just cheat here. (It looks like some
graphics hw (intel) actually requires this too hence it should be safe.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-09-19 17:14:36 +02:00
Adrian Negreanu
602d368446 android: Remove builtin_compiler
The first part was done in:

   commit c845140a20
   Author: Kenneth Graunke <kenneth@whitecape.org>
   Date:   Tue Sep 3 21:22:17 2013 -0700

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-18 09:35:55 -07:00
José Fonseca
e150c0da71 util/u_blit: Implement util_blit_pixels via pipe_context::blit.
This removes a lot of code, but not everything, as util_blit_pixels_tex
is still useful when one needs to override pipe_sampler_view::swizzle_?.

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-18 11:25:02 +01:00
José Fonseca
d8c7e13886 util/u_blit: Support blits from cubemaps.
By calling util_map_texcoords2d_onto_cubemap.

A new parameter for util_blit_pixels_tex is necessary, as
pipe_sampler_view::first_layer is always supposed to point to the first
face when sampling from cubemaps.

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-18 11:24:59 +01:00
José Fonseca
fb1d992da4 vega: Use pipe_context::blit instead of util_blit_pixels_tex.
Only compile-tested but it seems straightforward.

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-18 11:23:28 +01:00
Kenneth Graunke
ec44d56a5b i965: Rename brw_{fs,vec4}_emit.cpp to brw_{fs,vec4}_generator.cpp.
The previous names were really confusing to talk about:
- brw_fs_visitor() contained methods named emit_whatever().
- brw_fs_generator() contained methods named generate_whatever(), but
  lived in brw_fs_emit.cpp.

So when someone said "the emit layer", or "emit code", we weren't sure
whether they meant the visitor's emit() functions or the generator in
brw_fs_emit.cpp.

By renaming these files, the method names, class names, and file names
all match, which is much less confusing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2013-09-18 00:08:31 -07:00
Matt Turner
a3b51a22f7 glsl: Correctly validate fma()'s types.
lrp() can take a scalar as a third argument, and fma() cannot.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-17 17:02:06 -07:00
Matt Turner
d56bbd0441 glsl: Add frexp signatures and implementation.
I initially implemented frexp() as an IR opcode with a lowering pass,
but since it returns a value and has an out-parameter, it would break
assumptions our optimization passes make about ir_expressions being pure
(i.e., having no side effects).

For example, if opt_tree_grafting encounters this code:

uniform float u;
void main()
{
  int exp;
  float f = frexp(u, out exp);
  float g = float(exp)/256.0;
  float h = float(exp) + 1.0;
  gl_FragColor = vec4(f, g, h, g + h);
}

it may try to optimize it to this:

uniform float u;
void main()
{
  int exp;
  float g = float(exp)/256.0;
  float h = float(exp) + 1.0;
  gl_FragColor = vec4(frexp(u, out exp), g, h, g + h);
}

Some hardware has an instruction which performs frexp(), but we would
need some other compiler infrastructure to be able to generate it, such
as an intrinsics system that would allow backends to emit specific code
for particular bits of IR.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-17 17:01:58 -07:00
Matt Turner
c43d6060b1 i965: Lower ldexp.
v2: Drop frexp lowering.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-17 16:59:26 -07:00
Matt Turner
d0b8ea60b7 glsl: Add ldexp_to_arith lowering pass.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-17 16:59:23 -07:00
Matt Turner
5561251b58 glsl: Allow vectors to be created from ir_constant().
Note the parameter name change in the int version of ir_constant, to
avoid the conflict with the loop iterator.

v2: Make analogous change to builtin_builder::imm().
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-17 16:59:14 -07:00
Matt Turner
b2ab840130 glsl: Add support for ldexp.
v2: Drop frexp. Rebase on builtins rewrite.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-17 16:59:05 -07:00
Paul Berry
4b0488ef4e i965: Add some missing bits to {mesa,brw,cache}_bits[].
These data structures are used for debug output, so it wasn't hurting
anything that there were missing bits.  But it's good to keep things
up to date.

This patch also adds static asserts so that the {brw,cache}_bits[]
arrays are the proper size, so that we don't forget to add to them in
the future.  Unfortunately there's no convenient way to assert that
mesa_bits[] is the proper size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-17 15:18:18 -07:00
Paul Berry
3374dabce7 i965/gs: Implement basic gl_PrimitiveIDIn functionality.
If the geometry shader refers to the built-in variable
gl_PrimitiveIDIn, we need to set a bit in 3DSTATE_GS to tell the
hardware to dispatch primitive ID to r1, and we need to leave room for
it when allocating registers.

Note: this feature doesn't yet work properly when software primitive
restart is in use (the primitive ID counter will incorrectly reset
with each primitive restart, since software primitive restart works by
performing multiple draw calls).  I plan to address that in a future
patch series.

Fixes piglit test "spec/glsl-1.50/execution/geometry/primitive-id-in".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-17 15:18:14 -07:00
Paul Berry
f67fa8f3c8 i965/gs: New gs primitive types are supported by HW primitive restart.
When we previously implemented primitive restart, we didn't add cases
to brw_primitive_restart.c's can_cut_index_handle_prims() for the
primitive types that are introduced with geometry shaders.  It turns
out that all of the new primitive types are supported by hardware
primitive restart.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-17 15:18:11 -07:00
Paul Berry
9791af90e3 i965/gs: Add new primitive types.
As part of its support for geometry shaders, GL 3.2 introduces four
new primitive types: GL_LINES_ADJACENCY, GL_LINE_STRIP_ADJACENCY,
GL_TRIANGLES_ADJACENCY, and GL_TRIANGLE_STRIP_ADJACENCY.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-17 15:18:07 -07:00
Roland Scheidegger
93b5f71179 gallivm: some bits of seamless cube filtering implementation
Simply adjust wrap mode to clamp_to_edge. This is all that's needed for a
correct implementation for nearest filtering, and it's way better than
using repeat wrap for instance for linear filtering (though obviously this
doesn't actually do seamless filtering).

v2: fix s/t wrap not r/s...

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-09-18 00:00:37 +02:00
Kenneth Graunke
b8244b0056 i965: Remove MIPLAYOUT_BELOW from Gen4-6 constant buffer surface state.
Specifying a miptree layout makes no sense for constant buffers.

This has no functional change since BRW_SURFACE_MIPMAPLAYOUT_BELOW is
just a #define for 0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-17 13:17:07 -07:00
Kristian Høgsberg
a1b6e69e45 egl: Also add EGL_TEXTURE_FORMAT as a valid eglQueryWaylandBufferWL attribute
Now that we have a table of accepted eglQueryWaylandBufferWL() attributes,
we should also list EGL_TEXTURE_FORMAT.
2013-09-16 22:22:49 -07:00
Stanislav Vorobiov
1281a90532 egl: add EGL_WAYLAND_Y_INVERTED_WL attribute
This enables querying of wl_buffer's orientation
2013-09-16 22:20:27 -07:00
Kenneth Graunke
9ad6dda21e i965: Use gen7_upload_constant_state for 3DSTATE_CONSTANT_PS as well.
Now we use gen7_upload_constant_state() for all three shader stages.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-16 18:25:14 -07:00
Kenneth Graunke
e776c18afb i965: Set brw_stage_state::push_const_size for PS constants.
This paves the way for using gen7_upload_constant_state for PS data.

The formula is copied from gen7_wm_state.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-16 18:25:11 -07:00
Kenneth Graunke
d385edf4c3 i965: Introduce a prog_data temporary in gen6_upload_wm_push_constants.
This saves a bit of typing and shortens a few lines.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-16 18:25:07 -07:00
Paul Berry
24765c58bd i965/gen6+: Support 128 varying components.
GL 3.2 requires us to support 128 varying components for geometry
shader outputs and fragment shader inputs, and 64 varying components
otherwise.  But there's no hardware limitation that restricts us to 64
varying components, and core Mesa doesn't currently allow different
stages to have different maximum values, so just go ahead and enable
128 varying components for all stages.  This gets us better test
coverage anyway.

Even though we are only working on GL 3.2 support for gen7 right now,
gen6 also supports 128 varying components, so go ahead and switch it
on there too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:58 -07:00
Paul Berry
f5d38c58ee i965/ff_gs: Generate URB writes using a loop.
Previously we only ever did 1 URB write, since the maximum number of
varyings we support is small enough to fit in 1 URB write (when using
BRW_URB_SWIZZLE_NONE, which is what the pre-Gen7 GS always uses).  But
we're about to increase the number of varying components we support
from 64 to 128.

With 128 varyings, the most URB writes we'll have to do is 2, but it's
just as easy to write a general-purpose loop.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:55 -07:00
Paul Berry
57b8cff33c i965/gen6: Fix assertions on VS/GS URB size.
The "{VS,GS} URB Entry Allocation Size" fields of 3DSTATE_URB allow
values in the range 0-4, but they are U8-1 fields, so the range of
possible allocation sizes is 1-5.  We were erroneously prohibiting a
size of 5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:52 -07:00
Paul Berry
784044c206 i965/vec4: Generate URB writes using a loop.
Previously we only ever did 1 or 2 URB writes, since the maximum
number of varyings we support is small enough to fit in 2 URB writes.
But GL 3.2 requires the geometry shader to support 128 output varying
components, and this could require up to 3 URB writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:49 -07:00
Paul Berry
875972029e i965/fs: When >64 input components, order them to match prev pipeline stage.
Since the SF/SBE stage is only capable of performing arbitrary
reorderings of 16 varying slots, we can't arrange the fragment shader
inputs in an arbitrary order if there are more than 16 input varying
slots in use.  We need to make sure that slots 16-31 match the
corresponding outputs of the previous pipeline stage.

The easiest way to accomplish this is to just make all varying slots
match up with the previous pipeline stage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:46 -07:00
Paul Berry
a4546ec114 i965/fs: Simplify computation of key.input_slots_valid during precompile.
The for loop was rather silly.  In addition to checking brw->gen < 6
on each loop iteration, it took pains to exclude bits from
fp->Base.InputsRead that don't correspond to fragment shader inputs.
But those bits would never have been set in the first place, since the
only bits that are ever set in fp->Base.InputsRead are fragment shader
inputs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:43 -07:00
Paul Berry
8a36f4382b i965/gs: Stop storing an input VUE map in the GS program key.
Now that the vertex shader output VUE map is determined solely by a
64-bit bitfield, we don't have to store it in its entirety in the
geometry shader program key; instead, we can just store the bitfield,
and let the geometry shader infer the VUE map at compile time.

This dramatically reduces the size of the geometry shader program key,
which we want to keep small since it gets recomputed whenever the
active program changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:40 -07:00
Paul Berry
d1ad447f01 i965/gen6+: Remove VUE map dependency on userclip_active.
Previously, on Gen6+, we laid out the vertex (or geometry) shader VUE
map differently depending whether user clipping was active.  If it was
active, we put the clip distances in slots 2 and 3 (where the clipper
expects them); if it was inactive, we assigned them in the order of
the gl_varying_slot enum.

This made for unnecessary recompiles, since turning clipping on/off
for a shader that used gl_ClipDistance might rearrange the varyings.
It also required extra bookkeeping, since it required the user
clipping flag to be provided to brw_compute_vue_map() as a parameter.

With this patch, we always put clip distances at in slots 2 and 3 if
they are written to.  do_vs_prog() and do_gs_prog() are responsible
for ensuring that clip distances are written to when user clipping is
enabled (as do_vs_prog() previously did for gen4-5).

This makes the only input to brw_compute_vue_map() a bitfield of which
varyings the shader writes to, a fact that we'll take advantage of in
forthcoming patches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:36 -07:00
Paul Berry
3a83b20dcc i965/fs: Stop wasting input attribute space on gl_FragCoord and gl_FrontFacing.
Previously, if a fragment shader accessed gl_FragCoord or
gl_FrontFacing, we would assign them their own slots in the fragment
shader input attribute array, using up space that could be made
available to real varyings.  This was not strictly necessary (since
these values are not true varyings, and are instead computed from
other data available in the FS payload).  But we had to do it anyway
because the SF/SBE setup code assumed that every 1 bit in the
gl_program::InputsRead bitfield corresponded to a genuine varying
variable.

Now that the SF/SBE code consults brw_wm_prog_data and only sets up
the attributes that the fragment shader actually needs, we don't have
to do this anymore.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:32 -07:00
Paul Berry
0af1252ae4 i965/sf: Consult brw_wm_prog_data when setting up SF/SBE state.
Previously, the SF/SBE setup code delivered varying inputs to the FS
in the order in which they appear in the gl_program::InputsRead
bitfield, since that's what the FS expects.

When we add support for more than 64 varying components, this will no
longer always be the case, because the Gen6+ SF/SBE stage is only
capable of performing arbitrary reorderings of 16 varying slots.  So,
when there are more than 16 vec4's worth of varying inputs, the FS
will have to adjust the order its input varyings in order to partially
match the order of outputs from the geometry or vertex shader.

To allow extra flexibility in the ordering of FS varyings, this patch
causes the SF/SBE to deliver varying inputs to the FS in exactly the
order that the FS requests, by consulting brw_wm_prog_data::urb_setup
and brw_wm_prog_data::num_varying_inputs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:29 -07:00
Paul Berry
af84bbd2ca i965/sf: Consolidate common code for setting up gen6-7 attribute overrides.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:25 -07:00
Paul Berry
d5b4095356 i965/sf: Use BRW_SF_URB_ENTRY_READ_OFFSET rather than hardcoded values.
We always program the SF unit to start reading the vertex URB entry at
offset 1.  In upcoming patches, we'll be adding FS code that relies on
this.  So consistently use the constant BRW_SF_URB_ENTRY_READ_OFFSET
rather than hardcoding a 1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:21 -07:00
Paul Berry
8c2b9bd1df i965/fs: Consult brw_wm_prog_data::num_varying_inputs when setting up WM state.
Previously, we assumed that the number of varying inputs consumed by
the fragment shader was equal to the number of bits set in
gl_program::InputsRead.  However, we'll soon be making two changes
that will cause that not to be true:

- We'll stop wasting varying input space for gl_FragCoord and
  gl_FrontFacing, which aren't varyings.

- For fragment shaders that have more than 16 varying inputs, we'll
  adjust the layout of the inputs to account for the fact that the
  SF/SBE pipeline stage can't reorder inputs beyond the first 16; if
  there are GS outputs that the FS doens't use (or vice versa) this
  may cause the number of FS varying inputs to change.

So, instead of trying to guess the number of FS inputs from
gl_program::InputsRead, simply read it from
brw_wm_prog_data:num_varying_inputs, which is guaranteed to be correct
since it's populated by fs_visitor::calculate_urb_setup().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:18 -07:00
Paul Berry
8c69eaba1a i965/fs: Change brw_wm_prog_data::urb_read_length to num_varying_inputs.
On gen4-5, the FS stage reads varying inputs from URB entries that
were output by the SF thread, where each register stores the
interpolation setup for two components of a vec4, therefore the FS
urb_read_length is twice the number of FS input varyings.  On gen6+,
varying inputs are directly deposited in the FS payload by the SF/SBE
fixed function logic, so urb_read_length is irrelevant.

However, in future patches, it will be nice to be able to consult
brw_wm_prog_data to determine how many varying inputs the FS expects
(rather than inferring it from gl_program::InputsRead).  So instead of
storing urb_read_length, we simply store num_varying_inputs in
brw_wm_prog_data.  On gen4-5, we multiply this by 2 to recover the URB
read length.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:14 -07:00
Paul Berry
58f01bd17d i965/fs: Expose "urb_setup" as part of brw_wm_prog_data.
At the moment, for Gen6+, the FS assumes that all varying inputs are
delivered to it in the order in which they appear in the
gl_program::InputsRead bitfield, and the SF/SBE setup code ensures
that they are delivered in this order.

When we add support for more than 64 varying components, this will no
longer always be possible, because the Gen6+ SF/SBE stage is only
capable of performing arbitrary reorderings of 16 varying slots.

To allow extra flexibility in the ordering of FS varyings, this patch
causes the FS to advertise exactly what ordering it expects.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 12:53:05 -07:00
Chia-I Wu
4a6939edae ilo: make ilo_bind_sampler_states return void
So that it can be hooked up pipe_context::bind_sampler_states that is
currently living on another branch.
2013-09-17 00:20:50 +08:00
Kenneth Graunke
120d100627 glsl/tests: Update .gitignore for new unit test.
I rarely run 'git status', so I failed to notice this was missing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-16 08:26:09 -07:00
Kenneth Graunke
1da3ff1b1c glsl/tests: Add a test for properties of sampler types.
For each sampler type, this tests that:
- The base type is GLSL_TYPE_SAMPLER.
- The dimensionality is set correctly.
- The returned data type is correct.
- The sampler_array and sampler_shadow flags are set correctly.
- sampler_coordinate_components() returns the correct value.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-09-15 21:48:20 -07:00
Dave Airlie
2f508f244e st/mesa: don't dereference stObj->pt if NULL
It seems a user app can get us into this state, I trigger the fail
running fbo-maxsize inside virgl, it fails to create the backing
storage for the texture object, but then segfaults here when it
should fail the completeness test.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-16 08:33:02 +10:00
Dave Airlie
bbe3d6dc29 nouveau: fix regression since float comparison instructions (v2)
Fix the return type and allow src and dst types for comparison
to be separate, this at least fixes the two test cases I've written.

v2: drop the u32->s32 change

Acked-by: Christoph Bumiller <christoph.bumiller@speed.at>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-16 08:32:42 +10:00
Rico Schüller
6f52295129 vdpau/decode: Check max width and max height.
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-09-15 16:18:08 +02:00
Rob Clark
ffa3244534 freedreno: PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE
When the old contents do not need to be preserved, it is faster to
create a new backing bo rather than stall.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
d7be322410 freedreno/a3xx: fix VFD_INDEX_MAX overflow
max_index may be 0xffffffff.  The hardware does not need 1 + max_index
(although it does not hurt unless max_index wraps around to zero).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
c756a3ef70 freedreno: add debug option to disable GMEM bypass
Useful for debugging.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
cdec879e38 freedreno/a3xx: handle front_ccw
Used by supertuxkart.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
cda75253f7 freedreno/a3xx: stencil fixes
For mem->gmem we don't sample depth/stencil as it's native type.  So we
need to setup the swizzle state for the sampler based on the format used
for sampling.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
65ae4392ce freedreno/a3xx: alpha-test
Needed by some games, like etuxracer and supertuxkart which use alpha
test rather than blending, to handle texture transparency.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
dbf041e61f freedreno/a3xx/compiler: implement SUB
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
1a42d4ee34 freedreno/a3xx: use INDIRECT state load for shaders
With a debug option to force DIRECT (mainly to make it easier for
capturing cmdstream dumps).  Using INDIRECT for large shaders at least
makes a noticable reduction in CPU load, which helps for CPU limited
games.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
6e9c386d16 freedreno: avoid stalling at ringbuffer wraparound
Because of how the tiling works, we can't really flush at arbitrary
points very easily.  So wraparound is handled by resetting to top of
ringbuffer.  Previously this would stall until current rendering is
complete.  Instead cycle through multiple ringbuffers to avoid a stall.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
ca505303a7 freedreno: emit markers to scratch registers
Emit markers by writing to scratch registers in order to "triangulate"
gpu lockup position from post-mortem register dump.  By comparing
register values in post-mortem dump to command-stream, it is possible to
narrow down which DRAW_INDX caused the lockup.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
1e6d290f21 freedreno: split out WFI helper
Mostly just to give an easy debug/instrumentation point.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
74052347f3 freedreno: fd_draw helper
Have a single helper that all draws come through.. mainly for a
convenient debug and instrumentation point.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
4712904ddc freedreno/a3xx: fix gpu lockup in some piglit tests
The varying-out config comes from the inputs of the frag shader (so that
we aren't exporting unneeded varyinges).  The varyings-count should come
from the frag shader as well, to avoid a discrepency in configuration
and resulting gpu lockup.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
64c134cedb freedreno/a3xx/compiler: add LIT
Needed by glxgears and etuxracer ;-)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Rob Clark
cb9e07aa84 freedreno: multi-slice resources (cubemap, mipmap, etc)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-09-14 13:31:58 -04:00
Paul Berry
71ffac691b glsl/builtins: Fix {texture1D,texture2D,shadow1D}ArrayLod availibility.
These functions are defined in EXT_texture_array, which makes no
mention of what shader types they should be allowed in.  At the time
EXT_texture_array was introduced, functions ending in "Lod" were
available only in vertex shaders, however this restriction was lifted
in later spec versions and extensions.

We already have the function lod_exists_in_stage() for figuring out
whether functions ending in "Lod" should be available, so just re-use
that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-13 14:59:06 -07:00
Kenneth Graunke
4b3c0a797f i965: Use brw_stage_state for WM data as well.
This gets the VS, GS, and PS all using the same data structure.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-13 14:26:52 -07:00
Kenneth Graunke
e6e5f88848 i965: Increase the size of brw_stage_state::surf_offset.
Since BRW_MAX_WM_SURFACES is greater than BRW_MAX_VEC4_SURFACES, the
existing array isn't large enough to be used by the WM.  Increasing it
will make it possible to share them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-13 14:26:50 -07:00
Kenneth Graunke
3a835b699a i965: Add comments to the new brw_state_state structure's fields.
These are largely based on the similar fields in brw->wm.

v2: Add a better comment than "Scratch buffer".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-13 14:26:31 -07:00
Ian Romanick
ea373f03e8 mesa: Rename MESA_shader_integer_mix to EXT_shader_integer_mix
Everyone at the Khronos meeting was as surprised that GLSL didn't
already support this as we were.  Several vendors said they'd ship it,
but there didn't seem to be enough interest to put in the effort to make
it ARB or KHR.

v2: Fix a couple typos and rename the spec file to
EXT_shader_integer_mix.spec.  Suggested by Roland.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-13 09:56:36 -05:00
Marek Olšák
f4e35f897e radeonsi: fix and enable transform feedback for CIK
The CP_STRMOUT_CNTL register was moved again.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-13 01:08:04 +02:00
Marek Olšák
f317ce5c5d radeonsi: fix gl_InstanceID with non-zero start_instance
start_instance doesn't affect gl_InstanceID.

There's no piglit test, but it's kinda obvious the code was wrong.

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-09-13 01:08:03 +02:00
Marek Olšák
9c75d2f65b gallium: comment that INSTANCEID doesn't include start_instance
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-09-13 01:08:03 +02:00
Marek Olšák
122a880b78 radeonsi: enable streamout AKA transform feedback for SI
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:07:56 +02:00
Marek Olšák
8d03d923b6 radeonsi: implement streamout shader support
The shader is responsible for writing to streamout buffers using
the TBUFFER_STORE_FORMAT_* instructions.

The locations of some input SGPRs and VGPRs are assigned dynamically, because
the input SGPRs controlling streamout are not declared if they are not needed,
decreasing the indices of all following inputs.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:04:44 +02:00
Marek Olšák
9d16e70b3f radeonsi: implement glDrawTransformFeedback functionality
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:04:44 +02:00
Marek Olšák
6cf29c7dab radeonsi: fix streamout queries
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:04:44 +02:00
Marek Olšák
91ede46222 radeonsi: implement streamout flush properly
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:04:44 +02:00
Marek Olšák
2993ccab38 radeonsi: bind streamout buffers to VGT and the vertex shader
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:04:44 +02:00
Marek Olšák
e4c5d3ee27 radeonsi: handle rasterizer_discard and set GS_OUT_PRIM_TYPE
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:04:44 +02:00
Marek Olšák
9eb3b9dc2b radeonsi: initialize the first CS like any other
So that the "init" state is always emitted first and not later in draw_vbo.

This fixes streamout where the "init" state, which disables streamout,
was emitted in draw_vbo after streamout was enabled.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:04:44 +02:00
Marek Olšák
2b0a54d6ec radeonsi: integrate shared streamout state
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:04:44 +02:00
Marek Olšák
4ea35023c5 radeon: don't emit streamout state if there are no streamout buffers
This could happen if set_stream_output_targets is called twice
in a row without a draw call in between.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:04:44 +02:00
Marek Olšák
60416cb173 radeon: don't emit VGT_STRMOUT_BUFFER_BASE on SI
The register doesn't exist on SI.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-09-13 01:04:44 +02:00
Kenneth Graunke
2b71b3d466 mesa: Disallow relinking if a program is used by an active XFB object.
Paused transform feedback objects may refer to a program other than the
current program.  If any active objects refer to a program, LinkProgram
must reject the request to relink.

The code to detect this is ugly since _mesa_HashWalk is awkward to use,
but unfortunately we can't use hash_table_foreach since there's no way
to get at the underlying struct hash_table (and even then, we'd need to
handle locking somehow).

Fixes the last subcase of Piglit's new ARB_transform_feedback2
api-errors test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-12 10:19:10 -07:00
Kenneth Graunke
9cc74c93f8 mesa: Reject ResumeTransformFeedback if the wrong program is bound.
This is actually a pretty important error condition: otherwise, you
could set up transform feedback with one program, and resume it with
a program that generates a completely different set of outputs.

Fixes a subcase of Piglit's new ARB_transform_feedback2 api-errors test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-12 10:19:09 -07:00
Kenneth Graunke
c732f68cf4 mesa: Track the vertex program active at BeginTransformFeedback() time.
The next few patches will use this for API error checking.

All of the drivers appear to CALLOC_STRUCT transform feedback objects,
so this should be properly NULL initialized on creation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-12 10:19:07 -07:00
Kenneth Graunke
a7d616da69 mesa: Disallow TransformFeedbackVaryings when active.
Fixes a subcase of Piglit's new ARB_transform_feedback2 api-errors test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-12 10:18:59 -07:00
Christian König
2487324591 radeon/uvd: move more logic into the common files
Move the code back into the common UVD files since we now
have base structures for R600 and radeonsi.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-12 15:16:30 +02:00
Christian König
56be937d42 radeon/uvd: use more sane defaults for bitstream buffer size
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-12 15:16:06 +02:00
Andreas Boll
32637f56a5 os: First check for __GLIBC__ and then for PIPE_OS_BSD
Fixes FTBFS on kfreebsd-*

Debian GNU/kFreeBSD doesn't provide getprogname() since it uses stdlib.h
from glibc. Instead it provides program_invocation_short_name from glibc.

You can find the same order in src/mesa/drivers/dri/common/xmlconfig.c

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Tested-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-12 12:35:34 +02:00
José Fonseca
315f8f17d0 llvmpipe: Remove the special path for TGSI_OPCODE_EXP.
It was wrong for EXP.y, as we clamped the source before computing the
fractional part, and this opcode should be rarely used, so it's not
worth the hassle.
2013-09-12 11:24:24 +01:00
José Fonseca
e75211df0f trace: Several enhancements to dump_state.py
- Handle more calls
- Handle more state
- Try to normalize the output a bit, to eliminate spurious differences
2013-09-12 11:24:24 +01:00
José Fonseca
9641f1037c trace: Support bigger TGSI shaders.
Trivial.
2013-09-12 11:24:24 +01:00
Kenneth Graunke
c59659ca08 glsl: Use sampler_coordinate_components instead of passing it by hand.
We used to pass the number of components actually used for the
coordinate (rather than padding, shadow comparitors, and projectors) by
hand, specifying it on every _texture() call.

The new helper function can just compute this, eliminating a lot of
potential mistakes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 22:48:32 -07:00
Kenneth Graunke
694be9115d glsl: Add a new glsl_type::sampler_coordinate_components() function.
This computes the number of components necessary to address a sampler
based on its dimensionality.  It will be useful for texturing built-ins.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 22:48:32 -07:00
Johannes Obermayr
5eb7ff1175 Move nv30, nv50 and nvc0 to nouveau.
It is planned to ship openSUSE 13.1 with -shared libs.
nouveau.la, nv30.la, nv50.la and nvc0.la are currently LIBADDs in all nouveau
related targets.
This change makes it possible to easily build one shared libnouveau.so which is
then LIBADDed.
Also dlopen will be faster for one library instead of three and build time on
-jX will be reduced.

Whitespace fixes were requested by 'git am'.

Signed-off-by: Johannes Obermayr <johannesobermayr@gmx.de>
Acked-by: Christoph Bumiller <christoph.bumiller@speed.at>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-11 21:47:07 +02:00
Paul Berry
ebcdaa7bbc i965/gs: implement EndPrimitive() functionality in the visitor.
According to GLSL, the shader may call EndPrimitive() at any point
during its execution, causing the line or triangle strip currently
being output to be terminated and a new strip to be begun.

This is implemented in gen7 hardware by using one control data bit per
vertex, to indicate whether EndPrimitive() was called after that
vertex was emitted.

In order to make this work without sacrificing too much efficiency, we
accumulate 32 control data bits at a time in a GRF.  When we have
accumulated 32 bits (or when the shader terminates), we output them to
the appropriate DWORD in the control data header and reset the
accumulator to 0.

We have to take special care to make sure that EndPrimitive() calls
that occur prior to the first vertex have no effect.

Since geometry shaders that output a large number of vertices are
likely to be rare, an optimization kicks in if max_vertices <= 32.  In
this case, we know that we can wait until the end of shader execution
before any control data bits need to be output.

I've tried to write the code in such a way that in the future, we can
easily adapt it to output stream ID bits (which are two bits/vertex
instead of one).

Fixes piglit tests "spec/glsl-1.50/glsl-1.50-geometry-end-primitive *".

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 11:17:54 -07:00
Paul Berry
564a900a45 i965/vec4: Add the ability to emit opcodes with just a dst register.
This is needed for GS_OPCODE_PREPARE_CHANNEL_MASKS.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 11:17:50 -07:00
Paul Berry
6ced0fa57f i965/gs: Add opcodes needed for EndPrimitive().
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 11:17:41 -07:00
Paul Berry
a74af8148d i965/gen7: Add the ability to send URB_WRITE_OWORD messages.
Previously, brw_urb_WRITE() would always generate a URB_WRITE_HWORD
message, we always wanted to write data to the URB in pairs of varying
slots or larger (an HWORD is 32 bytes, which is 2 varying slots).

In order to support geometry shader EndPrimitive functionality, we'll
need the ability to write to just a single OWORD (16 byte) slot, since
we'll only be outputting 32 of the control data bits at a time.  So
this patch adds a flag that will cause brw_urb_WRITE to generate a
URB_WRITE_OWORD message.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 11:17:31 -07:00
Paul Berry
bf5419e389 i965/gen7: Allow URB_WRITE channel masks to be used.
Previously, brw_urb_WRITE() would unconditionally override the channel
masks in the URB_WRITE message to 0xff (indicating that all channels
should be written to the URB).

In order to support geometry shader EndPrimitive functionality, we'll
need the ability to set the channel masks programatically, so that we
can output just 32 of the control data bits at a time.  So this patch
adds a flag that will prevent brw_urb_WRITE() from overriding them.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 11:17:24 -07:00
Paul Berry
247f90c77e i965/gs: Set control data header size/format appropriately for EndPrimitive().
The gen7 geometry shader uses a "control data header" at the beginning
of the output URB entry to store either

(a) flag bits (1 bit/vertex) indicating whether EndPrimitive() was
    called after each vertex, or

(b) stream ID bits (2 bits/vertex) indicating which stream each vertex
    should be sent to (when multiple transform feedback streams are in
    use).

Fortunately, OpenGL only requires separate streams to be supported
when the output type is points, and EndPrimitive() only has an effect
when the output type is line_strip or triangle_strip, so it's not a
problem that these two uses of the control data header are mutually
exclusive.

This patch modifies do_vec4_gs_prog() to determine the correct
hardware settings for configuring the control data header, and
modifies upload_gs_state() to propagate these settings to the
hardware.

In addition, it modifies do_vec4_gs_prog() to ensure that the output
URB entry is large enough to contain both the output vertices *and*
the control data header.

Finally, it modifies vec4_gs_visitor so that it accounts for the size
of the control data header when computing the offset within the URB
where output vertex data should be stored.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

v2: Fixed incorrect handling of IVB/HSW differences.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 11:17:14 -07:00
Paul Berry
1a33e0233a glsl: During linking, record whether a GS uses EndPrimitive().
This information will be useful in the i965 back end, since we can
save some compilation effort if we know from the outset that the
shader never calls EndPrimitive().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 11:16:35 -07:00
Paul Berry
79d9c6b7ff i965/gs: Add a state atom to set up geometry shader state.
v2: Do not attempt to share the code that uploads
3DSTATE_BINDING_TABLE_POINTERS_GS, 3DSTATE_SAMPLER_STATE_POINTERS_GS,
or 3DSTATE_GS with VS.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

v3: Add _NEW_TRANSFORM to gen7_gs_state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 11:16:25 -07:00
Paul Berry
ec5c924290 i965/gen7: Extract a function for setting up a shader stage's constants.
This will allow us to reuse some code when setting up the geometry
shader stage.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-11 11:16:19 -07:00
Torsten Duwe
3bc642cbf6 wayland-egl.pc requires wayland-client.pc.
Mesa provides the wayland-egl libs and the pkgconfig file, but the headers
originate from the wayland package. Ensure everything matches, by requiring
application builds to look at the wayland headers as well.

Signed-off-by: Torsten Duwe <duwe@suse.de>
Signed-off-by: Johannes Obermayr <johannesobermayr@gmx.de>
2013-09-11 10:51:02 -07:00
Johannes Obermayr
87ebbe1270 st/gbm: Add $(WAYLAND_CFLAGS) for HAVE_EGL_PLATFORM_WAYLAND. 2013-09-11 10:50:34 -07:00
Maarten Lankhorst
b217d48364 st/dri: do not create a new context for msaa copy
Commit b77316ad75
    st/dri: always copy new DRI front and back buffers to corresponding MSAA buffers

introduced creating a pipe_context for every call to validate, which is not required
because the callers have a context anyway.

Only exception is egl_g3d_create_pbuffer_from_client_buffer, can someone test if it
still works with NULL passed as context for validate? From examining the code I
believe it does, but I didn't thoroughly test it.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-11 09:03:44 +02:00
Kenneth Graunke
169f9c030c i965: Add an assertion that writemask != NULL for non-ARFs.
We've observed GPU hangs on Ivybridge from the following instruction:

mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q };

There should be no reason to ever set the writemask on a destination
register to zero, except for perhaps the ARF NULL register.

This patch adds an assertion to enforce this for non-ARF registers.
Excluding ARFs is conservative yet should still catch the majority
of mistakes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2013-09-10 17:52:59 -07:00
Kenneth Graunke
4e5eb8ba25 i965/vec4: Only zero out unused message components when there are any.
Otherwise, coordinates with four components would result in a MOV
with a destination writemask that has no channels enabled:

mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q };

At best, this is stupid: we emit code that shouldn't do anything.
Worse, it apparently causes GPU hangs (observable with Chris's
textureGather test on CubeArrays.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Cc: mesa-stable@lists.freedesktop.org
2013-09-10 17:52:56 -07:00
Kenneth Graunke
17eb1df7b8 i965/vec4: Simplify the computation of coord_mask and zero_mask.
We can easily compute these without loops, resulting in simpler and
shorter code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Suggested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2013-09-10 17:52:36 -07:00
Matt Turner
66be7b4c27 docs: Clean up autoconf.html.
Remove long dead options and clarify some things.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69148
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-10 16:59:35 -07:00
Henri Verbeet
bd77f51758 mesa: Properly set the fog scale (gl_Fog.scale) to +INF when fog start and end are equal.
This was originally introduced by commit
ba47aabc98, but unfortunately the commit message
doesn't go into much detail about why +INF would be a problem here.

A similar issue exists for STATE_FOG_PARAMS_OPTIMIZED, but allowing infinity
there would potentially introduce NaNs where they shouldn't exist, depending
on the values of fog end and the fog coord. Since STATE_FOG_PARAMS_OPTIMIZED
is only used for fixed function (including ARB_fragment_program with fog
option), and the calculation there probably isn't very stable to begin with
when fog start and end are close together, it seems best to just leave it
alone.

This fixes piglit glsl-fs-fogscale, and a couple of Wine D3D tests. No piglit
regressions on Cayman.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-10 22:25:16 +02:00
Vinson Lee
09e385ee3b mesa: Use correct enum conversion function.
Fixes "Mixing enum types" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-10 10:56:38 -07:00
Vinson Lee
fd66a85f6b mesa: Ensure gl_sync_object is fully initialized.
278372b47e added the uninitialized pointer
field gl_sync_object:Label. A free of this pointer, added in commit
6d8dd59cf5, resulted in a crash.

This patch fixes piglit ARB_sync regressions with swrast introduced by
6d8dd59cf5.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-10 10:54:26 -07:00
Vinson Lee
49f2ba2cb0 radeonsi: Add parentheses around '|' operands.
Fixes GCC parentheses warning.

r600_texture.c: In function 'si_texture_create':
r600_texture.c:518:20: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses]
      !(templ->bind & PIPE_BIND_CURSOR | PIPE_BIND_LINEAR)) {
                    ^

Fixes "Wrong operator used" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-10 10:44:09 -07:00
Vinson Lee
d93e23ba25 util: Fix unmatched parenthesis.
Fixes MSVC build error introduced with commit
923d346714.

src\gallium\auxiliary\util\u_cpu_detect.c(286) : fatal error C1012: unmatched parenthesis : missing '('

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-09-10 10:33:47 -07:00
Brian Paul
923d346714 util: don't use _fxsave() with MSVC 2010 or older
And update _MSC_VER comments in p_config.h

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-09-10 11:01:37 -06:00
Vinson Lee
787ac4207e glsl: Add missing va_end in builtin_builder::add_function.
Fixes "Missing varargs init or cleanup" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-10 09:52:03 -07:00
Vinson Lee
118cdd1d3f glsl: Initialize builtin_builder member variables.
Fixes "Uninitialized pointer field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-10 09:49:02 -07:00
Brian Paul
395b941086 glsl: fix variadic macro for MSVC
MSVC doesn't accept the rest... syntax.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-09 17:52:44 -06:00
Brian Paul
1ddb56d160 glsl: remove struct keyword from ir_variable declarations
To silence MSVC warnings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-09 17:52:44 -06:00
Kenneth Graunke
0bb3cd8090 Revert "i965/vec4: Only zero out unused message components when there are any."
This reverts commit 6c3db2167c, which I
accidentally pushed along with other code.  A better version of the fix
will be committed later.
2013-09-09 15:33:16 -07:00
Matt Turner
89f5f675ad i965: Allow immediates to be folded into logical and shift instructions.
These instructions will be used with immediate arguments in the upcoming
ldexp lowering pass and frexp implementation.

v2: Add vec4 support as well.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 15:01:08 -07:00
Matt Turner
d83221c2d3 i965: Enable MESA_shader_integer_mix.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-09 15:01:08 -07:00
Matt Turner
56fff7063d glsl: Implement MESA_shader_integer_mix extension.
Because why doesn't GLSL allow you to do this already?

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-09 15:01:08 -07:00
Matt Turner
fd183fa02c glsl: Use conditional-select in mix().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-09 15:01:08 -07:00
Matt Turner
8477262958 i965: Add support for ir_triop_csel.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-09 15:01:08 -07:00
Matt Turner
7aaa38728f glsl: Add conditional-select IR.
It's a ?: that operates per-component on vectors. Will be used in
upcoming lowering pass for ldexp and the implementation of frexp.

 csel(selector, a, b):
   per-component result = selector ? a : b

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-09 15:01:08 -07:00
Kenneth Graunke
60850b7b9f glsl: Rename ir_function_signature::builtin_info to builtin_avail.
builtin_info was originally going to be a structure containing a bunch
of information, but after various rewrites, it turned into a boolean
availability predicate.

builtin_avail is a better name than builtin_info, since it doesn't
store any information other than availability.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 14:54:46 -07:00
Kenneth Graunke
260965b7a7 build: Delete cross-compiling macros.
Now that builtin_compiler is gone, nothing uses these.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 14:42:33 -07:00
Kenneth Graunke
b973b44a4d glsl: Add missing type inference for ir_binop_bfm.
Matt noticed that this was missing.  Nothing uses this currently.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 14:42:33 -07:00
Kenneth Graunke
722eff674b glsl: Delete old built-in function generation code.
None of this is used anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 14:42:33 -07:00
Kenneth Graunke
c845140a20 glsl: Remove builtin_compiler from the build system.
We don't actually use anything from builtin_function.cpp, so we don't
need to generate it anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 14:42:33 -07:00
Kenneth Graunke
76d2f73643 glsl: Switch to the new built-in function module.
All built-ins are now handled by the new code; the old system is dead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 14:42:33 -07:00
Kenneth Graunke
7ddc312c1b glsl: Write a new built-in function module.
This creates a new replacement for the existing built-in function code.
The new module lives in builtin_functions.cpp (not builtin_function.cpp)
and exists in parallel with the existing system.  It isn't used yet.

The new built-in function code takes a significantly different approach:

Instead of implementing built-ins via printed IR, build time scripts,
and run time parsing, we now implement them directly in C++, using
ir_builder.  This translates to faster load times, and a much less
complex build system.

It also takes a different approach to built-in availability: each
signature now stores a boolean predicate, which makes it easy to
construct arbitrary expressions based on _mesa_glsl_parse_state's
fields.  This is much more flexible than the old system, and also
easier to use.

Built-ins are also now stored in a single gl_shader object, rather
than being spread out across a number of shaders that need to be linked.
When searching for a matching prototype, we simply consult the
availability predicate.  This also simplifies the code.

v2: Incorporate Matt Turner's feedback: use the new fma() function rather
    than expr().  Don't expose textureQueryLOD() in GLSL 4.00 (since it
    was renamed to textureQueryLod()).  Also correct some #undefs.
v3: Incorporate Paul Berry's feedback: rename legacy to compatibility;
    add comments to explain a few things; fix uvec availability; include
    shaderobj.h instead of repeating the _mesa_new_shader prototype.
v4: Fix lack of TEX_PROJECT on textureProjGrad[Offset] (caught by oglc).
    Add an out_var convenience function (more feedback by Matt Turner).
v5: Rework availability predicates for Lod functions.  They were broken.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Enthusiastically-acked-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 14:42:18 -07:00
Kenneth Graunke
8d90328eb3 glsl: Add optional parameters to the ir_factory constructor.
Each ir_factory needs an instruction list and memory context in order to
be useful.  Rather than creating an object and manually assigning these,
we can just use optional parameters in the constructor.

This makes it possible to create a ready-to-use factory in one line:

   ir_factory body(&sig->body, mem_ctx);

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:22 -07:00
Kenneth Graunke
666df56551 glsl: Add IR builder shortcuts for a bunch of random opcodes.
Adding new convenience emitters makes it easier to generate IR involving
these opcodes.

bitfield_insert is particularly useful, since there is no expr() for
quadops.

v2: Add fma() and rename lrp() operands to x/y/a to match the GLSL
    specification (suggested by Matt Turner).  Fix whitespace issues.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:22 -07:00
Kenneth Graunke
1a6c0efa11 glsl: Expose IR builder support for arbitrary swizzling.
IR builder already offers a lot of swizzling functions, such as
swizzle_xxxx, swizzle_z, or swizzle_for_size.

The swizzle_xxxx style is convenient if you statically know which
components you want.  swizzle_for_size is great if you want to select
the first few components.  However, if you want to select components
based on, say, a loop counter, none of those are sufficient.

IR builder actually already had support for arbitrary swizzling, but
didn't expose it.  This patch exposes that API.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:22 -07:00
Kenneth Graunke
202238824b glsl: Add a new ir_builder::dotlike() function.
dotlike() uses ir_binop_mul for scalars, and ir_binop_dot for vectors.

When generating built-in functions, we often want to use regular
multiply for scalar signatures, and dot() for vector signatures.
ir_binop_dot only works on vectors, so we have to switch opcodes,
even if the code is otherwise identical.  dotlike() makes this easy.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:22 -07:00
Kenneth Graunke
d716b3376c glsl: Add IR builder support for generating return statements.
We use "ret" as the function name since "return" is a C++ keyword, and
"ir_return" is already a class name.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:22 -07:00
Kenneth Graunke
f72a8498e7 glsl: Add IR builder support for conditional assignments.
This adds two new signatures:

   assign(lhs, rhs, condition, writemask);
   assign(lhs, rhs, condition);

All the other existing APIs still exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:22 -07:00
Kenneth Graunke
eff2ca1ac3 glsl: Add IR builder support for triops.
Now that we have the ir_expression constructor that does type inference,
this is trivial to do.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:22 -07:00
Kenneth Graunke
7f0f60cd84 glsl: Add an ir_expression triop constructor with type inference.
We already have ir_expression constructors for unary and binary
operations, which automatically infer the type based on the opcode and
operand types.

These are convenient and also required for ir_builder support.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:22 -07:00
Kenneth Graunke
183f7a3e6f glsl: Add missing type inference support for ARB_gpu_shader5 unops.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:21 -07:00
Kenneth Graunke
33faaf0b4a glsl: Initialize lod_info in the ir_texture constructor.
This isn't strictly necessary, since creators of ir_texture objects
should set LOD when relevant.  However, it's nice to have a NULL pointer
in case they forget.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:21 -07:00
Kenneth Graunke
1b3a482a96 glsl: Skip unavailable built-ins when printing out similar candidates.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:21 -07:00
Kenneth Graunke
1ffcef04ce glsl: Skip unavailable built-ins when matching signatures.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:21 -07:00
Kenneth Graunke
3e820e3aef glsl: Pass _mesa_glsl_parse_state into matching_signature and such.
During compilation, we'll use this to determine built-in availability.
The plan is to have a single shader containing every built-in in every
version of the language, but filter out the ones that aren't actually
available to the shader being compiled.

At link time, we don't actually need this filtering capability: we've
already imported prototypes for every built-in that the shader actually
calls, and they're flagged as is_builtin().  The linker doesn't import
any additional prototypes, so it won't pull in any unavailable
built-ins.  When resolving prototypes to function definitions, the
linker ensures the values of is_builtin() match, which means that a
shader can't trick the linker into importing the body of an unavailable
built-in by defining a suspiciously similar prototype.

In other words, during linking, we can just pass in NULL.  It will work
out fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:21 -07:00
Kenneth Graunke
0823a87a75 glsl: Add a method to tell whether a built-in is available.
We can simply call the stored predicate function.  If state is NULL,
just report that the function is available.

v2: Add a comment (requested by Paul Berry).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:52:16 -07:00
Kenneth Graunke
d403a10573 glsl: Mark _mesa_glsl_parse_state::is_version() as const.
This promises the method won't modify the contents of the object.
This allows us to call it even with a const pointer to the state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:46:51 -07:00
Kenneth Graunke
4b0bac0dce glsl: Convert ir_function_signature::is_builtin to a method.
A signature is a built-in if and only if builtin_info != NULL, so we
don't actually need a separate flag bit.  Making a boolean-valued
method allows existing code to ask the same question while not worrying
about the internal representation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:46:51 -07:00
Kenneth Graunke
ca321d07fd glsl: Store a predicate for whether a built-in signature is available.
For the upcoming built-in function rewrite, we'll need to be able to
answer "Is this built-in function signature available?".

This is actually a somewhat complex question, since it depends on the
language version, GLSL vs. GLSL ES, enabled extensions, and the current
shader stage.

Storing such a set of constraints in a structure would be painful, so
instead we store a function pointer.  When creating a signature, we
simply point to a predicate that inspects _mesa_glsl_parse_state and
answers whether the signature is available in the current shader.

Unfortunately, IR reader doesn't actually know when built-in functions
are available, so this patch makes it lie and say that they're always
present.  This allows us to hook up the new functionality; it just won't
be useful until real data is populated.  In the meantime, the existing
profile mechanism ensures built-ins are available in the right places.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-09 11:46:50 -07:00
Kenneth Graunke
6c3db2167c i965/vec4: Only zero out unused message components when there are any.
Otherwise, coordinates with four components would result in a MOV
with a destination writemask that has no channels enabled:

mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q };

At best, this is stupid: we emit code that shouldn't do anything.
Worse, it apparently causes GPU hangs (observable with Chris's
textureGather test on CubeArrays.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
2013-09-09 11:26:53 -07:00
Paul Berry
2924b5f73b vbo: Implement new gs prim types in vbo_count_tessellated_primitives.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-09-09 09:34:46 -07:00
Ian Romanick
2937d704dc i965: Enable AMD_seamless_cubemap_per_texture
The change is very small.  Do seamless filtering if either the context
enable is set or the sampler enable is set.

The AMD_seamless_cubemap_per_texture says:

    "If TEXTURE_CUBE_MAP_SEAMLESS_ARB is emabled (sic) globally or the
    value of the texture's TEXTURE_CUBE_MAP_SEAMLESS_ARB parameter is
    TRUE, seamless cube map sampling is enabled..."

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-08 07:54:12 -07:00
Ian Romanick
4a19503516 mesa: Always use seamless cubemap filtering in GLES3
Appendix F.2 of the OpenGL ES 3.0.0 spec says:

    "OpenGL ES 3.0 requires that all cube map filtering be
    seamless. OpenGL ES 2.0 specified that a single cube map face be
    selected and used for filtering."

Setting the field only in the context will work fine with sampler
objects (and drivers that support AMD_seamless_cubemap_per_texture)
because seamless filtering is used if *either* the context or the
sampler enable it:

    "If TEXTURE_CUBE_MAP_SEAMLESS_ARB is emabled (sic) globally or the
    value of the texture's TEXTURE_CUBE_MAP_SEAMLESS_ARB parameter is
    TRUE, seamless cube map sampling is enabled..."

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reported-by: Maxence Le Dore <maxence.ledore@gmail.com>
Thanked-by: Maxence Le Dore <maxence.ledore@gmail.com>
2013-09-08 07:54:12 -07:00
Ian Romanick
e334ff43c4 mesa: Don't allow glSamplerParameteriv(GL_TEXTURE_CUBE_MAP_SEAMLESS) in ES
There is no GL_TEXTURE_CUBE_MAP_SEAMLESS in any version of OpenGL ES or
in any extension that applies to OpenGL ES.  The same error check
already occurs for glTexParameteri.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: Maxence Le Dore <maxence.ledore@gmail.com>
2013-09-08 07:54:12 -07:00
Ian Romanick
7efe55cb2d docs: initial 9.3 release notes file
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
2013-09-08 07:54:11 -07:00
Chia-I Wu
e67f99bd29 ilo: preliminary GEN 7.5 support
This is based on grepping for brw->is_haswell in i965 to see how GEN 7.5
differs from GEN 7.  Slightly tested with Xonotic and some Mesa demos.
2013-09-08 01:22:52 +08:00
Alex Deucher
18805b16c8 radeonsi: add berlin pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-06 19:27:23 -04:00
Alex Deucher
9bc47dbe50 r600g: remove DMA padding
This is now handled in the winsys.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-06 19:10:27 -04:00
Alex Deucher
a81beee37e radeon/winsys: pad IBs to a multiple of 8 DWs
This aligns the gfx, compute, and dma IBs to 8 DW boundries.
This aligns the the IB to the fetch size of the CP for optimal
performance. Additionally, r6xx hardware requires at least 4
DW alignment to avoid a hw bug.  This also aligns the DMA
IBs to 8 DW which is required for the DMA engine.  This
alignment is already handled in the gallium driver, but that
patch can be removed now that it's done in the winsys.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
2013-09-06 19:08:35 -04:00
Axel Davy
e8f9195e5f gallium, intel: Implements new __DRI_IMAGE_USE_LINEAR and PIPE_BIND_LINEAR flags to enforce no tiling.
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2013-09-06 15:02:34 -07:00
Vinson Lee
0a0f543082 mesa: Ensure gl_query_object is fully initialized.
278372b47e added the uninitialized pointer
field gl_query_object:Label. A free of this pointer resulted in a crash.

This patch fixes piglit regressions with swrast introduced by
6d8dd59cf5.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69047
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-06 14:51:51 -07:00
Zack Rusin
e9f1f6ab42 gallivm: support indirect registers on both dimensions
We support indirect addressing only on the vertex index, but some
shaders also use indirect addressing on attributes. This patch
adds support for indirect addressing on both dimensions inside
gs arrays.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-09-06 15:05:27 -04:00
Stéphane Marchesin
f9b37f7183 i915g: Document fall-through switch
Fixes warning reported by Coverity.
2013-09-06 11:05:25 -07:00
Stéphane Marchesin
519a2cf950 i915g: Handle i915->batch == NULL correctly in flush
Fixes warning reported by Coverity.
2013-09-06 11:05:24 -07:00
Stéphane Marchesin
9e14895884 i915g: Remove useless comparison
Fixes "Macro compares unsigned to 0" defect reported by Coverity.
2013-09-06 11:05:24 -07:00
Stéphane Marchesin
7125af2957 i915g: Fix initial array index
Fixes "Out-of-bounds read" defect reported by Coverity.
2013-09-06 11:05:24 -07:00
Brian Paul
ac8448dd97 mesa: add GL_KHR_debug functions to dispatch_sanity.cpp
Fixes 'make check' failures.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-06 07:53:41 -06:00
Timothy Arceri
238201158f docs: Add some notes on submitting patches
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-06 07:52:18 -06:00
Tom Stellard
505fad04f1 r600g/compute: Fix bug in compute memory pool
When adding a new buffer to the beginning of the memory pool, we were
accidentally deleting the buffer that was first in the buffer list.
This was caused by a bug in the memory pool's linked list
implementation.
2013-09-05 17:18:00 -07:00
Tom Stellard
f0435ebb07 r600g/compute: Don't flush the cs in pipe_context::launch_grid()
This is the state tracker's responsibility.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-05 17:17:43 -07:00
Matt Turner
16cedf3a25 i965: Remove never used DPA2 opcode.
DPA2 is listed in the "Defeatured Instructions" section of the
965 PRM, Volume 4:

"The following instructions are removed from Gen4 implementation mainly
 due to implementation cost/schedule reasons.  They are candidates for
 future generations."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-05 14:55:27 -07:00
Matt Turner
4a6100054c i965: Remove never used RSR and RSL opcodes.
RSR and RSL are listed in the "Defeatured Instructions" section of the
965 PRM, Volume 4:

"The following instructions are removed from Gen4 implementation mainly
 due to implementation cost/schedule reasons.  They are candidates for
 future generations."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-05 14:55:19 -07:00
Dominik Behr
0f6fce1585 glsl: propagate max_array_access through function calls
Fixes a bug where if an uniform array is passed to a function the accesses
to the array are not propagated so later all but the first vector of the
uniform array are removed in parcel_out_uniform_storage resulting in
broken shaders and out of bounds access to arrays in
brw::vec4_visitor::pack_uniform_registers.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-and-Tested-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dominik Behr <dbehr@chromium.org>
2013-09-05 14:36:11 -07:00
Ilia Mirkin
85f7df81a9 nv30: fix inconsistent setting of push->user_priv
It's set to &nv30->bufctx everywhere else.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-09-05 20:46:56 +02:00
Paul Berry
588ec545ac i965/gen7.5: Fix lower bound on number of VS URB entries.
Haswell GT2 and GT3 require the number of vertex shader URB entries to
be at least 64, not 32.

At the moment, we always meet this requirement automatically, because
in the absence of a geometry shader, we assign all available URB space
to the vertex shader.  But when we turn on support for geometry
shaders, this lower limit will become important.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-05 09:52:47 -07:00
Paul Berry
ae79e3332e i965/vs: Move vs-specific code out of brw_vec4_visitor.cpp.
This patch creates a new file brw_vec4_vs_visitor.cpp, to contain code
that is specific to the vertex shader.  Now the organization of vertex
shader and geometry shader visitor code is symmetric: vs-specific code
is in brw_vec4_vs_visitor.cpp, gs-specific code is in
brw_vec4_gs_visitor.cpp, and code shared between vs and gs is in
brw_vec4_visitor.cpp.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-05 09:52:42 -07:00
Paul Berry
e241e7c979 i965/vec4: Make with_writemask() non-static.
This will allow it to be shared between brw_vec4_visitor.cpp and
brw_vec4_vs_visitor.cpp (which will be created in the next patch).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-05 09:52:38 -07:00
Paul Berry
8f9a339c10 i965/vs: Move vs-specific code out of brw_vec4.h.
Now brw_vec4.h contains only code that is shared between the vertex
and geometry shaders.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-05 09:52:33 -07:00
Paul Berry
9dfa8ae662 i965/gs: Don't assign gl_Layer its own slot in the VUE map.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-09-05 09:52:20 -07:00
Stéphane Marchesin
8709e2b6c5 i915g: Implement writemask fixup
The fixup code emulates non-BGRA render targets by adding an
extra instruction at the end of fragment shaders to swizzle the
output. To do this, we also swizzle the blend function. However
an oversight until now was that the writemask wasn't getting
swizzled. This patch fixes that which fixes a bunch of piglit
tests.
2013-09-04 19:48:18 -07:00
Stéphane Marchesin
b1461acf15 i915g: Stop calling draw_prepare_shader_outputs
It's not useful on i915g since we don't support primid. Fixes
piglit point tests on i915g.
2013-09-04 19:48:18 -07:00
Rico Schüller
8b302e1635 glx: Initialize OpenGL version to 1.0
The old code in dri2_glx suffered from a typographical error that caused
the default version to be 2.1 instead of 1.2 (minimum required by the
Linux OpenGL ABI).  drisw_glx had a similar error resulting in a default
version of 0.1.

Some driver/card combinations (r200/RV280, i915/915G) don't support
OpenGL 2.1.  These create in some corner cases an indirect context
instead of a direct context when calling glXCreateContextAttribsARB().
This happens because of a bad default value.  To avoid this, just used
the default value specified by the GLX_ARB_create_context specification:

    "The default values for GLX_CONTEXT_MAJOR_VERSION_ARB and
    GLX_CONTEXT_MINOR_VERSION_ARB are 1 and 0 respectively. In this
    case, implementations will typically return the most recent version
    of OpenGL they support which is backwards compatible with OpenGL 1.0
    (e.g. 3.0, 3.1 + GL_ARB_compatibility, or 3.2 compatibility
    profile)"

Refactor all the default value setting to dri2_convert_glx_attribs, and
make sure the correct defaults are set in that one place.

Signed-off-by: Rico Schüller <kgbricola@web.de>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla http://bugs.winehq.org/show_bug.cgi?id=34238
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
2013-09-04 16:07:21 -07:00
Stéphane Marchesin
4e861ac4a1 i915g: Add more optimizations
This patch adds liveness analysis to i915g and a couple
optimizations which benefit from it. One interesting
optimization turns (fake) indirect texture accesses into direct
texture accesses (the i915 supports a maximum of 4 indirect
texture accesses). Among other things this fixes a bunch of
piglit tests.
2013-09-04 12:11:02 -07:00
Ian Romanick
a974b915b6 glsl: Remove unused prog parameter from tfeedback_decl::init
It looks like commit 53febac removed the last user of that parameter.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-04 08:13:11 -07:00
Ian Romanick
0851aa7365 glsl: Validate qualifiers on VS color outputs with FS color inputs
The vertex shader color outputs (gl_FrontColor, gl_BackColor,
gl_FrontSecondaryColor, and gl_BackSecondaryColor) don't have the same
names as the matching fragment shader color inputs (gl_Color and
gl_SecondaryColor).  As a result, the qualifiers on them were not being
properly cross validated.

Full spec compliance required ir_variable::used and
ir_variable::assigned be set properly.  Without the preceeding patch,
which fixes the ::clone method to copy them, this will not be the case.

Fixes all of the previously failing piglit
spec/glsl-1.30/linker/interpolation-qualifiers tests.

v2: Update callers of cross_validate_types_and_qualifiers and
cross_validate_front_and_back_color.  The function signature changed in
v2 of a previous patch.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47755
2013-09-04 08:11:45 -07:00
Ian Romanick
ceceaf53ce glsl: Copy ir_variable::assigned and ir_variable::used fields in ::clone method
Nothing currently relies on this, but one of the next patches will.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-04 08:10:01 -07:00
Ian Romanick
c0e4a4adb7 glsl: Refactor a bunch of the code out of cross_validate_outputs_to_inputs
The new function, cross_validate_types_and_qualifiers, will have
multiple callers from this file in future commits.

v2: Don't pass the names of the producer / consumer stages to
cross_validate_types_and_qualifiers.  Instead, pass the types and get
the names only in the error paths.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-04 08:08:15 -07:00
Ian Romanick
87252bf97b glsl: Reallow precision qualifiers on structure members
Changes to the grammar for GL_ARB_shading_language_420pack (commit
6eec502) moved precision qualifiers out of the type_specifier production
chain.  This caused declarations such as:

    struct S {
        lowp float f;
    };

to generate parse errors.  Section 4.1.8 (Structures) of both the GLSL
ES 1.00 spec and GLSL 1.30 specs says:

        "Member declarators may contain precision qualifiers, but may not
        contain any other qualifiers."

So, it sure seems like we shouldn't generate a parse error. :)

Instead of type_specifier, use fully_specified_type in struct members.
However, fully_specified_type allows a lot of other qualifiers that are
not allowed on structure members, so expeclitly disallow them.

Note, this makes struct_declaration look an awful lot like
member_declaration (used for interface blocks).  We may want to
(somehow) unify these rules to reduce code duplication at some point.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68753
Reported-by: Aras Pranckevicius <aras@unity3d.com>
Cc: Aras Pranckevicius <aras@unity3d.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-09-04 08:02:23 -07:00
Timothy Arceri
51a279254f mesa: Setup remaining infrastucture and enable KHR_debug
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:49 -06:00
Timothy Arceri
9405be4add glapi: Setup autogeneration infrastructure for KHR_debug
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:49 -06:00
Timothy Arceri
6964fa7ea3 mesa: Remap debug type and severity
Remap any type or severity exclusive to KHR_debug to
something suitable for ARB_debug_output

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:49 -06:00
Timothy Arceri
b5c4795f38 mesa: Implement GL_DEBUG_OUTPUT
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:49 -06:00
Timothy Arceri
a7f5eb8ebb mesa: Update builds scripts to build object labels
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:49 -06:00
Timothy Arceri
262b5ff667 mesa: Implement KHR_debug ObjectLabel functions
V3: make sure to add null terminator when setting label,
generate error when the client specifies an explicit
length that exceeds MAX_LABEL_LENGTH, set label pointer
to NULL when freed, and output correct length in
MAX_LABEL_LENGTH error message.

V2: fixed indentation of comment

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:49 -06:00
Timothy Arceri
21b5bf712b mesa: make _mesa_validate_sync() non-static
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:49 -06:00
Timothy Arceri
6d8dd59cf5 mesa: free object labels when deleting
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:48 -06:00
Timothy Arceri
278372b47e mesa: add debug Label field to several data structures
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:48 -06:00
Timothy Arceri
6faf7052a2 mesa: make _mesa_lookup_list() non-static
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:48 -06:00
Timothy Arceri
97f9f11ec4 mesa: make _mesa_lookup_arrayobj() non-static
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:48 -06:00
Timothy Arceri
797b9dc3ff mesa: Implement glPushDebugGroup and glPopDebugGroup
V4: fixes _mesa_error() compiler warnings (BrianP).

V3: removed C++ style comment

V2: fixed spelling typo in comment

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:48 -06:00
Timothy Arceri
60f435319c mesa: Add a clone function to mesa hash
V2: const qualify table parameter

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:48 -06:00
Timothy Arceri
f5badf4671 mesa: Share common code between ARB_debug_output and KHR_debug functions
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:48 -06:00
Timothy Arceri
77d38fd3fb mesa: Add some constants and state variables for KHR_debug functions
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:48 -06:00
Kenneth Graunke
644fbbd3eb mesa: Rename gl_context::swtnl_im to vbo_context; use proper type.
The main GL context's swtnl_im field is the VBO module's vbo_context
structure.  Using the name "swtnl" in the name is confusing since
some drivers use hardware texturing and lighting, but still rely on the
VBO module for drawing.

v2: Forward declare the type and use that instead of void *
    (suggested by Eric Anholt).
v3: Remove unnecessary cast (pointed out by by Topi Pohjolainen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-03 11:30:15 -07:00
Kenneth Graunke
6e143af66d i965: Rename "prim" parameter to "prims" where it's an array.
Some drawing functions take a single _mesa_prim object, while others
take an array of primitives.  Both kinds of functions used a parameter
called "prim" (the singular form), which was confusing.

Using the plural form, "prims," clearly communicates that the parameter
is an array of primitives.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-03 11:29:33 -07:00
Kenneth Graunke
9f7d5870a3 i965: Actually check every primitive for cut index support.
can_cut_index_handle_prims() was passed an array of _mesa_prim objects
and a count, and ran a loop for that many iterations.  However, it
treated the array like a pointer, repeatedly checking the first element.

This patch makes it actually check every primitive.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-03 11:29:09 -07:00
Michel Dänzer
6b5c802c30 radeonsi: Don't save/restore FMASK sampler view states for u_blitter
Fixes assertion failues in 24 piglit tests with
MESA_GL_VERSION_OVERRIDE=3.0, 12 of which are now passing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-02 17:25:27 +02:00
Michel Dänzer
9933b85e12 radeonsi: Expose pure integer vertex formats
Fixes 20 piglit tests with MESA_GL_VERSION_OVERRIDE=3.0.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-02 17:25:27 +02:00
Maarten Lankhorst
ad4dc77231 nvc0: restore viewport after blit
Based on calim's original fix in the nine branch.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
2013-09-02 17:09:21 +02:00
Christian König
3e81b8eedd radeon/uvd: save the aligned width & height
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=68845

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-09-02 15:42:13 +02:00
Chia-I Wu
da33347131 glx: make the interval of LIBGL_SHOW_FPS adjustable
LIBGL_SHOW_FPS=1 makes GLX print FPS every second while other values do
nothing.  Extend it so that LIBGL_SHOW_FPS=N will print the FPS every N
seconds.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-09-02 11:42:58 +08:00
Kenneth Graunke
b8211ab3ed i965: Use the proper element of the prim array in brw_try_draw_prims.
The VBO module actually calls us with an array of _mesa_prim objects.
For example, it may break up a DrawArrays() call into multiple
primitives when primitive restart is enabled.

Previously, we treated prim like a pointer, always accessing element 0.
This worked because all of the primitive objects in a single draw call
have the same value for num_instances and basevertex.

However, accessing an array as a pointer and using the wrong object's
fields is misleading.  For stylistic reasons alone, we should use the
right object.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-01 18:54:39 -07:00
Kenneth Graunke
976d1d6665 i965: Combine brw_emit_prim and gen7_emit_prim.
These functions have almost identical code; the only difference is that
a few of the bits moved around.  Adding a few trivial conditionals
allows the same function to work on all generations, and the resulting
code is still quite readable.

v2: Comment that the workaround flush is only necessary on SNB
    (requested by Paul Berry).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-01 18:54:37 -07:00
Kenneth Graunke
a3335417e3 i965: Remove unused ATTRIB_BIT_DWORDS define.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-09-01 18:53:55 -07:00
Christoph Bumiller
7fe159ba74 nvc0: delete compute object on screen destruction
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-09-01 20:57:15 +02:00
Joakim Sindholt
2a7762bdb6 nvc0: fix blitctx memory leak
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
2013-09-01 20:56:23 +02:00
Christoph Bumiller
1048d89907 nvc0: don't use bufctx in nvc0_cb_push
Too many calls into libdrm when a single one is enough.
2013-09-01 20:53:11 +02:00
Christoph Bumiller
528a48ee8d nvc0: clear the flushed flag 2013-09-01 20:52:27 +02:00
Christoph Bumiller
5399206056 nvc0/ir: add f32 long immediate cannot saturate
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-09-01 20:51:56 +02:00
Tiziano Bacocco
7086636358 nvc0/ir: fix use after free in texture barrier insertion pass
Fixes crash with Amnesia: The Dark Descent.

Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
2013-09-01 20:51:39 +02:00
Ilia Mirkin
3282697621 nv30: find first unused texcoord rather than bailing if first is used
This fixes shaders produced by supertuxkart.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-09-01 20:38:21 +02:00
Emil Velikov
dc10251d08 nouveau: initialise the nouveau_transfer maps
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-09-01 20:38:07 +02:00
Chris Forbes
f35dea05b1 i965/fs: Gen4: Zero out extra coordinates when using shadow compare
Fixes broken rendering if these MRFs contained anything other than zero.

NOTE: This is a candidate for stable branches.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-09-01 19:50:59 +12:00
Paul Berry
4cc692e355 i965/gs: Implement support for geometry shader samplers.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:13:10 -07:00
Paul Berry
89563489ff i965/gs: add geometry shader support to brw_texture_surfaces.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:13:07 -07:00
Paul Berry
08d8ff0965 i965/gs: generalize brw_texture_surfaces in preparation for gs.
There is a slight functionality change.  Previously we would compute a
common value for num_samplers for all stages, and populate that many
entries in each stage's surf_offset table regardless of how many
samplers each stage used.  Now we only populate the number of entries
in the surf_offset table corresponding to the number of samplers
actually used by the stage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:13:04 -07:00
Paul Berry
5a8033f142 i965: Modify signature to update_texture_surface functions.
Previously these functions would accept a pointer to the binding table
and an index indicating which entry in the binding table should be
updated.  Now they merely take a pointer to the binding table entry to
be updated.

This will make it easier to generalize brw_texture_surfaces to support
geometry shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:12:53 -07:00
Paul Berry
f560ce4a38 i965/vs: generalize gen6_vs_push_constants in preparation for GS.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:12:43 -07:00
Paul Berry
4ec2604422 i965/gs: make the state atom for compiling Gen7 geometry shaders.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Use "unsigned" rather than "GLuint".
2013-08-31 17:12:33 -07:00
Paul Berry
130f0f78be i965/gs: Implement support for geometry shader surfaces.
This patch implements pull constant upload, binding table upload, and
surface setup for geometry shaders, by re-using vertex shader code
that was generalized in previous patches.

Based on work by Eric Anholt <eric@anholt.net>.

v2: Update ditry bits for brw_gs_ubo_surfaces to account for commit
77d8fbc (mesa: add & use a new driver flag for UBO updates instead of
_NEW_BUFFER_OBJECT).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:12:21 -07:00
Paul Berry
f986222754 i965/vs: generalize brw_vs_binding_table in preparation for GS.
v2: Use GLbitfield instead of GLbitfield64 in
brw_vec4_upload_binding_table.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:12:15 -07:00
Paul Berry
1b19f2c576 i965: generalize brw_vs_pull_constants in preparation for GS.
v2: Use GLbitfield instead of GLbitfield64 in
brw_upload_vec4_pull_constants.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:12:09 -07:00
Paul Berry
555f9cf46d i965: Make sure constants re-sent after constant buffer reallocation.
The hardware requires that after constant buffers for a stage are
allocated using a 3DSTATE_PUSH_CONSTANT_ALLOC_{VS,HS,DS,GS,PS}
command, and prior to execution of a 3DPRIMITIVE, the corresponding
stage's constant buffers must be reprogrammed using a
3DSTATE_CONSTANT_{VS,HS,DS,GS,PS} command.

Previously we didn't need to worry about this, because we only
programmed 3DSTATE_PUSH_CONSTANT_ALLOC_{VS,HS,DS,GS,PS} once on
startup (or, previous to that, whenever BRW_NEW_CONTEXT was flagged).
But now that we reallocate the constant buffers whenever geometry
shaders are switched on and off, we need to make sure the constant
buffers are reprogrammed.

We do this by adding a new bit, BRW_NEW_PUSH_CONSTANT_ALLOCATION, to
brw->state.dirty.brw.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:11:59 -07:00
Paul Berry
27eecefc67 i965/gs: Allocate push constant space for use by GS.
Previously, we would always use the same push constant allocation
regardless of what shader programs were being run: the available push
constant space was split into 2 equal size partitions, one for the
vertex shader, and one for the fragment shader.

Now that we are adding geometry shader support, we need to do
something smarter.  This patch adjusts things so that when a geometry
shader is in use, we split the available push constant space into 3
nearly-equal size partitions instead of 2.

Since the push constant allocation is now affected by GL state, it can
no longer be set up by brw_upload_initial_gpu_state(); instead it must
be set up by a state atom.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:11:49 -07:00
Paul Berry
df62421382 i965/gen7: Emit CS stall after 3DSTATE_PUSH_CONSTANT_ALLOC_PS.
This is required by the internal hardware docs and the PRM.  Probably
the reason we were getting away with not doing it was because we only
emitted 3DSTATE_PUSH_CONSTANT_ALLOC_PS during startup.  However that's
going to change with the introduction of geometry shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:11:46 -07:00
Paul Berry
fffba41c68 i965/gs: Allocate URB space for use by GS.
Previously, we gave all of the URB space (other than the small amount
that is used for push constants) to the vertex shader.  However, when
a geometry shader is active, we need to divide it up between the
vertex and geometry shaders.

The size of the URB entries for the vertex and geometry shaders can
vary dramatically from one shader to the next.  So it doesn't make
sense to simply split the available space in two.  In particular:

- On Ivy Bridge GT1, this would not leave enough space for the worst
  case geometry shader, which requires 64k of URB space.

- Due to hardware-imposed limits on the maximum number of URB entries,
  sometimes a given shader stage will only be capable of using a small
  amount of URB space.  When this happens, it may make sense to
  allocate substantially less than half of the available space to that
  stage.

Our algorithm for dividing space between the two stages is to first
compute (a) the minimum amount of URB space that each stage needs in
order to function properly, and (b) the amount of additional URB space
that each stage "wants" (i.e. that it would be capable of making use
of).  If the total amount of space available is not enough to satisfy
needs + wants, then each stage's "wants" amount is scaled back by the
same factor in order to fit.

When only a vertex shader is active, this algorithm produces
equivalent results to the old algorithm (if the vertex shader stage
can make use of all the available URB space, we assign all the space
to it; if it can't, we let it use as much as it can).

In the future, when we need to support tessellation control and
tessellation evaluation pipeline stages, it should be straightforward
to expand this algorithm to cover them.

v2: Use "unsigned" rather than "GLuint".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-31 17:11:35 -07:00
Paul Berry
53f6e79633 i965: Make CACHE_NEW_GS_PROG.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-31 17:11:25 -07:00
Paul Berry
a702f6325c i965/gs: Create brw_context::gs structure to track GS program state.
v2: Change name from "vec4_gs" to simply "gs".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-31 17:11:15 -07:00
Paul Berry
ec94e3c3d0 i965: Move data from brw->vs into a base class if gs will also need it.
This paves the way for sharing the code that will set up the vertex
and geometry shader pipeline state.

v2: Rename the base class to brw_stage_state.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-31 17:11:05 -07:00
Paul Berry
cdf03b6928 i965/gs: Update defines related to GS surface organization.
Defines that previously referred to VS now refer to VEC4, since they
will be shared by the user-programmable vertex shader and geometry
shader stages.

Defines that previously referred to the Gen6 geometry shader stage
(which is only used for transform feedback) are now renamed to
explicitly refer to Gen6, to avoid confusion with the Gen7
user-programmable geometry shader stage.

Based on work by Eric Anholt <eric@anholt.net>.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-31 17:10:54 -07:00
Paul Berry
b3a4d5c785 i965: Move vec4 register allocation data structures to brw->vec4.
This will avoid confusion when we add geometry shaders, since these
data structures will be shared by vertex and geometry shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-31 17:10:44 -07:00
Paul Berry
56a2e57bdb i965: Rename user-defined gs structs from vec4_gs to gs.
Now that the name "gs" is no longer used to refer to the legacy fixed
function geometry shaders, we can use it to refer to user-defined
geometry shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-31 17:10:34 -07:00
Paul Berry
32e16e2337 i965: rename legacy gs structs and functions to ff_gs.
"ff" is for "fixed function".  This frees up the name "gs" to refer to
user-defined geometry shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-31 17:10:15 -07:00
Marek Olšák
a77ee8b548 radeonsi: simplify and improve flushing
This mimics r600g. The R600_CONTEXT_xxx flags are added to rctx->b.flags
and si_emit_cache_flush emits the packets. That's it. The shared radeon code
tells us when the streamout cache should be flushed, so we have to check
the flags anyway.

There is a new atom "cache_flush", because caches must be flushed *after*
resource descriptors are changed in memory.

Functional changes:

* Write caches are flushed at the end of CS and read caches are flushed
  at its beginning.

* Sampler view states are removed from si_state, they only held the flush
  flags.

* Everytime a shader is changed, the I cache is flushed. Is this needed?
  Due to a hw bug, this also flushes the K cache.

* The WRITE_DATA packet is changed to use TC, which fixes a rendering issue
  in openarena. I'm not sure how TC interacts with CP DMA, but for now it
  seems to work better than any other solution I tried. (BTW CIK allows us
  to use TC for CP DMA.)

* Flush the K cache instead of the texture cache when updating resource
  descriptors (due to a hw bug, this also flushes the I cache).
  I think the K cache flush is correct here, but I'm not sure if the texture
  cache should be flushed too (probably not considering we use TC
  for WRITE_DATA, but we don't use TC for CP DMA).

* The number of resource contexts is decreased to 16. With all of these cache
  changes, 4 doesn't work, but 8 works, which suggests I'm actually doing
  the right thing here and the pipeline isn't drained during flushes.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-31 01:34:30 +02:00
Marek Olšák
aa5c40f97c radeonsi: convert constant buffers to si_descriptors
There is a new "class" si_buffer_resources, which should be good enough for
implementing any kind of buffer bindings (constant buffers, vertex buffers,
streamout buffers, shader storage buffers, etc.)

I don't even keep a copy of pipe_constant_buffer - we don't need it.

The main motivation behind this is to have a well-tested infrastrusture
for setting up streamout buffers.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-31 01:34:30 +02:00
Marek Olšák
a81c3e00fe radeonsi: use r600_common_context, r600_common_screen, r600_resource
Also r600_hw_context_priv.h and si_state_streamout.c are removed, because
they are no longer needed.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-31 01:34:30 +02:00
Marek Olšák
d5b23dfc1c r600g: move streamout state to drivers/radeon
This streamout state code will be used by radeonsi.

There are new structures r600_common_context and r600_common_screen.
What is inherited by what is shown here:

pipe_context -> r600_common_context -> r600_context
pipe_screen -> r600_common_screen -> r600_screen

The common structures reside in drivers/radeon. Currently they only contain
enough functionality to be able to handle streamout. Eventually I'd like
the whole pipe_screen implementation to be shared and some of the context
stuff too.

This is quite big, but most changes are because of the new structures and
the fact r600_write_value is replaced by radeon_emit.

Thanks to Tom Stellard for fixing the build for r600g/compute.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-31 01:34:30 +02:00
Marek Olšák
13a1a8b877 radeonsi: cleanup initialization of SGPR shader parameters
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-31 01:34:29 +02:00
Marek Olšák
d698f19cba r600g,radeonsi: remove unused variables
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-31 01:34:29 +02:00
Marek Olšák
89a665eb5f draw: fix segfaults with aaline and aapoint stages disabled
There are drivers not using these optional stages.

Broken by a3ae5dc7dd.

Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-31 01:34:29 +02:00
Kenneth Graunke
a35b320250 i965/fs: Detect GRF sources in split_virtual_grfs send-from-GRF code.
It is incorrect to assume that src[0] of a SEND-from-GRF opcode is the
GRF.  For example, FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD uses src[1] for
the GRF.

To be safe, loop over all the source registers and mark any GRFs.  We
probably won't ever have more than one, but it's simpler to just check
all three rather than attempting to bail early.

Not observed to fix anything yet, but likely to.  Parallels the bug fix
in the previous commit, which actually does fix known failures.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: mesa-stable@lists.freedesktop.org
2013-08-30 15:49:31 -07:00
Kenneth Graunke
4e3d1712a2 i965/vs: Detect GRF sources in split_virtual_grfs send-from-GRF code.
It is incorrect to assume that src[0] of a SEND-from-GRF opcode is the GRF.
VS_OPCODE_PULL_CONSTANT_LOAD_GEN7 uses an IMM as src[0], and stores the
GRF as src[1].

To be safe, loop over all the source registers and mark any GRFs.  We
probably won't ever have more than one, but it's simpler to just check
all three rather than attempting to bail early.

Fixes assertion failures in Unigine Sanctuary since we started making
register allocation rely on split_virtual_grfs working.  (The register
classes were actually sufficient, we were just interpreting an IMM as
a virtual GRF number.)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68637
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: mesa-stable@lists.freedesktop.org
2013-08-30 15:49:31 -07:00
Niels Ole Salscheider
217d2f7359 radeonsi: Do not suspend timer queries
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-08-30 23:30:00 +02:00
Roland Scheidegger
431e60625b draw: fix PIPE_MAX_SAMPLER/PIPE_MAX_SHADER_SAMPLER_VIEWS issues
pstipple/aaline stages used PIPE_MAX_SAMPLER instead of
PIPE_MAX_SHADER_SAMPLER_VIEWS when dealing with sampler views.
Now these stages can't actually handle sampler_unit != texture_unit anyway
(they cannot work with d3d10 shaders at all due to using tex not sample
opcodes as "mixed mode" shaders are impossible) but this leads to crashes if
a driver just installs these stages and then more than PIPE_MAX_SAMPLER views
are set even if the stages aren't even used.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-30 23:20:04 +02:00
Roland Scheidegger
f37edb5e20 gallivm: handle unbound textures in texture sampling / texture queries
Turns out we don't need to do much extra work for detecting this case,
since we are guaranteed to get a empty static texture state in this case,
hence just rely on format being 0 and return all zero then.
Previously needed dummy textures (would just have crashed on format being 0
otherwise) which cannot return the correct result for size queries and when
sampling textures with wrap modes using border.
As a bonus should hugely increase performance when sampling unbound textures -
too bad it isn't a useful feature :-).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-30 23:20:03 +02:00
Roland Scheidegger
bb7dc1b2f6 softpipe: handle NULL sampler views for texture sampling / queries
Instead of crashing just return all zero.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-30 23:20:03 +02:00
Roland Scheidegger
81ab3e57bc softpipe: check if so_target is NULL before accessing it
No idea if this is working right but copied straight from llvmpipe.
(Not only does this check the so_target but also use buffer->data instead
of buffer for the mapping.)
Just trying to get rid of a segfault testing something else...

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-30 23:20:03 +02:00
Roland Scheidegger
289faa7e23 gallivm: (trivial) don't pass sampler_unit variable down to filtering funcs
The only reason this was needed was because the fetch texel function had to
get the (dynamic) border color, but this is now done much earlier.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-30 23:20:03 +02:00
Roland Scheidegger
61add3cc3c gallivm: don't use AoS path if min/mag filter are different with multiple lods
Instead of enhancing the AoS path so it can deal with it, just use SoA. Fixing
AoS path wouldn't be all that difficult (use all the same logic as SoA) but
considered not worth it for now.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-30 23:20:03 +02:00
Eric Anholt
bdf3f50e9a mesa: Don't choose S3TC for generic compression if we can't compress.
If the app is asking us to do GL_COMPRESSED_RGBA, then the app obviously
doesn't have pre-compressed data to hand us.  So don't choose a storage
format that we won't actually be able to compress and store.

Fixes black screen in warzone2100 when libtxc_dxtn is not present.  Also
66 piglit tests.

NOTE: This is a candidate for the 9.2 branch.
Reported-by: Paul Wise <pabs@debian.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-30 11:49:09 -07:00
Eric Anholt
b188467fdf mesa: Rip out more extension checking from texformat.c.
You should only be flagging the formats as supported if you support them
anyway.

NOTE: This is a candidate for the 9.2 branch. (required for next commit)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-30 11:49:07 -07:00
Eric Anholt
b1080cfbdb i965: Switch gen4-6 to using the sampler's base level for GL BASE_LEVEL.
Thanks to Ken for trawling through my neglected public branches and
finding the bug in this change (inside a megacommit) that made me abandon
this work.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-30 11:30:45 -07:00
Eric Anholt
f217791ee2 i965/gen7: Use the base_level field of the sampler to handle GL's BASE_LEVEL.
This avoids the need to get the inter- and intra-tile offset and adjust
our miptree info based on them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-30 11:30:45 -07:00
Eric Anholt
2e2445fa7e i965: Add missing state reset at the end of blorp.
These are things that happen to be occurring because of the batch flush at
the start of the blorp op (which exists to prevent batch space or aperture
space overflow), but the intention was for this sequence of state resets at
the end of blorp to be everything necessary for the next draw call.

Found when debugging the next commit, by comparing brw_new_batch() and
intel_batchbuffer_reset() to brw_blorp_exec().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-30 11:30:44 -07:00
Eric Anholt
85aff83f3e i965: Drop extra flush when calling intel_miptree_map_raw().
The code that got replaced with map_raw didn't do the flush, but now
map_raw() is responsible for it and we don't have to worry about it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-30 11:30:44 -07:00
Eric Anholt
535fbf286c i965: Make a slight distinction in perf debug for BOs versus miptrees.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-30 11:30:44 -07:00
Eric Anholt
7801a8cc89 intel: Reuse intel_glFlush().
v2 (Kenneth Graunke): Rebase on latest master.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-30 11:30:44 -07:00
Eric Anholt
313f2bc32b intel: Add support for the new flush_with_flags extension.
This gives us more information about why we're flushing that we can
use for handling our throttling.

v2 (Kenneth Graunke): Rebase on latest master, add missing
   FLUSH_VERTICES and FLUSH_CURRENT, which fixes a regression in Glean's
   polygonOffset test.
v3 (anholt): Drop FLUSH_CURRENT -- FLUSH_VERTICES is what we need, which
   is "get any queued prims out of VBO and into the driver", not "update
   ctx->Current so we can read it with the CPU."  Also drop batch->used
   check, which intel_batchbuffer_flush() does anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-30 11:30:44 -07:00
Eric Anholt
bbdc83bca9 intel: Add a batch flush between front-buffer downsample and X protocol.
This was already happening because blorp happens to flush at the end of
every call, but we have been talking about removing that at some point,
and this would surely get overlooked.

v2 (Kenneth Graunke): Rebase on latest master.  Note that we did remove
   the other flush, and this change actually did get overlooked!

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-30 11:30:44 -07:00
Eric Anholt
6404fcb266 i965: Directly call intel_batchbuffer_flush() after i915 split.
intel_flush() now did nothing except call through (and
intel_batchbuffer_flush() does the no-op check, too!)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-30 11:30:44 -07:00
Eric Anholt
09e2df5961 i965/vs: Fix regression on pre-gen6 with no VS uniforms in use.
df06745c5a made it so that we didn't
allocate extra uniform space for unused clip planes, which also
incidentally made us not allocate any space at all, which we were relying
on for this no-uniforms case.  Instead of putting the knowledge of this
special HW exception into the thing that normally preallocates prog_data
for us, just allocate it here.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68766
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-30 11:29:50 -07:00
Vadim Girlin
f7217b99f2 r600g: enable SB backend by default
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-08-30 15:51:11 +04:00
Vadim Girlin
29ff2e907d r600g: fix color exports when we have no CBs
We need to export at least one color if the shader writes it,
even when nr_cbufs==0.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-08-30 15:51:11 +04:00
Vinson Lee
74be77a99e nvc0/ir: Initialize NVC0LegalizePostRA member variables.
Fixes "Uninitialized pointer field" defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-08-29 20:42:24 -07:00
Roland Scheidegger
a479f34025 gallivm: support per-pixel min/mag filter in SoA path
Since we can have per-pixel lod we should also honor the filter per-pixel
(in fact we didn't honor it per quad neither in the multiple quad case).
Do this by running the linear path and simply beating the weights into shape
(the sample with the higher weight is the one which should have been chosen
with nearest filtering hence adjust filter weight to 1.0/0.0 based on that).
If all pixels use nearest filter (either min and mag) then still run just a
nearest filter as this is way cheaper (probably around 4 times faster for 2d,
more for 3d case) and it should be relatively rare that pixels really need
different filtering. OTOH if all pixels would require linear don't do anything
special since the linear path with filter adjustments shouldn't really be all
that much more expensive than ordinary linear, and we think it's rare that
min/mag filters are configured differently so there doesn't seem much value
in trying to optimize this further.
This does not yet fix the AoS path (though currently AoS is only used for
single quads hence it could be considered less broken, just never honoring
per-pixel filter decision but doing it per quad).

v2: simplify code a bit (unify min linear and min nearest cases)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-30 02:16:45 +02:00
Roland Scheidegger
81cfcdbd87 gallivm: don't calculate square root of rho if we use accurate rho method
While a sqrt here and there shouldn't hurt much (depending on the cpu) it is
possible to completely omit it since rho is only used for calculating lod and
there log2(x) == 0.5*log2(x^2). Depending on the exact path taken for
calculating lod this means we get a simple mul instead of sqrt (in case of
nearest mip filter in fact we don't need to replace the sqrt with something
else at all), only in some not very useful path this doesn't work (combined
brilinear calculation of int level and fractional lod, accurate rho calc but
brilinear filtering seems odd).
Apart from being faster as an added bonus this should increase our crappy
fractional accuracy of lod, since fast_log2 is only good for ~3bits and this
should increase accuracy by one bit (though not used if dimension is just one
as we'd need an extra mul there as we never had the squared rho in the first
place).

v2: use separate ilog2_sqrt function if we have squared rho.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-30 02:16:45 +02:00
Roland Scheidegger
10e40ad11d gallivm: refactor num_lods handling
This is just preparation for per-pixel (or per-quad in case of multiple quads)
min/mag filter since some assumptions about number of miplevels being equal
to number of lods no longer holds true.
This change does not change behavior yet (though theoretically when forcing
per-element path it might be slower with different min/mag filter since the
code will respect this setting even when there's no mip maps now in this case,
so some lod calcs will be done per-element just ultimately still the same
filter used for all pixels).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-30 02:16:45 +02:00
Vinson Lee
4a6d2f3dd7 radeonsi: Early return if no depth or stencil on release builds.
Fixes "Missing break in switch" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-08-29 15:49:12 -07:00
Rob Clark
de10d383d0 freedreno: pipe loader for either kgsl or msm
The downstream android kernel driver is "kgsl", the upstream drm/kms
driver is called "msm".  Since libdrm_freedreno handles the differences
between the two, we need to load the same thing for either device.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-29 17:35:05 -04:00
Rob Clark
e95b7d89b9 freedreno: updates for msm drm/kms driver
There where some small API tweaks in libdrm_freedreno to enable support
for msm drm/kms driver.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-29 17:35:05 -04:00
Rob Clark
0267f264cc freedreno/a3xx/compiler: handle sync flags better
We need to set the flag on all the .xyzw components that are written by
the instruction, not just on .x.  Otherwise a later use of rN.y (for
example) will not trigger the appropriate sync bit to be set.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-29 17:35:04 -04:00
Rob Clark
4a2b5b2384 freedreno/a3xx/compiler: better const handling
Seems like most/all instructions have some restrictions about const src
registers.  In seems like the 2 src (cat2) instructions can take at most
one const, and the 3 src (cat3) instructions can take at most one const
in the first 2 arguments.  And so on.  Handle this properly now.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-29 17:35:04 -04:00
Anuj Phogat
9c0b7be964 glsl: Allow precision qualifiers for sampler types
GLSL 1.30 doesn't allow precision qualifiers on sampler types,
but in GLSL ES, sampler types are also allowed. This seems like
an oversight (since the intention of including these in GLSL 1.30
is to allow compatibility with ES shaders).

Currently, Mesa allows "default" precision qualifiers to be set for
sampler types in GLSL (commit d5948f2). This patch makes it follow
GLSL ES rules and also allow declaring sampler variables with a
precision qualifier in GLSL 1.30 (and later). e.g.
uniform lowp sampler2D sampler;

This fixes a shader compilation error in Khronos OpenGL conformance
test "depth_texture_mipmap".

V2: Update comments.
Signed-off-by: Ian Romanick <idr@lists.freedesktop.org>

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@lists.freedesktop.org>
Cc: <mesa-stable@lists.freedesktop.org>
2013-08-29 12:10:57 -07:00
Matt Turner
1ecfdba98a glsl: Add heuristics to print floating-point numbers better.
v2: Fix *.expected files to match.
Reviewed-by: Paul Berry <strereotype441@gmail.com>
2013-08-29 12:07:28 -07:00
Jonathan Gray
57cf5946ce radeonsi: Make sure libdrm_radeon headers are picked up from the right place
And remove libdrm/ from a winsys include statement.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2013-08-29 15:37:44 +02:00
Brian Paul
4e7f1346ae draw: fix point/line/triangle determination in draw_need_pipeline()
The previous point/line/triangle() functions didn't handle GS primitives.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-08-29 07:29:31 -06:00
Christian König
aebd065a64 radeon/uvd: fix MPEG2/4 ref frame index limit
Otherwise the first few frames have an incorrect reference index.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-08-29 08:51:12 +02:00
Vinson Lee
57684d52e9 nouveau: Copy m4x4 and m8x8 separately.
Silences Coverity "Out-of-bounds access" defect.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-08-28 23:23:49 -07:00
Kenneth Graunke
df06745c5a i965: Allocate just enough space for user clip planes in uniform arrays.
Previously, we allocated space in brw_vs_prog_data's params and
pull_params arrays for MAX_CLIP_PLANES vec4s---even when it wasn't
necessary.

On a 64-bit architecture, this used 0.5 kB of space (8 clip planes *
4 floats per plane * 8 bytes per float pointer * 2 arrays of pointers =
512 bytes).  Since this cost was per-vertex shader, it added up.

Conveniently, we already store the number of clip plane constants in the
program key.  By using that, we can allocate the exact amount of space
needed.  For the common case where user clipping is disabled, this means
0 bytes.

While we're here, mention exactly what code requires this extra space,
since it wasn't obvious.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-28 14:12:48 -07:00
Chad Versace
72b3c6c96f i965: Silence unused variable warning in release build
Use `(void) success;` to silence this warning:

  i965/brw_vs.c:481:12:
  warning: unused variable 'success' [-Wunused-variable]
         bool success = do_vs_prog(brw, ctx->Shader.CurrentVertexProgram,

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-28 10:42:51 -07:00
Brian Paul
031c3393a1 docs: minor fixes for 9.2 release notes
Fix incorrect </li> tag, fix language.
(cherry picked from commit 2377205bcb)
2013-08-27 18:59:05 -06:00
Ian Romanick
e496583975 docs: Add news item for 9.2 release
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-27 16:38:57 -07:00
Ian Romanick
9f2608bc46 docs: Import 9.2 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-27 16:38:57 -07:00
Fabian Bieler
cd18269705 mesa/main: Check for 0 size draws after validation.
When validating draw parameters move check for 0 draw count last
(drawing with count 0 is not an error), so that other parameters (e.g.: the
primitive type) are validated and the correct errors (if applicable) are
generated.

>From the OpenGL 3.3 spec page 33 (page 48 of the PDF):
"[Regarding DrawArraysOneInstance, in terms of which other draw operations
are defined:]
If count is negative, an INVALID_VALUE error is generated."

This patch also changes the bahavior of MultiDrawElements to perform the draw
operation if some primitive's index counts are zero.

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-27 15:11:52 -07:00
Matt Turner
ac74de3710 glsl: Add built-ins from ARB_shader_bit_encoding to ARB_gpu_shader5.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-27 15:06:16 -07:00
Matt Turner
4929be0b5f i965/vs: Add support for translating ir_triop_fma into MAD.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-27 15:03:30 -07:00
Matt Turner
530842127e i965/fs: Add support for translating ir_triop_fma into MAD.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-27 15:03:30 -07:00
Matt Turner
e817b94a2c i965/fs: Assert that ir_expressions are usable by 3-src instructions.
MAD will be generated directly from ir_triop_fma, so this assertion
checks that all ir_expressions are usable.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-27 15:03:30 -07:00
Matt Turner
d55c543c36 glsl: Add support for new fma built-in in ARB_gpu_shader5.
v2: Add constant folding support.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-27 15:03:30 -07:00
Matt Turner
6829c18609 glsl: Add new fma built-in IR and prototype from ARB_gpu_shader5.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-27 15:03:30 -07:00
Marek Olšák
adb93e3bda r300g: enable MSAA on r300-r400, be careful about using color compression
MSAA was tested by one user on RS690 and it works for him with color
compression (CMASK) disabled. Our theory is that his chipset lacks CMASK RAM.

Since we don't have hardware documentation about which chipsets actually have
CMASK RAM, I had to take a guess based on the presence of HiZ.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-27 23:18:54 +02:00
Fabio Pedretti
aa3905423e configure.ac: Bump Wayland requirement to 1.2.0
Since 8d29b52 wayland 1.2.0 is required.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-27 08:40:40 -07:00
Roland Scheidegger
bd3909f265 draw: clean up setting stream out information a bit
In particular noone is interested in the vertex count, so drop that,
and also drop the duplicated num_primitives_generated /
so.primitives_storage_needed variables in drivers. I am unable for now to figure
out if primitives_storage_needed in SO stats (used for d3d10) should
increase if SO is disabled, though the equivalent num_primitives_generated
used for OpenGL definitely should increase. In any case we were only counting
when SO is active both in softpipe and llvmpipe anyway so don't pretend there's
an independent num_primitives_generated counter which would count always.
(This means the PIPE_QUERY_PRIMITIVES_GENERATED count will still be wrong just
as before, should eventually fix this by doing either separate counting for this
query or adjust the code so it always counts this even if SO is inactive depending
on what's correct for d3d10.)

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-27 16:59:39 +02:00
Roland Scheidegger
aff2ecf09a llvmpipe: support nested/overlapping queries for all query types
There's just no way resetting the counters is working with nested/overlapping
queries.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-27 16:59:01 +02:00
Roland Scheidegger
4900e625bd softpipe: support nested/overlapping queries for all query types
There's just no way resetting the counters is working with nested/overlapping
queries.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-27 16:58:20 +02:00
Matt Turner
d8ac987f6a glsl: Disallow uniform block layout qualifiers on non-uniform block vars.
Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68460
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-26 23:19:14 -07:00
Kristian Lehmann
cec7b5c5bc Fixed and/or order mistake, resulting in compiling llvmpipe without llvm installed
Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68544
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-26 22:13:45 -07:00
Ian Romanick
d127a0343d i915: Optimize SEQ and SNE when two operands are uniforms
SEQ and SNE are not native i915 instructions, so they each generate at
least 3 instructions.  If both operands are uniforms or constants, we
get 5 instructions like:

                U[1] = MOV CONST[1]
                U[0].xyz = SGE CONST[0].xxxx, U[1]
                U[1] = MOV CONST[1].-x-y-z-w
                R[0].xyz = SGE CONST[0].-x-x-x-x, U[1]
                R[0].xyz = MUL R[0], U[0]

This code is stupid.  Instead of having the individual calls to
i915_emit_arith generate the moves to utemps, do it in the caller.  This
results in code like:

                U[1] = MOV CONST[1]
                U[0].xyz = SGE CONST[0].xxxx, U[1]
                R[0].xyz = SGE CONST[0].-x-x-x-x, U[1].-x-y-z-w
                R[0].xyz = MUL R[0], U[0]

This allows fs-temp-array-mat2-index-col-wr and
fs-temp-array-mat2-index-row-wr to fit in hardware limits (instead of
falling back to software rasterization).

NOTE: Without pending patches to the piglit tests, these tests will now
fail.  This is an unrelated, pre-existing issue.

v2: Copy most of the body of the commit message into comments in the
code.  Suggested by Eric.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-08-26 22:11:26 -07:00
Tom Stellard
f3e86d4a68 clover: Don't use PIPE_TRANSFER_UNSYNCHRONIZED for blocking copies
CC: "9.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-08-26 18:27:03 -07:00
Niels Ole Salscheider
ef6ed7220a st/clover: Add event to deps even if it has been triggered
The command is submitted once the event has been triggered, but it might not
have completed yet. Therefore, we have to add it to deps in order to wait on it.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-08-26 18:25:17 -07:00
Niels Ole Salscheider
4a3505d548 st/clover: Profiling support
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Acked-by: Francisco Jerez <currojerez@riseup.net>
2013-08-26 18:25:17 -07:00
Dave Airlie
4763a032a0 tgsi_build: fix order of arguments for ind register build
This was broken when arrayid was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-08-27 10:41:27 +10:00
Dave Airlie
81204d0e9c tgsi: finish declaration parsing for arrays.
I previously fixed this partly in 9e8400f4c9,
however I didn't go far enough in testing it, now when I parse a TGSI shader
with arrays in it my iterator can see the ArrayID set to the proper value.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-08-27 10:41:09 +10:00
Brian Paul
92cbfded6a svga: replace 0 with PIPE_OK in a few places 2013-08-26 15:49:16 -06:00
Brian Paul
5e7ac28ebf swrast: init i0, i1 values to silence warnings
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-26 12:52:06 -06:00
Brian Paul
ef47ab520d mesa: init dst values in COPY_CLEAN_4V_TYPE_AS_FLOAT()
to silence gcc 4.8.1 warnings.  And improve the ASSERT(0) call.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-26 12:52:06 -06:00
Brian Paul
f91f6ef739 glsl: init limit=0 to silence uninitialized var warning
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-26 12:52:06 -06:00
Kenneth Graunke
d65e3c082a i965/vs: Allocate register set once at context creation.
Now that we use a fixed set of register classes, we can set up the
register set and conflict graphs once, at context creation, rather than
on every VS compile.  This is obviously less expensive, and also what
we already do in the FS backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-26 11:21:10 -07:00
Kenneth Graunke
a149f744d9 i965/vs: Move base_reg_count computation to brw_alloc_reg_set().
We're soon going to be calling brw_alloc_reg_set() from outside of the
visitor, where we don't have the precomputed "max_grf" variable handy.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-26 11:21:10 -07:00
Kenneth Graunke
7aaaa8bc8f i965/vs: Expose the payload registers to the register allocator.
For now, nothing else can get allocated over them.  That may change at
some point in the future.

This also means that base_reg_count can be computed without knowing the
number of registers used for the payload, which is required if we want
to allocate the register set once at context creation time.

See commit 551e1cd44f, which implemented
virtually identical code in the FS backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-26 11:21:10 -07:00
Kenneth Graunke
528d70d0b5 i965/vs: Use a fixed set of register classes.
Arrays, structures, and matrices use large VGRFs of arbitrary sizes.
However, split_virtual_grfs() breaks those down into VGRFs of size 1.

For reference, commit 5d90b98879 is the
analogous change to the FS backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-26 11:21:10 -07:00
Paul Berry
cfe39ea14e i965: Allow C++ type safety in the use of enum brw_urb_write_flags.
(From a suggestion by Francisco Jerez)

If an enum represents a bitfield of flags, e.g.:

enum E {
  A = 1,
  B = 2,
  C = 4,
  D = 8,
};

then C++ normally prohibits statements like this:

enum E x = A | B;

because A and B are implicitly converted to ints before OR-ing them,
and an int can't be stored in an enum without a type cast.  C, on the
other hand, allows an int to be implicitly converted to an enum
without casting.

In the past we've dealt with this situation by storing flag bitfields
as ints.  This avoids ugly casting at the expense of some type safety
that C++ would normally have offered (e.g. we get no warning if we
accidentally use the wrong enum type).

However, we can get the best of both worlds if we override the |
operator.  The ugly casting is confined to the operator overload, and
we still get the benefit of C++ making sure we don't use the wrong
enum type.

v2: Remove unnecessary comment and unnecessary use of "enum" keyword.
Use static_cast.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-08-26 10:15:51 -07:00
Paul Berry
612226c43b i965: Remove redundant (and uninitialized) field vec4_generator::ctx.
We never noticed that this field was uninitialized because it is only
used in an error path that reports internal Mesa errors.

But it's silly to have it around anyway because &brw->ctx is
equivalent.

Should fix Coverity defect CID 1063351: Uninitialized pointer field
(UNINIT_CTOR) /src/mesa/drivers/dri/i965/brw_vec4_emit.cpp: 148

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-26 08:55:39 -07:00
Paul Berry
4bf91ca791 i965: Don't try to fall back when creating unrecognized program targets.
If brwNewProgram is asked to create a program for an unrecognized
target, don't bother falling back on _mesa_new_program().  That just
hides bugs.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>

v2: Use assert() rather than _mesa_problem().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-26 08:55:39 -07:00
Michel Dänzer
46fd81e586 radeonsi: Also set the depth component mask bit for stencil-only exports
The stencil values come out wrong without this for some reason.

50 more little piglits.

Cc: mesa-stable@lists.freedesktop.org
2013-08-26 15:47:50 +02:00
Kenneth Graunke
7fa18774bd glsl: Add built-in function prototypes for GLSL 3.30
330.frag is a direct copy of 150.frag.
330.glsl is 150.glsl combined with ARB_shader_bit_encoding.glsl.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-25 20:32:39 -07:00
Kenneth Graunke
8f00409d23 glsl: Bump standalone compiler versions to 3.30.
These are necessary in order to compile the built-in functions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-25 20:32:39 -07:00
Kenneth Graunke
7950315583 mesa: Set query->EverBound in glQueryCounter().
glIsQuery is supposed to return false for names returned by glGenQueries
until their first use.  BeginQuery is a use, but QueryCounter is also a
use.

From the ARB_timer_query spec:
"A timer query object is created with the command

      void QueryCounter(uint id, enum target);

 [...] If <id> is an unused query object name, the
 name is marked as used [...]"

Fixes Piglit's spec/ARB_timer_query/query-lifetime.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: mesa-stable@lists.freedesktop.org
2013-08-25 20:29:59 -07:00
Henri Verbeet
b5ddaf9975 r600g: Implement the new float comparison instructions for Cayman as well.
I assume this should have been part of commit
7727fbb7c5. This (obviously) fixes a lot tests.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-08-25 13:00:02 +02:00
Ilia Mirkin
bac6efe8e3 nv30: add forgotten PIPE_CAP_CUBE_MAP_ARRAY cap to list
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-25 10:47:28 +02:00
Ilia Mirkin
293fa4e559 nouveau/video: avoid overwriting base codec init with template
Commit 53e20b8b introduced the use of a template to initialize some
common fields. Move this copying of fields to before the common vp3
fields are initialized.

Reported-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-08-25 10:14:30 +02:00
Rob Clark
56ea2c4816 freedreno/a3xx: don't leak so much
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:58:01 -04:00
Rob Clark
9b9038496c freedreno/a3xx/compiler: fix SGT/SLT/etc
The cmps.f.* instruction doesn't actually seem to give a float 1.0 or
0.0 output.  It either needs a cov.u16f16 or add.s + sel.f16.  This
makes SGT/SLT/etc more similar to CMP, so handle them in trans_cmp().

This fixes a bunch of piglit tests.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:23:32 -04:00
Rob Clark
572d4646f7 freedreno/a3xx/compiler: bit of re-arrange/cleanup
It seems there are a number of cases where instructions have limitations
about taking reading src's from const register file, so make
get_unconst() a bit easier to use.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:23:32 -04:00
Rob Clark
d63bbac3a5 freedreno/a3xx/compiler: make compiler errors more useful
We probably should get rid of assert() entirely, but at this stage it is
more useful for things to crash where we can catch it in a debugger.
With compile_error() we have a single place to set an error flag (to
bail out and return an error on the next instruction) so that will be a
small change later when enough of the compiler bugs are sorted.

But re-arrange/cleanup the error/assert stuff so we at least get a dump
of the TGSI that triggered it.  So we see some useful output in piglit
logs.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:23:32 -04:00
Rob Clark
4c91930a25 freedreno: fix segfault when no color buffer bound
Don't crash when no color buffer bound.  Something caught when starting
to run piglit, fixes a hanful of piglit tests.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:23:32 -04:00
Rob Clark
7eeab24344 freedreno/a3xx/compiler: cat4 cannot use const reg as src
Category 4 instructions (rsq, rcp, sqrt, etc) seem to be unable to take
a const register as src.  In these cases we need to move the src to a
temporary gpr first.

This is the second case of such a restriction, where the instruction
encoding appears to support a const src, but in fact the hw appears to
ignore that bit.  So split things out into a helper that can be re-used
for any instructions which have this limitation.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:23:32 -04:00
Rob Clark
2effac5a67 freedreno/a3xx/compiler: use max_reg rather than file_count
Our current (rather naive) register assignment is based on mapping
different register files (INPUT, OUTPUT, TEMP, CONST, etc) based on the
max register index of the preceding file.  But in some cases, the lowest
used register in a file might not be zero.  In which case
file_count[file] != file_max[file] + 1.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:23:32 -04:00
Rob Clark
aee1ed708a freedreno/a3xx/compiler: handle saturate on dst
Sometimes things other than color dst need saturating, like if there is
a 'clamp(foo, 0.0, 1.0)'.  So for saturated dst add the extra
instructions to fix up dst.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:23:32 -04:00
Rob Clark
8b250bb8aa freedreno/a3xx/compiler: fix CMP
The 1st src to add.s needs (r) flag (repeat), otherwise it will end up:

  add.s dst.xyzw, tmp.xxxx -1

instead of:

  add.s dst.xyzw, tmp.xyzw, -1

Also, if we are using a temporary dst to avoid clobbering one of the src
registers, we actually need to use that as the dst for the sel
instruction.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:23:32 -04:00
Rob Clark
528bee59fe freedreno/a3xx: some texture fixes
Stop hard coding bits that indicate texture type (2d/3d/cube/etc).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:21:59 -04:00
Rob Clark
fd59f3ea98 freedreno: update register headers
resync w/ rnndb database

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:12:26 -04:00
Rob Clark
c2babfccb5 freedreno: add debug option to disable scissor optimization
Useful for testing and debugging.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:11:50 -04:00
Rob Clark
ae1a3f1736 freedreno/a3xx: fix viewport on gmem->mem resolve
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:04:29 -04:00
Rob Clark
fbef4e795f freedreno/a3xx: fix color inversion on mem->gmem restore
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-24 13:04:29 -04:00
Niels Ole Salscheider
288a252523 radeonsi: Handle additional PIPE_COMPUTE_CAP_*
This patch adds support for:
PIPE_COMPUTE_CAP_MAX_INPUT_SIZE
PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE

Return the values reported by the closed source driver for now.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-23 17:00:01 -07:00
Niels Ole Salscheider
04349541cd radeonsi: copy r600_get_timestamp
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-08-23 16:59:55 -07:00
Niels Ole Salscheider
db6f4165f4 radeonsi: Implement PIPE_QUERY_TIMESTAMP
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-08-23 16:59:44 -07:00
Roland Scheidegger
ad9b5b9ae9 gallivm: fix min/mag switchover point for nearest/none mip filter
Previously, the min/mag switchover point when using nearest/none mip
filter was effectively -0.5 which can't be right. Looks like new OpenGL
thinks it's ok if it's always 0.0 (older versions required 0.5 in some
cases), let's hope everybody else thinks that's fine too.
Refactor this slightly and get the per-quad/per-pixel min/mag decision
values further down to sampling, though still only the first component
is used yet.
While here also fix code trying to skip lod bias application etc. when
mipfilter is none, as this is still needed for determining min/mag filter.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-23 23:46:28 +02:00
Jon Severinsson
b47bde0079 gallium/osmesa: Link, not copy, the shared library to the LIB_DIR.
Just like all other mesa libraries...

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 12:58:48 -07:00
Jon Severinsson
aeb9c9e4b0 gallium/osmesa: Always link with the c++ linker.
Just like all other gallium targets...

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 12:58:45 -07:00
Jon Severinsson
c811190430 gallium/osmesa: Make and install an osmesa.pc.
As of "2f142d59 build: Add --enable-gallium-osmesa flag." the pkgconfig
file from classic osmesa is no longer installed when building gallium
osmesa, so copy it to gallium osmesa and install the copy instead.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 12:58:30 -07:00
Paul Berry
60ddb96f7e i965/gs: Add a data structure for tracking VS output VUE map.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:47 -07:00
Paul Berry
06918f84c2 i965/vec4: Make a function for setting up vec4 program key clip info.
This functionality will need to be reused by geometry shaders.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:43 -07:00
Paul Berry
5b5d10bcd3 i965: Make prim_to_hw_prim accessible outside brw_draw.c.
We will need access to this array in order to configure the geometry
shader.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:38 -07:00
Paul Berry
16512ba70d i965/gs: add GS visitors.
This patch introduces the vec4_gs_visitor class, which translates
geometry shaders from GLSL IR to back-end opcodes.

This class is derived from vec4_visitor (which is also the base class
for vec4_vs_visitor), so as a result most of the back end code is
shared.  The only parts that differ are:

- Geometry shaders use a different input payload organization, since
  the inputs need to match up with the outputs of the previous
  pipeline stage (vec4_gs_visitor::setup_payload() and
  vec4_gs_visitor::setup_varying_inputs()).

- Geometry shader input array dereferences need a special stride
  computation, since all geometry shader inputs are interleaved into
  one giant array (vec4_gs_visitor::compute_array_stride()).

- There are no geometry shader system values
  (vec4_gs_visitor::make_reg_for_system_value()).

- At the beginning of a geometry shader, extra data in R0 needs to be
  zeroed out, and a vertex counter needs to be initialized
  (vec4_gs_visitor::emit_prolog()).

- When EmitVertex() appears in the shader, the current contents of
  output variables need to be emitted to the URB, and the vertex
  counter needs to be incremented
  (vec4_gs_visitor::visit(ir_emit_vertex *)).

- When generating a URB_WRITE message to output vertex data, the
  current state of the vertex counter needs to be used to store a
  write offset in the message header
  (vec4_gs_visitor::emit_urb_write_header()).

- The URB_WRITE message that outputs vertex data needs to be sent
  using GS_OPCODE_URB_WRITE, since VS_OPCODE_URB_WRITE would overwrite
  the offsets in the message header
  (vec4_gs_visitor::emit_urb_write_opcode()).

- At the end of a geometry shader, the final vertex count needs to be
  delivered using a URB WRITE message
  (vec4_gs_visitor::emit_thread_end()).

- EndPrimitive() functionality is not implemented yet
  (vec4_gs_visitor::visit(ir_end_primitive *)).

- There is no support for assembly shaders
  (vec4_gs_visitor::emit_program_code()).

v2: Make num_input_vertices const.  Refer to registers as rN rather
than gN, for consistency with the PRM.  Fix misspelling.  Improve
comment in the ir_emit_vertex visitor explaining why we emit vertices
inside a conditional.  Enclose the conditional code in the
ir_emit_vertex visitor between curly braces.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:34 -07:00
Paul Berry
35bdd552d5 i965/gs: Add GS_OPCODE_SET_DWORD_2_IMMED.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:31 -07:00
Paul Berry
7417eddea9 i965/gs: Add GS_OPCODE_SET_VERTEX_COUNT.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:27 -07:00
Paul Berry
ce722fd65d i965/gs: Add GS_OPCODE_SET_WRITE_OFFSET.
v2: Added a comment to vec4_generator::generate_gs_set_write_offset().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:23 -07:00
Paul Berry
4416cb7992 i965/gs: Add GS_OPCODE_THREAD_END.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:19 -07:00
Paul Berry
96eb2f3536 i965/gs: Add GS_OPCODE_URB_WRITE.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:15 -07:00
Paul Berry
eaa63cbbc2 i965/gs: Add a flag allowing URB write messages to use a per-slot offset.
This will be used by geometry shaders to implement the EmitVertex()
function, since it requires writing data to a dynamically-determined
offset within the geometry shader's URB entry.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:12 -07:00
Paul Berry
a9e8c10bd7 i965: Combine 4 boolean args of brw_urb_WRITE into a flags bitfield.
The arguments to brw_urb_WRITE() were getting pretty unwieldy, and we
have to add more flags to support geometry shaders anyhow.

Also plumb these flags through brw_clip_emit_vue(),
brw_set_urb_message(), and the vec4_instruction class.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:08 -07:00
Paul Berry
591fc0861c i965/gs: Add a case to brwNewProgram() for geometry shaders.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:05 -07:00
Paul Berry
ebbb8c0c76 i965/gs: Create structs for use by GS program compilation.
v2: Make id "unsigned" rather than "GLuint".

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:03:01 -07:00
Paul Berry
3167dca3d4 i965/gs: Add a case to brwBindProgram() for geometry shaders.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:58 -07:00
Paul Berry
158dcdc0e2 i965/gs: Add brw->geometry_program.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:54 -07:00
Paul Berry
7f57101ad5 i965/vec4: Virtualize setup_payload instead of setup_attributes.
When I initially generalized the vec4_visitor class in preparation for
geometry shaders, I assumed that the setup_attributes() function would
need to be different between vertex and geometry shaders, but its
caller, setup_payload(), could be shared.  So I made
setup_attributes() a virtual function.

It turns out this isn't true; setup_payload() needs to be different
too, since the geometry shader payload sometimes includes an extra
register (primitive ID) that has to come before uniforms.

So setup_payload() needs to be the virtual function instead of
setup_attributes().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:51 -07:00
Paul Berry
626495d269 i965/vec4: Allow for dispatch_grf_start_reg to vary.
Both 3DSTATE_VS and 3DSTATE_GS have a dispatch_grf_start_reg control,
which determines the register where the hardware delivers data sourced
from the URB (push constants followed by per-vertex input data).

For vertex shaders, we always set dispatch_grf_start_reg to 1, since
R1 is always the first register available for push constants in vertex
shaders.

For geometry shaders, we'll need the flexibility to set
dispatch_grf_start_reg to different values depending on the behvaiour
of the geometry shader; if it accesses gl_PrimitiveIDIn, we'll need to
set it to 2 to allow the primitive ID to be delivered to the thread in
R1.

This patch eliminates the assumption that dispatch_grf_start_reg is
always 1.  In vec4_visitor, we record the regnum that was passed to
vec4_visitor::setup_uniforms() in prog_data for later use.  In
vec4_generator, we consult this value when converting an abstract
UNIFORM register to a concrete hardware register.  And in the code
that emits 3DSTATE_VS, we set dispatch_grf_start_reg based on the
value recorded in prog_data.

This will allow us to set dispatch_grf_start_reg to the appropriate
value when compiling geometry shaders.  Vertex shaders will continue
to always use a dispatch_grf_start_reg of 1.

v2: Make dispatch_grf_start_reg "unsigned" rather than "GLuint".

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:47 -07:00
Paul Berry
72168f5f00 i965/vec4: Move vec4 data structures and functions to brw_vec4.{cpp,h}.
This patch moves the following things into brw_vec4.{cpp,h}:

- struct brw_vec4_compile
- struct brw_vec4_prog_key
- brw_vec4_prog_data_compare()
- brw_vec4_prog_data_free()

This will allow us to avoid having to include brw_vs.h in
geometry-shader-specific files.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:44 -07:00
Paul Berry
e556286802 i965: Make brw_{shader,vec4}.h safe to include from C.
The patch that follows will move the definition of struct
brw_vec4_prog_key from brw_vs.h to brw_vec4.h, making it necessary for
brw_vs.h to include brw_vec4.h (because brw_vs.h defines struct
brw_vs_prog_key, which contains brw_vec4_prog_key as a member).  Since
brw_vs.h is included from C source files, that means that brw_vec4.h
will need to be safe to include from C.  Same for brw_shader.h, since
it is included by brw_vec4.h.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:40 -07:00
Paul Berry
5fb13d871e i965: Stop including brw_vs.h from brw_vec4.h.
This is backwards from what we are going to want in the long term, which is:

- brw_vec4.h declares general-purpose vec4 infrastructure needed by
  both VS and GS
- brw_vs.h includes brw_vec4.h and adds VS-specific parts.
- brw_gs.h includes brw_vec4.h and adds GS-specific parts.

Note that at the moment brw_vec.h contains a fair amount of
VS-specific declarations--I plan to address that in a later patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:37 -07:00
Paul Berry
52bac6e4ff i965: Initialize all elements of ctx->ShaderCompilerOptions.
Otherwise any GS that requires lowering (e.g. one that uses
gl_ClipDistance as an input or output) will fail to work.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:34 -07:00
Paul Berry
61a5bd8336 i965: Make brw_{program,vs}.h safe to include from C++.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:31 -07:00
Paul Berry
ad65825098 mesa/program: Make prog_instruction.h and program.h safe to include from C++.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:25 -07:00
Paul Berry
44e07de3ac glsl: Refactor handling of gl_ClipDistance/gl_ClipVertex linkage rules for GS.
This patch extracts the following logic from
validate_vertex_shader_executable():

(a) Generate an error if the shader writes to both gl_ClipDistance and
    gl_ClipVertex.

(b) Record whether the shader writes to gl_ClipDistance in
    gl_shader_program for use by the back-end.

(c) Record the size of gl_ClipDistance in gl_shader_program for use by
    transform feedback logic.

And moves it into a function that is shared between vertex and
geometry shaders.

Strictly speaking we only need to have shared logic for (b) and (c)
right now (since (a) only matters in compatibility contexts, and we're
only implementing geometry shaders in core contexts right now).  But
the three are closely related enough that it seems sensible to keep
them together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-23 11:02:15 -07:00
Timothy Arceri
f0072e3c6b mesa: Fix assertion error with glDebugMessageControl
enums were being converted twice resulting in incorrect values.
The extra conversion has been removed and the redundant assert is
removed also.

Cc: 9.2 <mesa-stable@lists.freedesktop.org>

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-23 08:15:19 -06:00
Kenneth Graunke
a27180d0d8 mesa: Specify a better GL_MAX_SERVER_WAIT_TIMEOUT limit.
The previous value of (GLuint64) ~0 has some problems:

GL_MAX_SERVER_WAIT_TIMEOUT is supposed to be a GLuint64 value, but has
to be queried via GetInteger64v(), which returns a GLint64.  This means
that some applications are likely to treat it as a signed integer, where
~0 means -1.  Negative values are nonsensical and problematic.

When interpreted correctly, ~0 translates to about 0.58 million years,
which seems rather excessive.

This patch changes it to 0x1fff7fffffff, which is about 1.11 years.
This is still plenty long, and is the same as both an int64 and uint64.
Applications that accidentally store it in a 32-bit int/unsigned also
get a non-negative value, which is again the same as both int and
unsigned.  This value was suggested by Ian Romanick.

v2: Add the ULL prefix on the constant (suggested by Ian).

Fixes Piglit's spec/!OpenGL 3.2/get-integer-64v.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
2013-08-22 23:08:20 -07:00
Kenneth Graunke
62411681da meta: Set correct viewport and projection in decompress_texture_image.
_mesa_meta_begin() sets up an orthographic project and initializes the
viewport based on the current drawbuffer's width and height.  This is
likely the window size, since it occurs before the meta operation binds
any temporary buffers.

decompress_texture_image needs the viewport to be the size of the image
it's trying to draw.  Otherwise, it may only draw part of the image.

v2: Actually set the projection properly too.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68250
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Mak Nazecic-Andrlon <owlberteinstein@gmail.com>
2013-08-22 20:28:53 -07:00
Chad Versace
ce8639a766 i965: Fix misapplication of gles3 srgb workaround
Fixes inconsistent failure of gles2conform/GL2Tests/glUniform/glUniform.test
under gnome-shell. What follows is a description of the bug and its fix.

When intel_update_renderbuffers() allocates a miptree for a winsys
renderbuffer, it propagates the renderbuffer's format to become also the
miptree's format.

If the winsys color buffer format is SARGB, then, in the first call to
eglMakeCurrent, intel_gles3_srgb_workaround() changes the renderbuffer's
format to ARGB. That is, it changes the format from sRGB to non-sRGB.
However, it changes the renderbuffer's format *after*
intel_update_renderbuffers() has allocated the renderbuffer's miptree.
Therefore, when eglMakeCurrent returns, the miptree format (SARGB)
differs from the renderbuffer format (ARGB).

If the X server reallocates the color buffer,
intel_update_renderbuffers() will create a new miptree for the
renderbuffer. The new miptree's format (ARGB) will differ from old
miptree's format (SARGB). This mismatch between old and new miptrees
causes bugs.

Fix the bug by moving intel_gles3_srgb_workaround() to occur *before*
intel_update_renderbuffers().

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67934
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-22 10:54:36 -07:00
Roland Scheidegger
bd0b6c5180 gallivm: do per-element lod for lod bias and explicit derivs too
Except for explicit derivs with cube maps which are very bogus anyway.
Just like explicit lod this is only used if no_quad_lod is set in
GALLIVM_DEBUG env var.
Minification is terrible on cpus which don't support true vector shifts
(but should work correctly). Cannot do the min/mag filter decision (if
they are different) per pixel though, only selecting different mip levels
works.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-22 19:05:52 +02:00
Roland Scheidegger
33694a1800 gallivm: (trivial) fix int/uint border color clamping
Just a copy & paste error.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=68409.
Note that the test passing before probably simply means it doesn't verify
clamping of the border color itself as required by the OpenGL spec.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-22 19:05:52 +02:00
Roland Scheidegger
6ff9008544 gallivm: (trivial) fix linear aos sampling of 3d compressed formats
block size depth is always 1 even for compressed formats (unless someone
invents true 3d compressed formats at least which we can't represent).
Nearest (and soa) path had it right.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-22 19:05:52 +02:00
Michel Dänzer
237cb074cb radeonsi: Fix y/z/w component values of TGSI_SEMANTIC_FOG pixel shader inputs
They are defined as constant 0.0/0.0/1.0.

Three more little piglits.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-22 16:12:17 +02:00
José Fonseca
fb62388d6a gallium: Support PIPE_FORMAT_R10G10B10A2_UINT.
Same as PIPE_FORMAT_B10G10R10A2_UINT but without the swizzling.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-08-22 12:14:15 +01:00
José Fonseca
c5f2cd6e41 trace: Handle null tokens.
Used for example on stream out without geometry shader.
2013-08-22 12:14:15 +01:00
Chia-I Wu
b6037e734e ilo: do not need last shader stage for 3DSTATE_SBE
We have set up 3DSTATE_SBE (or 3DSTATE_SF on GEN6) in
ilo_shader_select_kernel_routing().  There is no need to pass the last shader
stage to the GPE function.
2013-08-22 15:18:29 +08:00
Chia-I Wu
627d7ca763 ilo: fix a potential issue with STATE_SIP
Command length is ORed to the wrong place.  Since the ORed value is zero,
there is no real change.
2013-08-22 15:18:29 +08:00
Chia-I Wu
475d7ecce2 ilo: add GEN check to 3DSTATE_CLIP
Assert that gen6_emit_3DSTATE_CLIP is for GEN 6 and 7.
2013-08-22 15:18:29 +08:00
Matt Turner
2f142d596f build: Add --enable-gallium-osmesa flag.
The Gallium implementation is apparently not ready for regular
consumption, so as much as I hate adding more build-time options, here's
another.

Acked-by: Brian Paul <brianp@vmware.com>
2013-08-21 23:07:10 -07:00
Ian Romanick
dded321f92 glsl: Give a warning, not an error, for UBO qualifiers on non-matrices.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59648
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-21 23:06:59 -07:00
Matt Turner
921ef55a72 glsl: Remove ubo_qualifiers_allowed variable.
No longer used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-08-21 22:47:02 -07:00
Matt Turner
77373e020e glsl: Drop duplicate error messages.
This same message is printed in the validate_matrix_layout_for_type
function.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-08-21 22:47:02 -07:00
Matt Turner
1a45db9705 glsl: Rename ubo_qualifiers_valid to ubo_qualifiers_allowed.
The variable means that UBO qualifiers are allowed in a particular
context (e.g., not allowed in a struct field declaration), rather than a
particular set of UBO qualifiers are valid.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-08-21 22:47:02 -07:00
Kenneth Graunke
9d08756ac7 i965/fs: Add code to print out global copy propagation sets.
This was invaluable when debugging the global copy propagation
algorithm.  We may as well commit it in case someone needs to print
out the sets in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-21 21:05:50 -07:00
Armin K
63ac68bae3 osmesa: Symlink shared library to LIB_DIR
Cc: 9.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
2013-08-21 17:55:32 -06:00
Brian Paul
e4217396b7 svga: minor clean-ups in emit_hw_vs_vdecl() 2013-08-21 17:55:06 -06:00
Roland Scheidegger
e6013e4bee gallivm: unify sin and cos implementation
The (complicated!) math is all identical, there's just minimal differences how
sign bit is calculated plus there's an additional subtraction for the argument
going into the polynomial for cos.
The logic stays 100% the same (with a small exception, sign bit calculation for
sin is minimally simplified, applying sign mask after xoring the arguments
instead of applying it to each argument).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-21 22:05:53 +02:00
Roland Scheidegger
275d2efeed gallivm: add comment for bogus min/mag filter selection with nearest mip filter
Detected this hunting some other bug, not sure if it really needs fixing but
it is definitely wrong.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-21 22:05:52 +02:00
Roland Scheidegger
21d8fa2759 gallivm: fix rho calculation for 1d case
Was using wrong (undefined) vector element (the elements are at 0/2 position,
not 0/1).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-21 22:05:52 +02:00
Ville Syrjälä
e6893b99ad i965/gen7: Set MOCS L3 cacheability for IVB/BYT (v2)
IVB/BYT also has the same L3 cacheability control in MOCS as HSW,
so let's make use of it.

pts/xonotic and pts/reaction @ 1920x1080 gain ~4% on my IVB GT2. Most
other things show less gains/no regressions, except furmark which
loses some 10 points.

I didn't have a BYT at hand for testing.

v2: Don't check (brw->gen == 7) in gen7 functions. (chadv)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-21 10:14:04 -07:00
Ville Syrjälä
22161983c3 i965/hsw: Populate MOCS for STATE_BASE_ADDRESS (v2)
Just spotted these unpopulated MOCS fields when comparing the code
against BSpec. Set the MOCS to the same as everywhere else in Haswell:
L3-cacheable.

v2: Annotate state packet fields (chadv).

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-21 10:14:04 -07:00
Maarten Lankhorst
10aa3677cc glapi/gen: build temporary files in the build directory
Writing to the source directory can cause multiple parallel builds
from the same source to fail. Create the temporary files in the
build directory.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-21 18:34:59 +02:00
Ian Romanick
f53b634807 mesa: Never advertise _S3TC compressed formats
The NVIDIA driver doesn't expose them, and piglit's
arb_texture_compression-invalid-formats expects them to not be there.

This, with the previous commit, fixes piglit
arb_texture_compression-invalid-formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-21 07:48:31 -07:00
Ian Romanick
40550c8ced mesa: Only advertise GL_ETC1_RGB8_OES in ES contexts
There is no extension for this format in desktop GL, so an application
can't give the format back to glCompressedTexImage2D.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-21 07:46:51 -07:00
Ian Romanick
cabd45773b glsl: Track existence of default float precision in GLSL ES fragment shaders
This is required by the spec, and it's a bit tricky because the default
precision is scoped.  As a result, I'm slightly abusing the symbol
table.

Fixes piglit no-default-float-precision.frag tests and the piglit
default-precision-nested-scope-0[1234].frag tests that are currently on
the piglit mailing list for review.

On IRC I got confirmation from cwabbot that ARM (Mali T6xx and T400)
enforces this requirement and from kusma that NVIDIA (Tegra2) enforces
this requirement.  We should be safe from regressing shipping
applications.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-21 07:44:26 -07:00
Ian Romanick
73e2d69792 glsl: Merge precision qualifiers too
We never noticed this before because we previously didn't enfoce GLSL ES
fragement shader requirements that precision be defined.  There may also
have been some interaction here with the addition of
GL_ARB_shading_language_420pack, but it doesn't appear to me that it
added any new bugs (just perhaps uncovered some old ones).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-21 07:43:48 -07:00
Ian Romanick
b15b62c54c glsl: Pass type to is_valid_default_precision_type instead of name
This is used by the next patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-21 07:43:48 -07:00
Rico Schüller
00fcdc81ff vdpau/decode: Fix comment.
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-08-21 11:25:36 +02:00
Rico Schüller
d8d90ecf30 vl/query: Only support VDP_CHROMA_TYPE_420 for 12 bit formats.
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-08-21 11:25:10 +02:00
Roland Scheidegger
4b45b61fef util: add avx2 and xop detection to cpu detection code
Going to need this soon (not going to bother with avx2 intrinsics at this time
but don't want to do workarounds for true vector shifts if llvm itself can use
them just fine and won't need the gazillion instruction emulation).
Not really tested other than my cpu returns 0 for these features...
(I have no idea if llvm actually would emit avx2/xop instructions neither...)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-20 23:00:24 +02:00
Roland Scheidegger
9299128bf2 gallivm: fix bogus aos path detection
Need to check the wrap mode of the actually used coords not a fixed 2.
While checking more than necessary would only potentially disable aos and
not cause any harm I'm pretty sure for 3d textures it could have caused
assertion failures (if s,t coords have simple filter and r not).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-20 23:00:24 +02:00
Roland Scheidegger
fe92d7fab4 gallivm: do clamping of border color correctly for all formats
Turns out it is actually very complicated to figure out what a format really
is wrt range, as using channel information for determining unorm/snorm etc.
doesn't work for a bunch of cases - namely compressed, subsampled, other.
Also while here add clamping for uint/sint as well - d3d10 doesn't actually
need this (can only use ld with these formats hence no border) and we could
do this outside the shader for GL easily (due to the fixed texture/sampler
relation) do it here too just so I can forget about it.

v2: move border color clamping out of fetch texel. Also change it to clamp
the whole border vector at once (and use vectorized load of border color),
which saves a couple of instructions - needs some different handling of
mixed signed/unsigned formats so skip the per channel stuff and just derive
this from first channel except for special formats.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-20 23:00:24 +02:00
Roland Scheidegger
ac1a2714c7 gallivm: implement better control of per-quad/per-element/scalar lod
There's a new debug value used to disable per-quad lod optimizations
in fragment shader (ignored for vs/gs as the results are just too wrong
typically). Also trying to detect if a supplied lod value is really a
scalar (if it's coming from immediate or constant file) in which case
sampler code can use this to stay on per-quad-lod path (in fact for
explicit lod could simplify even further and use same lod for both
quads in the avx case but this is not implemented yet).
Still need to actually implement per-element lod bias (and derivatives),
and need to handle per-element lod in size queries.

v2: fix comments, prettify.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-20 23:00:24 +02:00
Brian Paul
d427278a2d mesa: use ARRAY_SIZE() macro instead of magic number
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-20 13:14:25 -06:00
Ross Burton
76feef0823 build: fix out-of-tree builds in gallium/auxiliary
The rules were writing files to e.g. util/u_indices_gen.py, but in an
out-of-tree build this directory doesn't exist in the build directory.  So,
create the directories just in case.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
2013-08-20 10:35:14 -07:00
Michel Dänzer
be301f707e radeonsi: Always pre-load separate VGPRs for centroid vs. center interpolation
The LLVM R600 backend currently always uses separate VGPRs for these.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68162
(Centroid interpolation is identical to center interpolation without
multisampling, so the shader hardware was only pre-loading one set of
interpolation coefficients, and the pixel shader code was using
uninitialized values as the centroid interpolation coefficients)

Cc: mesa-stable@lists.freedesktop.org
Tested-by: Laurent Carlier <lordheavym@gmail.com>
2013-08-20 18:50:28 +02:00
Michel Dänzer
5edcb682c9 radeonsi: Fix SPI_BARYC_CNTL register initialization
The centroid / center interpolation related bits have different meanings
as of SI.

Fixes 7 centroid interpolation related piglit tests.
2013-08-20 18:50:10 +02:00
Maarten Lankhorst
86751cbddf gallium/osmesa: add same checks to OSMesaMakeCurrent as the other osmesa
Fixes a opengl crash in wine.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-08-20 12:36:17 +02:00
Maarten Lankhorst
603160d4c0 gallium/osmesa: link against static libglapi library too to get the gl exports
This should fix missing symbols in a osmesa built against shared glapi
osmesa build. All opengl exports were missing that are defined in the
static glapi, so link against both to fix this.

I could swear I've done this before, maybe there was a glitch in the matrix.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47824
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-08-20 10:44:53 +02:00
Kenneth Graunke
a4ff1fd388 i965: Shorten sampler loops in precompile key setup.
Now that we have the number of samplers available, we don't need to
iterate over all 16.  This should be particularly helpful for vertex
shaders.

v2: Use the correct shader program (caught by Paul Berry).

This needs to initialize the exact same set of sampler swizzles as
the actual key setup, or else we end up doing recompiles due to some
being XYZW and others being 0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-20 01:09:52 -07:00
Chia-I Wu
ce87c51e9a ilo: add ILO_DEBUG=flush
When specified, ilo will print a line similar to

  cp flushed for render with 949+888 DWords (22.4%) because of frame end

for every ilo_cp_flush() call.
2013-08-20 13:54:39 +08:00
Chia-I Wu
216a576e11 ilo: add ILO_DEBUG=draw
It can print out pipe_draw_info and the dirty bits set, useful for debugging.
2013-08-20 13:54:38 +08:00
Vinson Lee
ff3cb378ad r600g/sb: Move memsets of member structs to within constructor bodies.
Silences "Uninitialized pointer field" defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-08-19 17:37:08 -07:00
Ian Romanick
574e4843e9 glsl: Use alignment of container record for its first field
The first field of a record in a UBO has the aligment of the record
itself.

Fixes piglit vs-struct-pad, fs-struct-pad, and (with the patch posted to
the piglit list that extends the test) layout-std140.

NOTE: The bit of strangeness with the version of visit_field without the
record_type poitner is because that method is pure virtual in the base
class.  The original implementation of the class did this to ensure
derived classes remembered to implement that flavor.  Now they can
implement either flavor but not both.  I don't know a C++ way to enforce
that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68195
Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
2013-08-19 16:39:04 -07:00
Ian Romanick
5ac884fd9f glsl: Add new overload of program_resource_visitor::visit_field method
The outer-most record is passed into the visit_field method for
the first field.  In other words, in the following structure:

    struct S1 {
        vec4 v;
        float f;
    };

    struct S {
        S1 s1;
        S1 s2;
    };

    uniform Ubo {
        S s;
    };

s.s1.v would get record_type = S (because s1.v is the first non-record
field in S), and s.s2.v would get record_type = S1.  s.s1.f and s.s2.f
would get record_type = NULL becuase they aren't the first field of
anything.

This new overload isn't used yet, but the next patch will add several
uses.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
2013-08-19 16:39:04 -07:00
Ian Romanick
d9bb8b7b56 glsl: Disallow embedded structure definitions
Continue to allow them in GLSL 1.10 because the spec allows it.
Generate an error in all other versions because the specs specifically
disallow it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-19 16:39:04 -07:00
Ian Romanick
5fb1dd51f3 meta: Add default precision qualifier to all fragement shaders
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-19 16:39:04 -07:00
Ian Romanick
5ac247a73e glsl: Add default precision qualifiers for ES builtins
Once the compiler proplerly checks for default precision qualifiers,
these shaders will cease to compile.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-19 16:39:04 -07:00
Ian Romanick
0b5fb6d417 glsl: Remove extra "types" from error message
Send it straight to the Department of Redundancy Department.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-19 16:39:04 -07:00
Kenneth Graunke
e197f53730 i965: Make the VS binding table as small as possible.
For some reason, we didn't use this information even though the VS
backend has computed it (albeit poorly) for ages.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:17:00 -07:00
Kenneth Graunke
7e9559c9ba i965/vs: Rework binding table size calculation.
Unlike the FS, the VS backend already computed the binding table size.
However, it did so poorly: after compilation, it looked to see if any
pull constants/textures/UBOs were in use, and set num_surfaces to the
maximum surface index for that category.  If the VS only used a single
texture or UBO, this overcounted by quite a bit.

The shader time surface was also noted at state upload time (during
drawing), not at compile time, which is inefficient.  I believe it also
had an off by one error.

This patch computes it accurately, while also simplifying the code.

It also renames num_surfaces to binding_table_size, since num_surfaces
wasn't actually the number of surfaces used.  For example, a VS that
used one UBO and no other surfaces would have set num_surfaces to
SURF_INDEX_VS_UBO(1) == 18, rather than 1.  A bit of a misnomer there.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:17:00 -07:00
Kenneth Graunke
c642bd3dcc i965/vs: Plumb brw_vec4_prog_data into vec4_generator().
This will be useful for the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:17:00 -07:00
Kenneth Graunke
60689c05d1 i965/fs: Make the FS binding table as small as possible.
Computing the minimum size was easy, and done at compile-time for no
extra overhead here.  Making the binding table smaller wastes less batch
space.

Adding the CACHE_NEW_WM_PROG dirty bit isn't strictly necessary, since
other atoms depend on it and flag BRW_NEW_SURFACES.  However, it's best
to add it for clarity and safety.  It shouldn't add any new overhead.

v2: Use binding_table_size, rather than max_surface_index.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-19 13:17:00 -07:00
Kenneth Graunke
6d89bc803d i965/fs: Track the binding table size in brw_wm_prog_data.
By tracking the maximum surface index used by the shader, we know just
how small we can make the binding table.

Since it depends entirely on the shader program, we can just compute
it once at compile time, rather than at binding table emit time (which
happens during drawing).

v2: Store binding_table_size, rather than max_surface_index, for
    consistency with the VS (which needs to be able to represent 0
    surfaces).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-19 13:17:00 -07:00
Kenneth Graunke
7c717690b5 i965: Use SURF_INDEX_DRAW() for drawbuffer binding table indices.
SURF_INDEX_DRAW() has been the identity function since the dawn of time,
and both the shader code and binding table upload code relied on that,
simply using X rather than SURF_INDEX_DRAW(X).

Even if that continues to be true, using the macro clarifies the code.

The comment about draw buffers needing to be first in order for
headerless render target writes to work turned out to be wrong; with
this change, SURF_INDEX_DRAW can be changed to arbitrary indices and
everything continues working.

The confusion was over the "Render Target Index" field in the FB write
message header.  If it were a binding table index, then RT 0 would have
to be at index 0 for headerless FB writes to work.  However, it's
actually an index into the blend state table, so there's no problem.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:17:00 -07:00
Kenneth Graunke
c5fe7d063c i965: Shorten sampler loops in key setup.
Now that we have the number of samplers available, we don't need to
iterate over all 16.  This should be particularly helpful for vertex
shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:17:00 -07:00
Kenneth Graunke
d0401d09ce i965: Make sampler counts available for the entire drawing operation.
Previously, we computed sampler counts when generating the SAMPLER_STATE
table.  By computing it earlier, we should be able to shorten a bunch of
loops.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:17:00 -07:00
Kenneth Graunke
c6e572275b i965: Split the brw_samplers atom into separate FS/VS stages.
This allows us to avoid uploading the VS sampler state table if only the
fragment program changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:17:00 -07:00
Kenneth Graunke
7e01af662a i965: Upload separate VS and FS sampler state tables.
Now, each shader stage has a sampler state table that only refers to the
samplers actually used by that problem.  This should make the VS table
non-existant or very small.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:16:59 -07:00
Kenneth Graunke
2b7f876a6a i965: Make upload_sampler_state_table a virtual function.
This allows us to coalesce the brw_samplers and gen7_samplers atoms.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:16:59 -07:00
Kenneth Graunke
decc708c7c i965: Upload separate per-stage sampler state tables.
Also upload separate sampler default/texture border color entries.

At the moment, this is completely idiotic: both tables contain exactly
the same contents, so we're simply wasting batch space and CPU time.

However, soon we'll only upload data for textures actually /used/ in
a particular stage, which will usually make the VS table empty and
very likely eliminate all redundancy.  This is just a stepping stone.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:16:59 -07:00
Kenneth Graunke
9525bcf5f7 i965: Un-hardcode border color table from update_sampler_state().
Like the previous patch, this simply pushes direct access to brw->wm up
one level in the call chain.  Rather than passing the whole array, we
just pass a pointer to the correct spot in the array, similar to what we
do for the actual sampler state structure.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:16:59 -07:00
Kenneth Graunke
ed4459b10b i965: Un-hardcode border color table from upload_default_color.
When we begin uploading separate sampler state tables for VS and FS,
we won't be able to use &brw->wm.sdc_offset[ss_index].  By passing it in
as a parameter, we push the problem up to the caller.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:16:59 -07:00
Kenneth Graunke
f5a690cb68 i965: Split sampler count variable to be per-stage.
Currently, we only have a single sampler state table shared among all
stages, so we just copy wm.sampler_count into vs.sampler_count.

In the future, each shader stage will have its own SAMPLER_STATE table,
at which point we'll need these separate sampler counts.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 13:16:59 -07:00
Kenneth Graunke
44960ef918 i965/fs: Re-enable global copy propagation.
I believe the data flow analysis actually works now, and it should be
safe to re-enable global copy propagation.  It even does things now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
72f2249c11 i965/fs: Fix computation of livein.
Since the initial value for livein is an overestimation (0xffffffff),
it's extremely likely that it will shrink, which means we can't simply
OR in new bits - we need to fully recompute it based on the current
liveout values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
70b02a7fac i965/fs: Fully recompute liveout at each step.
Since we start with an overestimation of livein (0xffffffff), successive
steps can actually take away values.  This means we can't simply OR in
new liveout values; we need to recompute it from scratch at each
iteration of the fixed-point algorithm.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
d20b472d0a i965/fs: Skip the initial block when updating livein/liveout.
The starting block always has livein = 0 and liveout = copy.  Since we
start with real data, not estimates, there's no need to refine it with
the fixed point algorithm.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
731145c579 i965/fs: Drop unnecessary and incorrect liveout initialization.
The previous commit properly initialized liveout.  This previous
(and incorrect) initialization is no longer necessary.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
1d40c784f2 i965/fs: Properly initialize the livein/liveout sets.
Previously, livein was initialized to 0 for all blocks.  According to
the textbook, it should be the universal set (~0) for all blocks except
the one representing the start of the program (which should be 0).

liveout also needs to be initialized to COPY for the initial block.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
f06826cece i965/fs: Use the COPY set in the calculation for liveout.
According to page 360 of the textbook, the proper formula for liveout
is:

CPout(n) = COPY(i) union (CPin(i) - KILL(i))

Previously, we omitted COPY.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
a291c59bba i965/fs: Simplify liveout calculation.
Excluding the existing liveout bits is a deviation from the textbook
algorithm.  The reason for doing so was to determine if the value
changed, which means the fixed-point algorithm needs to run for another
iteration.

The simpler way to do that is to save the value from step (N-1) and
compare it to the new value at step N.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
597efd2b67 i965/fs: Create the COPY() set for use in copy propagation dataflow.
This is the "COPY" set from Muchnick's textbook, which is necessary
to do the dataflow algorithm correctly.

v2: Simplify initialization based on Paul Berry's observation that
    out_acp contains exactly what needs to be in the COPY set.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
669d4d7f77 i965/fs: Rename setup_kills() to setup_initial_values().
Although this function currently only initializes the KILL set, it will
soon initialize other data flow sets as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
2ef81372dc i965/fs: Separate the updating of liveout/livein.
To compute the actual liveout/livein data flow values, we start with
some initial values and apply a fixed-point algorithm until they settle.

Previously, we iterated through all blocks, updating both liveout and
livein together in one pass.  This is awkward, since computing livein
for a block requires knowing liveout for all parent blocks.  Not all
of those parent blocks may have been processed yet.

This patch separates the two.  First, we update liveout for all blocks.
At iteration N of the fixed-point algorithm, this uses livein values
from iteration N-1.  Secondly, we update livein for all blocks.  At
step N, this uses the liveout information we just computed (in step N).

This ensures each computation has a consistent picture of the data,
rather than seeing an random mix of data from steps N-1 and N depending
on the order of the blocks in the CFG data structure.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:24 -07:00
Kenneth Graunke
7d86042dee i965/fs: Rename "cont" to "progress" in dataflow algorithm.
This variable indicates that the fixed-point algorithm made changes to
the data at this step, so it needs to run for another iteration.

"progress" seems a nicer name for that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:23 -07:00
Kenneth Graunke
0225dea6c4 i965/fs: Switch to a do-while loop in copy propagation dataflow.
The fixed-point algorithm needs to run at least once, so a do-while loop
is more natural.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:23 -07:00
Kenneth Graunke
3c68662bb1 i965/fs: Skip global copy propagation step.
The dataflow analysis used for global copy propagation is severely
broken, and I believe it doesn't actually do anything.  Fixing it will
require a lot of changes, each of which might break things.

Once all the fixes land, we can re-enable this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-19 11:29:23 -07:00
Emil Velikov
b9d1173f2c vl/buffers: consistent use on VL_MAX_SURFACES
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-08-19 18:32:08 +02:00
Emil Velikov
e7c17eb819 st/vdpau: drop unnecessary variable prof
Any decent compiler will do this for us, although doing this
will make grepping through the code alot easier.

v2: In both mixer and query interface
v3: rebase

Reviewed-by: Christian König <christian.koenig@amd.com> [v1]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-08-19 18:32:08 +02:00
Emil Velikov
1d260360d8 vl/idct: cleanup all idct buffers
Code should loop through and cleanup the three (VL_NUM_COMPONENTS) idct
buffers, rather than doing the first one three times.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-08-19 18:32:08 +02:00
Emil Velikov
5354d2e76a vl/buffer: add sanity check after CALLOC_STRUCT
Check if we have successfully allocated memory.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-08-19 18:32:08 +02:00
Emil Velikov
eab9bad1ac st/xvmc: exit gracefully if we fail to create video buffer
Free any allocated memory and return BadAlloc if create_video_buffer()
has failed to create a buffer.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-08-19 18:32:07 +02:00
Emil Velikov
5e91c15290 st/vdpau: don't try to create video buffer when the format is FORMAT_NONE
Not seen in the wild yet, but seems like a reasonable thing to do.
[suggested by Christian]

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-08-19 18:32:03 +02:00
Andy Furniss
3448b66dac vdpau/vl 422 chroma width/height mix up
I was looking into some minor 422 issues/discrepencies I noticed long
ago using vdpau on my rv790.

I noticed that there is code that is halving height rather than width -
422 is full height AFAIK.

Making the changes below doesn't actually make any noticable difference
to what I was looking into.

Maybe there are more but here's three I've found so far

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-08-19 18:31:26 +02:00
Vinson Lee
b1d05eeb1f radeonsi: Ensure fmask_format is initialized in release builds.
Fixes "Uninitialized scalar variable" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-08-19 09:19:19 -07:00
Paul Berry
c6b6c93643 i965: STATIC_ASSERT that there aren't too many BRW_NEW_* flags.
We are getting close to the maximum number of BRW_NEW_* bits that can
be stored in brw->state.dirty.brw without overflowing 32 bits, and
geometry shaders are going to add more.  Add a STATIC_ASSERT so that
we will be alerted when we need to switch to 64 bits.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-19 08:28:17 -07:00
Christian König
5ddd840f5a vl: add entrypoint to is_video_format_supported
Signed-off-by: Christian König <christian.koenig@amd.com>
2013-08-19 10:21:15 +02:00
Christian König
a15cbabb8b vl: add entrypoint to get_video_param
Signed-off-by: Christian König <christian.koenig@amd.com>
2013-08-19 10:21:15 +02:00
Christian König
f2f7064e56 vl: rename pipe_video_decoder to pipe_video_codec
Signed-off-by: Christian König <christian.koenig@amd.com>
2013-08-19 10:21:15 +02:00
Christian König
8e423ab984 vl: rename enum pipe_video_codec to pipe_video_format
Signed-off-by: Christian König <christian.koenig@amd.com>
2013-08-19 10:21:15 +02:00
Christian König
53e20b8b41 vl: use a template for create_video_decoder
Signed-off-by: Christian König <christian.koenig@amd.com>
2013-08-19 10:21:14 +02:00
Marek Olšák
d13003f544 glsl: don't eliminate texcoords that can be set by GL_COORD_REPLACE
Tested by examining generated TGSI shaders from piglit/glsl-routing.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
Tested-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-18 12:27:08 +02:00
Ilia Mirkin
a8346a2f52 nv50: allow non-nv12 buffers to be created, just pass them through to vl
Since we expose non-NV12 formats as supported when there is no decoer
profile selected, make sure that those formats are actually allowed to
be allocated.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-17 17:58:36 +02:00
Eric Anholt
bef423bee6 dri: Choose a decent global driNConfigOptions.
Previously, we were asserting that each driver specified an NConfigOptions
exactly equal to the number of options they supplied, leading to frequent
bugs when people would forget to adjust the value when adjusting driver
options.  Instead, just overallocate the table by a bit and leave sanity
checking to the assert in findOption().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-17 11:43:19 +02:00
Kenneth Graunke
703a2f4219 i965: Improve comments for driver hooks in intel_buffer_object.c.
Consistently using a "The ___ driver hook." line at the the top of each
function's comment block makes it easy to see at a glance what function
is being implemented.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 19:00:49 -07:00
Kenneth Graunke
96a0fe7e4d i965: Split intel_upload code out into a separate file.
This code upload performs batched uploads via a BO.  By moving it out to
a separate file, intel_buffer_objects.c only provides the core buffer
object functionality.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 19:00:49 -07:00
Kenneth Graunke
76c2533470 i965: Move GL_APPLE_object_purgeable functionality into a new file.
GL_APPLE_object_purgeable creates a mechanism for marking OpenGL objects
as "purgeable" so they can be thrown away when system resources become
scarce.  It specifically applies to buffer objects, textures, and
renderbuffers.

The intel_buffer_objects.c file provides core functionality for GL
buffer objects, such as MapBufferRange and CopyBufferSubData.  Having
texture and renderbuffer functionality in that file is a bit strange.

The 2010 copyright on the new file is because Chris Wilson first added
this code in January 2010 (commit 755915fa).

v2: Actually remember to call the new dd table setup function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 19:00:49 -07:00
Marek Olšák
aafb0f9e06 radeonsi: fix feature support reporting
broken by 21d9a1b5ef
2013-08-17 02:49:00 +02:00
Niels Ole Salscheider
5394ee8f30 clover: Fix linkage of libOpenCL
Clover needs the option component of llvm.

Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
2013-08-16 16:52:31 -07:00
Marek Olšák
21d9a1b5ef radeonsi: require LLVM 3.4 for MSAA 2013-08-17 01:48:25 +02:00
Marek Olšák
87b88f1dae radeonsi: don't make scanout resources linear except for cursors
The surface allocator understands the scanout flag just fine.

This seems to improve performance for Ubuntu Unity on top of st/xorg
and it fixes the cursor.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
89ca4a00f5 radeonsi: remove useless code from tex_fetch_args
The array slice has already been added to "address".

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
5550554f1e radeonsi: disable unbound colorbuffers
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
356c041167 radeonsi: port texture improvements from r600g
This started as an attempt to add support for MSAA texture transfers and
MSAA depth-stencil decompression for the DB->CB copy path.
It has gotten a bit out of control, but it's for the greater good.

Some changes do not make much sense, they are there just to make it look
like the other driver.

With a few cosmetic modifications, r600_texture.c can be shared with
a symlink.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
4855acd461 radeonsi: implement texture fetching for compressed MSAA textures (v2)
v2: use resource slots 16..31 for FMASK textures

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
f671dfa8aa radeonsi: add FMASK texture binding slots and resource setup (v2)
v2: bind FMASK textures to shader resource slots 16..31

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
3c3feb38f4 radeonsi: implement FMASK decompression for MSAA texturing
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
8c04f25360 radeonsi: scanout buffers cannot be a destination of MSAA resolve
Resolving to scanout buffers just doesn't work.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
2a4b2e2305 radeonsi: implement MSAA colorbuffer compression for rendering
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
2f1c449415 radeonsi: implement uncompressed MSAA texturing
This is glBlitFramebuffer support for MSAA surfaces as required by GL 3.0
and texturing as required by GL 3.2 and GL_ARB_texture_multisample.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
f083f79751 radeonsi: disable alpha-to-coverage for integer colorbuffers
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
6d4755a4d7 radeonsi: implement GL_SAMPLE_ALPHA_TO_ONE
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
07955d4f2b radeonsi: implement uncompressed MSAA rendering and color resolving
This is basic MSAA support which should work with most apps.
Some features are missing, those will be implemented by other commits.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-17 01:48:25 +02:00
Marek Olšák
c8e70e64ac radeonsi: add flexible shader descriptor management and use it for sampler views
It moves all sampler view descriptors to a buffer.
It supports partial resource updates and it can also unbind resources
(required for FMASK texturing).

The buffer contains all sampler view descriptors for one shader stage,
represented as an array. On top of that, there are N arrays in the buffer,
which are used to emulate context registers as implemented by the previous
ASICs (each array is a context).

This uses the RCU synchronization approach to avoid read-after-write hazards
as discussed in the thread:
"radeonsi: add FMASK texture binding slots and resource setup"

CP DMA is used to clear the descriptors at context initialization and to copy
the descriptors from one context to the next.

v2: - use PKT3_DMA_DATA on CIK (I'll test CIK later)
    - turn the bool CP DMA parameters into self-explanatory flags
    - add a nice simple API for packet emission to radeon_winsys.h
    - use 256 contexts, 128 causes texture corruption in openarena
2013-08-17 01:48:25 +02:00
Tom Stellard
764502b481 radeonsi/compute: Let the state tracker do all the flushing
It shouldn't be necessary to call radeon_winsys::cs_flush() from
radeonsi_launch_grid(), because the state tracker is responsible for
flushing the pipeline at the appropriate time.  The current behavior is
also wrong, because radeonsi_launch_grid() submits packets to the
compute ring, but when the state tracker calls pipe->flush() everything
is submitted to the graphics ring.  This has the potential to create a
race condition.

The downside of removing this flush is that the compute dispatch packets
will be sent to the graphics ring rather than the compute ring.
In the future we will need to come up with a way to detect 'compute'
command streams and submit them to the appropriate ring.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-08-17 01:48:25 +02:00
Kenneth Graunke
e29931aa74 i965: Dump more information about batch buffer usage.
Previously, INTEL_DEBUG=bat would dump messages like:

intel_mipmap_tree.c:1643: Batchbuffer flush with 456b used

This only reported the space used for command packets, and didn't
report any information on the space used for indirect state.

Now it dumps:

intel_context.c:366: Batchbuffer flush with 6128b (pkt) + 4288b (state)
= 10416b (31.8%)

This conveniently shows the breakdown of space used for packets vs.
state, as well as the percentage of batchbuffer space.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 15:54:24 -07:00
Kenneth Graunke
2a9492f321 i965: Add Gen7 depth stall flushes before disabling depth in BLORP.
We emit these before configuring depth in the normal path, or actually
using the depth buffer in BLORP - we just failed to emit them when
disabling depth altogether.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-16 15:03:55 -07:00
Kenneth Graunke
8fba8d4ee7 i965: Add Gen6 depth stall flushes before disabling depth in BLORP.
We emit these before configuring depth in the normal path, or actually
using the depth buffer in BLORP - we just failed to emit them when
disabling depth altogether.

On Sandybridge, this also requires the post_sync_nonzero flush.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-16 15:03:38 -07:00
Matt Turner
9c48ae751a i965: Don't copy propagate bitcasts with source modifiers.
Previously, copy propagation would cause bitcast_f2u(abs(float)) to
be performed in a single step, but the application of source modifiers
(abs, neg) happens after type conversion, leading to incorrect results.

That is, for bitcast_f2u(abs(float)) we would in fact generate code to
do abs(bitcast_f2u(float)).

For example, whereas bitcast_f2u(abs(float)) might result in a register
argument such as
   (abs)g2.2<0,1,0>UD

v2: Set interfered = true and break in register_coalesce instead of
    returning false.

Reviewed-by: Paul Berry <stereoytpe441@gmail.com>
2013-08-16 13:11:07 -07:00
Matt Turner
0ae9ca12a8 i965: Emit MOVs for neg/abs.
Necessary to avoid combining a bitcast and a modifier into a single
operation. Otherwise if safe, the MOV should be removed by
copy-propagation or register coalescing.

With this and the next patch, there are only four changes in shader-db:
all a single extra instruction. The code does something like
   mov a.w, -b.x
and copy propagation doesn't work because it only handles no-op
swizzles. Seems acceptable, given the known limitation of our copy
propagation.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereoytpe441@gmail.com>
2013-08-16 13:11:07 -07:00
Anuj Phogat
079bdba05f i965/blorp: Add support for single sample scaled blit with bilinear filter
Currently single sample scaled blits with GL_LINEAR filter falls
back to meta path. Patch removes this limitation in BLORP engine
and implements single sample scaled blit with bilinear filter.
No piglit, gles3 regressions are observed with this patch on Ivybridge.

V2: Use "sample" message to utilize the linear filtering functionality
built in to hardware.
V3: Define a bool variable (bilinear_filter) to handle the conditions
for GL_LINEAR blits.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 09:46:15 -07:00
Anuj Phogat
aff371b634 i965/blorp: Define a function to clamp texture coordinates
New function clamp_tex_coords() clamps the texture coordinates
to texture boundaries.  This function will also be utilized later
for the BLORP implementation of single-sample scaled blit with
bilinear filter.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 09:46:15 -07:00
Anuj Phogat
6066fb1721 i965/blorp: Use more appropriate variable names
When we talk about both multi-sample and single-sample scaled blits,
rect_grid_{x1, y1} are more appropriate variable names as compared
to sample_grid_{x1, y1}. There are no functional changes in this patch.
It just prepares for the BLORP implementation of single-sample scaled
blit with bilinear filter.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 09:46:15 -07:00
Anuj Phogat
d944a6144f meta: Fix blitting a framebuffer with renderbuffer attachment
This patch fixes a case of framebuffer blitting with renderbuffer
as color attachment and GL_LINEAR filter. Meta implementation of
glBlitFrambuffer() converts source color buffer to a texture and
uses it to do the scaled blitting in to destination buffer. Using
the exact source rectangle to create the texture does incorrect
linear filtering along the edges. This patch makes the changes to
extend the texture edges by one pixel in x, y directions. This
ensures correct linear filtering.
It fixes failing piglit fbo-attachments-blit-scaled-linear test.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 09:46:15 -07:00
Ilia Mirkin
a2061eea0f nv50: add vp3/vp4 support for mpeg2/vc1
h264/mpeg4 remain disabled for pre-nvc0, there's some minor
bug/difference which causes the decoding to hang after some frames.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-16 09:48:47 +02:00
Ilia Mirkin
b3f6f127f2 nv50: separate video logic from noalloc
The upcoming vp3 logic will want the video layout, but allocated by the
miptree.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-16 09:48:26 +02:00
Ilia Mirkin
c1a6f59b20 nv30: remove no-longer-used formats from table
Commit 14ee790df7 removed the formats from the vtxfmt_table but forgot
to also update the info_table.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
2013-08-16 09:48:09 +02:00
Fredrik Höglund
0e7a61a29f mesa: Update the BGRA vertex array error handling
The error code was changed from INVALID_VALUE to INVALID_OPERATION
in OpenGL 3.3. We should also generate an error when size is BGRA
and normalized is FALSE.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-15 21:38:13 -07:00
Kenneth Graunke
90129da82c i965/fs: Fix Sandybridge regressions from SEL optimization.
Sandybridge is the only platform that supports an IF instruction
with an embedded comparison.  In this case, we need to emit a CMP
to go along with the SEL.

Fixes regressions in Piglit's glsl-fs-atan-3, fs-unpackHalf2x16,
fs-faceforward-float-float-float, isinf-and-isnan fs_basic, and
isinf-and-isnan fs_fbo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68086
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: lu hua <huax.lu@intel.com>
2013-08-15 15:33:00 -07:00
Kenneth Graunke
c189840b21 i965: Force X-tiling for 128 bpp formats on Sandybridge.
128 bpp formats are not allowed to be Y-tiled on any architectures
except Gen7.

+11 Piglits on Sandybridge (mostly regression fixes since the
switch to Y-tiling).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63867
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64261
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-15 15:18:48 -07:00
Ian Romanick
41eef83cc0 mesa/vbo: Fix handling of attribute 0 in non-compatibilty contexts
It is only in OpenGL compatibility-style contexts where generic
attribute 0 and GL_VERTEX_ARRAY have a bizzare, aliasing relationship.
Moreover, it is only in OpenGL compatibility-style contexts and OpenGL
ES 1.x where one of these attributes provokes the vertex.  In all other
APIs each implicit call to glArrayElement provokes a vertex regardless
of which attributes are enabled.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Robert Bragg <robert@sixbynine.org>
Cc: "9.0 9.1 9.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55503
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66292
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67548
2013-08-15 14:59:37 -07:00
Zack Rusin
7115bc3940 draw: handle nan clipdistance
If clipdistance for one of the vertices is nan (or inf) then the
entire primitive should be discarded.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-08-15 16:26:32 -04:00
Vinson Lee
035bf21983 i915,i965: Fix memory leak in try_pbo_upload (v2)
Fixes "Resource leak" defect reported by Coverity.
Tested on Haswell, no Piglit regressions.

v2: Apply to i965, not just i915. (chadv)

CC: "9.2, 9.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-15 10:37:22 -07:00
Roland Scheidegger
6ca18e06ae gallivm: revert accidentally commited hunk
That magic wasn't meant to be commited, need to work on some proper fix.
2013-08-15 19:26:39 +02:00
Roland Scheidegger
5626a84a00 gallivm: do per-sample depth comparison instead of doing it post-filter
Doing the comparisons pre-filter is highly recommended by OpenGL (and d3d9)
and definitely required by d3d10.
This actually doesn't do it pre-filter but more "in-filter" as otherwise
need to push the comparisons even further down into fetch code and this
also trivially allows using a somewhat cheaper lerp.
Doing it pre-filter would actually have some performance advantage for UNORM
formats (because the comparisons should be done in texture format, we'd only
need to convert the shadow ref coord to texture format once, but in turn would
save converting the per-sample texture values to floats) but this gets a bit
messy as this has implications for border color handling as well (which needs
to be done prior to depth comparisons, hence would also need to convert border
color to texture format too or use some other tricks like doing separate border
color / shadow ref comparison and simply using that result directly when doing
border replacement).
Should make no difference for nearest filtering, and performance for linear
filtering should be mostly the same too (essentially have one more comparison
instruction per sample, and replace the sub/mul/add lerp with a sub/and/and/add
special "lerp" which all in all shouldn't be much of a difference).

v2: get rid of old code completely

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-15 18:42:20 +02:00
Michel Dänzer
3b2f3f90ac radeonsi: Pixel shaders pre-load one more SGPR
Acked-by: Marek Olšák <maraeo@gmail.com>
2013-08-15 17:55:00 +02:00
Michel Dänzer
f0753a3cd4 radeonsi: TGSI_SEMANTIC_CLIPVERTEX doesn't use any parameters 2013-08-15 17:54:40 +02:00
Michel Dänzer
2f98dc223f radeonsi: Don't export unused clip distance vectors from vertex shader
E.g. the Source engine seems to always write to gl_ClipVertex, but normally
doesn't enable any GL_CLIP_DISTANCEn states. This change removes some
irrelevant parts from the generated vertex shader code in such cases.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-15 17:53:50 +02:00
Michel Dänzer
b00269aa58 radeonsi: Don't leave gaps between position exports from vertex shader
If the vertex shader exports clip distances but not point size, use
position exports 1/2 instead of 2/3 for the clip distances. Fixes
geometry corruption in that case.

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

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-15 17:42:26 +02:00
Roland Scheidegger
abdd32dcd5 llvmpipe: fix stencil bug if we have both stencil and depth tests
This is a very well hidden bug found by accident (only the fixed glean
tstencil2 test so far seems to hit it).
We must use new mask with combined s_pass values and orig_mask values
for zpass/zfail stencil ops, otherwise both the sfail op and one of
zpass/zfail op are applied (probably not hit in most tests because
some of the ops tend to be KEEP usually).

Note: this is a candidate for the 9.2 branch.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-15 17:30:07 +02:00
Roland Scheidegger
7ae9cc71f0 st/mesa: use new float comparison opcodes if native integers are supported
Should get rid of some float-to-int conversions (with negation).
No piglit regressions (with llvmpipe).

v2: fix bogus formatting spotted by Brian.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-15 17:30:07 +02:00
Ilia Mirkin
4ea191fb2d nvc0: move video param and format support functions to nouveau
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:19:48 +02:00
Ilia Mirkin
9255019a53 nvc0: move firmware loading functions to nouveau
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:19:48 +02:00
Ilia Mirkin
9d8c076803 nvc0: move some of the simpler decoder functions into nouveau
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:19:48 +02:00
Ilia Mirkin
73f4499a02 nvc0: move vp param filling logic into nouveau
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:19:48 +02:00
Ilia Mirkin
e1cd987bb6 nvc0: move bsp param-filling logic into nouveau
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:19:48 +02:00
Ilia Mirkin
d6a82a7747 nvc0: move nvc0_decoder into nouveau, rename to nouveau_vp3_decoder
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:19:47 +02:00
Ilia Mirkin
86e5c3c97b nvc0: standardize on using #if for NVC0_DEBUG_FENCE
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:19:47 +02:00
Ilia Mirkin
b57875bbb3 nvc0: refactor video buffer management logic into nouveau_vp3
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:19:47 +02:00
Ilia Mirkin
940f7cec77 nv50: allow forcing PMPEG use, for ease of testing
This also allows people who don't want to install the binary blobs
required for VP2 to still get MPEG decoding.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:15:23 +02:00
Ilia Mirkin
ee3ca3614e nv30: hook up PMPEG support via nouveau_video, enables XvMC to work
Force the format to be the reasonable format that doesn't require an
inverse z-scan.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:15:12 +02:00
Ilia Mirkin
6010c683d0 nouveau: set buffer format of video buffer
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:15:04 +02:00
Ilia Mirkin
8975f83402 nouveau: fix number of surfaces in video buffer, use defines
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-15 15:15:02 +02:00
Ilia Mirkin
14ee790df7 nv30: U8_USCALED only works for size 4
See https://bugs.freedesktop.org/show_bug.cgi?id=61635 for a sample
program. Changing it to use a vec4 makes it work. Remove the unsupported
formats.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
2013-08-15 15:14:25 +02:00
Chris Forbes
4f739646b0 i965: allow 8 user clip planes on CTG+
There's no need to use a clip flag for NEGW on these gens, so
no reason we can't just enable 8 planes.

V2: - Bump (and document!) MAX_VERTS in the clip code.
    - Fix clip flag masks in the clip unit state and in the shader
      prolog
    - Move this to the end of the series for less breakage.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:24:56 +12:00
Chris Forbes
ee0b8e0f06 i965: get rid of clip plane compaction
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:24:56 +12:00
Chris Forbes
cf52f6435e i965/clip: Support clip distances for line clipping
This does the same thing as we do for triangle clipping -- select the
appropriate source (either dot(hpos,fixed plane) or a clipdistance
slot).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:24:56 +12:00
Chris Forbes
2a8a85e1ad i965/clip: remove spurious clipvertex param
Nothing in the clipper uses gl_ClipVertex any more, so we don't care
where it is.

V2: Don't bother fishing out the clipvertex offset either.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:24:56 +12:00
Chris Forbes
45540921ec i965/clip: Use clip distances for all user clipping
V2: Adjust explanation of load_clip_distance()

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:24:55 +12:00
Chris Forbes
bf9ede92c2 i956/clip: push dp4 into load_clip_distance
Soon the dp4 is only going to be used for fixed clip planes.

V2: Remove old inaccurate comment about the behavior of this function;
add a better explanation above.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:24:55 +12:00
Chris Forbes
265336e75a i965/clip: Track offset into the vertex for clipdistance
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:24:55 +12:00
Chris Forbes
3b738f5f85 i965/Gen4-5: Set clip flags from clip distances
V2: - Use the new VS_OPCODE_UNPACK_FLAGS_SIMD4X2 to correctly split the
      flags for the two vertices being processed together.
    - Don't apply bogus masking of clip flags. The set of plane enables
      aren't included in the shader key, and we wouldn't want the
      recompiles anyway.

V3: - Tidy up spurious instructions, name temps properly.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
[V2] Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:24:55 +12:00
Chris Forbes
a9be50f776 i965: add new VS_OPCODE_UNPACK_FLAGS_SIMD4X2
Splits the bottom 8 bits of f0.0 for further wrangling
in a SIMD4x2 program. The 4 bits corresponding to the channels in each
program flow are copied to the LSBs of dst.x visible to each flow.

This is useful for working with clipping flags in the VS.

V3: - Fixup immediate types
    - Teach scheduler about the hidden dep on flags

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
V2: Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:24:38 +12:00
Chris Forbes
9e2c1e28a1 i965/vs: add vec4_instruction::depends_on_flags
We're about to have an instruction that depends on the flags but isn't
predicated. This lays the groundwork.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2013-08-16 07:21:43 +12:00
Chris Forbes
c5e2d0454b i965/clip: Enable interpolation of clip distances
Previously we had disabled interpolation of the clip distances as a
special case, since they were unused.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:21:42 +12:00
Chris Forbes
972e2f11c0 i965/vs: Do legacy clip lowering earlier
We need to produce clip flags for the vertex header on Gen4/5, so
clip plane lowering has to be done before we try to emit the flags/psiz
attribute.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:21:37 +12:00
Chris Forbes
9e07a68cad i965/Gen4-5: ensure VUE slots for clipdistance are valid if user clipping is enabled.
V2: We don't particularly care where they fall in the VUE map, as long
as they are allocated somewhere, and occupy two contiguous slots. Don't
fiddle with the SF layout at all -- there's no need.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-16 07:20:47 +12:00
Chia-I Wu
a453eb6f86 ilo: fix fragment shaders that use PCB on GEN7+
Missed this commit when preparing PCB changes for upstreaming.
2013-08-15 11:35:46 +08:00
Vinson Lee
ae645b83fc nouveau: Fix variable name.
Fixes build error introduced with commit
d1ba1055d9.

  CC     nouveau_video.lo
nouveau_video.c: In function 'nouveau_screen_get_video_param':
nouveau_video.c:866:33: error: 'screen' undeclared (first use in this function)
nouveau_video.c:866:33: note: each undeclared identifier is reported only once for each function it appear

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-08-14 17:35:31 -07:00
Matt Turner
57a6bcd56b glsl: Add i2b() and b2i() to ir_builder.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-14 17:15:06 -07:00
Matt Turner
1cf76c72da glsl: Add nequal() to ir_builder.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-14 17:15:06 -07:00
Matt Turner
16be6298c0 glsl: Add abs() to ir_builder.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-14 17:15:06 -07:00
Matt Turner
6bfb1a8344 glsl: Add bitcast_i2f() to ir_builder.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-14 17:15:06 -07:00
Marek Olšák
3d1b01662b radeonsi: unduplicate code in create_context
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-15 02:03:03 +02:00
Marek Olšák
e801b78aa0 radeonsi: initialize the radeon_surface structure
this fixes valgrind warnings

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-15 02:03:03 +02:00
Marek Olšák
731c6aa52d radeonsi: correct sampler function names
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-15 02:03:03 +02:00
Marek Olšák
0469171159 radeonsi: rename r600_texture::dirty_db_mask to dirty_level_mask
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-15 02:03:03 +02:00
Marek Olšák
363b2805f7 radeonsi: rename r600_resource_texture to r600_texture
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-15 02:03:02 +02:00
Marek Olšák
128819d394 tgsi: add info about MSAA samplers to tgsi_shader_info
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-15 02:03:02 +02:00
Marek Olšák
0ee4bae70d tgsi: fix the location of sample index
The sample index is always in W.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-08-15 02:03:02 +02:00
Roland Scheidegger
7727fbb7c5 r600/radeonsi: implement new float comparison instructions
Also use ordered comparisons for old cmp instructions.

Tested-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Tom Stellard <tom@stellard.net>
2013-08-15 00:40:14 +02:00
Roland Scheidegger
72874d2352 nv50: implement new float comparison instructions
untested.

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2013-08-15 00:40:14 +02:00
Roland Scheidegger
e858921d52 ilo: implement new float comparison instructions
untested.

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2013-08-15 00:40:14 +02:00
Roland Scheidegger
e58c2310b8 gallivm: already pass coords in the right place in the sampler interface
This makes things a bit nicer, and more importantly it fixes an issue
where a "downgraded" array texture (due to view reduced to 1 layer and
addressed with (non-array) samplec instruction) would use the wrong
coord as shadow reference value. (This could also be fixed by passing
target through the sampler interface much the same way as is done for
size queries, might do this eventually anyway.)
And if we'd ever want to support (shadow) cube map arrays, we'd need
5 coords in any case.

v2: fix bugs (texel fetch using wrong layer coord for 1d, shadow tex
using wrong shadow coord for 2d...). Plus need to project the shadow
coord, and just for fun keep projecting the layer coord too.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-15 00:40:14 +02:00
Roland Scheidegger
d4b43cedb6 gallivm: change coordinate handling throughout functions
Instead of passing s,t,r coordinates pass a coord array - the reason is that
I need to pass more coords (in particular for shadow "coord", future will also
need another one for cube map arrays) so just pass them as an array.
Also, to simplify things, use fixed location for the shadow reference value I
want to get rid of the silly "where is the right coord value" game.
Keep old-style however for aos sampling (which is not going to need shadow
coord, though for cube map arrays it still would need fixing).
(Next patch will pass those through using the new arrangement directly from
sampler interface.)

v2: fix up soa split path (unreachable currently but still...)

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-15 00:40:14 +02:00
Roland Scheidegger
c6c55ad3e9 gallivm: fix border color with normalized texture formats
We need to put border color into texture format color space which
essentially means clamping for non-float, normalized formats (not entirely
sure if we're also meant to quantize the float but it's probably ok not to
do it thankfully).
For OpenGL we could do this easily outside generated code due to the
1:1 sampler/texture correspondence but not for d3d10 which is terrible
(as we recalculate a constant over and over again per shader invocation).
Fortunately border color should be rare enough that we don't care THAT much.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-15 00:40:14 +02:00
Zack Rusin
27cedd8aec llvmpipe: fix pipeline statistics with a null ps
If the fragment shader is null then pixel shader invocations have
to be equal to zero. And if we're running a null ps then clipper
invocations and primitives should be equal to zero but only
if both stancil and depth testing are disabled.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-08-14 18:23:36 -04:00
Zack Rusin
a3ae5dc7dd draw: make sure that the stages setup outputs
Calling the prepare outputs cleans up the slot assignments
for outputs, unfortunately aapoint and aaline didn't have
code to reset their slots after the initial setup, this
was messing up our slot assignments. The unfilled stage
was just missing the initial assignment of the face slot.
This fixes all of the reported piglit failures.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-08-14 18:23:35 -04:00
Paul Berry
98d2498404 glsl: Fix incorrect pattern matching in ir_set_program_inouts
In commit 8fc41df (glsl: Modify ir_set_program_inouts to handle
geometry shaders), when attempting to pattern match the "foo" part of
expressions such as:

   foo[i][j]
   foo[i]

I incorrectly called as_dereference_variable() on the subexpression
foo[i] instead of foo.  As a result, the pattern never matched, so
ir_set_program_inouts would fall back on marking the entire variable
as used, rather than just the portion indexed by the array.

This didn't result in incorrect behaviour, but it could have resulted
in inefficiency by causing the back-end to allocate resources for
unused parts of an input or output array.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-14 10:53:47 -07:00
Rico Schüller
d1ba1055d9 vl: Add support for max level query v2
This patch adds the level query support to the video decoders
and uses some more reasonable defaults.

v2: (ck) add commit message

Reviewed-by: Christian König <christian.koenig@amd.com>
2013-08-14 13:20:01 +02:00
Ian Romanick
830f4df993 glsl: Emit better warnings for things that look like default precision statements
Previously we would emit a warning for empty declarations like

float;

We would also emit the same warning for things like

highp float;

However, this second case is most likely the application trying to set
the default precision.  This makes the compiler generate a stronger
warning with some suggestion of a fix.

It really seems like this should be an error.  I'll bet that 100% of the
time someone writes 'highp float;' the actually meant 'precision highp
float;'.  Alas, both AMD and NVIDIA accept this syntax, and the spec
doesn't explicitly forbid it.

This makes piglit's precision-05.vert generate the following warnings:

0:12(11): warning: empty declaration with precision qualifier, to set the default precision, use `precision lowp float;'
0:13(12): warning: empty declaration with precision qualifier, to set the default precision, use `precision mediump int;'

v2: Add { } around a one-line if body and fix a comment.  Suggested by
Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-13 20:47:20 -07:00
Paul Berry
825f9ff5d3 glsl/ast: Don't perform GS input array checks on non-inputs.
Previously, we were accidentally calling
handle_geometry_shader_input_decl() on non-input interface block
declarations, resulting in bogus error checking.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-13 20:02:55 -07:00
Paul Berry
91c8fea924 glsl/ast: Fix assertion failure when GS input declared as non-array.
Previously, if a geometry shader input was declared as a non-array, we
would flag the proper compiler error, but then before we got a chance
to report it to the client, handle_geometry_shader_input_decl() would
assertion fail.

With this patch, handle_geometry_shader_input_decl() ignores
non-arrays.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-13 20:02:54 -07:00
Paul Berry
336351e971 glsl/ast: Check that geometry shader interface block inputs are arrays.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-13 20:02:54 -07:00
Paul Berry
3b837e637e i965/gen7+: Fix build error introduced by renaming upload_3dstate_so_decl_list.
Commit 9f9ccf707c renamed
upload_3dstate_so_decl_list to gen7_upload_3dstate_so_decl_list but
forgot to update the caller.
2013-08-13 19:36:27 -07:00
Jon Severinsson
9298f537a7 radeon/llvm: Add missing "%s" format string to fprintf.
This fixes a compilation warning with -Wformat-security.

CC: "9.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-13 19:18:14 -07:00
Chad Versace
11b8f8e7e4 i965: Move arrays brw_multisample_positions* to new header
Move the arrays to the new header brw_multisample_state.h, which will be
shared with Broadwell code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-13 18:04:20 -07:00
Chad Versace
7eecda29c8 i965: Refactor names of sample_positions_8/4x arrays
Place each array in the brw namespace by renaming it:
    sample_positions_4x -> brw_multisample_positions_4x
    sample_positions_8x -> brw_multisample_positions_8x

This prepares for moving the arrays to a header shared by gen6 and gen8.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-13 18:03:59 -07:00
Kenneth Graunke
9f9ccf707c i965/gen7+: Mark upload_3dstate_so_decl_list as non-static (v2)
We will reuse this for Broadwell.

v2: Prefix function name with 'gen7'. (chadv)

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-13 18:03:57 -07:00
Kenneth Graunke
f4e5c235de i965: Mark a few brw_draw_upload.c functions as non-static
We will reuse these for Broadwell.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-13 18:02:13 -07:00
Ian Romanick
1b35e33af4 glsl: Require function return type arrays be explicitly sized
Fixes piglit array-function-return-unsized.vert.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-13 17:53:33 -07:00
Ian Romanick
42624b1c81 glsl: Move and refine test for unsized arrays in GLSL ES
GLSL ES does not allow unsized arrays, and GLSL ES 1.00 does not allow
array initializers.  However, GLSL ES 3.00 allows array initializers,
and the initializer can explicitly size the array.  The specification
even includes some examples of this:

    float x[] = float[2] (1.0, 2.0);     // declares an array of size 2
    float y[] = float[] (1.0, 2.0, 3.0); // declares an array of size 3

    float a[5];
    float b[] = a;

Move the unsized array check to after the initializer has been
processed.  If the array is still unsized, generate the error.  This
should have no effect in GLSL ES 1.00 because, as previously mentioned,
array initializers are not allowed.

Fixes piglit "glsl-es-3.00 compiler array-sized-by-initializer.vert".

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
2013-08-13 17:53:33 -07:00
Ian Romanick
d5aee174b8 glx: Generate GLXBadDrawable when drawable is zero
Fixes piglit glx-query-drawable-GLXBadDrawable.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-13 17:53:33 -07:00
Ian Romanick
ef83bd2b95 mesa: Use _mesa_detach_renderbuffer when deleting a texture
The functional change is that now invalidate_framebuffer is called if
the texture is actually detached from one of the currently bound FBOs.
Previously this was only done for renderbuffers.

The remaining changes make the texture delete path look more similar to
the renderbuffer delete path.  This includes adding relevant spec
quotations to justify the behavior.

Fixes piglit fbo-incomplete "delete texture of bound FBO" test.

v2: Move 'fb->Attachment[i].Texture == att' check from previous patch to
this patch... where it was intended to be in the first place.  Noticed
by Chad.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-13 17:53:33 -07:00
Ian Romanick
438cc6bc49 mesa: Make detach_renderbuffer available outside fbobject.c
Also add a return value indicating whether any work was done.

This will be used by the next patch.

v2: Move 'fb->Attachment[i].Texture == att' check to the next
patch... where it was intended to be in the first place.  Noticed by
Chad.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-13 17:53:33 -07:00
Ian Romanick
341fb93c16 meta: Don't call _mesa_Ortho with width or height of 0
Fixes failures in oglconform fbo mipmap.manual.color,
mipmap.manual.colorAndDepth, mipmap.automatic, and
mipmap.manualIterateTexTargets subtests.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-13 17:53:33 -07:00
Vadim Girlin
17bb96b03d r600g/sb: use MULADD workaround on R7xx for MULADD_IEEE
Looks like the same issue that was seen with MULADD in trans slot on
R7xx also affects MULADD_IEEE (maybe all OP3 instructions and MULADD is
just a most frequently used?). So the workaround is to not allow affected
instructions to be placed into the trans slot.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=67927

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-14 01:03:18 +04:00
Roland Scheidegger
6991f86945 gallivm: implement new float comparison instructions returning integer masks
FSEQ/FSGE/FSLT/FSNE work just the same as SEQ/SGE/SLT/SNE except skip the
select.
And just for consistency use the same appropriate ordered/unordered comparisons
for the old opcodes as well.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-13 19:09:17 +02:00
Roland Scheidegger
0930082ffd tgsi: implement new float comparison instructions returning integer masks
Also while here add a bunch of other forgotten (integer) instructions to
tgsi_util_get_inst_usage_mask() (which isn't used for much except optimizing
away unused input components), though it may still be incomplete.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-13 19:09:17 +02:00
Roland Scheidegger
e7a5bf7a34 gallium: add new float comparison instructions returning integer masks
Newer graphic languages don't want messy float mask results but instead true
"boolean" mask results for float comparisons. Otherwise just need to convert
the floats back to integers. Need to keep the old opcodes however due to both
legacy (gl and d3d9) needing them and because older hw can't really deal with
integers. These new FSEQ/FSGE/FSLT/FSNE opcodes are part of integer API and
hence must be supported if a driver claims to support glsl 1.30 (or
PIPE_SHADER_CAP_INTEGERS).

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-13 19:09:17 +02:00
Chia-I Wu
3b6cee1634 ilo: enable dumping of WM PCB
It was disabled because it wasn't supported.
2013-08-13 16:28:24 +08:00
Chia-I Wu
0f8a86682f ilo: no binding table change when constants are pushed
When constants can be pushed, and nothing else requires new SURFACE_STATEs,
there is no need to emit BINDING_TABLE_STATE.
2013-08-13 16:26:03 +08:00
Chia-I Wu
c6e1e0157b ilo: support push constant model in shaders
Source constants from URB constant data when the constant data can fit in the
PCB.
2013-08-13 16:04:35 +08:00
Chia-I Wu
5e30ffbda6 ilo: support copying constant buffer 0 to PCB
Add ILO_KERNEL_PCB_CBUF0_SIZE so that a kernel can specify how many bytes of
constant buffer 0 need to be copied to PCB.
2013-08-13 15:52:41 +08:00
Chia-I Wu
5df62dce34 ilo: make constant buffer 0 upload optional
Add ILO_KERNEL_SKIP_CBUF0_UPLOAD so that we can skip constant buffer 0 upload
when the kernel does not need it.
2013-08-13 15:52:37 +08:00
Chia-I Wu
8b5b5fe394 Revert "ilo: initialize constant buffer SURFACE_STATE early"
This reverts commit a9b800aa81.  With push
constant support, the constructed SURFACE_STATE is unused and wasted.  The
change only slows things down.
2013-08-13 15:24:58 +08:00
Armin K
f423eba46e gbm: Link to libwayland-drm if Wayland EGL platform is enabled
We were relying on libEGL to pull in libwayland-client symbols, but with
commit 2c2e64edab cleaned up the
symbol leak.

https://bugs.freedesktop.org/show_bug.cgi?id=67962
2013-08-12 15:16:22 -07:00
Roland Scheidegger
cd2f26090a gallivm: fix exec_mask interaction with geometry shader after end of main
Because we must maintain an exec_mask even if there's currently nothing
on the mask stack, we can still have an exec_mask at the end of the program.
Effectively, this mask should be set back to default when returning from main.
Without relying on END/RET opcode (I think it's valid to have neither) it is
actually difficult to do this, as there doesn't seem any reasonable place to
do it, so instead let's just say the exec_mask is invalid outside main (which
it really is effectively).
The problem is that geometry shader called end_primitive outside the shader
(in the epilogue), and as a result used a bogus mask, leading to bugs if we
had to set the (somewhat misnamed) ret_in_main bit anywhere. So just avoid
the mask combining function when called from outside the shader.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-12 23:33:00 +02:00
Roland Scheidegger
dfa7b72563 draw: simplify prim mask construction
The code was quite weird, the second comparison was in fact a complete no-op
and we can also do the comparison with the vector directly instead of scalar,
which should not also be faster but it is way more obvious how that mask
is actually going to look like.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-12 23:33:00 +02:00
Roland Scheidegger
7147094ff2 gallivm: simplify geometry shader mask handling a bit
Instead of reducing masks to 0/1 simply use the mask directly as -1.
Also use some signed comparison instead of unsigned (as far as I understand
these values have to be (very) small and signed means llvm doesn't have to
apply additional logic to do the unsigned comparisons the cpu can't do).
Saves a couple of instructions in some test geometry shader here.

v2: that was a bit to much optimization, don't skip combining the masks...

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-12 23:33:00 +02:00
Roland Scheidegger
84fce45321 draw: (trivial) dump tgsi for geometry shaders with GALLIVM_DEBUG_TGSI
And dump the variant key too (same as vs does).
Just so I can stop wondering why I see the tgsi dump for fs and vs but not
gs...
2013-08-12 23:33:00 +02:00
Roland Scheidegger
8c5283dc17 gallivm: (trivial) fix typo in argument declaration of lp_build_size_query_soa
Was meant to match the name used elsewhere, spotted by Anthony.
2013-08-12 23:33:00 +02:00
Kenneth Graunke
4d95efd146 i965/fs: Add dump_instruction() support for ARF destinations.
CMP instructions use BRW_ARF_NULL as a destination.  Prior to this
patch, dump_instruction() decoded the destination as "???".

Now it decodes BRW_ARF_NULL as "(null)" and other ARFs numerically.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-12 13:13:06 -07:00
Kenneth Graunke
ee7bfab068 i965/fs: Remove extraneous newline in dump_instruction() for CMP.
This resulted in printouts like:

   246: cmp.cmod.f0.0
    ???, vgrf152, 0.000000f, (null),

With this patch, CMP is properly printed on one line.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-12 13:13:04 -07:00
Kenneth Graunke
80e1c2f35f i965/fs: Optimize IF/MOV/ELSE/MOV/ENDIF to SEL when possible.
Many GLSL shaders contain code of the form:

   x = condition ? foo : bar

The compiler emits an ir_if tree for this, since each subexpression
might be a complex tree that could have side-effects and short-circuit
logic operations.

However, the common case is to simply pick one of two constants or
variable's values---which is exactly what SEL is for.  Replacing IF/ELSE
with SEL also simplifies the control flow graph, making optimization
passes which work on basic blocks more effective.

The shader-db statistics:

   total instructions in shared programs: 1655247 -> 1503234 (-9.18%)
   instructions in affected programs:     949188 -> 797175 (-16.02%)

   2,970 shaders were helped, none hurt.  Gained 181 SIMD16 programs.

This helps Valve's Source Engine games (max -41.33%), The Cave
(max -33.33%), Serious Sam 3 (max -18.64%), Yo Frankie! (max -30.19%),
Zen Bound (max -22.22%), GStreamer (max -6.12%), and GLBenchmark 2.7
(max -1.94%).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-12 13:13:01 -07:00
Kenneth Graunke
2c32c3985c i965/fs: Consider predicated SEL instructions as whole variable writes.
The instruction

   (+f0.0) SEL dst, src0, src1

will write either src0 or src1 to dst, depending on the predicate.
Unlike most predicated instructions, it always writes to dst.

fs_inst::is_partial_write() is supposed to return true if the whole
register is guaranteed to be written.  The !inst->predicated check makes
sense for most instructions, which might not write the whole register,
but SEL is a special case.

This caused live interval analysis to ignore the destination of
predicated SEL instructions when computing "def" information.

Requires the previous commit to avoid regressions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-12 13:12:59 -07:00
Kenneth Graunke
d21f542aa1 i965/fs: Explicitly disallow CSE on predicated instructions.
The existing inst->is_partial_write() already disallows predicated
instructions, so this has no functional change.  However, it's worth
doing explicitly since the CSE pass does not consider the flag register.
This means it could blindly factor out operations that use the same
sources, but which have different condition codes set.

This prevents a regression in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-12 13:12:57 -07:00
Kenneth Graunke
53d8cff63b i965/fs: Log a performance warning if skipping 16-wide due to pulls.
Usually, the driver creates both 8-wide and 16-wide variants of every
fragment shader.  When 16-wide compilation fails, it logs a performance
warning explaining why only an 8-wide program exists.

However, when there are pull parameters, the driver won't even bother
trying the 16-wide compile (since it would fail).  In this case, it
failed to emit a performance warning, leaving no explanation for the
missing 16-wide program.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-12 13:12:47 -07:00
Chia-I Wu
a9b800aa81 ilo: initialize constant buffer SURFACE_STATE early
Fix ilo_gpe_init_view_surface_for_buffer to allow buffer to be NULL, and add
ilo_gpe_set_view_surface_bo to set it later.  This allows us to set up
SURFACE_STATE early for constant buffers backed by user buffers.
2013-08-12 11:49:51 +08:00
Chia-I Wu
b2f79a3823 ilo: 3DSTATE_INDEX_BUFFER may be wrongly skipped
In finalize_index_buffer(), when the current index buffer was destroyed due to
u_upload_data(), it may happen that the new index buffer is at the same
address as the old one.  Comparing the pointers to the two buffers could fail
to work, and 3DSTATE_INDEX_BUFFER would be incorrectly skipped.

Holding a reference to the current index buffer before calling u_upload_data()
should fix the problem.
2013-08-10 13:01:41 +08:00
Chris Forbes
637e6a0aa8 i965: add missing BRW_NEW_INTERPOLATION_MAP to state dump
Makes this flag appear in the output for INTEL_DEBUG=state

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-10 20:29:12 +12:00
Chris Forbes
e114b13dae i965: Add a new debug mode for the VUE map
INTEL_DEBUG=vue now emits a listing of each slot in the VUE map,
and the corresponding interpolation mode.

V2: Fix whitespace issues.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-10 20:28:45 +12:00
Ian Romanick
5894898148 glsl: Don't allow const on out or inout function parameters
Fixes piglit tests const-inout-parameter.frag and
const-out-parameter.frag.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-09 13:51:18 -07:00
Roland Scheidegger
894d4903e7 gallivm: set non-existing values really to zero in size queries for d3d10
My previous attempt at doing so double-failed miserably (minification of
zero still gives one, and even if it would not the value was never written
anyway).
While here also rename the confusingly named int_vec bld as we have int vecs
of different sizes, and rename need_nr_mips (as this also changes out-of-bounds
behavior) to is_sviewinfo too.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-09 20:49:19 +02:00
Roland Scheidegger
b0f74250e1 gallivm: use texture target from shader instead of static state for size query
d3d10 has no notion of distinct array resources neither at the resource nor
sampler view level. However, shader dcl of resources certainly has, and
d3d10 expects resinfo to return the values according to that - in particular
a resource might have been a 1d texture with some array layers, then the
sampler view might have only used 1 layer so it can be accessed both as 1d
or 1d array texture (I think - the former definitely works). resinfo of a
resource decleared as array needs to return number of array layers but
non-array resource needs to return 0 (and not 1). Hence fix this by passing
the target from the shader decl to emit_size_query and use that (in case of
OpenGL the target will come from the instruction itself).
Could probably do the same for actual sampling, though it may not matter there
(as the bogus components will essentially get clamped away), possibly could
wreak havoc though if it REALLY doesn't match (which is of course an error
but still).

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-09 20:49:18 +02:00
Roland Scheidegger
38ad404f76 gallivm: honor d3d10's wishes of out-of-bounds behavior for texture size query
Specifically, must return 0 for non-existent mip levels (and non-existent
textures which is an unsolved problem) for everything but total mip count.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-09 20:49:18 +02:00
Paul Berry
417dc8081b glsl: Enable ARB_fragment_coord_conventions functionality in GLSL 1.50.
GLSL 1.50 incorporates the functionality of the
ARB_fragment_coord_conventions extension, so we need to make this
functionality available even if the extension isn't enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-09 10:35:06 -07:00
Paul Berry
13fedf2883 main: Fix deprecation of glLineWidth()
From section E.1 (Profiles and Deprecated Features of OpenGL 3.0)
of the OpenGL 3.0 spec:

    "LineWidth is not deprecated, but values greater than 1.0
    will generate an INVALID VALUE error"

From context it is clear that values greater than 1.0 should only
generate an INVALID VALUE error in a forward-compatible context.

The code was correctly quoting this spec text, but it was disallowing
all line widths in forward-compatible contexts, instead of just widths
greater than 1.0.

This patch introduces the correct check, so that setting a line width
of 1.0 or less is permitted.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-09 10:34:05 -07:00
Roland Scheidegger
836098f6b2 util: (trivial) fix asm input/output list for fxsave
Otherwise gcc might do very unsafe optimizations, spotted by Uros Bizjak.
Hopefully this time it's finally right?
2013-08-09 17:30:13 +02:00
Alex Deucher
c88783047e r600g: disable GPUVM by default
Cayman and trinity systems still seem to suffer from
stability problems with GPUVM.  This also fixes compute
on these asics.  It can still be enabled for testing
by setting env var RADEON_VA=true.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=65958

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-08-09 10:51:25 -04:00
Zack Rusin
e8d8974f80 softpipe: fix the regressions
softpipe has a really weird handling of the draw attrs, lets
just not inject outputs in its data.
Trivial.
2013-08-08 20:54:50 -04:00
Zack Rusin
662a4d4a12 draw: rewrite primitive assembler
We can't be injecting the primitive id's in the pipeline because
by that time the primitives have already been decomposed. To
properly number the primitives we need to handle the adjacency
primitives by hand. This patch moves the prim id injection into
the original primitive assembler and completely removes the
useless pipeline stage.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-08-08 20:54:25 -04:00
Zack Rusin
1d425c4c6d draw: reset the vertex id when injecting new primitive id
Without reseting the vertex id, with primitives where the same
vertex is used with different primitives (e.g. tri/lines strips)
our vbuf module won't re-emit those vertices with the changed
primitive id. So lets reset the vertex id whenever injecting
new primitive id to make sure that the vertex data is correctly
emitted.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-08-08 20:54:03 -04:00
Zack Rusin
57cd326778 draw: cleanup the extra attribs
Before inserting new front face and prim id outputs cleanup
the old extra outputs, otherwise our cache will use previous
output slots which will break as soon as outputs of the current
shader don't match the last.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-08-08 20:53:40 -04:00
Dieter Nützel
8f40fa0e7f util: (trivial) fix more compile errors in u_cpu_detect (gcc/x86 this time).
Oops. Should fix https://bugs.freedesktop.org/show_bug.cgi?id=67921
2013-08-09 01:25:54 +02:00
Chad Versace
2c2e64edab egl: Do not export private symbols
libEGL was incorrectly exporting *all* symbols, public and private.
This patch adds -fvisibility=hidden to libEGL's linker flags to ensure
that only symbols annotated with __attribute__((visibility("default")))
get exported.

Sanity-checked with libEGL's builtin DRI2 driver and the i965 DRI driver
by running Piglit on X/EGL and by running weston-gears on Weston as an
X client.

Sanity-checked with libEGL's Gallium driver (which is not built-in) and
the swrast Gallium driver by running es2gears_x11.

Kristian reviewed the symbol diff in `nm libEGL.so`.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: Ian Romanick <idr@freedesktop.org>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-08 15:17:51 -07:00
Kenneth Graunke
fb3d62fe3d i965: Remember to call intel_prepare_render() before blitting.
Otherwise, blits to the window system buffer may cause crashes,
since dst_irb->mt may be NULL.

This code is lifted straight out of brw_blorp_framebuffer()'s
try_blorp_blit() helper.

Fixes crashes in Piglit's fbo-sys-blit on systems without BLORP.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65919
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-08 12:12:47 -07:00
Roland Scheidegger
43076a55c2 util: (trivial) fix compile error with MSVC on x86 2013-08-08 19:08:57 +02:00
Roland Scheidegger
6ce54a81b2 gallivm: honor d3d10 floating point rules for shadow comparisons
d3d10 specifies ordered comparisons for everything but not_equal which is
unordered (http://msdn.microsoft.com/en-us/library/windows/desktop/cc308050.aspx).
OpenGL probably doesn't care.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-08 18:55:58 +02:00
Roland Scheidegger
aa84f1ad55 softpipe: don't clamp reference value for shadow comparison for float formats
Clamping is only done for fixed-point formats as part of conversion to
texture format.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-08 18:55:57 +02:00
Roland Scheidegger
e1590b9690 gallivm: don't clamp reference value for shadow comparison for float formats
This is wrong both for OpenGL and d3d. (In fact clamping is a side effect
of converting to depth format, so this should really do quantization too
at least in d3d10 for the comparisons to be truly correct.)

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-08 18:55:57 +02:00
Roland Scheidegger
eac57bc223 gallivm: propagate scalar_lod to emit_size_query too
Clearly the returned values need to be per-element if the lod is per element.
Does not actually change behavior yet.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-08 18:55:57 +02:00
Roland Scheidegger
c8572a9457 gallium: clarify SVIEWINFO opcode
This opcode is quite problematic in tgsi, while it tries to mirror
d3d10 resinfo it can't really do what's stated there due to missing
the crazy return type modifiers. Hence specify this is ignored along
with the swizzle.
(Other options would be to have multiple opcodes or specify the ret
type modifier maybe in dst_reg as there's padding bits left there but
it is the only instruction allowing this.)

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-08 18:55:57 +02:00
Roland Scheidegger
ce0e66af0a gallivm: fix out-of-bounds behavior for fetch/ld
For d3d10 and ARB_robust_buffer_access_behavior, we are required to return
0 for out-of-bounds coordinates (for which we can just enable the code already
there was just disabled). Additionally, also need to return 0 for
out-of-bounds mip level and out-of-bounds layer. This changes the logic
so instead of clamping the level/layer, an out-of-bound mask is computed
instead in this case (actual clamping then can be omitted just like with
coordinates, since we set the fetch offset to zero if that happens anyway).

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-08 18:55:57 +02:00
Roland Scheidegger
883987503f util: try much harder to set DAZ flag
While so far this only causes some harmless test failures, there's lots more
cpus with DAZ. All 64bit capable ones can do it (particularly relevant for
AMD cpus as they supported sse3 very very late) but if really necessary we
can check support for that for real with some more magic.
(In fact just about ANY cpu with sse2 can support DAZ, I believe the only
exception are first gen P4 (Willamette) and from those only early steppings
which can't do it it's almost like intel forgot to add it... - a real pity
though docs say you can't just try to set it as they will throw a GPF.)
While this was meant to address https://bugs.freedesktop.org/show_bug.cgi?id=67672
it does not fix it. Most likely the tests need fixing as I don't think
there's any guarantee about denorm handling in the reference math library
functions if the flags aren't set to standard values. Nevertheless enabling
DAZ on all cpus which can do it should be the right thing to do.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-08 18:55:57 +02:00
Roland Scheidegger
e3b5e2db1b util: implement table-based + linear interpolation linear-to-srgb conversion
Should be much faster, seems to work in softpipe.
While here (also it's now disabled) fix up the pow factor - the former value
is what is in GL core it is however not actually accurate to fp32 standard
(as it is 1.0/2.4), and if someone would do all the accurate math there's no
reason to waste 8 mantissa bits or so...

v2: use real table generating function instead of just printing the values
(might take a bit longer as it does calculations on some 3+ million floats
but much more descriptive obviously).
Also fix up another inaccurate pow factor (this time in the python code) -
wondering where the couple one bit errors came from :-(.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-08-08 18:55:57 +02:00
Roland Scheidegger
2d9fea95e8 gallivm: fix comment wrt srgb accuracy.
I think it's actually not good enough now...
2013-08-08 18:55:57 +02:00
Chia-I Wu
f9a4288bd2 ilo: get rid of GPE tables completely
Move the estimate functions out of the tables and kill the tables.
2013-08-08 13:46:01 +08:00
Chia-I Wu
19204081ce ilo: clean up GPE header inclusions
This reduces the number of source files need to be recompiled when GPE
functions are changed other than regular clean ups.
2013-08-08 13:41:10 +08:00
Chia-I Wu
e292b9362a ilo: initialize alpha test state in ilo_gpe_init_dsa
This could speed up BLEND_STATE and COLOR_CALC_STATE emission a bit.
2013-08-08 13:30:34 +08:00
Chia-I Wu
02496cd2b6 ilo: fold gen6_translate_index_size into the caller
There is only one caller so fold it.
2013-08-08 13:10:36 +08:00
Chia-I Wu
1c19d0bb81 ilo: fold gen6_translate_depth_format into the caller
There is only one caller so fold it.
2013-08-08 13:02:17 +08:00
Courtney Goeltzenleuchter
c2c5366ff2 ilo: Call GPE emit functions directly.
Eliminate pipeline and GPE function vectors and have the pipeline functions
call the GPE emit functions directly.
2013-08-08 11:39:21 +08:00
Courtney Goeltzenleuchter
4bc9daf923 ilo: move emit functions so that they can be inlined. 2013-08-08 11:39:21 +08:00
Tom Stellard
d0c13fba17 r300g/compiler/tests: Pass the required LDFLAGS when building the test program
CC: "9.2 <mesa-stable@lists.freedesktop.org>"
2013-08-07 17:28:19 -07:00
Tom Stellard
d691ba4d94 r300g/compiler/tests: Fix segfault
CC: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-07 17:27:23 -07:00
Kristian Høgsberg
5575fdaccf gallium-egl: Commit the rest of the native_wayland_drm_bufmgr_helper v2 patch
I missed Anders v2 on the list which fixed non-wayland compilation:

http://lists.freedesktop.org/archives/mesa-dev/2013-July/042062.html

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2013-08-07 11:23:47 -07:00
Ander Conselvan de Oliveira
8d29b5271a egl: Update to Wayland 1.2 server API
Since Wayland 1.2, struct wl_buffer and a few functions are deprecated.

References to wl_buffer are replaced with wl_resource and some getter
functions and calls to deprecated functions are replaced with the proper
new API. The latter changes are related to resource versioning.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-08-07 10:37:58 -07:00
Ander Conselvan de Oliveira
602351dd58 gallium-egl: Don't add a listener for wl_drm twice in wayland platform
A listener is added just after the interface is bound, in
registry_handle_global().

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-08-07 10:37:58 -07:00
Ander Conselvan de Oliveira
331a8fa41d gallium-egl: Simplify native_wayland_drm_bufmgr_helper interface
The helper provides a series of functions to easy the implementation
of the WL_bind_wayland_display extension on different platforms. But
even with the helpers there was still a bit of duplicated code between
platforms, with the drm authentication being the only part that
differs.

This patch changes the bufmgr interface to provide a self contained
object with a create function that takes a drm authentication callback
as an argument. That way all the helper functions are made static and
the "_helper" suffix was removed from the sources file name.

This change also removes the mix of Wayland client and server code in
the wayland drm platform source file. All the uses of libwayland-server
are now contained in native_wayland_drm_bufmgr.c.

Changes to the drm platform are only compile tested.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-08-07 10:37:58 -07:00
Chia-I Wu
79b868fea1 ilo: speed up 3DSTATE_VERTEX_BUFFERS emission a bit
Ignore vbuffer_mask which does not gain us anything.
2013-08-07 23:13:50 +08:00
Chia-I Wu
7ce3cbaacf ilo: skip state emission when reducing sampler count
When the number of sampler states bound is reduced, we are good to keep
referencing the old SAMPLER_STATE array and skip emitting a new one.
2013-08-07 23:13:44 +08:00
Chia-I Wu
2811dba1d0 ilo: simplify setting of shader samplers and views
Remove the special path that unbinds all samplers/views not in the range.
Just make another call to unbind them.
2013-08-07 18:10:32 +08:00
Chia-I Wu
186dab5b8f ilo: correctly check for stencil ref change
I intended to do a memcmp(), not a memcpy()...
2013-08-07 18:00:46 +08:00
Zack Rusin
12522041d6 draw: fix slot detection
Nowadays -1 for slots means that the semantic is not present, so
we need to store it in a signed variables, otherwise <0 comparisons
are pointless. Fixes
http://bugzilla.eng.vmware.com/show_bug.cgi?id=67811 (at least
with softpipe, edgeflags don't work wit llvmpipe)

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-08-06 20:23:57 -04:00
Laurent Carlier
2572e3b4a1 gallivm: Fix build - Remove TargetOptions.RealignStack for llvm>=3.4
Since llvm -3.4svn r187618, TargetOptions doesn't provide
RealignStack, so only enable it with llvm<3.4

This option must now be specified using function attributes, see LLVM
commit r187618

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-08-06 15:31:48 -07:00
Kenneth Graunke
0f7a15a247 i965: Add #defines for the MI_LOAD_REGISTER_MEM command.
This command reads a value from memory and writes it to a register (the
opposite of MI_STORE_REGISTER_MEM).  It's only available on Gen7+.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-06 14:41:37 -07:00
Kenneth Graunke
c047ad000b i965: Initialize the intel_context::bufmgr pointer earlier.
This prevents a crash in a future patch.

_mesa_initialize_context() creates a default transform feedback object
by calling the NewTransformFeedbackObject() driver hook.  Eventually,
we'll want to subclass that and allocate a buffer object.  This means
passing brw->bufmgr to drm_intel_alloc_bo(), and crashing if it isn't
initialized yet.

The buffer manager is actually already initialized; we just hadn't
copied the pointer from intel_screen to intel_context quite early
enough.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-06 14:41:37 -07:00
Kenneth Graunke
263ebe1a71 i965: Tidy preprocessor macros for SO_PRIM_STORAGE_NEEDED registers.
Gen7+ supports four transform feedback streams.  Using a function-like
macro makes it easy to access them by stream number or loop over them.
"GEN7_" prefixes are more common than "_IVB" suffixes, so use that.

Gen6 only supports a single stream, so the single #define should be
fine.  However, SO_NUM_PRIM_STORAGE_NEEDED was a poor name.  For one,
the word "NUM" doesn't appear in the actual name of the register.
It's also confusingly generic, as it doesn't exist on Gen7+.  Add a
"GEN6_" prefix for clarity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-06 14:41:37 -07:00
Kenneth Graunke
8c27f13cd9 i965: Tidy preprocessor macros for SO_NUM_PRIMS_WRITTEN registers.
Gen7+ supports four transform feedback streams.  Using a function-like
macro makes it easy to access them by stream number or loop over them.
"GEN7_" prefixes are more common than "_IVB" suffixes, so we use that.

Gen6 only supports a single stream, so the single #define should be
fine.  However, SO_NUM_PRIMS_WRITTEN was confusingly generic, as it
doesn't exist on Gen7+.  Add a "GEN6_" prefix for clarity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-06 14:41:37 -07:00
Christoph Bumiller
2daf974cfe nvc0: don't access array out of bounds on unexpected sample count 2013-08-06 22:29:33 +02:00
Emil Velikov
07c8f7a6f8 nv50: handle pure integer vertex attributes
And as a side effect fix a crash in the following piglit test:
general/attribs GL3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "9.2 and 9.1" mesa-stable@lists.freedesktop.org
2013-08-06 22:25:26 +02:00
Samuel Pitoiset
31caddb8d9 nvc0: implement MP performance counters for nvc0:nvd9 2013-08-06 22:24:30 +02:00
Samuel Pitoiset
9dcd7888e6 nvc0: implement compute support for nvc0
Tested on nvc0, nvc1, nvcf and nvd9.
2013-08-06 22:22:49 +02:00
Samuel Pitoiset
981b589101 nvc0: add more MP counters for nve4 2013-08-06 22:22:34 +02:00
Ian Romanick
2f9fe2d80a mesa: Generate a renderbuffer wrapper even if the texture has no image
This prevents a segfault in check_begin_texture_render when an FBO is
rebound while in this state.  This fixes the piglit test
fbo-incomplete-invalid-texture.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
2013-08-06 12:18:50 -07:00
Ian Romanick
25281fef0f mesa: Validate the layer selection of an array texture too
Previously only the slice of a 3D texture was validated in the FBO
completeness check.  This fixes the failure in the 'invalid layer of an
array texture' subtest of piglit's fbo-incomplete test.

v2: 1D_ARRAY textures have Depth == 1.  Instead, compare against Height.

v3: Handle CUBE_MAP_ARRAY textures too.  Noticed by Marek.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
2013-08-06 12:18:46 -07:00
Ian Romanick
41485fea7c mesa: Don't call driver RenderTexture for invalid zoffset
This fixes the segfault in the 'invalid slice of 3D texture' and
'invalid layer of an array texture' subtests of piglit's fbo-incomplete
test.

The 'invalid layer of an array texture' subtest still fails.

v2: Fix off-by-one comparison error noticed by Chris Forbes.  Also,
1D_ARRAY textures have Depth == 1.  Instead, compare against Height.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
2013-08-06 12:18:42 -07:00
Ian Romanick
fb49713f8e mesa: Don't call driver RenderTexture for really broken textures
This fixes the segfault in the '0x0 texture' subtest of piglit's
fbo-incomplete test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
2013-08-06 12:18:39 -07:00
Ian Romanick
0c3dbd689b mesa: Remove stray debug printfs in attachment completeness code
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
2013-08-06 12:18:29 -07:00
Ian Romanick
4a9522a5a0 mesa: Treat glBindFramebuffer and glBindFramebufferEXT more correctly
Allow user-generated names for glBindFramebufferEXT on desktop GL.
Disallow its use altogether for core profiles.

Names bound with glBindFramebuffer in desktop OpenGL are still
(incorrectly) shared across the share group instead of being
per-context.  This gets us a bit closer to being strictly conformant.

v2: Disallow glBindFramebufferEXT in 3.1 by not installing it in the
dispatch table.  Suggested by Jordan.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v1]
Cc: mesa-stable@lists.freedesktop.org
2013-08-06 10:46:05 -07:00
Ian Romanick
97965e87fc mesa: Treat glBindRenderbuffer and glBindRenderbufferEXT correctly
Allow user-generated names for glBindRenderbufferEXT on desktop GL.
Disallow its use altogether for core profiles.

v2: Disallow glBindRenderbufferEXT in 3.1 by not installing it in the
dispatch table.  Suggested by Jordan.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v1]
Cc: mesa-stable@lists.freedesktop.org
2013-08-06 10:46:05 -07:00
Michel Dänzer
46b6f79fea radeonsi: Number of SGPRs retrieved from LLVM already includes VCC
Fixes spurious 'Assertion `num_sgprs <= 104' failed.' with shaders using
all 104 SGPRs.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-08-06 12:50:01 +02:00
Kenneth Graunke
59f22148b3 i965: Don't allocate curbe buffers on Gen6+.
These are only used on Gen4-5.  Why waste the 8kB of space?

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-08-06 00:21:10 -07:00
Vinson Lee
b57c1e4b86 llvmpipe: Do not need to free anything if there is no geometry shader.
If gs is null, then freeing state->shader.tokens would result in a null
dereference.

Fixes "Dereference after null check" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-05 21:54:20 -07:00
Vinson Lee
60b567ee59 nvc0: Initialize ptr for unexpected sample_count on release builds.
Fixes "Uninitialized pointer read" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-05 21:53:39 -07:00
Vinson Lee
8e850f2feb draw: Change slot from unsigned to int.
unfilled_stage::face_slot is of type int.

Fixes "Unsigned compared against 0" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-05 17:40:19 -07:00
Vinson Lee
8294d969e1 postprocess: Check ppq is null before calling pp_free_bos.
pp_free_bos dereferences ppq without a null check.

Fixes "Dereference before null check" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-05 17:27:38 -07:00
Zack Rusin
a9cb914f49 draw: add back separate input assembler
the issue is that stream output is run before the pipeline, which
means that unless we decompose the primitives before the so
then things crash. we could convert the entire stream output
code into a pipeline stage but it will take a bit, so for now
fix the crashes by simply re-adding the old input assembler
which is run before the SO.

Signed-off-by: Zack Rusin <zackr@vmware.com>
2013-08-03 02:57:40 -04:00
Zack Rusin
c9c211fae1 draw: implement proper primitive assembler as a pipeline stage
we used to have a face primitive assembler that we ran after if
the gs was missing but we had adjacency primitives in the pipeline,
lets convert it to a pipeline stage, which allows us to use it
to inject outputs (primitive id) into the vertices. it's also
a lot cleaner because the decomposition is already handled for us.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-03 00:38:58 -04:00
Zack Rusin
8a94d15fba draw: fix front face injection
Inject front face only if the fragment shader uses it and
propagate through all channels because otherwise we'll
need to figure out the exact swizzle that the fs expects and
it's just simpler to make sure all the components within
the front face register are correctly set.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-03 00:36:39 -04:00
Brian Paul
4c9f12d69c tgsi: remove unneeded File == TGSI_FILE_INPUT test
We're already in an "if (File == TGSI_FILE_INPUT)" block at that point.
2013-08-05 10:25:08 -06:00
Brian Paul
3e4b5c6c9c tgsi: clean up tgsi_scan_shader() function
Replace "fulldecl->Semantic.Name/Index" with semName/semIndex.
Simplify if/else logic for TGSI_FILE_OUTPUT code.
Remove old comment.
Fix indentation.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-05 10:11:33 -06:00
Zack Rusin
95829e2029 llvmpipe: fix frontface behavior again
Lets make sure the frontface is 1 for front and -1 for back.
Discussed with Roland and Jose.

Signed-off-by: Zack Rusin <zackr@vmware.com>
2013-08-02 22:21:29 -04:00
Vinson Lee
0794f638ee r600g/sb: Dump correct value for CND.
Fixes "Copy-paste error" reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-08-04 13:49:17 -07:00
Jordan Justen
83486d3148 intel_fbo: remove unused intel_renderbuffer hiz functions
We are now using functions that operate on the renderbuffer
attachment to handle layered rendering.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-04 11:52:38 -07:00
Jordan Justen
7b36137642 i965 clear/draw: set renderbuffer attachment as needing depth resolve
Previously we would mark a renderbuffer as needing a depth resolve.
But, to support layered rendering, we need to look at the attachment
instead, since the attachment knows if layered rendering is being
used.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-04 11:52:38 -07:00
Jordan Justen
d44be9ed2f i965: add intel_renderbuffer_att_set_needs_depth_resolve
This function is needed to support layered rendering. With
layered rendering, the attachment stores the state of whether
layered rendering is being used.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-04 11:52:38 -07:00
Jordan Justen
814a040504 i965: add intel_miptree_set_all_slices_need_depth_resolve
This function marks all slices of a renderbuffer at a particular
level as needing a depth resolve.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-04 11:52:38 -07:00
Jordan Justen
b05b81743c i965 gen7: don't set FORCE_ZERO_RTAINDEX for layered rendering
When layered rendering is being used, we should not set
FORCE_ZERO_RTAINDEX in the clip state to allow render target
array values other than zero to be used.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:38 -07:00
Jordan Justen
20799c11eb hsw hiz: Remove x/y offset restriction for hiz
This restriction was related to programming the offset fields
of the depth buffer packet. We are now setting these offsets
to 0 now, so this restriction should no longer be required.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:37 -07:00
Jordan Justen
bf25ee2840 gen7 depth surface: program 3DSTATE_DEPTH_BUFFER to top of surface
Previously we would always find the 2D sub-surface of interest,
and then program the surface to this location. Now we always
program the 3DSTATE_DEPTH_BUFFER at the start of the surface.
To select the lod/slice, we utilize the lod & minimum array
element fields.

As part of this change, we must revert 1f112ccf:
Revert "i965/gen7: Align all depth miplevels to 8 in the X direction."

We also must disable brw_workaround_depthstencil_alignment for
gen >= 7. Now the hardware will handle alignment when rendering
to additional slices/LODs.

v2:
 * Merge with recent MOCS changes

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:37 -07:00
Jordan Justen
f3c886be1f gen7 fbo: make unmatched depth/stencil configs return unsupported
For gen >= 7, we will use the lod/minimum-array-element fields to
support layered rendering. This means that we must restrict
the depth & stencil attachments to match in various more retrictive
ways. (Now the width, height, depth, LOD and layer must match)

The reason width, height, and depth must match is that the hardware
has a single set of width, height, and depth settings (in
3DSTATE_DEPTH_BUFFER) that affect both the depth and stencil buffers.
Since these controls determine the miptree layout, they need to be
set correctly in order for lod and minimum-array-element to work
properly.  So the only way rendering can work is if the width,
height, and depth match.

In the future, if this restriction proves to be a problem (say
because some crucial client application relies on rendering to
different levels/layers of stencil and depth buffers), then we can
always work around the restriction by copying depth and/or stencil
data to a temporary buffer prior to rendering (much in the same way
that brw_workaround_depthstencil_alignment() does today for
gen < 7), but hopefully that won't be necessary.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:37 -07:00
Jordan Justen
65290a20f9 hsw hiz: Add new size restrictions for miplevels > 0
When performing hiz ops, we must ensure that the region sizes
have an 8 aligned width and 4 aligned height. We can tweak the
size for blorp hiz operations at LOD 0, but for the others we
can't. Therefore, we disable hiz for these miplevels if they
don't meet the size alignment requirements.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:37 -07:00
Jordan Justen
e3a49e1ad3 gen7 blorp depth: calculate base surface width/height
This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:37 -07:00
Jordan Justen
a23cfb8648 gen7 depth surface: calculate minimum array element being rendered
In layered rendering this will be 0. Otherwise it will be the
selected slice.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:37 -07:00
Jordan Justen
08ef1dde1b gen7 depth surface: calculate LOD being rendered to
This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:37 -07:00
Jordan Justen
bc1acaa426 gen7 depth surface: calculate depth (array size) for depth surface
This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.

Note: Cube maps are treated as 2D arrays with 6 times as
many array elements as the cube map array would have.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:37 -07:00
Jordan Justen
171e633294 gen7 depth surface: calculate more specific surface type
This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.

Note: Cube maps are treated as 2D arrays with 6 times as
many array elements as the cube map array would have.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:37 -07:00
Jordan Justen
0e6be2e67b i965: init global state first in brw_workaround_depthstencil_alignment
In a future pass this will allow us to exit-early from this
routine to disable it for gen >= 7.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04 11:52:37 -07:00
Ilia Mirkin
8edb79f1ef nv50: fix some h264 interlaced decoding on vp2
Some videos specify mb_adaptive_frame_field_flag instead of
field_pic_flag. This implies that the pic height needs to be halved, and
this field needs to be passed to the VP engine.

Cc: "9.2" mesa-stable@lists.freedesktop.org

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2013-08-03 12:52:04 +02:00
Zack Rusin
bff0d87668 llvmpipe: don't interpolate front face or prim id
The loop was iterating over all the fs inputs and setting them
to perspective interpolation, then after the loop we were
creating extra output slots with the correct interpolation. Instead
of injecting bogus extra outputs, just set the interpolation
on front face and prim id correctly when doing the initial scan
of fs inputs.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-02 20:12:53 -04:00
Zack Rusin
8e77e5e543 draw: make sure clipping works with injected outputs
clipping would drop the extra outputs because it always
used the number of standard vertex shader outputs, without
geometry shader or extra outputs. The commit makes sure
that clipping with geometry shaders which have more outputs
than the current vertex shader and with extra outputs correctly
propagates the entire vertex.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-02 20:11:18 -04:00
Zack Rusin
d6b3a193d4 draw: inject frontface info into wireframe outputs
Draw module can decompose primitives into wireframe models, which
is a fancy word for 'lines', unfortunately that decomposition means
that we weren't able to preserve the original front-face info which
could be derived from the original primitives (lines don't have a
'face'). To fix it allow draw module to inject a fake face semantic
into outputs from which the backends can figure out the original
frontfacing info of the primitives.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-02 20:11:18 -04:00
Zack Rusin
05487ef88d draw: stop crashing with extra shader outputs
Draw sometimes injects extra shader outputs (aa points, lines or
front face), unfortunately most of the pipeline and llvm code
didn't handle them at all. It only worked if number of inputs
happened to be bigger or equal to the number of shader outputs
plus the extra injected outputs. In particular when running
the pipeline which depends on the vertex_id in the vertex_header
things were completely broken. The patch adjust the code to
correctly use the total number of shader outputs (the standard
ones plus the injected ones) to make it all stop crashing and
work.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-08-02 20:11:18 -04:00
Zack Rusin
2e46a1dcb3 draw: use the vertex size
Instead of using the magical 4 use the above computed
vertex size. Doesn't change the behavior, just makes the code
a bit cleaner.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-02 20:11:18 -04:00
Zack Rusin
da1a74f673 draw/llvm: add some extra debugging output
when dumping shader outputs it's nice to have the integer
values of the outputs, in particular because some values
are integers.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-02 20:11:18 -04:00
Zack Rusin
36096af026 tgsi: detect prim id and front face usage in fs
Adding code to detect the usage of prim id and front face
semantics in fragment shaders.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-02 20:11:18 -04:00
Zack Rusin
2da1daaa4e tgsi: add ucmp to the list of opcodes
we forgot to add ucmp to the list of opcodes, so it was never
generated for ureg.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-02 19:08:39 -04:00
Zack Rusin
2d15f4746b llvmpipe: make the front-face behavior match the gallium spec
The spec says that front-face is true if the value is >0 and false
if it's <0. To make sure that we follow the spec, lets just
subtract 0.5 from our value (llvmpipe did 1 for frontface and 0
otherwise), which will get us a positive num for frontface and
negative for backface.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-02 15:50:16 -04:00
Matt Turner
4f83956347 Makefile.am: Remove api_exec_es* from EXTRA_FILES.
These files were removed in commits a0102154 and a8ab7e33.

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-08-02 09:51:57 -07:00
Matt Turner
5854883312 mesa: Use MIN3 instead of two MIN2s. 2013-08-02 09:51:57 -07:00
Matt Turner
01bdad3173 mesa: Update comments to match newer specs.
Old GL 1.x specs used 'b' but newer specs use 'p'. The line immediately
above the second hunk also uses 'p'.
2013-08-02 09:51:57 -07:00
Kenneth Graunke
9375c16e72 i965: Initialize the maximum number of GS threads on Haswell.
We'll need proper values for max_gs_threads when we eventually support
geometry shaders.  Also, we initialize it for every other platform.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-02 08:24:23 -07:00
Kenneth Graunke
a1ddbd1d7c glsl: Disallow interpolation qualifiers on non-input/output variables.
Commit 2548092ad8 switched the sense of interpolation qualifier
checks in order to permit them on geometry shader in/out variables.

In doing so, it accidentally allowed interpolation qualifiers to be
applied to ordinary variables and function parameters.

Fixes a regression in Piglit's local-smooth-01.frag.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-02 08:24:23 -07:00
Kenneth Graunke
7d2423a09e glsl: Fix NULL pointer dereferences when linking fails.
Commit 7cfefe6965 introduced a check for whether linked->Type equals
GL_GEOMETRY_SHADER.  However, linked may be NULL due to an earlier error
condition.

Since the entire function after the error path is (or should be) guarded
by linked != NULL checks, we may as well just return early and remove
the checks.

Fixes crashes in 9 Piglit tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-02 08:24:23 -07:00
Andreas Boll
9d569fed8d docs: Document UVD (2.2 and 3.0) video decoding support in mesa 9.2
Cc: "9.2" mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-02 17:14:08 +02:00
Andreas Boll
ec4a6a94b1 docs: Document that i965 Gen6+ requires Kernel 3.6 or later
Cc: "9.2" mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-02 17:13:40 +02:00
Timothy Arceri
37f9e0e84f docs: Update some out of date sourcetree information
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-08-02 16:22:03 +02:00
Christoph Bumiller
957a2014f9 r600g: honour semantic index in fragment color exports
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2013-08-02 13:32:49 +02:00
Andreas Boll
38903db439 docs: Add md5sums to 9.1.5 release notes 2013-08-02 09:58:34 +02:00
Andreas Boll
7eaaf62434 docs: Fix a typo in the 9.1.6 release notes 2013-08-02 09:47:43 +02:00
Topi Pohjolainen
f5947c2bc7 i965: enable image external sampling for imported dma-buffers
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-02 08:56:03 +03:00
Topi Pohjolainen
20de7f9f22 egl/dri2: support for creating images out of dma buffers
v2:
   - upon success close the given file descriptors

v3:
   - use specific entry for dma buffers instead of the basic for
     primes, and enable the extension based on the availability
     of the hook

v4 (Chad):
   - use ARRAY_SIZE
   - improve the comment about the number of file descriptors
   - in case of invalid format report EGL_BAD_ATTRIBUTE instead
     of EGL_BAD_MATCH
   - take into account specific error set by the driver.

v5:
   - fix error handling

v6 (Chad):
   - fix invalid plane count checking

v7 (Chad):
   - fix indentation and reset loop counter before checking
     for excess attributes

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-02 08:56:03 +03:00
Topi Pohjolainen
3a52cd351a intel: restrict dma-buf-import images to external sampling only
Memory originating outside mesa stack is meant to be for reading
only. In addition, the restrictions imposed by the image external
extension should apply. For example, users shouldn't be allowed
to generare mip-trees based on these images.

v2 (Chad): document using full extension names, fix the comment
           style itself and emit description of error

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-02 08:56:03 +03:00
Topi Pohjolainen
0de013b619 egl: definitions for EXT_image_dma_buf_import
As specified in:

http://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt

Checking for the valid fourcc values is left for drivers avoiding
dependency to drm header files here.

v2: enforce EGL_NO_CONTEXT

v3: declare the extension as EGL (not GLES)

v4: do not update eglext.h manually but rely on update from
    Khronos instead

v5: (Eric) report invalid context as EGL_BAD_PARAMETER instead of as
    EGL_BAD_CONTEXT

v6: (Chad) fix the checking for valid hints. Before all values were
    rejected.

v7: (Chad) comment style change from

    /**
     * Multi-
     * line

    into

    /* Multi-
     * line

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-02 08:56:03 +03:00
Topi Pohjolainen
674dedc87a dri: propagate extra dma_buf import attributes to the drivers
v2: do not break ABI, but instead introduce new entry point for
    dma buffers and bump up the dri-interface version to eight

v3 (Chad): allow the hook to specify an error originating from the
           driver. For now only unsupported format is considered.
           I thought about rejecting the hints also as they are
           addressing only YUV sampling which is not supported at
           the moment but then thought against it as the spec is
           not saying one way or the other.

v4 (Eric, Chad): restrict to rgb formatted only

v5: rebased on top of i915/i965 split

v6 (Chad): document using full extension name

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-02 08:56:03 +03:00
Topi Pohjolainen
ee844b6660 intel: set dri image dimensions even when creating out of primes
Otherwise 'intel_set_texture_image_region()' won't have enough
details to work with.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-02 08:56:03 +03:00
Topi Pohjolainen
904587ac3a intel: refactor planar format lookup
v2 (Eric): refactor both occurences, not just one

v3 (Chad): replace 0 by NULL

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-02 08:56:03 +03:00
Topi Pohjolainen
55162e2164 intel: do not create renderbuffers out of planar images
v2 (Chad): emit 'GL_INVALID_OPERATION' and description of error

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-02 08:56:03 +03:00
Topi Pohjolainen
e8568a0803 intel: allow packed prime buffers to be treated normally
v2:
   - fix earlier rebase error breaking bisect
     (loaderPriv -> loaderPrivate)

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-02 08:56:02 +03:00
Paul Berry
34c55b5925 main: Warn that geometry shader support is experimental.
Geometry shader support in the Mesa front end is still fairly
preliminary.  Many features are untested, and the following things are
known not to work:

- The gl_in interface block
- The gl_ClipDistance input
- Transform feedback of geometry shader outputs
- Constants that are new in GLSL 1.50 (e.g. gl_MaxGeometryInputComponents)

This isn't a problem, since no back-end drivers currently enable
geometry shaders.  However, to make sure no one gets the wrong
impression, emit a nasty warning to let the user know that geometry
shader support isn't complete.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01 20:24:49 -07:00
Paul Berry
7cfefe6965 glsl: Implement rules for geometry shader input sizes.
Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
contains some tricky rules for how the sizes of geometry shader input
arrays are related to the input layout specification.  In essence,
those rules boil down to the following:

- If an input array declaration does not specify a size, and it
  follows an input layout declaration, it is sized according to the
  input layout.

- If an input layout declaration follows an input array declaration
  that didn't specify a size, the input array declaration is given a
  size at the time the input layout declaration appears.

- All input layout declarations and input array sizes must ultimately
  match.  Inconsistencies are reported as soon as they are detected,
  at compile time if the inconsistency is within one compilation unit,
  otherwise at link time.

- At least one compilation unit must contain an input layout
  declaration.

(Note: the geom_array_resize_visitor class was contributed by Bryan
Cain <bryancain3@gmail.com>.)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:24:39 -07:00
Paul Berry
20ae8e0c91 glsl: Allow geometry shader input instance arrays to be unsized.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01 20:24:32 -07:00
Paul Berry
c1f1d8522c glsl: Permit non-ubo input interface arrays to use non-const indexing.
From the GLSL ES 3.00 spec:

    "All indexes used to index a uniform block array must be constant
    integral expressions."

Similar text exists in GLSL specs since 1.50.

When we implemented this, the only type of interface block supported
by Mesa was uniform blocks, so we required all indexes used to index
any interface block to be constant integral expressions.

Now that we are adding interface block support for GLSL 1.50, we need
a more specific check.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:24:27 -07:00
Eric Anholt
6065a87bce glsl: Cross-validate GS layout qualifiers while intrastage linking.
This gets piglit's geometry-basic test running.

TODO: Still need to validate that the GS layout qualifiers don't get used
in places they shouldn't (like an interface block, or a particular shader
input or output)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:24:23 -07:00
Eric Anholt
010a6a8fd3 glsl: Export the compiler's GS layout qualifiers to the gl_shader.
Next step is to validate them at link time.

v2 (Paul Berry <stereotype441@gmail.com>): Don't attempt to export the
layout qualifiers in the event of a compile error, since some of them
are set up by ast_to_hir(), and ast_to_hir() isn't guaranteed to have
run in the event of a compile error.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v3 (Paul Berry <stereotype441@gmail.com>): Use PRIM_UNKNOWN to
represent "not set in this shader".

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01 20:23:43 -07:00
Eric Anholt
624b7bac76 glsl: Parse the GLSL 1.50 GS layout qualifiers.
Limited semantic checking (compatibility between declarations, checking
that they're in the right shader target, etc.) is done.

v2: Remove stray debug printfs.

v3 (Paul Berry <stereotype441@gmail.com>): Process input layout
qualifiers at ast_to_hir time rather than at parse time, since certain
error conditions depend on the relative ordering between input layout
qualifiers, declarations, and calls to .length().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:23:33 -07:00
Eric Anholt
f2e14238a7 glsl: Make sure that we don't put too many bitfields in ast_type_qualifier.
We do some tests of qualifiers using a union containing an int and the
struct full of bitfields, so make sure the bitfields don't spill
outside the int.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:23:28 -07:00
Paul Berry
e62ca57199 main: Fix delete_shader_cb() for geometry shaders
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:23:25 -07:00
Fabian Bieler
bd85ba08bc glsl/linker: Fail to link geometry shader without vertex shader.
From section 2.15 (Geometry Shaders) the OpenGL 3.2 spec:

    A program object that includes a geometry shader must also include
    a vertex shader; otherwise a link error will occur.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:23:21 -07:00
Fabian Bieler
8cdbe8394e mesa: Validate the drawing primitive against the geometry shader input primitive type.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:23:19 -07:00
Fabian Bieler
39ca58192b mesa/shaderapi: Allow 0 GEOMETRY_VERTICES_OUT.
ARB_geometry_shader4 spec Errors:
"The error INVALID_VALUE is generated by ProgramParameteriARB if <pname>
is GEOMETRY_VERTICES_OUT_ARB and <value> is negative."

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:23:16 -07:00
Paul Berry
72219acf6b glsl: Properly pack GS output varyings
In geometry shaders, outputs are consumed at the time of a call to
EmitVertex() (as opposed to all other shader types, where outputs are
consumed when the shader exits).  Therefore, when packing geometry
shader output varyings using lower_packed_varyings, we need to do the
packing at the time of the EmitVertex() call.

This patch accomplishes that by adding a new visitor class,
lower_packed_varyings_gs_splicer, which is responsible for splicing
the varying packing code into place wherever EmitVertex() is found.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01 20:23:12 -07:00
Paul Berry
f2ecc84826 glsl: Modify varying packing to use a temporary exec_list.
This patch modifies lower_packed_varyings to store the packing code it
generates in a temporary exec_list, and then splice that list into the
shader's main() function when it's done.  This paves the way for
supporting geometry shader outputs, where we'll have to splice a clone
of the packing code before every call to EmitVertex().

As a side benefit, varying packing code is now emitted in the same
order for inputs and outputs; this should make debug output a little
easier to read.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01 20:23:08 -07:00
Paul Berry
3b0cf7027d glsl/linker: Properly pack GS input varyings.
Since geometry shader inputs are arrays (where the array index
indicates which vertex is being examined), varying packing needs to
treat them differently.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01 20:22:59 -07:00
Paul Berry
40d469f9ac glsl/linker: Properly error check VS-GS linkage.
From section 4.3.4 (Inputs) of the GLSL 1.50 spec:

    Geometry shader input variables get the per-vertex values written
    out by vertex shader output variables of the same names. Since a
    geometry shader operates on a set of vertices, each input varying
    variable (or input block, see interface blocks below) needs to be
    declared as an array.

Therefore, the element type of each geometry shader input array should
match the type of the corresponding vertex shader output.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:22:55 -07:00
Paul Berry
05234e707b glsl: Require geometry shader inputs to be arrays.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:22:48 -07:00
Paul Berry
fc5fa56c86 mesa: Copy linked program data for GS.
The documentation for gl_shader_program.Geom and gl_geometry_program
says that the former is copied to the latter at link time, but this
wasn't happening.  This patch causes _mesa_ir_link_shader() to perform
the copy, and updates comment accordingly.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:22:07 -07:00
Paul Berry
13022c9c5f mesa: Refactor copying of linked program data.
This patch creates a single function to copy the the UsesClipDistance
flag from gl_shader_program.Vert to gl_vertex_program.  Previously
this logic was duplicated in the i965-specific function
brw_link_shader() and the core mesa function _mesa_ir_link_shader().

This logic will have to be expanded to support geometry shaders, and I
don't want to have to update it in two separate places.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:21:26 -07:00
Bryan Cain
2548092ad8 glsl: support compilation of geometry shaders
This commit adds all of the parsing and semantics for GLSL 150 style
geometry shaders.

v2 (Paul Berry <stereotype441@gmail.com>): Add a few missing calls to
get_pipeline_stage().  Fix some signed/unsigned comparison warnings.
Fix handling of NULL consumer in assign_varying_locations().

v3 (Bryan Cain <bryancain3@gmail.com>): fix indexing order of 2D
arrays.  Also, allow interpolation qualifiers in geometry shaders.

v4 (Paul Berry <stereotype441@gmail.com>): Eliminate
get_pipeline_stage()--it is no longer needed thanks to 030ca23 (mesa:
renumber shader indices according to their placement in pipeline).
Remove 2D stuff.  Move vertices_per_prim() to ir.h, so that it will be
accessible from outside the linker.  Remove
inject_num_vertices_visitor.  Rework for GLSL 1.50.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

v5 (Paul Berry <stereotype441@gmail.com>): Split out
do_set_program_inouts() argument refactoring to a separate patch.
Move geom_array_resizing_visitor to later in the series.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:20:45 -07:00
Paul Berry
844bd71736 glsl/linker: Make separate allocations to track vertex and fragment shaders.
There's no reason to be clever about this.  By making separate
allocations for vertex and fragment shaders, we'll allow geometry
shaders to be added without introducing any complication.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:20:41 -07:00
Bryan Cain
ff52377183 glsl: add builtins for geometry shaders.
v2 (Paul Berry <stereotype441@gmail.com>): Account for rework of
builtin_variables.cpp.  Use INTERP_QUALIFIER_FLAT for gl_PrimitiveID
so that it will obey provoking vertex conventions.  Convert to GLSL
1.50 style geometry shaders.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

v3 (Paul Berry <stereotype441@gmail.com>): Be less obscure about
setting interpolation field of gl_Primitive variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:20:36 -07:00
Bryan Cain
ae6eba3e32 glsl: add ir_emit_vertex and ir_end_primitive instruction types
These correspond to the EmitVertex and EndPrimitive functions in GLSL.

v2 (Paul Berry <stereotype441@gmail.com>): Add stub implementations of
new pure visitor functions to i965's vec4_visitor and fs_visitor
classes.

v3 (Paul Berry <stereotype441@gmail.com>): Rename classes to be more
consistent with the names used in the GL spec.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:20:16 -07:00
Bryan Cain
c6be77ee6f mesa: account for geometry shader texture fetches in update_texture_state
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:20:14 -07:00
Paul Berry
b272a01879 main: Allow for the possibility of GL 3.2 without ARB_geometry_shader4.
Previously, we assumed that the only way Mesa would expose geometry
shader support was via the ARB_geometry_shader4 extension.  But this
extension has some extra complications over GL 3.2 (interactions with
compatibility-only features, and link-time initialization of the
constant gl_VerticesIn).  So we want to allow for the possibility of
supporting GL 3.2 (with GLSL 1.50 style geometry shaders) even if
ctx->Extensions.ARB_geometry_shader4 is false.

This patch adds a new function, _mesa_has_geometry_shaders(), which
returns true if either ARB_geometry_shader4 is supported or the GL
version is at least 3.2 desktop.  Since compute_version() only enables
GL 3.2 functionality when GLSL 1.50 support is present, a sufficient
way for a back-end to advertise geometry shader support is to set
ctx->Const.GLSLVersion >= 150.

v2: Remove unnecessary ctx->Const.GeometryShaders150 constant.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:19:57 -07:00
Paul Berry
56dcc46f0e main: Fix geometry shader error messages (missing right paren)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:19:55 -07:00
Paul Berry
37270715ff glsl: Add EXT_texture_array support for geometry shaders.
We can't just use a ".glsl" file since the Lod variants are only
available in vertex and geometry shaders, while the bias variants are
only available in the fragment shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01 20:19:51 -07:00
Paul Berry
6a2baf3a06 glsl/linker: Make update_array_sizes apply to just uniforms.
Commit 586b4b5 (glsl: Also update implicit sizes of varyings at link
time) extended update_array_sizes() to apply to both uniforms and
shader ins/outs.  However, doing creates problems for geometry
shaders, because update_array_sizes() assumes that variables with
matching names in different parts of the pipeline should have the same
sizes.  With the addition of geometry shaders, this is no longer true
(e.g. both vertex and geometry shaders have a gl_ClipDistance output
variable, but there's no reason these variables should have the same
sizes).

The original reason for commit 586b4b5 (avoid problems with
gl_TexCoord being 0 length) has since been addressed by commit 6f53921
(linker: Ensure that unsized arrays have a size after linking).  So go
ahead and switch update_array_sizes() back to only acting on uniforms.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:19:47 -07:00
Paul Berry
8fc41df549 glsl: Modify ir_set_program_inouts to handle geometry shaders.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01 20:19:43 -07:00
Paul Berry
cea946e39d glsl: In ir_set_program_inouts, handle indexing outside array/matrix bounds.
According to GLSL, indexing into an array or matrix with an
out-of-range constant results in a compile error.  However, indexing
with an out-of-range value that isn't constant merely results in
undefined results.

Since optimization passes (e.g. loop unrolling) can convert
non-constant array indices into constant array indices, it's possible
that ir_set_program_inouts will encounter a constant array index that
is out of range; if this happens, just mark the whole array as used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:19:39 -07:00
Paul Berry
1c789d8087 glsl: Fallback gracefully if ir_set_program_inouts sees unexpected indexing.
The code in ir_set_program_inouts that marks just a portion of a
variable as used (rather than the whole variable) only works on a few
kinds of indexing operations:

- Indexing into matrices
- Indexing into arrays of matrices, vectors, or scalars.

Fortunately these are the only kinds of indexing operations that we
expect to see; everything else is either handled by a
previously-executed lowering pass or prohibited by GLSL.

However, that could conceivably change in the future (the GLSL rules
might change, or we might modify the lowering passes).  To avoid
mysterious bugs in the future, let's have ir_set_program_inouts report
an assertion failure if it ever encounters an unexpected kind of
indexing operation (and in release builds, fall back to just marking
the whole variable as used).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:19:35 -07:00
Paul Berry
d5a333a06f glsl: Extract marking functions from ir_set_program_inouts.
This patch extracts the functions mark_whole_variable() and
try_mark_partial_variable() from the ir_set_program_inouts visitor
functions.  This will make the code easier to follow when we add
geometry shader support.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:19:31 -07:00
Paul Berry
0b0dc03a31 glsl: Use count_attribute_slots() in ir_set_program_inouts.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:19:26 -07:00
Paul Berry
7d95d2b4c9 glsl: Expand count_attribute_slots() to cover structs.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:19:22 -07:00
Paul Berry
0026ad4994 Move count_attribute_slots() out of the linker and into glsl_type.
Our previous justification for leaving this function out of glsl_type
was that it implemented counting rules that were specific to GLSL
1.50.  However, these counting rules also describe the number of
varying slots that Mesa will assign to a varying in the absence of
varying packing.  That's useful to be able to compute from outside of
the linker code (a future patch will use it from
ir_set_program_inouts.cpp).  So go ahead and move it to glsl_type.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:19:02 -07:00
Paul Berry
906eff09e3 glsl: Change do_set_program_inouts' is_fragment_shader arg to shader_type.
This will allow us to add geometry shader support without having to
add another boolean argument.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:18:42 -07:00
Roland Scheidegger
e7ed70a52e gallivm: obey clarified shift behavior
llvm shifts are undefined for shift counts exceeding (or matching) bit width,
so need to apply a mask for the tgsi shift instructions.

v2: only use mask for the tgsi shift instructions, not for the build shift
helpers. None of the internal callers need this behavior, and while llvm can
optimize away the masking for constants there are legitimate cases where it
might not be able to do so even if we know that shift count must be smaller
than type width (currently all such callers do not use the build shift
helpers).

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-02 03:49:57 +02:00
Roland Scheidegger
7a72bef47e tgsi: obey clarified shift behavior
c shifts are undefined for shift counts exceeding (or matching) bit width,
so need to apply a mask (on x86 it actually would usually probably work as
shifts do masking on int domain shifts - unless some auto-vectorizer would
come along at last as simd domain does not mask the shift count).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-02 03:49:57 +02:00
Roland Scheidegger
606132b4de gallium: clarify shift behavior with shift count >= 32
Previously, nothing was said what happens with shift counts exceeding
bit width of the values to shift. In theory 3 behaviors are possible:
1) undefined (classic c definition)
2) just shift out all bits (so result is zero, or -1 potentially for ashr)
3) mask the shift count to bit width - 1
API's either require 3) or are ok with 1). In particular, GLSL (as well as a
couple uninteresting legacy GL extensions) is happy with undefined, whereas
both OpenCL and d3d10 require 3). Consequently, most hw also implements 3).
So, for simplicity we just specify that 3) is required rather than saying
undefined and then needing state trackers to work around it.
Also while here specify shift count as a vector, not scalar. As far as I
can tell this was a doc bug, neither state trackers nor drivers used scalar
shift count.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-08-02 03:49:57 +02:00
Carl Worth
7f2f63409a docs: Add md5sums to 9.1.6 release notes 2013-08-01 15:45:04 -07:00
Carl Worth
964b89e42a docs: Import 9.1.6 release notes, add news item. 2013-08-01 15:12:25 -07:00
Kenneth Graunke
fcb4ab6db1 i965: Delete the BATCH_LOCALS macro.
This hasn't done anything in a long time, and it's only used in a couple
places...which means we couldn't use it without doing a bunch of work
anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-01 10:38:20 -07:00
Corey Richardson
abdbd02e59 Correct clamping of TEXTURE_{MAX, BASE}_LEVEL
Previously, if TEXTURE_IMMUTABLE_FORMAT was TRUE, the levels were allowed to
be set like usual, but ARB_texture_storage states:

> if TEXTURE_IMMUTABLE_FORMAT is TRUE, then level_base is clamped to the range
> [0, <levels> - 1] and level_max is then clamped to the range [level_base,
> <levels> - 1], where <levels> is the parameter passed the call to
> TexStorage* for the texture object

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Corey Richardson <corey@octayn.net>
2013-08-01 10:23:39 -07:00
Corey Richardson
986ae4306c De-tab and align comments in gl_texture_object
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Corey Richardson <corey@octayn.net>
2013-08-01 10:23:39 -07:00
Chris Forbes
3eef7fec67 i965 Gen4/5: clip: Don't mangle flat varyings
This patch ensures that integers will pass through unscathed.  Doing
(useless) computations on them is risky, especially when their bit
patterns correspond to values like inf or nan.

[V1-2]: Signed-off-by: Olivier Galibert <galibert at pobox.com>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:59:03 +12:00
Chris Forbes
3f6fb5e1dd i965 Gen4/5: clip: Add support for noperspective varyings
Adds support for interpolating noperspective varyings linearly in screen
space when clipping.

Based on Olivier Galibert's patch from last year:
http://lists.freedesktop.org/archives/mesa-dev/2012-July/024341.html

At this point all -fixed and -vertex interpolation tests work.

V5: Add brw_clip_compile.has_noperspective_shading rather than another
key flag.
V6: Real bools.

[V1-2]: Signed-off-by: Olivier Galibert <galibert at pobox.com>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:58:59 +12:00
Chris Forbes
f0feb32eaf i965 Gen4/5: clip: correctly handle flat varyings
Previously we only gave special treatment to the builtin color varyings.
This patch adds support for arbitrary flat-shaded varyings, which is
required for GLSL 1.30.

Based on Olivier Galibert's patch from last year:
http://lists.freedesktop.org/archives/mesa-dev/2012-July/024340.html

V5: Move key.do_flat_shading to brw_clip_compile.has_flat_shading
V6: Real bools.

[V1-2]: Signed-off-by: Olivier Galibert <galibert at pobox.com>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:58:56 +12:00
Chris Forbes
21922cb70d i965 Gen4/5: Generalize SF interpolation setup for GLSL1.3
Previously the SF only handled the builtin color varying specially.
This patch generalizes that support to cover user-defined varyings,
driven by the interpolation mode array set up alongside the VUE map.

Based on the following patches from Olivier Galibert:
- http://lists.freedesktop.org/archives/mesa-dev/2012-July/024335.html
- http://lists.freedesktop.org/archives/mesa-dev/2012-July/024339.html

With this patch, all the GLSL 1.3 interpolation tests that do not clip
(spec/glsl-1.30/execution/interpolation/*-none.shader_test) pass.

V5: Move key.do_flat_shading to brw_sf_compile.has_flat_shading; drop
vestigial hunks.
V6: Real bools.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:58:52 +12:00
Chris Forbes
3b5fe704e1 i965: Add helper functions for interpolation map
V6: real bools

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:58:49 +12:00
Chris Forbes
9f51499d28 i965 Gen4/5: Introduce 'interpolation map' alongside the VUE map
The interpolation map (in brw->interpolation_mode) is a new auxiliary
structure alongside the post-GS VUE map, which describes the
interpolation modes for each VUE slot, for use by the clip and SF
stages.

This patch introduces a new state atom to compute the interpolation map,
and adjusts the program keys for the clip and SF stages, but it is not
actually used yet.

[V1-2]: Signed-off-by: Olivier Galibert <galibert at pobox.com>

V3: Updated for vue_map changes, intel -> brw merge, etc. (Chris Forbes)
V4: Compute interpolation map as a new state atom rather than tacking it
on the front of the clip setup
V5: Rework commit message, make interpolation_mode_map a struct.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01 20:58:19 +12:00
Carl Worth
c6f3036179 get-pick-list: Allow for non-whitespace between "CC:" and "mesa-stable"
We recently proposed a new syntax for stable-patch nominations such as:

	CC: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>

and this has already appeared in the wild.

So we extend the regular expression to pick this up as well.
2013-07-31 15:49:48 -07:00
Samuel Pitoiset
ef6d5ee9f3 nvc0: properly align NVE4_COMPUTE_MP_TEMP_SIZE
MP_TEMP_SIZE must be aligned to 0x8000, while TEMP_SIZE on NVE4_3D
must be aligned to 0x20000, so perform both alignments to be sure
we allocate enough space (actually the bo will most likely use 128
KiB pages and not aligning to that would be a waste anyway).

Cc: "9.2" mesa-stable@lists.freedesktop.org
2013-07-31 21:40:38 +02:00
Laurent Carlier
5ffa28df4e mesa/program: remove useless YYID
This fixes the build with Bison 3.0. Also works with Bison 2.7.1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-31 11:57:32 -07:00
Kenneth Graunke
6d2a9220b8 mesa/program: Switch from the deprecated YYLEX_PARAM to %lex-param.
YYLEX_PARAM is no longer supported as of Bison 3.0.  Instead, the Bison
developers recommend using %lex-param.

%lex-param takes a type and variable name, similar to %parse-param,
so you can't pass an arbitrary expression like state->scanner.  But Flex
insists on passing the actual scanner object, not an arbitrary object
like state.

To solve this, the parser defines a wrapper lex() function which accepts
"state," and calls Flex's lex() function with state->scanner.

Fixes the build with Bison 3.0.  Also works with Bison 2.7.1.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
Cc: "9.2" mesa-stable@lists.freedesktop.org
2013-07-31 11:52:13 -07:00
Kenneth Graunke
de917b4c4c mesa/program: Change the program parser's namespace.
Bison 3.0 removes the YYLEX_PARAM macro.  In preparation for handling
this using %lex-param, the parser needs a wrapper function for the
actual Flex lex() function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
Cc: "9.2" mesa-stable@lists.freedesktop.org
2013-07-31 11:52:06 -07:00
Kenneth Graunke
f043381334 glsl: Switch from the deprecated YYLEX_PARAM to %lex-param.
YYLEX_PARAM is no longer supported as of Bison 3.0.  Instead, the Bison
developers recommend using %lex-param.

%lex-param takes a type and variable name, similar to %parse-param,
so you can't pass an arbitrary expression like state->scanner.  But Flex
insists on passing the actual scanner object, not an arbitrary object
like state.

To solve this, the parser defines a wrapper lex() function which accepts
"state," and calls Flex's lex() function with state->scanner.

Fixes the build with Bison 3.0.  Also works with Bison 2.7.1.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
Cc: "9.2" mesa-stable@lists.freedesktop.org
2013-07-31 11:51:57 -07:00
Kenneth Graunke
eb7c8c7fb6 glsl: Change the lexer's namespace.
Bison 3.0 removes the YYLEX_PARAM macro.  In preparation for handling
this using %lex-param, the parser needs a wrapper function for the
actual Flex lex() function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
Cc: "9.2" mesa-stable@lists.freedesktop.org
2013-07-31 11:49:30 -07:00
Eric Anholt
eed0a80137 egl: Restore "bogus" DRI2 invalidate event code.
I had removed it in commit 1e7776ca2b
because it was obviously wrong -- why do we care whether the server is a
version that emits events, if we're not watching for the server's events,
anyway?  And why would you only invalidate on a server that emits
invalidate events, when the comment said to emit invalidates if the server
*doesn't*?  Only, I missed that we otherwise don't flag that our buffers
might have changed at swap time at all, so the driver was only checking
for new buffers when triggered by the Viewport hack.  Of course you don't
expect Viewport to be called after a swap.

So, this is effectively a revert of the previous commit, except that I
dropped the check for only emitting invalidates on a new server -- we
*always* need to invalidate if we're doing a SwapBuffers.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63435
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 and 9.2" <mesa-stable@lists.freedesktop.org>
2013-07-31 10:43:35 -07:00
Roland Scheidegger
b1ed7202df gallivm: use nearest rounding for float->unorm24 conversion
Previously we were using truncation, which gives the correct result
only for numbers in [0.5-1.0] range (because there's no mantissa bits
to do any rounding there).
This is frequently hit (and probably only used there) when converting
fragment depth to depth format (d24s8 etc.) or otherwise dealing with
depth format.

v2: as spotted by Jose, get rid of extra type (src_type is already unsigned).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-07-31 17:09:02 +02:00
Mikko Juola
8624a514c2 mesa: fix multisampling proxy textures not being queryable
The code that checks if some texture target is valid for
glGetTexLevelParameter*() was not programmed to check for multisampling
proxy textures.  This made it impossible(?) to use the proxy textures
for their intended purpose as glGetTexLevelParameter*() would just fail
on you.

Reviewed-by: Brian Paul <brianp@vmware.com>

Cc: mesa-stable@lists.freedesktop.org
2013-07-31 07:27:01 -06:00
Mikko Juola
e404105e7d mesa: fix proxy textures becoming immutable and unusable
glTexStorage*() functions make textures immutable.  This carries on to
proxy textures.  Error checking in texture storage functions prevents
proxy textures from working after first time because internally, they
became immutable.

This commit makes the error checking ignore the immutability flag when
working with proxy textures.

Reviewed-by: Brian Paul <brianp@vmware.com>

Cc: mesa-stable@lists.freedesktop.org
2013-07-31 07:26:55 -06:00
Mikko Juola
3f3f66fd94 mesa: fix proxy textures not working with default texture binding
When working with the glTexStorage*() functions, the error checking
checks that a non-default (i.e., non-zero) texture is currently bound.
However, this check made glTexStorage*() functions fail with proxy
textures when the default texture is bound. Proxy textures do not care
about the current texture bindings so for them this check should not
be done.

Reviewed-by: Brian Paul <brianp@vmware.com>

Cc: mesa-stable@lists.freedesktop.org
2013-07-31 07:26:50 -06:00
Mikko Juola
de7e3741eb mesa: fix number of mipmaps calculation for proxy textures
The function _mesa_get_tex_max_num_levels() is supposed to calculate
the number of mipmap levels but it was not written to handle proxy
textures, at best returning a maximum of 1 mipmap level. Because of
this, at least glTexStorage*() calls would incorrectly fail when used
with proxy textures with more than one mipmap level.

Reviewed-by: Brian Paul <brianp@vmware.com>

Cc: mesa-stable@lists.freedesktop.org
2013-07-31 07:26:43 -06:00
Brian Paul
e5f32a0b3a mesa: improve free() cleanup in generate_mipmap_compressed()
Free all our temporary buffers in one place at the end of the
function.  Fixes memory leak detected by Coverity.

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-31 06:53:48 -06:00
Brian Paul
fdbd6a5033 gallium/util: reformat, comment util_get_offset()
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-07-31 06:53:48 -06:00
Brian Paul
30f1770cb1 gallium/util: comments, var renaming in u_inlines.h
The variable 'usage' was being used for two different things.
Sometimes for PIPE_USAGE_x and other times for PIPE_TRANSFER_x.
This renames usage to access when we're talking about PIPE_TRANSFER_x
flags.  Plus, add a bunch of comments to remind us what's going on.

Also, use unsigned for PIPE_TRANSFER_x bitmask to be consistent with
other places.  And add a missing const qualifier.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-07-31 06:53:48 -06:00
Brian Paul
365f38f3df softpipe: use new softpipe_resource_data() accessor
We should probably be using map()/unmap() when accessing resource
data, but this is a little better.

v2: assert that the resource is not a display target, per Jose.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-07-31 06:53:48 -06:00
Brian Paul
99c42d11a2 softpipe: don't ignore pipe_constant_buffer::buffer_offset
This was never a problem since the Mesa state tracker always gives
us a user-space constant buffer with buffer_offset=0.  But if another
state tracker ever gave us a "HW" constant buffer with non-zero
buffer_offset we'd mis-render.

Also, use the correct buffer size.  And move an assertion to the
top of the function.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-07-31 06:53:48 -06:00
Brian Paul
089ef37eab gallium/docs: clarify definition of PIPE_CAP_USER_CONSTANT_BUFFERS, etc
The cap means _can_ accept user-space constant buffers; it doesn't
mean _only_ accepts user-space constant buffers.

v2: also update the PIPE_CAP_USER_VERTEX_BUFFERS and
PIPE_CAP_USER_INDEX_BUFFERS descriptions as well.  Per Jose.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-07-31 06:53:48 -06:00
Chris Forbes
cace82b0cd i965/vs: Put lod parameter in the correct place for Gen4
This was never visible before due to the bogus sampler state pointer.
Fixes remaining vertex texturing breakage on Gen4.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
2013-07-31 21:33:18 +12:00
Chris Forbes
97676032c2 i965/vs: set up sampler state pointer for Gen4/5.
Fixes broken filter and lod selection for vertex texturing.
(txs/txf only worked properly because they ignore the sampler state
completely)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
2013-07-31 21:33:18 +12:00
Marek Olšák
7568a89500 st/dri: add a new driconf option disable_shader_bit_encoding for Unigine
Now Unigine Heaven 3.0 finally works with r600g.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-30 23:31:30 +02:00
Marek Olšák
369c829152 st/mesa: fix opcode translation for ARB_shader_bit_encoding functions
We treat the opcodes as MOVs, but we should at least change the type
of the expression, which later affects which TGSI opcode is chosen.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-30 23:31:30 +02:00
Marek Olšák
0f6a7cb00c mesa,glsl,st/dri: add a new driconf option force_glsl_version for Unigine
See documentation in mtypes.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-30 23:31:28 +02:00
Marek Olšák
ab78939344 mesa: add MESA_GLSL debug flag to dump shaders on compile error
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-30 23:31:26 +02:00
Marek Olšák
7f2f804c75 driconf: enable app-specific workarounds for all drivers
They were only enabled for i965.

Note that drirc must be installed in /etc.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-30 23:31:24 +02:00
Marek Olšák
bc4f0b6bac st/dri: remove driOptionCache from dri_context in favor of dri_screen
There is no reason to have this duplicated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-30 23:31:24 +02:00
Marek Olšák
dda936e057 st/dri: move enabling postprocessing to dri_screen
The driconf options are global.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-30 23:31:24 +02:00
Marek Olšák
772070527f st/dri: remove more unused driconf options
vblank_mode is read by dri_util.c and falls under the "dri2" driver name,
which is not connected to the actual Mesa/Gallium driver in any way.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-30 23:31:24 +02:00
Marek Olšák
83dbe61ea4 st/dri: implement the driconf option force_s3tc_enable properly
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-30 23:31:24 +02:00
Marek Olšák
f27f3a4b15 driconf: remove the unused option allow_large_textures
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-30 23:31:23 +02:00
Marek Olšák
2acc27cc6d st/dri: support the driconf option disable_blend_func_extended
This is needed for Unigine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-30 23:31:23 +02:00
Marek Olšák
71e0b5d688 st/osmesa: initialize disable_glsl_line_continuations
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-30 23:31:22 +02:00
Marek Olšák
4c89ec1f69 gallium/postprocessing: convert blits to pipe->blit
PP saves current states to cso_context and then util_blit_pixels does
the same. cso_context doesn't like that and the original state is not
correctly restored.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-30 23:31:22 +02:00
Marek Olšák
c84e8d039e gallium/postprocessing: fix shader parsing
tokens was converted to a pointer, which made the Elements macro return 1.

Broken by e87fc11cac.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-30 23:31:22 +02:00
Marek Olšák
c40f8d087a docs/GL3: clarify core vs compatibility extension support
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-30 23:31:21 +02:00
Marek Olšák
7db83d8d4b mesa: default texture buffer format should be R8 in the core profile
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

v2: Since we don't expose the extension in the compatibility profile,
    the "if (API == CORE) .. else .." statement is removed.
2013-07-30 22:36:21 +02:00
Marek Olšák
a6b1a7c0d2 mesa: default DEPTH_TEXTURE_MODE should be RED in the core profile
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-30 22:36:21 +02:00
Marek Olšák
63569dbeb0 st/mesa: expose EXT_framebuffer_multisample_blit_scaled if MSAA is supported
Surprisingly all drivers supporting MSAA can already do this (r300g and r600g
for sure) and I think Christoph wanted to have this feature for his Nouveau
drivers anyway.
2013-07-30 22:36:21 +02:00
Marek Olšák
1302c66896 st/mesa: fix sRGB renderbuffers without EXT_framebuffer_sRGB support
https://bugs.freedesktop.org/show_bug.cgi?id=59322

Cc: mesa-stable@lists.freedesktop.org
2013-07-30 22:36:20 +02:00
Marek Olšák
4dfe1a0df5 Revert "r300g: Give CLIP_DISABLE another try"
This reverts commit e866bd1ade.

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

Cc: mesa-stable@lists.freedesktop.org
2013-07-30 22:36:20 +02:00
Carl Worth
122d8d2f5a get-pick-list.sh: Include commits mentionining "CC: mesa-stable..." in pick list
We recently adopted a new convention that patches can be nominated for the
stable branch by including a line in the commit message as follows:

	CC: mesa-stable@lists.freedesktop.org

This is a convenient syntax as "git send-email" will notice this line and
automatically copy the resulting patch email to the mesa-stable mailing list.

Here we extend the regular expression in the get-pick-list.sh script to also
notice this pattern, (as well as the traditional "NOTE: This patch is a
candidate..." form.
2013-07-30 12:36:37 -07:00
Paul Berry
1299694ed5 glsl: Remove redundant writes to prog->LinkStatus
The linker_error() function sets prog->LinkStatus to false.  There's
no reason for the caller of linker_error() to also do so.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-30 10:10:27 -07:00
Paul Berry
5fe6b90c87 glsl: Improve error message for interstage interface block mismatch.
We're now emitting this error from a point where we have easy access
to the name of the block that failed to match, so go ahead and include
that in the error message, as we do for intrastage interface block
mismatches.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-30 10:10:27 -07:00
Paul Berry
b95d237fe6 glsl: Use a consistent technique for tracking link success/failure.
This patch changes link_shaders() so that it sets prog->LinkStatus to
true when it starts, and then relies on linker_error() to set it to
false if a link failure occurs.

Previously, link_shaders() would set prog->LinkStatus to true halfway
through its execution; as a result, linker functions that executed
during the first half of link_shaders() would have to do their own
success/failure tracking; if they didn't, then calling linker_error()
would add an error message to the log, but not cause the link to fail.
Since it wasn't always obvious from looking at a linker function
whether it was called before or after link_shaders() set
prog->LinkStatus to true, this carried a high risk of bugs.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-30 10:10:26 -07:00
Paul Berry
659ec1c958 glsl: Add error message for intrastage interface block mismatch.
Previously we failed to link (which is correct), but we did not output
an error message, which could have been confusing for users.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-30 10:10:26 -07:00
Paul Berry
4682b9b7bf glsl: Remove bogus check on return value of link_uniform_blocks().
A comment in link_intrastage_shaders(), and an if-test that followed
it, seemed to indicate that link_uniform_blocks() would return a
negative value in the event of an error.  But this is not the
case--all error checking has already been performed by
validate_intrastage_interface_blocks(), and link_uniform_blocks() can
only return unsigned values.

So get rid of the if-test and change the return type of
link_intrastage_shaders() to clarify that it can only return unsigned
values.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-30 10:10:25 -07:00
Jonathan Charest
4f8048bb5a r600g/compute: Added missing address space checking of kernel parameters
To have non-static buffers in local memory, it is necessary to pass them
as arguments to the kernel.

For r600, the correct lds size must be set to the SQ_LDS_ALLOC register.
The correct size is the clover size plus the size reported by the
compiler.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-07-30 07:09:16 -07:00
Jonathan Charest
d9576598c7 clover: Added missing address space checking of kernel parameters v2
Here is an updated patch with no line wrapping and respecting 80-column limit (for my changes).

v2: Tom Stellard
  - Create global arguments for constant buffers so we don't break
    r600g.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-07-30 07:09:15 -07:00
Kenneth Graunke
07cdf426c1 mesa: Remove broken assertion about enabled texture targets.
For GLSL programs, enabledTargets can have more than one bit set.  For
example, a shader that uses sampler2D and samplerCube uniforms will have
both TEXTURE_2D_BIT and TEXTURE_CUBE_BIT set.

The code that sets _ReallyEnabled already handles this, selecting the
"highest priority" texture target.  We should simply use that.

Fixes new Piglit test incomplete-textures-of-multiple-types.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62698
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-07-29 22:35:37 -07:00
Emil Velikov
488b3ed6f4 build: unify mesa version by using a VERSION file
Rather than having to keep track of all the build systems and their respecitve
definition of the mesa version, use a single top file VERSION. Every build
system is responsible for reading/parsing the file and using it

v2:
* remove useless bulletpoint from the documentation, suggested by Matt
* "Androing is Linux. Use '/' in stead of '\'", spotted by Chad V
* use cleaner code to get the version in scons, suggested by Chad V

v3:
* ensure leading and trailing whitespace characters are stripped while parsing
* android: handle GNU shell commands approapriately

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-07-29 13:39:29 -07:00
Kenneth Graunke
efb566dff2 i965: Don't create a swrast context on ES2+.
We already skip this for API_OPENGL_CORE; ES2+ is very similar.
The primary user of the swrast context is GL_SELECT and GL_FEEDBACK,
which have never existed in ES.

This saves approximately 18MB of memory in GLBenchmark 2.7 Egypt (ES2).
No regressions in es3conform on Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2013-07-29 13:26:27 -07:00
Kenneth Graunke
6aba035f6b glsl: Remove shader stage checking for extension handling.
Certain extensions only add functionality to particular shader stages.
(For example, ARB_draw_instanced only adds variables to the vertex
shader stage.)

Previously, we only allowed such extensions to be enabled in the shader
stages where they're useful.  However, I've never found any text which
mandates that behavior; in my opinion, you should be able to turn on
extensions in any shader stage, even if they have no effect.

Fixes Piglit tests glslparsertest/glsl2/draw_buffers-05.vert and
ARB_draw_instanced/preprocessor/feature-macro-enabled.frag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29185
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-29 10:51:25 -07:00
Matt Turner
0ed02d435e mesa: Expose OES_surfaceless_context.
EGL_KHR_surfaceless_context extension allows contexts to be made current
without a default winsys fbo. This extension specifies what ES 1.1 and
2.0 should do (the ES 3.0 spec already does).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-29 10:35:16 -07:00
Matt Turner
8dd15e6021 mesa: Return GL_FRAMEBUFFER_UNDEFINED if the winsys fbo is incomplete.
Specified by ARB_framebuffer_object, GL 3.0, and ES 3.0.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-07-29 10:35:01 -07:00
Matt Turner
b2d3f25aa2 gles3: Update gl3.h to 2013-02-12.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-07-29 10:35:00 -07:00
Matt Turner
00a945f61e gles2: Update gl2ext.h to revision 22161.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-07-29 10:34:58 -07:00
Matt Turner
efa8a6e72f gles2: Update gl2.h to revision 20555.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-07-29 10:34:47 -07:00
Matt Turner
32a2ab47fe gles: Update glext.h to revision 20798.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-07-29 10:34:42 -07:00
Roland Scheidegger
e08114fed7 gallivm: (trivial) git rid of assertion in float->uint conversion code
Commit 8c3d3622d9 introduced a new assertion,
but since it causes lp_test_conv failures remove it again and let's hope
we don't really hit bugs caused by the potentially bogus code (it is possible
the assert() caught some cases which work correctly too).
2013-07-29 13:23:56 +02:00
Maarten Lankhorst
e847b5ae06 nvc0: force use of correct firmware file
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-07-28 12:06:57 +02:00
Ian Romanick
803f755ede glsl: Less const for glsl_type convenience accessors
The second 'const' says that the pointer itself is constant.  This in
unenforcible in C++, so GCC emits a warning (see) below for each of
these functions in every file that includes glsl_types.h.  It's a lot of
warning spam.

../../../src/glsl/glsl_types.h:176:58: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
2013-07-27 12:13:03 -07:00
Kenneth Graunke
17856726c9 glsl: Disallow auxiliary storage qualifiers on FS outputs.
This has always been an error; we just forgot to check for it.

Fixes Piglit's no-aux-qual-on-fs-output.frag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67333
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2013-07-27 10:31:40 -07:00
Kenneth Graunke
c178ec0d7e glsl: Classify "layout" like other identifiers.
When "layout" isn't being lexed as LAYOUT_TOK, we should treat it like
an ordinary identifier.  This means we need to classify it to determine
whether we should return IDENTIFIER, TYPE_IDENTIFIER, or NEW_IDENTIFIER.

Fixes the WebGL conformance test "shader-with-non-reserved-words."

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64087
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2013-07-27 10:31:38 -07:00
Paul Berry
4d7899fe81 glsl: Be consistent about '\n', '.', and capitalization in errors/warnings.
The majority of calls to _mesa_glsl_error(), _mesa_glsl_warning(), and
_mesa_glsl_parse_state::check_version() use a message that begins with
a lower case letter and ends without a period.  This patch makes all
messages follow that convention.

Also, error/warning messages shouldn't end in '\n', since
_mesa_glsl_msg() automatically adds '\n' at the end of the message.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-07-27 09:41:30 -07:00
Roland Scheidegger
8c3d3622d9 gallivm: fix float->SNORM conversion
Just like the UNORM case we need to use round to nearest, not trunc.
(There's also another problem, we're using the formula for SNORM->float
which will produce a value below -1.0 for the most negative value which
according to both OpenGL and d3d10 would need clamping. However, no actual
failures have been observed due to that hence keep cheating on that.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-07-27 16:41:29 +02:00
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
Jeremy Huddleston Sequoia
fa5ed99d8e Apple: glFlush() is not needed with CGLFlushDrawable()
<rdar://problem/14496373>

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-07-20 10:25:28 -07:00
José Fonseca
b844c8e039 util/u_math: Define NAN/INFINITY macros for MSVC.
Untested. But should hopefully fix the build.
2013-07-20 00:31:18 +01:00
Zack Rusin
f59cb67376 llvmpipe/tests: update arith test to check for edge cases
Test infs, zeros and nans with our arith functions to assure
correct/defined behavior with those values.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-07-19 16:29:18 -04:00
Zack Rusin
f7c06785d0 gallivm: add a log function that handles edge cases
Same as log2_safe, which means that it can handle infs, 0s and
nans.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-07-19 16:29:18 -04:00
Zack Rusin
018c69ac56 gallivm: export unordered/ordered cmp to a common function
Only the floating point operarators change everything else
is the same so it makes sense to share the code.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-07-19 16:29:18 -04:00
Zack Rusin
192c68b85a gallivm: handle -inf, inf and nan's in sin/cos instructions
sin/cos for anything not finite is nan and everything else has
to be between [-1, 1].

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-07-19 16:29:17 -04:00
Zack Rusin
13e2cd2f2c gallivm: add a version of log2 which handles edge cases
That means that if input is:
 * - less than zero (to and including -inf) then NaN will be returned
 * - equal to zero (-denorm, -0, +0 or +denorm), then -inf will be returned
 * - +infinity, then +infinity will be returned
 * - NaN, then NaN will be returned
It's a separate function because the checks are a little bit costly
and in most cases are likely unnecessary.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-07-19 16:29:17 -04:00
Zack Rusin
7b672c1503 gallivm: fix edge cases in exp2
exp(0) has to be exactly 1, exp(-inf) has to be 0, exp(inf) has
to be inf and exp(nan) has to be nan, this fixes all of those
cases.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-07-19 16:29:17 -04:00
Zack Rusin
ab47bbecd6 gallivm: handle nan's in min/max
Both D3D10 and OpenCL say that if one the inputs is nan then
the other should be returned. To preserve that behavior
the patch fixes both the sse and the non-sse paths in both
functions and adds helper code for handling nans.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-07-19 16:29:17 -04:00
José Fonseca
719000bd7d scons: Disallow undefined symbols in Xlib libGL.so.
It's not the first time that, due to missing build dependencies or
incomplete commits, we end up with a broken libGL.so that's missing
symbols, causing all tests to fail catastrophically.

Instead try to catch this sort of issues earlier.
2013-07-19 13:08:07 +01:00
1547 changed files with 81269 additions and 55213 deletions

View File

@@ -33,9 +33,10 @@ endif
LOCAL_C_INCLUDES += \
$(MESA_TOP)/include
MESA_VERSION=$(shell cat $(MESA_TOP)/VERSION)
# define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
LOCAL_CFLAGS += \
-DPACKAGE_VERSION=\"9.2.0-devel\" \
-DPACKAGE_VERSION=\"$(MESA_VERSION)\" \
-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
-DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANDROID_MINOR_VERSION)

View File

@@ -26,12 +26,6 @@ ACLOCAL_AMFLAGS = -I m4
doxygen:
cd doxygen && $(MAKE)
check-local:
$(MAKE) -C src/mapi/glapi/tests check
$(MAKE) -C src/mapi/shared-glapi/tests check
$(MAKE) -C src/mesa/main/tests check
$(MAKE) -C src/glx/tests check
.PHONY: doxygen
# Rules for making release tarballs
@@ -51,18 +45,13 @@ EXTRA_FILES = \
bin/ltmain.sh \
bin/missing \
bin/ylwrap \
bin/test-driver \
src/glsl/glsl_parser.cpp \
src/glsl/glsl_parser.h \
src/glsl/glsl_lexer.cpp \
src/glsl/glcpp/glcpp-lex.c \
src/glsl/glcpp/glcpp-parse.c \
src/glsl/glcpp/glcpp-parse.h \
src/mesa/main/api_exec_es1.c \
src/mesa/main/api_exec_es1_dispatch.h \
src/mesa/main/api_exec_es1_remap_helper.h \
src/mesa/main/api_exec_es2.c \
src/mesa/main/api_exec_es2_dispatch.h \
src/mesa/main/api_exec_es2_remap_helper.h \
src/mesa/program/lex.yy.c \
src/mesa/program/program_parse.tab.c \
src/mesa/program/program_parse.tab.h \
@@ -75,7 +64,7 @@ IGNORE_FILES = \
parsers: configure
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp glcpp/glcpp-lex.c glcpp/glcpp-parse.c glcpp/glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(PACKAGE_NAME).tar.gz \

View File

@@ -69,8 +69,10 @@ if env['gles']:
#######################################################################
# Environment setup
with open("VERSION") as f:
mesa_version = f.read().strip()
env.Append(CPPDEFINES = [
('PACKAGE_VERSION', '\\"9.2.0-devel\\"'),
('PACKAGE_VERSION', '\\"%s\\"' % mesa_version),
('PACKAGE_BUGREPORT', '\\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\\"'),
])

1
VERSION Normal file
View File

@@ -0,0 +1 @@
10.0.1

13
bin/.cherry-ignore Normal file
View File

@@ -0,0 +1,13 @@
# Since we've disabled DRI3 completely in 10.0, this commit is no longer
# necessary.
f0f202e6b764be803470e27cba9102f14361ae22 glx: conditionaly build dri3 and present loader (v3)
# This patch makes bug #71870 worse, so it won't be cherry picked until that
# issue can be resolved. See
# http://lists.freedesktop.org/archives/mesa-dev/2013-November/048899.html
068a073c1d4853b5c8f33efdeb481026f42e23a5 meta: fix meta clear of layered framebuffers
# This patch isn't actually necessary because that bug that it fixes isn't in
# the 10.0 branch. See
# http://lists.freedesktop.org/archives/mesa-stable/2013-December/000500.html
a057b837ddd1c725a7504eedc53c6df05a012773 egl: add HAVE_LIBDRM define, fix EGL X11 platform

View File

@@ -14,7 +14,7 @@ git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
# Grep for commits that were marked as a candidate for the stable tree.
git log --reverse --pretty=%H -i --grep='^[[:space:]]*NOTE: .*[Cc]andidate' HEAD..origin/master |\
git log --reverse --pretty=%H -i --grep='^\([[:space:]]*NOTE: .*[Cc]andidate\|CC:.*mesa-stable\)' HEAD..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.

View File

@@ -6,17 +6,14 @@ dnl Tell the user about autoconf.html in the --help output
m4_divert_once([HELP_END], [
See docs/autoconf.html for more details on the options for Mesa.])
AC_INIT([Mesa], [9.2.0-devel],
m4_define(MESA_VERSION, m4_normalize(m4_include(VERSION)))
AC_INIT([Mesa], [MESA_VERSION],
[https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
AC_CONFIG_AUX_DIR([bin])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([foreign])
dnl http://people.gnome.org/~walters/docs/build-api.txt
dnl We don't support srcdir != builddir.
echo \#buildapi-variable-no-builddir >/dev/null
# Support silent build rules, requires at least automake-1.11. Disable
# by either passing --disable-silent-rules to configure or passing V=1
# to make
@@ -32,21 +29,17 @@ AC_SUBST([OSMESA_VERSION])
dnl Versions for external dependencies
LIBDRM_REQUIRED=2.4.24
LIBDRM_RADEON_REQUIRED=2.4.46
LIBDRM_INTEL_REQUIRED=2.4.38
LIBDRM_INTEL_REQUIRED=2.4.49
LIBDRM_NVVIEUX_REQUIRED=2.4.33
LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
LIBDRM_FREEDRENO_REQUIRED=2.4.39
DRI2PROTO_REQUIRED=2.6
GLPROTO_REQUIRED=1.4.14
LIBDRM_XORG_REQUIRED=2.4.24
LIBKMS_XORG_REQUIRED=1.0.0
dnl Check for progs
AC_PROG_CPP
AC_PROG_CC
AX_PROG_CC_FOR_BUILD
AC_PROG_CXX
AX_PROG_CXX_FOR_BUILD
AM_PROG_CC_C_O
AM_PROG_AS
AC_CHECK_PROGS([MAKE], [gmake make])
@@ -141,21 +134,6 @@ dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
_SAVE_LDFLAGS="$LDFLAGS"
_SAVE_CPPFLAGS="$CPPFLAGS"
dnl build host compiler macros
DEFINES_FOR_BUILD=""
AC_SUBST([DEFINES_FOR_BUILD])
case "$build_os" in
linux*|*-gnu*|gnu*)
DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -D_GNU_SOURCE"
;;
solaris*)
DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -DSVR4"
;;
cygwin*)
DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD"
;;
esac
dnl Compiler macros
DEFINES=""
AC_SUBST([DEFINES])
@@ -178,7 +156,6 @@ if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -Wall -std=gnu99"
;;
*)
CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -Wall -std=c99"
CFLAGS="$CFLAGS -Wall -std=c99"
;;
esac
@@ -208,16 +185,13 @@ if test "x$GCC" = xyes; then
CFLAGS=$save_CFLAGS
# Work around aliasing bugs - developers should comment this out
CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -fno-strict-aliasing"
CFLAGS="$CFLAGS -fno-strict-aliasing"
# gcc's builtin memcmp is slower than glibc's
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -fno-builtin-memcmp"
CFLAGS="$CFLAGS -fno-builtin-memcmp"
fi
if test "x$GXX" = xyes; then
CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -Wall"
CXXFLAGS="$CXXFLAGS -Wall"
# Enable -fvisibility=hidden if using a gcc that supports it
@@ -234,12 +208,10 @@ if test "x$GXX" = xyes; then
CXXFLAGS=$save_CXXFLAGS
# Work around aliasing bugs - developers should comment this out
CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -fno-strict-aliasing"
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
# gcc's builtin memcmp is slower than glibc's
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -fno-builtin-memcmp"
CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
fi
@@ -314,14 +286,6 @@ AC_ARG_ENABLE([debug],
[enable_debug=no]
)
if test "x$enable_debug" = xyes; then
DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -DDEBUG"
if test "x$GCC_FOR_BUILD" = xyes; then
CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -g -O0"
fi
if test "x$GXX_FOR_BUILD" = xyes; then
CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -g -O0"
fi
DEFINES="$DEFINES -DDEBUG"
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -g -O0"
@@ -579,17 +543,17 @@ AC_ARG_ENABLE([osmesa],
[enable OSMesa library @<:@default=disabled@:>@])],
[enable_osmesa="$enableval"],
[enable_osmesa=no])
AC_ARG_ENABLE([gallium-osmesa],
[AS_HELP_STRING([--enable-gallium-osmesa],
[enable Gallium implementation of the OSMesa library @<:@default=disabled@:>@])],
[enable_gallium_osmesa="$enableval"],
[enable_gallium_osmesa=no])
AC_ARG_ENABLE([egl],
[AS_HELP_STRING([--disable-egl],
[disable EGL library @<:@default=enabled@:>@])],
[enable_egl="$enableval"],
[enable_egl=yes])
AC_ARG_ENABLE([xorg],
[AS_HELP_STRING([--enable-xorg],
[enable support for X.Org DDX API @<:@default=no@:>@])],
[enable_xorg="$enableval"],
[enable_xorg=no])
AC_ARG_ENABLE([xa],
[AS_HELP_STRING([--enable-xa],
[enable build of the XA X Acceleration API @<:@default=no@:>@])],
@@ -618,19 +582,25 @@ AC_ARG_ENABLE([opencl],
@<:@default=no@:>@])],
[],
[enable_opencl=no])
AC_ARG_ENABLE([xlib_glx],
AC_ARG_ENABLE([opencl_icd],
[AS_HELP_STRING([--enable-opencl-icd],
[Build an OpenCL ICD library to be loaded by an ICD implementation
@<:@default=no@:>@])],
[enable_opencl_icd="$enableval"],
[enable_opencl_icd=no])
AC_ARG_ENABLE([xlib-glx],
[AS_HELP_STRING([--enable-xlib-glx],
[make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
[enable_xlib_glx="$enableval"],
[enable_xlib_glx=no])
AC_ARG_ENABLE([gallium_egl],
AC_ARG_ENABLE([gallium-egl],
[AS_HELP_STRING([--enable-gallium-egl],
[enable optional EGL state tracker (not required
for EGL support in Gallium with OpenGL and OpenGL ES)
@<:@default=disable@:>@])],
[enable_gallium_egl="$enableval"],
[enable_gallium_egl=no])
AC_ARG_ENABLE([gallium_gbm],
AC_ARG_ENABLE([gallium-gbm],
[AS_HELP_STRING([--enable-gallium-gbm],
[enable optional gbm state tracker (not required for
gbm support in Gallium)
@@ -644,7 +614,7 @@ AC_ARG_ENABLE([r600-llvm-compiler],
[enable_r600_llvm="$enableval"],
[enable_r600_llvm=no])
AC_ARG_ENABLE([gallium_tests],
AC_ARG_ENABLE([gallium-tests],
[AS_HELP_STRING([--enable-gallium-tests],
[Enable optional Gallium tests) @<:@default=disable@:>@])],
[enable_gallium_tests="$enableval"],
@@ -674,7 +644,6 @@ if test "x$enable_opengl" = xno -a \
"x$enable_gles1" = xno -a \
"x$enable_gles2" = xno -a \
"x$enable_openvg" = xno -a \
"x$enable_xorg" = xno -a \
"x$enable_xa" = xno -a \
"x$enable_xvmc" = xno -a \
"x$enable_vdpau" = xno -a \
@@ -730,8 +699,6 @@ fi
AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xyes -a \
"x$enable_dri" = xyes)
AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
"x$enable_osmesa" = xyes)
AC_ARG_ENABLE([shared-glapi],
[AS_HELP_STRING([--enable-shared-glapi],
@@ -769,7 +736,13 @@ if test "x$enable_dri" = xyes; then
GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
fi
if test "x$enable_osmesa" = xyes; then
if test "x$enable_gallium_osmesa" = xyes; then
if test -z "$with_gallium_drivers"; then
AC_MSG_ERROR([Cannot enable gallium_osmesa without Gallium])
fi
if test "x$enable_osmesa" = xyes; then
AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations])
fi
GALLIUM_STATE_TRACKERS_DIRS="osmesa $GALLIUM_STATE_TRACKERS_DIRS"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS osmesa"
fi
@@ -877,8 +850,6 @@ AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
AC_SUBST([GLESv2_LIB_DEPS])
AC_SUBST([GLESv2_PC_LIB_PRIV])
DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
AC_SUBST([HAVE_XF86VIDMODE])
dnl
@@ -991,7 +962,7 @@ if test "x$enable_dri" = xyes; then
;;
esac
;;
freebsd* | dragonfly* | *netbsd* | openbsd*)
*freebsd* | dragonfly* | *netbsd* | openbsd*)
DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
DEFINES="$DEFINES -DHAVE_ALIAS"
@@ -1022,39 +993,41 @@ if test "x$enable_dri" = xyes; then
DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
# Check for expat
EXPAT_INCLUDES=""
EXPAT_LIB=-lexpat
AC_ARG_WITH([expat],
[AS_HELP_STRING([--with-expat=DIR],
[expat install directory])],[
EXPAT_INCLUDES="-I$withval/include"
CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
])
AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
save_LIBS="$LIBS"
AC_CHECK_LIB([expat],[XML_ParserCreate],[],
[AC_MSG_ERROR([Expat required for DRI.])])
LIBS="$save_LIBS"
PKG_CHECK_EXISTS([EXPAT], [have_expat=yes], [have_expat=no])
if test "x$have_expat" = "xyes"; then
PKG_CHECK_MODULES([EXPAT], [expat], [],
AC_MSG_ERROR([Expat required for DRI.]))
else
# expat version 2.0 and earlier do not provide expat.pc
EXPAT_LIBS=-lexpat
fi
# If we are building any DRI driver other than swrast.
if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
# ... libdrm is required
if test "x$have_libdrm" != xyes; then
AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
if test -n "$DRI_DIRS"; then
if test x"$DRI_DIRS" != xswrast; then
# ... libdrm is required
if test "x$have_libdrm" != xyes; then
AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
fi
DRICOMMON_NEED_LIBDRM=yes
else
DRICOMMON_NEED_LIBDRM=no
fi
# ... and build dricommon
HAVE_COMMON_DRI=yes
fi
# put all the necessary libs together
DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
DRI_DRIVER_LDFLAGS="-module -avoid-version -shared -Wl,-Bsymbolic"
fi
AM_CONDITIONAL(NEED_LIBDRICORE, test -n "$DRI_DIRS")
AC_SUBST([EXPAT_INCLUDES])
AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS")
AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
"x$enable_osmesa" = xyes -o \
-n "$DRI_DIRS")
AC_SUBST([DRI_LIB_DEPS])
AC_SUBST([DRI_DRIVER_LDFLAGS])
AC_SUBST([GALLIUM_DRI_LIB_DEPS])
case $DRI_DIRS in
@@ -1135,7 +1108,7 @@ x16|x32)
;;
esac
if test "x$enable_osmesa" = xyes; then
if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
@@ -1254,37 +1227,11 @@ if test "x$enable_gallium_gbm" = xyes; then
fi
AM_CONDITIONAL(HAVE_GALLIUM_GBM, test "x$enable_gallium_gbm" = xyes)
dnl
dnl X.Org DDX configuration
dnl
if test "x$enable_xorg" = xyes; then
PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
HAVE_XEXTPROTO_71="no")
GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
fi
AM_CONDITIONAL(HAVE_ST_XORG, test "x$enable_xorg" = xyes)
dnl
dnl XA configuration
dnl
if test "x$enable_xa" = xyes; then
AC_PROG_AWK
AC_PROG_GREP
AC_CHECK_PROG(NM, nm, "nm")
if test "x$AWK" = x || test "x$GREP" = x || test "x$NM" = x; then
AC_MSG_WARN([Missing one of nm, grep or awk. Disabling xa.])
enable_xa=no
fi
fi
if test "x$enable_xa" = xyes; then
GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
AC_SUBST(AWK)
AC_SUBST(GREP)
AC_SUBST(NM)
fi
AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
@@ -1360,29 +1307,42 @@ AC_ARG_WITH([clang-libdir],
[CLANG_LIBDIR="$withval"],
[CLANG_LIBDIR=""])
LIBCLC_INCLUDEDIR=`pkg-config --variable=includedir libclc`
LIBCLC_LIBEXECDIR=`pkg-config --variable=libexecdir libclc`
AC_SUBST([LIBCLC_INCLUDEDIR])
AC_SUBST([LIBCLC_LIBEXECDIR])
PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no])
if test "x$enable_opencl" = xyes; then
if test "x$with_gallium_drivers" = x; then
AC_MSG_ERROR([cannot enable OpenCL without Gallium])
fi
if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6; then
AC_MSG_ERROR([gcc >= 4.6 is required to build clover])
if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
AC_MSG_ERROR([gcc >= 4.7 is required to build clover])
fi
if test "x$LIBCLC_INCLUDEDIR" == x || test "x$LIBCLC_LIBEXECDIR" == x; then
AC_MSG_ERROR([pkg-config cannot use libclc.pc which is required to build clover])
if test "x$have_libclc" = xno; then
AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
Make sure the directory containing libclc.pc is specified in your
PKG_CONFIG_PATH environment variable.
By default libclc.pc is installed to /usr/local/share/pkgconfig/])
else
LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
AC_SUBST([LIBCLC_INCLUDEDIR])
AC_SUBST([LIBCLC_LIBEXECDIR])
fi
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
enable_gallium_loader=yes
if test "x$enable_opencl_icd" = xyes; then
OPENCL_LIBNAME="MesaOpenCL"
else
OPENCL_LIBNAME="OpenCL"
fi
fi
AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
AC_SUBST([OPENCL_LIBNAME])
dnl
dnl Gallium configuration
@@ -1423,8 +1383,6 @@ AC_ARG_WITH([egl-platforms],
with_egl_platforms=""
fi])
EGL_PLATFORMS=""
if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
@@ -1434,7 +1392,7 @@ egl_platforms=`IFS=', '; echo $with_egl_platforms`
for plat in $egl_platforms; do
case "$plat" in
wayland)
PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 1.0.2 wayland-server >= 1.0.2])
PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 1.2.0 wayland-server >= 1.2.0])
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
@@ -1478,8 +1436,6 @@ else
EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
fi
EGL_PLATFORMS="$egl_platforms"
if echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1; then
NEED_WINSYS_XLIB=yes
fi
@@ -1493,7 +1449,6 @@ AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")
AC_SUBST([EGL_NATIVE_PLATFORM])
AC_SUBST([EGL_PLATFORMS])
AC_SUBST([EGL_CFLAGS])
# If we don't have the X11 platform, set this define so we don't try to include
@@ -1510,13 +1465,6 @@ AC_ARG_WITH([egl-driver-dir],
[EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
AC_SUBST([EGL_DRIVER_INSTALL_DIR])
AC_ARG_WITH([xorg-driver-dir],
[AS_HELP_STRING([--with-xorg-driver-dir=DIR],
[Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
[XORG_DRIVER_INSTALL_DIR="$withval"],
[XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
AC_SUBST([XORG_DRIVER_INSTALL_DIR])
AC_ARG_WITH([max-width],
[AS_HELP_STRING([--with-max-width=N],
[Maximum framebuffer width (4096)])],
@@ -1546,11 +1494,6 @@ AC_ARG_WITH([llvm-shared-libs],
[link with LLVM shared libraries @<:@default=disabled@:>@])],
[],
[with_llvm_shared_libs=no])
AS_IF([test x$enable_opencl = xyes],
[
AC_MSG_WARN([OpenCL required, forcing LLVM shared libraries])
with_llvm_shared_libs=yes
])
AC_ARG_WITH([llvm-prefix],
[AS_HELP_STRING([--with-llvm-prefix],
@@ -1621,6 +1564,10 @@ if test "x$enable_gallium_llvm" = xyes; then
if $LLVM_CONFIG --components | grep -qw 'irreader'; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader"
fi
# LLVM 3.4 requires Option
if $LLVM_CONFIG --components | grep -qw 'option'; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} option"
fi
fi
DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT"
MESA_LLVM=1
@@ -1692,20 +1639,16 @@ gallium_check_st() {
fi
if test "x$enable_dri" = xyes && test "x$2" != x; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
HAVE_COMMON_DRI=yes
fi
if test "x$enable_xorg" = xyes && test "x$3" != x; then
if test "x$enable_xa" = xyes && test "x$3" != x; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
fi
if test "x$enable_xa" = xyes && test "x$4" != x; then
if test "x$enable_xvmc" = xyes && test "x$4" != x; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
fi
if test "x$enable_xvmc" = xyes && test "x$5" != x; then
if test "x$enable_vdpau" = xyes && test "x$5" != x; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
fi
if test "x$enable_vdpau" = xyes && test "x$6" != x; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
fi
}
gallium_require_llvm() {
@@ -1745,9 +1688,8 @@ radeon_llvm_check() {
}
dnl Gallium drivers
if test "x$enable_dri" = xyes -o "x$enable_xorg" = xyes -o \
"x$enable_xa" = xyes -o "x$enable_xvmc" = xyes -o \
"x$enable_vdpau" = xyes; then
if test "x$enable_dri" = xyes -o "x$enable_xa" = xyes -o \
"x$enable_xvmc" = xyes -o "x$enable_vdpau" = xyes; then
NEED_NONNULL_WINSYS=yes
fi
AM_CONDITIONAL(NEED_NONNULL_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes)
@@ -1760,7 +1702,7 @@ if test "x$with_gallium_drivers" != x; then
xsvga)
HAVE_GALLIUM_SVGA=yes
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
gallium_check_st "svga/drm" "dri-vmwgfx" "xa-vmwgfx"
;;
xi915)
HAVE_GALLIUM_I915=yes
@@ -1770,7 +1712,8 @@ if test "x$with_gallium_drivers" != x; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
fi
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
gallium_check_st "i915/drm" "dri-i915"
DRICOMMON_NEED_LIBDRM=yes
;;
xilo)
HAVE_GALLIUM_ILO=yes
@@ -1778,13 +1721,15 @@ if test "x$with_gallium_drivers" != x; then
gallium_require_drm_loader
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS ilo"
gallium_check_st "intel/drm" "dri-ilo"
DRICOMMON_NEED_LIBDRM=yes
;;
xr300)
HAVE_GALLIUM_R300=yes
PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
gallium_require_llvm "Gallium R300"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
gallium_check_st "radeon/drm" "dri-r300" "" "" "xvmc-r300" "vdpau-r300"
gallium_check_st "radeon/drm" "r300/dri" "" "" ""
DRICOMMON_NEED_LIBDRM=yes
;;
xr600)
HAVE_GALLIUM_R600=yes
@@ -1793,7 +1738,6 @@ if test "x$with_gallium_drivers" != x; then
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
radeon_llvm_check
R600_NEED_RADEON_GALLIUM=yes;
LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
fi
if test "x$enable_r600_llvm" = xyes; then
@@ -1802,7 +1746,8 @@ if test "x$with_gallium_drivers" != x; then
if test "x$enable_opencl" = xyes; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
fi
gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600"
gallium_check_st "radeon/drm" "r600/dri" "" "r600/xvmc" "r600/vdpau"
DRICOMMON_NEED_LIBDRM=yes
;;
xradeonsi)
HAVE_GALLIUM_RADEONSI=yes
@@ -1810,21 +1755,24 @@ if test "x$with_gallium_drivers" != x; then
gallium_require_drm_loader
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
radeon_llvm_check
gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi" "" "" "vdpau-radeonsi" ""
gallium_check_st "radeon/drm" "radeonsi/dri" "" "" "radeonsi/vdpau"
DRICOMMON_NEED_LIBDRM=yes
;;
xnouveau)
HAVE_GALLIUM_NOUVEAU=yes
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
gallium_require_drm_loader
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv50 nvc0"
gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau"
gallium_check_st "nouveau/drm" "dri-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
DRICOMMON_NEED_LIBDRM=yes
;;
xfreedreno)
HAVE_GALLIUM_FREEDRENO=yes
PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
gallium_require_drm_loader
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS freedreno"
gallium_check_st "freedreno/drm" "dri-freedreno" "" "" "" ""
gallium_check_st "freedreno/drm" "dri-freedreno" "" "" ""
DRICOMMON_NEED_LIBDRM=yes
;;
xswrast)
HAVE_GALLIUM_SOFTPIPE=yes
@@ -1836,17 +1784,6 @@ if test "x$with_gallium_drivers" != x; then
if test "x$enable_dri" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
HAVE_COMMON_DRI=yes
fi
if test "x$enable_vdpau" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
fi
if test "x$enable_xvmc" = xyes; then
GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
fi
if test "x$enable_vdpau" = xyes -o "x$enable_xvmc" = xyes; then
NEED_WINSYS_XLIB=yes
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
fi
;;
*)
@@ -1914,8 +1851,8 @@ AM_CONDITIONAL(NEED_GALLIUM_SOFTPIPE_DRIVER, test "x$HAVE_GALLIUM_SVGA" = xyes -
"x$HAVE_GALLIUM_I915" = xyes -o \
"x$HAVE_GALLIUM_SOFTPIPE" = xyes)
AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test "x$HAVE_GALLIUM_I915" = xyes -o \
"x$HAVE_GALLIUM_SOFTPIPE" = xyes -a \
"x$MESA_LLVM" = x1)
"x$HAVE_GALLIUM_SOFTPIPE" = xyes \
&& test "x$MESA_LLVM" = x1)
if test "x$enable_gallium_loader" = xyes; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
@@ -1940,7 +1877,6 @@ AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
AM_CONDITIONAL(HAVE_COMMON_DRI, test x$HAVE_COMMON_DRI = xyes)
AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes -a \
"x$HAVE_GALLIUM_R300" = xyes -o \
@@ -1950,27 +1886,22 @@ AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test "x$HAVE_GALLIUM_I915" = xyes -o \
"x$HAVE_GALLIUM_SVGA" = xyes)
AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes)
AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
AM_CONDITIONAL(R600_NEED_RADEON_GALLIUM, test x$R600_NEED_RADEON_GALLIUM = xyes)
AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
AM_CONDITIONAL(LLVM_NEEDS_FNORTTI, test $LLVM_VERSION_INT -ge 302)
AC_SUBST([ELF_LIB])
AM_CONDITIONAL(NEED_LIBPROGRAM, test "x$with_gallium_drivers" != x -o \
"x$enable_xlib_glx" = xyes -o \
"x$enable_osmesa" = xyes)
AM_CONDITIONAL(DRICOMMON_NEED_LIBDRM, test "x$DRICOMMON_NEED_LIBDRM" = xyes)
AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes)
AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes)
AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1)
AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
AM_CONDITIONAL(HAVE_X86_ASM, test "x$asm_arch" = xx86 -o "x$asm_arch" = xx86_64)
AM_CONDITIONAL(HAVE_X86_64_ASM, test "x$asm_arch" = xx86_64)
AM_CONDITIONAL(HAVE_SPARC_ASM, test "x$asm_arch" = xsparc)
AC_SUBST([VDPAU_MAJOR], 1)
AC_SUBST([VDPAU_MINOR], 0)
@@ -1978,7 +1909,7 @@ AC_SUBST([VDPAU_MINOR], 0)
AC_SUBST([XVMC_MAJOR], 1)
AC_SUBST([XVMC_MINOR], 0)
AC_SUBST([XA_MAJOR], 1)
AC_SUBST([XA_MAJOR], 2)
AC_SUBST([XA_MINOR], 0)
AC_SUBST([XA_TINY], 0)
AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
@@ -1987,6 +1918,12 @@ dnl Restore LDFLAGS and CPPFLAGS
LDFLAGS="$_SAVE_LDFLAGS"
CPPFLAGS="$_SAVE_CPPFLAGS"
dnl Suppress clang's warnings about unused CFLAGS and CXXFLAGS
if test "x$acv_mesa_CLANG" = xyes; then
CFLAGS="$CFLAGS -Qunused-arguments"
CXXFLAGS="$CXXFLAGS -Qunused-arguments"
fi
dnl Add user CFLAGS and CXXFLAGS
CFLAGS="$CFLAGS $USER_CFLAGS"
CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
@@ -2010,13 +1947,13 @@ AC_CONFIG_FILES([Makefile
src/gallium/drivers/freedreno/Makefile
src/gallium/drivers/freedreno/a2xx/Makefile
src/gallium/drivers/freedreno/a3xx/Makefile
src/gallium/drivers/galahad/Makefile
src/gallium/drivers/i915/Makefile
src/gallium/drivers/identity/Makefile
src/gallium/drivers/ilo/Makefile
src/gallium/drivers/llvmpipe/Makefile
src/gallium/drivers/noop/Makefile
src/gallium/drivers/nouveau/Makefile
src/gallium/drivers/nv30/Makefile
src/gallium/drivers/nv50/Makefile
src/gallium/drivers/nvc0/Makefile
src/gallium/drivers/r300/Makefile
src/gallium/drivers/r600/Makefile
src/gallium/drivers/radeon/Makefile
@@ -2032,44 +1969,36 @@ AC_CONFIG_FILES([Makefile
src/gallium/state_trackers/dri/sw/Makefile
src/gallium/state_trackers/egl/Makefile
src/gallium/state_trackers/gbm/Makefile
src/gallium/state_trackers/glx/Makefile
src/gallium/state_trackers/glx/xlib/Makefile
src/gallium/state_trackers/osmesa/Makefile
src/gallium/state_trackers/vdpau/Makefile
src/gallium/state_trackers/vega/Makefile
src/gallium/state_trackers/xa/Makefile
src/gallium/state_trackers/xorg/Makefile
src/gallium/state_trackers/xvmc/Makefile
src/gallium/targets/Makefile
src/gallium/targets/dri-freedreno/Makefile
src/gallium/targets/dri-i915/Makefile
src/gallium/targets/dri-ilo/Makefile
src/gallium/targets/dri-nouveau/Makefile
src/gallium/targets/dri-r300/Makefile
src/gallium/targets/dri-r600/Makefile
src/gallium/targets/dri-radeonsi/Makefile
src/gallium/targets/dri-swrast/Makefile
src/gallium/targets/dri-vmwgfx/Makefile
src/gallium/targets/egl-static/Makefile
src/gallium/targets/gbm/Makefile
src/gallium/targets/opencl/Makefile
src/gallium/targets/osmesa/Makefile
src/gallium/targets/osmesa/osmesa.pc
src/gallium/targets/pipe-loader/Makefile
src/gallium/targets/radeonsi/dri/Makefile
src/gallium/targets/radeonsi/vdpau/Makefile
src/gallium/targets/r300/dri/Makefile
src/gallium/targets/r600/dri/Makefile
src/gallium/targets/r600/vdpau/Makefile
src/gallium/targets/r600/xvmc/Makefile
src/gallium/targets/libgl-xlib/Makefile
src/gallium/targets/vdpau-nouveau/Makefile
src/gallium/targets/vdpau-r300/Makefile
src/gallium/targets/vdpau-r600/Makefile
src/gallium/targets/vdpau-radeonsi/Makefile
src/gallium/targets/vdpau-softpipe/Makefile
src/gallium/targets/xa-vmwgfx/Makefile
src/gallium/targets/xa-vmwgfx/xatracker.pc
src/gallium/targets/xorg-i915/Makefile
src/gallium/targets/xorg-nouveau/Makefile
src/gallium/targets/xorg-r600/Makefile
src/gallium/targets/xorg-radeonsi/Makefile
src/gallium/targets/xvmc-nouveau/Makefile
src/gallium/targets/xvmc-r300/Makefile
src/gallium/targets/xvmc-r600/Makefile
src/gallium/targets/xvmc-softpipe/Makefile
src/gallium/tests/trivial/Makefile
src/gallium/tests/unit/Makefile
src/gallium/winsys/Makefile
@@ -2089,7 +2018,6 @@ AC_CONFIG_FILES([Makefile
src/gbm/Makefile
src/gbm/main/gbm.pc
src/glsl/Makefile
src/glsl/builtin_compiler/Makefile
src/glx/Makefile
src/glx/tests/Makefile
src/gtest/Makefile
@@ -2120,12 +2048,8 @@ AC_CONFIG_FILES([Makefile
src/mesa/drivers/osmesa/Makefile
src/mesa/drivers/osmesa/osmesa.pc
src/mesa/drivers/x11/Makefile
src/mesa/libdricore/Makefile
src/mesa/main/tests/Makefile
src/mesa/main/tests/hash_table/Makefile
src/mesa/program/Makefile
src/mesa/x86-64/Makefile
src/mesa/x86/Makefile])
src/mesa/main/tests/hash_table/Makefile])
dnl Sort the dirs alphabetically
GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
@@ -2151,11 +2075,17 @@ echo " OpenVG: $enable_openvg"
dnl Driver info
echo ""
if test "x$enable_osmesa" != xno; then
case "x$enable_osmesa$enable_gallium_osmesa" in
xnoyes)
echo " OSMesa: lib$OSMESA_LIB (Gallium)"
;;
xyesno)
echo " OSMesa: lib$OSMESA_LIB"
else
;;
xnono)
echo " OSMesa: no"
fi
;;
esac
if test "x$enable_dri" != xno; then
# cleanup the drivers var
@@ -2184,7 +2114,7 @@ dnl EGL
echo ""
echo " EGL: $enable_egl"
if test "$enable_egl" = yes; then
echo " EGL platforms: $EGL_PLATFORMS"
echo " EGL platforms: $egl_platforms"
egl_drivers=""
if test "x$HAVE_EGL_DRIVER_GLX" != "x"; then

View File

@@ -7,105 +7,113 @@ infrastructure is complete but it may be the case that few (if any) drivers
implement the features.
OpenGL Core and Compatibility context support
OpenGL 3.1 and later versions are only supported with the Core profile.
There are no plans to support GL_ARB_compatibility. The last supported OpenGL
version with all deprecated features is 3.0. Some of the later GL features
are exposed in the 3.0 context as extensions.
Feature Status
----------------------------------------------------- ------------------------
GL 3.0:
GLSL 1.30 DONE
GLSL 1.30 DONE (i965, r600, radeonsi)
glBindFragDataLocation, glGetFragDataLocation DONE
Conditional rendering (GL_NV_conditional_render) DONE (i965, r300, r600, swrast)
Map buffer subranges (GL_ARB_map_buffer_range) DONE (i965, r300, r600, swrast)
Clamping controls (GL_ARB_color_buffer_float) DONE (i965, r300, r600)
Float textures, renderbuffers (GL_ARB_texture_float) DONE (i965, r300, r600)
GL_EXT_packed_float DONE (i965, r600)
GL_EXT_texture_shared_exponent DONE (i965, r600, swrast)
Float depth buffers (GL_ARB_depth_buffer_float) DONE (i965, r600)
Framebuffer objects (GL_ARB_framebuffer_object) DONE (i965, r300, r600, swrast)
Half-float DONE
Non-normalized Integer texture/framebuffer formats DONE (i965, r600)
1D/2D Texture arrays DONE
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE (i965, r600, swrast)
GL_EXT_texture_compression_rgtc DONE (i965, r300, r600, swrast)
Red and red/green texture formats DONE (i965, swrast, gallium)
Transform feedback (GL_EXT_transform_feedback) DONE (i965, r600)
Vertex array objects (GL_APPLE_vertex_array_object) DONE (i965, r300, r600, swrast)
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) DONE (i965, r600)
Conditional rendering (GL_NV_conditional_render) DONE (i965, r300, r600, radeonsi, swrast)
Map buffer subranges (GL_ARB_map_buffer_range) DONE (i965, r300, r600, radeonsi, swrast)
Clamping controls (GL_ARB_color_buffer_float) DONE (i965, r300, r600, radeonsi)
Float textures, renderbuffers (GL_ARB_texture_float) DONE (i965, r300, r600, radeonsi)
GL_EXT_packed_float DONE (i965, r600, radeonsi)
GL_EXT_texture_shared_exponent DONE (i965, r600, radeonsi, swrast)
Float depth buffers (GL_ARB_depth_buffer_float) DONE (i965, r600, radeonsi)
Framebuffer objects (GL_ARB_framebuffer_object) DONE (i965, r300, r600, radeonsi, swrast)
Half-float DONE (i965, r300, r600, radeonsi, swrast)
Non-normalized Integer texture/framebuffer formats DONE (i965, r600, radeonsi)
1D/2D Texture arrays DONE (i965, r600, radeonsi)
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE (i965, r600, radeonsi, swrast)
GL_EXT_texture_compression_rgtc DONE (i965, r300, r600, radeonsi, swrast)
Red and red/green texture formats DONE (i965, r300, r600, radeonsi, swrast)
Transform feedback (GL_EXT_transform_feedback) DONE (i965, r600, radeonsi)
Vertex array objects (GL_APPLE_vertex_array_object) DONE (all drivers)
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) DONE (i965, r600, radeonsi)
glClearBuffer commands DONE
glGetStringi command DONE
glTexParameterI, glGetTexParameterI commands DONE
glVertexAttribI commands DONE
Depth format cube textures DONE
Depth format cube textures DONE (i965, r600, radeonsi)
GLX_ARB_create_context (GLX 1.4 is required) DONE
GL 3.1:
GLSL 1.40 DONE (i965, r600)
Forward compatibile context support/deprecations DONE (i965, r600)
Instanced drawing (GL_ARB_draw_instanced) DONE (i965, gallium, swrast)
Buffer copying (GL_ARB_copy_buffer) DONE (i965, r300, r600, swrast)
Primitive restart (GL_NV_primitive_restart) DONE (i965, r600)
16 vertex texture image units DONE
Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts (i965, r600)
Rectangular textures (GL_ARB_texture_rectangle) DONE (i965, r300, r600, swrast)
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (i965, r600, swrast)
Signed normalized textures (GL_EXT_texture_snorm) DONE (i965, r300, r600)
GLSL 1.40 DONE (i965, r600, radeonsi)
Forward compatible context support/deprecations DONE (i965, r600, radeonsi)
Instanced drawing (GL_ARB_draw_instanced) DONE (i965, r600, radeonsi, swrast)
Buffer copying (GL_ARB_copy_buffer) DONE (i965, r300, r600, radeonsi, swrast)
Primitive restart (GL_NV_primitive_restart) DONE (i965, r300, r600, radeonsi)
16 vertex texture image units DONE (i965, r600, radeonsi)
Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts (i965, r600, radeonsi)
Rectangular textures (GL_ARB_texture_rectangle) DONE (i965, r300, r600, radeonsi, swrast)
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (i965, r600, radeonsi, swrast)
Signed normalized textures (GL_EXT_texture_snorm) DONE (i965, r300, r600, radeonsi)
GL 3.2:
Core/compatibility profiles DONE
GLSL 1.50 in progress
Geometry shaders (GL_ARB_geometry_shader4) partially done
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (i965, r300, r600, swrast)
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE (i965, r300, r600, swrast)
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (i965, r300, r600, swrast)
Provoking vertex (GL_ARB_provoking_vertex) DONE (i965, r300, r600, swrast)
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE (i965, r600)
Multisample textures (GL_ARB_texture_multisample) DONE (i965)
Frag depth clamp (GL_ARB_depth_clamp) DONE (i965, r600, swrast)
Fence objects (GL_ARB_sync) DONE (i965, r300, r600, swrast)
GLSL 1.50 DONE (i965)
Geometry shaders DONE (i965)
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (i965, r300, r600, radeonsi, swrast)
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE (i965, r300, r600, radeonsi, swrast)
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (i965, r300, r600, radeonsi, swrast)
Provoking vertex (GL_ARB_provoking_vertex) DONE (i965, r300, r600, radeonsi, swrast)
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE (i965, r600, radeonsi)
Multisample textures (GL_ARB_texture_multisample) DONE (i965, r600, radeonsi)
Frag depth clamp (GL_ARB_depth_clamp) DONE (i965, r600, swrast, radeonsi)
Fence objects (GL_ARB_sync) DONE (i965, r300, r600, radeonsi, swrast)
GLX_ARB_create_context_profile DONE
GL 3.3:
GLSL 3.30 new features in this version pretty much done
GL_ARB_blend_func_extended DONE (i965, r600, softpipe)
GL_ARB_explicit_attrib_location DONE (i915, i965, r300, r600, swrast)
GL_ARB_occlusion_query2 DONE (i965, r300, r600, swrast)
GL_ARB_sampler_objects DONE (i965, r300, r600)
GL_ARB_shader_bit_encoding DONE
GL_ARB_texture_rgb10_a2ui DONE (i965, r600)
GL_ARB_texture_swizzle DONE (same as EXT version) (i965, r300, r600, swrast)
GL_ARB_timer_query DONE (i965, r600)
GL_ARB_instanced_arrays DONE (i965, r300, r600)
GL_ARB_vertex_type_2_10_10_10_rev DONE (i965, r600)
GLSL 3.30 DONE (i965)
GL_ARB_blend_func_extended DONE (i965, r600, radeonsi, softpipe)
GL_ARB_explicit_attrib_location DONE (i915, i965, r300, r600, radeonsi, swrast)
GL_ARB_occlusion_query2 DONE (i965, r300, r600, radeonsi, swrast)
GL_ARB_sampler_objects DONE (i965, r300, r600, radeonsi)
GL_ARB_shader_bit_encoding DONE (i965, r600, radeonsi)
GL_ARB_texture_rgb10_a2ui DONE (i965, r600, radeonsi)
GL_ARB_texture_swizzle DONE (i965, r300, r600, radeonsi, swrast)
GL_ARB_timer_query DONE (i965, r600, radeonsi)
GL_ARB_instanced_arrays DONE (i965, r300, r600, radeonsi)
GL_ARB_vertex_type_2_10_10_10_rev DONE (i965, r600, radeonsi)
GL 4.0:
GLSL 4.0 not started
GL_ARB_texture_query_lod DONE (i965)
GL_ARB_draw_buffers_blend DONE (i965, r600, softpipe)
GL_ARB_draw_buffers_blend DONE (i965, r600, radeonsi, softpipe)
GL_ARB_draw_indirect started (Christoph)
GL_ARB_gpu_shader5 started
GL_ARB_gpu_shader_fp64 not started
GL_ARB_sample_shading not started
GL_ARB_sample_shading DONE (i965)
GL_ARB_shader_subroutine not started
GL_ARB_tessellation_shader not started
GL_ARB_texture_buffer_object_rgb32 DONE (i965, softpipe)
GL_ARB_texture_cube_map_array DONE (i965, softpipe)
GL_ARB_texture_gather started (Maxence, Chris)
GL_ARB_transform_feedback2 DONE
GL_ARB_transform_feedback3 DONE
GL_ARB_texture_buffer_object_rgb32 DONE (i965, r600, radeonsi, softpipe)
GL_ARB_texture_cube_map_array DONE (i965, r600, softpipe)
GL_ARB_texture_gather DONE (i965)
GL_ARB_transform_feedback2 DONE (i965, r600, radeonsi)
GL_ARB_transform_feedback3 DONE (i965, r600, radeonsi)
GL 4.1:
GLSL 4.1 not started
GL_ARB_ES2_compatibility DONE (i965, r300, r600)
GL_ARB_ES2_compatibility DONE (i965, r300, r600, radeonsi)
GL_ARB_get_program_binary DONE (0 binary formats)
GL_ARB_separate_shader_objects some infrastructure done
GL_ARB_shader_precision not started
@@ -118,42 +126,56 @@ GL 4.2:
GLSL 4.2 not started
GL_ARB_texture_compression_bptc not started
GL_ARB_compressed_texture_pixel_storage not started
GL_ARB_shader_atomic_counters not started
GL_ARB_texture_storage DONE (i965, r300, r600, swrast, gallium)
GL_ARB_transform_feedback_instanced DONE
GL_ARB_shader_atomic_counters DONE (i965)
GL_ARB_texture_storage DONE (all drivers)
GL_ARB_transform_feedback_instanced DONE (i965, r600, radeonsi)
GL_ARB_base_instance DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_shader_image_load_store not started
GL_ARB_conservative_depth DONE (softpipe)
GL_ARB_shading_language_420pack started (Todd)
GL_ARB_internalformat_query DONE (i965, gallium)
GL_ARB_conservative_depth DONE (all drivers that support GLSL 1.30)
GL_ARB_shading_language_420pack DONE (all drivers that support GLSL 1.30)
GL_ARB_internalformat_query DONE (i965, r300, r600, radeonsi)
GL_ARB_map_buffer_alignment DONE (r300, r600, radeonsi)
GL 4.3:
GLSL 4.3 not started
ARB_arrays_of_arrays not started
ARB_ES3_compatibility DONE (i965)
ARB_clear_buffer_object not started
ARB_compute_shader started (gallium)
ARB_copy_image not started
KHR_debug some work done (ARB_debug_output)
ARB_explicit_uniform_location not started
ARB_fragment_layer_viewport not started
ARB_framebuffer_no_attachments not started
ARB_internalformat_query2 not started
ARB_invalidate_subdata not started
ARB_multi_draw_indirect not started
ARB_program_interface_query not started
ARB_robust_buffer_access_behavior not started
ARB_shader_image_size not started
ARB_shader_storage_buffer_object not started
ARB_stencil_texturing not started
ARB_texture_buffer_range DONE (nv50, nvc0)
ARB_texture_query_levels not started
ARB_texture_storage_multisample DONE (i965)
ARB_texture_view not started
ARB_vertex_attrib_binding not started
GL_ARB_arrays_of_arrays not started
GL_ARB_ES3_compatibility DONE (i965)
GL_ARB_clear_buffer_object not started
GL_ARB_compute_shader not started
GL_ARB_copy_image not started
GL_KHR_debug DONE (all drivers)
GL_ARB_explicit_uniform_location not started
GL_ARB_fragment_layer_viewport not started
GL_ARB_framebuffer_no_attachments not started
GL_ARB_internalformat_query2 not started
GL_ARB_invalidate_subdata DONE (all drivers)
GL_ARB_multi_draw_indirect not started
GL_ARB_program_interface_query not started
GL_ARB_robust_buffer_access_behavior not started
GL_ARB_shader_image_size not started
GL_ARB_shader_storage_buffer_object not started
GL_ARB_stencil_texturing not started
GL_ARB_texture_buffer_range DONE (nv50, nvc0, i965, r600, radeonsi)
GL_ARB_texture_query_levels DONE (i965)
GL_ARB_texture_storage_multisample DONE (all drivers that support GL_ARB_texture_multisample)
GL_ARB_texture_view not started
GL_ARB_vertex_attrib_binding DONE (all drivers)
GL 4.4:
GLSL 4.4 not started
GL_MAX_VERTEX_ATTRIB_STRIDE not started
GL_ARB_buffer_storage not started
GL_ARB_clear_texture not started
GL_ARB_enhanced_layouts not started
GL_ARB_multi_bind not started
GL_ARB_query_buffer_object not started
GL_ARB_texture_mirror_clamp_to_edge DONE (i965, nv30, nv50, nvc0, r300, r600, radeonsi, swrast)
GL_ARB_texture_stencil8 not started
GL_ARB_vertex_type_10f_11f_11f_rev DONE (i965, r600)
More info about these features and the work involved can be found at

View File

@@ -123,24 +123,6 @@ directories.</p>
There are also a few general options for altering the Mesa build:
</p>
<dl>
<dt><code>--with-x</code></dt>
<dd><p>When the X11 development libraries are
needed, the <code>pkg-config</code> utility <a href="#pkg-config">will
be used</a> for locating them. If they cannot be found through
<code>pkg-config</code> a fallback routing using <code>imake</code> will
be used. In this case, the <code>--with-x</code>,
<code>--x-includes</code> and <code>--x-libraries</code> options can
control the use of X for Mesa.</p>
</dd>
<dt><code>--enable-gl-osmesa</code></dt>
<dd><p>The <a href="osmesa.html">OSMesa
library</a> can be built on top of libGL for drivers that provide it.
This option controls whether to build libOSMesa. By default, this is
enabled for the Xlib driver and disabled otherwise. Note that this
option is different than using OSMesa as the driver.</p>
</dd>
<dt><code>--enable-debug</code></dt>
<dd><p>This option will enable compiler
options and macros to aid in debugging the Mesa libraries.</p>
@@ -155,12 +137,12 @@ assembly will not be used.</p>
<dt><code>--enable-32-bit</code></dt>
<dt><code>--enable-64-bit</code></dt>
<dd><p>By default, the
build will compile code as directed by the environment variables
<dd><p>By default, the build will compile code as directed by the environment
variables
<code>CC</code>, <code>CFLAGS</code>, etc. If the compiler is
<code>gcc</code>, these options offer a helper to add the compiler flags
to force 32- or 64-bit code generation as used on the x86 and x86_64
architectures.</p>
architectures. Note that these options are mutually exclusive.</p>
</dd>
</dl>
@@ -171,19 +153,19 @@ architectures.</p>
There are several different driver modes that Mesa can use. These are
described in more detail in the <a href="install.html">basic
installation instructions</a>. The Mesa driver is controlled through the
configure option --with-driver. There are currently three supported
options in the configure script.
configure options <code>--enable-xlib-glx</code>, <code>--enable-osmesa</code>,
and <code>--enable-dri</code>.
</p>
<h3 id="xlib">Xlib</h3><p>This is the default mode for building Mesa.
<h3 id="xlib">Xlib</h3><p>
It uses Xlib as a software renderer to do all rendering. It corresponds
to the option <code>--with-driver=xlib</code>. The libX11 and libXext
to the option <code>--enable-xlib-glx</code>. The libX11 and libXext
libraries, as well as the X11 development headers, will be need to
support the Xlib driver.
<h3 id="dri">DRI</h3><p>This mode uses the DRI hardware drivers for
accelerated OpenGL rendering. Enable the DRI drivers with the option
<code>--with-driver=dri</code>. See the <a href="install.html">basic
<code>--enable-dri</code>. See the <a href="install.html">basic
installation instructions</a> for details on prerequisites for the DRI
drivers.
@@ -223,7 +205,8 @@ and <code>/usr/local/lib</code>, respectively.
<h3 id="osmesa">OSMesa </h3><p> No libGL is built in this
mode. Instead, the driver code is built into the Off-Screen Mesa
(OSMesa) library. See the <a href="osmesa.html">Off-Screen Rendering</a>
page for more details.
page for more details. It corresponds to the option
<code>--enable-osmesa</code>.
<!-- OSMesa specific options -->
<dl>

View File

@@ -36,7 +36,7 @@ To add a new GL extension to Mesa you have to do at least the following.
</pre>
</li>
<li>
In the src/mesa/glapi/ directory, add the new extension functions and
In the src/mapi/glapi/gen/ directory, add the new extension functions and
enums to the gl_API.xml file.
Then, a bunch of source files must be regenerated by executing the
corresponding Python scripts.
@@ -155,6 +155,29 @@ of <tt>bool</tt>, <tt>true</tt>, and
src/mesa/state_tracker/st_glsl_to_tgsi.cpp can serve as examples.
</p>
<h2>Submitting patches</h2>
<p>
You should always run the Mesa Testsuite before submitting patches.
The Testsuite can be run using the 'make check' command. All tests
must pass before patches will be accepted, this may mean you have
to update the tests themselves.
</p>
<p>
Patches should be sent to the Mesa mailing list for review.
When submitting a patch make sure to use git send-email rather than attaching
patches to emails. Sending patches as attachments prevents people from being
able to provide in-line review comments.
</p>
<p>
When submitting follow-up patches you can use --in-reply-to to make v2, v3,
etc patches show up as replies to the originals. This usually works well
when you're sending out updates to individual patches (as opposed to
re-sending the whole series). Using --in-reply-to makes
it harder for reviewers to accidentally review old patches.
</p>
<h2>Marking a commit as a candidate for a stable branch</h2>
@@ -193,15 +216,7 @@ branch is relevant.
</p>
<h3>Verify and update version info</h3>
<dl>
<dt>SConstruct</dt>
<dt>Android.common.mk</dt>
<dd>PACKAGE_VERSION</dd>
<dt>configure.ac</dt>
<dd>AC_INIT</dd>
</dl>
<h3>Verify and update version info in VERSION</h3>
<p>
Create a docs/relnotes/x.y.z.html file.
@@ -269,10 +284,10 @@ sftp USERNAME,mesa3d@web.sourceforge.net
<p>
Make an announcement on the mailing lists:
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>,
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
<em>mesa-dev@lists.freedesktop.org</em>,
<em>mesa-users@lists.freedesktop.org</em>
and
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
<em>mesa-announce@lists.freedesktop.org</em>
</p>
</div>

View File

@@ -16,6 +16,32 @@
<h1>News</h1>
<h2>October 18, 2013</h2>
<p>
<a href="relnotes/9.2.2.html">Mesa 9.2.2</a> is released.
This is a bug fix release.
</p>
<h2>October 4, 2013</h2>
<p>
<a href="relnotes/9.2.1.html">Mesa 9.2.1</a> and
<a href="relnotes/9.1.7.html">Mesa 9.1.7</a> are released,
both bug-fix releases.
</p>
<h2>August 27, 2013</h2>
<p>
<a href="relnotes/9.2.html">Mesa 9.2</a> is released.
This is a new development release.
See the release notes for more information about the release.
</p>
<h2>August 1, 2013</h2>
<p>
<a href="relnotes/9.1.6.html">Mesa 9.1.6</a> is released.
This is a bug fix release.
</p>
<h2>July 17, 2013</h2>
<p>
<a href="relnotes/9.1.5.html">Mesa 9.1.5</a> is released.

View File

@@ -21,7 +21,12 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<ul>
<li><a href="relnotes/10.0.html">10.0 release notes</a>
<li><a href="relnotes/9.2.2.html">9.2.2 release notes</a>
<li><a href="relnotes/9.2.1.html">9.2.1 release notes</a>
<li><a href="relnotes/9.2.html">9.2 release notes</a>
<li><a href="relnotes/9.1.7.html">9.1.7 release notes</a>
<li><a href="relnotes/9.1.6.html">9.1.6 release notes</a>
<li><a href="relnotes/9.1.5.html">9.1.5 release notes</a>
<li><a href="relnotes/9.1.4.html">9.1.4 release notes</a>
<li><a href="relnotes/9.1.3.html">9.1.3 release notes</a>

147
docs/relnotes/10.0.1.html Normal file
View File

@@ -0,0 +1,147 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.0.1 Release Notes / (December 12, 2013)</h1>
<p>
Mesa 10.0.1 is a bug fix release which fixes bugs found since the 10.0 release.
</p>
<p>
Mesa 10.0.1 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64323">Bug 64323</a> - Severe misrendering in Left 4 Dead 2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68838">Bug 68838</a> - GLSL: struct declarations produce a &quot;empty declaration warning&quot; in 9.2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69155">Bug 69155</a> - [NV50 gallium] [piglit] bin/varying-packing-simple triggers memory corruption/failures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70250">Bug 70250</a> - weston-terminal rendering corrupted with output transform 90 and 270</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70601">Bug 70601</a> - [SNB Bisected]Piglit spec/ARB_texture_float/multisample-formats 2 GL_ARB_texture_float fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72230">Bug 72230</a> - Unable to extract MesaLib-10.0.0.tar.{gz,bz2} with bsdtar</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72325">Bug 72325</a> - [swrast] piglit glean fbo regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72327">Bug 72327</a> - [swrast] piglit glean pointSprite regression</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following git command:</p>
<pre>
git log mesa-10.0..mesa-10.0.1
</pre>
<p>Axel Davy (2):</p>
<ul>
<li>egl/wayland: Flush the wl_display at the end of SwapBuffers</li>
<li>Enable throttling in SwapBuffers</li>
</ul>
<p>Chad Versace (2):</p>
<ul>
<li>i965/hsw: Apply non-msrt fast color clear w/a to all HSW GTs</li>
<li>i965: Add extra-alignment for non-msrt fast color clear for all hw (v2)</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>swrast: fix readback regression since inversion fix</li>
</ul>
<p>Emil Velikov (1):</p>
<ul>
<li>automake: include only one copy VERSION in tarball</li>
</ul>
<p>Ian Romanick (3):</p>
<ul>
<li>docs: Add 10.0 release md5sums</li>
<li>Remove a057b83 from the pick list</li>
<li>glsl: Don't emit empty declaration warning for a struct specifier</li>
</ul>
<p>Ilia Mirkin (8):</p>
<ul>
<li>mesa: don't leak performance monitors on context destroy</li>
<li>nv50: Fix GPU_READING/WRITING bit removal</li>
<li>nouveau: avoid leaking fences while waiting</li>
<li>nv50: wait on the buf's fence before sticking it into pushbuf</li>
<li>nv50: enable h264 and mpeg4 for nv98+ (vp3, vp4.0)</li>
<li>nouveau/video: update h264 picparm field names based on usage</li>
<li>nouveau/video: update a few more h264 picparm field names</li>
<li>nv50: report 15 max inputs for fragment programs</li>
</ul>
<p>Jordan Justen (1):</p>
<ul>
<li>dri megadriver_stub: add compatibility for older DRI loaders</li>
</ul>
<p>Kristian Høgsberg (2):</p>
<ul>
<li>egl/wayland: Damage INT32_MAX x INT32_MAX region for eglSwapBuffers</li>
<li>egl/wayland: Send commit after flushing the driver context</li>
</ul>
<p>Maarten Lankhorst (1):</p>
<ul>
<li>nouveau: Fix compiler warning regression</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>i965/gen6: Fix multisample resolve blits for luminance/intensity 32F formats.</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Bump major version number to 2</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>r300/compiler/tests: Fix segfault</li>
<li>r300/compiler/tests: Fix line length check in test parser</li>
</ul>
</div>
</body>
</html>

146
docs/relnotes/10.0.html Normal file
View File

@@ -0,0 +1,146 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.0 Release Notes / (November 30th, 2013)</h1>
<p>
Mesa 10.0 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 10.0.1.
</p>
<p>
Mesa 10.0 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
b38626b96c664db67a534d7859682436 MesaLib-10.0.0.tar.gz
f3fe55d9735bea158bbe97ed9a0da819 MesaLib-10.0.0.tar.bz2
c6ee1ce51e3bf35947d2978b872daf51 MesaLib-10.0.0.zip
</pre>
<h2>New features</h2>
<p>
Note: some of the new features are only available with certain drivers.
</p>
<ul>
<li>GL_AMD_seamless_cubemap_per_texture on i965.</li>
<li>GL_ARB_conservative_depth on i965.</li>
<li>GL_ARB_texture_gather on i965.</li>
<li>GL_ARB_texture_query_levels on i965.</li>
<li>GL_ARB_texture_mirror_clamp_to_edge.</li>
<li>GL_ARB_transform_feedback2, GL_ARB_transform_feedback3, and GL_ARB_transform_feedback_instanced on i965/Gen7 (with appropriate kernel support).</li>
<li>GL_ARB_sample_shading on i965.</li>
<li>GL_ARB_shader_atomic_counters on i965.</li>
<li>GL_ARB_vertex_attrib_binding</li>
<li>GL_ARB_vertex_type_10f_11f_11f_rev on i965 and r600g</li>
<li>GL_KHR_debug</li>
<li>GLX_MESA_query_renderer</li>
</ul>
<h2>Bug fixes</h2>
<p>Attempts have been made to <b>not</b> include bugs fixed in previous 9.2
releases or bugs that were regressions during 10.0 development. This list is
likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47755">Bug 47755</a> - [glsl-compiler] no error checking when Interpolation qualifier for built-in variable is different in vertex and fragment shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=52171">Bug 52171</a> - [gallium/r600/clover] Simple benchmarks failed to run</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53077">Bug 53077</a> - [IVB] Output error with msaa when both of framebuffer and source color's alpha are not 1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54867">Bug 54867</a> - bug in r300 compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60929">Bug 60929</a> - [r600-llvm] mono games with opengl are blocking on start</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62142">Bug 62142</a> - Mesa/demo mipmap_limits upside down with running by SOFTWARE</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62698">Bug 62698</a> - [bisected] WebGL demo &quot;Consumed&quot;: texstate.c:628: update_texture_state: Assertion „__builtin_popcount(enabledTargets) == 1“ failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64225">Bug 64225</a> - bfgminer --scyte generates Segmentation Fault on Northern Island</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64226">Bug 64226</a> - python-opencl package generate segmentation fault at pipe_r600.so</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64261">Bug 64261</a> - [SNB Bisected]Ogles3conform GL3Tests_color_buffer_float_color_buffer_float_clamp_fixed.test fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66213">Bug 66213</a> - Certain Mesa Demos Rendering Inverted (vertically)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66806">Bug 66806</a> - [softpipe] glxgears floating point exception</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67921">Bug 67921</a> - [bisected commit 883987] crosscompiling fails with util/u_cpu_detect.c:247:4: error: 'asm' undeclared (first use in this function)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68162">Bug 68162</a> - [radeonsi] texture rendering is broken in Source-Engine games</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68451">Bug 68451</a> - Texture flicker in native Dota2 in mesa 9.2.0rc1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68503">Bug 68503</a> - Graphical glitches in Serious Sam 3 when SB is enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68792">Bug 68792</a> - Problems during playback of h264 files using UVD and VLC on AMD E-350 CPU</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68845">Bug 68845</a> - VDPAU/UVD regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69078">Bug 69078</a> - Modern Warfare (1, 2 and 3) broken in Wine on SNB</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69321">Bug 69321</a> - starting openCL crashes/boots system</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70042">Bug 70042</a> - Major texture flickering in Dota 2 (r600g on HD 6950)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70088">Bug 70088</a> - Glamor on r600g crashes Xserver</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70123">Bug 70123</a> - Freeze caused by 'winsys/radeon: remove cs_queue_empty' commit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70327">Bug 70327</a> - Casting floating point variable to integer not working properly while constant gets converted properly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70891">Bug 70891</a> - CL_INVALID_BUILD_OPTIONS results in CL_INVALID_DEVICE when asking for build log</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70913">Bug 70913</a> - [PIGLIT,radeonsi] crash in &quot;spec/EXT_framebuffer_multisample/sample-alpha-to-coverage 4 depth&quot; (buffer overflow)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71022">Bug 71022</a> - configure: error: Expat required for DRI.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71110">Bug 71110</a> - xorg_driver.c:1030:2: error: too many arguments to function DamageUnregister</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71172">Bug 71172</a> - Segfault when running glxinfo. NV25GL [Quadro4 900 XGL]</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71512">Bug 71512</a> - dlopen.h:54: undefined reference to `dlopen'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71870">Bug 71870</a> - Metro: Last Light rendering issues</li>
</ul>
<h2>Changes</h2>
<ul>
<li>Removed X.Org state tracker (unmaintained and broken)</li>
<li>Removed the video-accel r300 targets</li>
<li>Removed the video-accel softpipe targets</li>
</ul>
</div>
</body>
</html>

View File

@@ -30,7 +30,9 @@ because GL_ARB_compatibility is not supported.
<h2>MD5 checksums</h2>
<pre>
TBD
4ed2af5943141a85a21869053a2fc2eb MesaLib-9.1.5.tar.bz2
47181066acf3231d74e027b2033f9455 MesaLib-9.1.5.tar.gz
4c9c6615bd99215325250f87ed34058f MesaLib-9.1.5.zip
</pre>
<h2>New features</h2>

168
docs/relnotes/9.1.6.html Normal file
View File

@@ -0,0 +1,168 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 9.1.6 Release Notes / August 1, 2013</h1>
<p>
Mesa 9.1.6 is a bug fix release which fixes bugs found since the 9.1.5 release.
</p>
<p>
Mesa 9.1 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
443a2a352667294b53d56cb1a74114e9 MesaLib-9.1.6.tar.bz2
08d3069cccd6821e5f33e0840bca0718 MesaLib-9.1.6.tar.gz
90aa7a6d9878cdbfcb055312f356d6b9 MesaLib-9.1.6.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47824">Bug 47824</a> - osmesa using --enable-shared-glapi depends on libgl</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62362">Bug 62362</a> - Crash when using Wayland EGL platform</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63435">Bug 63435</a> - [Regression since 9.0] Flickering in EGL OpenGL full-screen window with swap interval 1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64087">Bug 64087</a> - Webgl conformance shader-with-non-reserved-words crash when mesa is compiled without --enable-debug</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64330">Bug 64330</a> - WebGL snake demo crash in loop_analysis.cpp:506: bool is_loop_terminator(ir_if*): assertion „inst != __null“ failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65236">Bug 65236</a> - [i965] Rendering artifacts in VDrift/GL2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66558">Bug 66558</a> - RS690: 3D artifacts when playing SuperTuxKart</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66847">Bug 66847</a> - compilation broken with llvm 3.3</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66850">Bug 66850</a> - glGenerateMipmap crashes when using GL_TEXTURE_2D_ARRAY with compressed internal format</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66921">Bug 66921</a> - [r300g] Heroes of Newerth: HiZ related corruption</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67283">Bug 67283</a> - VDPAU doesn't work on hybrid laptop through DRI_PRIME</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-9.1.5..mesa-9.1.6
</pre>
<p>Andreas Boll (1):</p>
<ul>
<li>configure.ac: Require llvm-3.2 for r600g/radeonsi llvm backends</li>
</ul>
<p>Brian Paul (4):</p>
<ul>
<li>mesa: handle 2D texture arrays in get_tex_rgba_compressed()</li>
<li>meta: handle 2D texture arrays in decompress_texture_image()</li>
<li>mesa: implement mipmap generation for compressed 2D array textures</li>
<li>mesa: improve free() cleanup in generate_mipmap_compressed()</li>
</ul>
<p>Carl Worth (7):</p>
<ul>
<li>docs: Add 9.1.5 release md5sums</li>
<li>Merge 'origin/9.1' into stable</li>
<li>cherry-ignore: Drop 13 patches from the pick list</li>
<li>get-pick-list.sh: Include commits mentionining "CC: mesa-stable..." in pick list</li>
<li>get-pick-list: Allow for non-whitespace between "CC:" and "mesa-stable"</li>
<li>get-pick-list: Ignore commits which CC mesa-stable unless they say "9.1"</li>
<li>Bump version to 9.1.6</li>
</ul>
<p>Chris Forbes (5):</p>
<ul>
<li>i965/Gen4: Zero extra coordinates for ir_tex</li>
<li>i965/vs: Fix flaky texture swizzling</li>
<li>i965/vs: set up sampler state pointer for Gen4/5.</li>
<li>i965/vs: Put lod parameter in the correct place for Gen4</li>
<li>i965/vs: Gen4/5: enable front colors if back colors are written</li>
</ul>
<p>Christoph Bumiller (1):</p>
<ul>
<li>nv50,nvc0: s/uint16/uint32 for constant buffer offset</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>gallium/vl: add prime support</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>egl: Restore "bogus" DRI2 invalidate event code.</li>
</ul>
<p>Jeremy Huddleston Sequoia (1):</p>
<ul>
<li>Apple: glFlush() is not needed with CGLFlushDrawable()</li>
</ul>
<p>Kenneth Graunke (1):</p>
<ul>
<li>glsl: Classify "layout" like other identifiers.</li>
</ul>
<p>Kristian Høgsberg (1):</p>
<ul>
<li>egl-wayland: Fix left-over wl_display_roundtrip() usage</li>
</ul>
<p>Maarten Lankhorst (2):</p>
<ul>
<li>osmesa: link against static libglapi library too to get the gl exports</li>
<li>nvc0: force use of correct firmware file</li>
</ul>
<p>Marek Olšák (4):</p>
<ul>
<li>r300g/swtcl: fix geometry corruption by uploading indices to a buffer</li>
<li>r300g/swtcl: fix a lockup in MSAA resolve</li>
<li>Revert "r300g: allow HiZ with a 16-bit zbuffer"</li>
<li>r600g: increase array size for shader inputs and outputs</li>
</ul>
<p>Matt Turner (2):</p>
<ul>
<li>i965: NULL check prog on shader compilation failure.</li>
<li>i965/vs: Print error if vertex shader fails to compile.</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>glsl: Handle empty if statement encountered during loop analysis.</li>
</ul>
</div>
</body>
</html>

168
docs/relnotes/9.1.7.html Normal file
View File

@@ -0,0 +1,168 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 9.1.7 Release Notes / October 4, 2013</h1>
<p>
Mesa 9.1.7 is a bug fix release which fixes bugs found since the 9.1.6 release.
</p>
<p>
Mesa 9.1 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
9e4abf7b7a6db762012c3c9917a8e8c7 MesaLib-9.1.7.tar.bz2
f1d4d479d6ce12b9566fdb379960a912 MesaLib-9.1.7.tar.gz
abd612bfc5dd478d04fcc630dd7672f2 MesaLib-9.1.7.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55503">Bug 55503</a> - Constant vertex attributes broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61635">Bug 61635</a> - glVertexAttribPointer(id, GL_UNSIGNED_BYTE, GL_FALSE,...) does not work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65958">Bug 65958</a> - GPU Lockup on Trinity 7500G</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66292">Bug 66292</a> - [SNB/IVB/HSW Bisected]Ogles3conform GL3Tests_depth24_depth24_basic.test fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67548">Bug 67548</a> - glGetAttribLocation seems to be broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68195">Bug 68195</a> - piglit tests vs-struct-pad and fs-struct-pad both fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68250">Bug 68250</a> - Automatic mipmap generation with texture compression produces borders that fade to black</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69525">Bug 69525</a> - [GM45, bisected] Piglit tex-shadow2drect fails</li>
</ul>
<h2>Changes</h2>
<p>Alex Deucher (2):</p>
<ul>
<li>r600g: disable GPUVM by default</li>
<li>radeon/winsys: pad IBs to a multiple of 8 DWs</li>
</ul>
<p>Andreas Boll (2):</p>
<ul>
<li>docs: Fix a typo in the 9.1.6 release notes</li>
<li>mesa: Fix MESA_PATCH version</li>
</ul>
<p>Anuj Phogat (1):</p>
<ul>
<li>meta: Fix blitting a framebuffer with renderbuffer attachment</li>
</ul>
<p>Carl Worth (5):</p>
<ul>
<li>docs: Add 9.1.6 release md5sums</li>
<li>Use -Bsymbolic when linking libEGL.so</li>
<li>Update get-pick-list to look specifically for "9.1" in NOTE</li>
<li>cherry-ignore: Ignore last two patches in current get-pick-list output</li>
<li>Bump version to 9.1.7</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>i965/fs: Gen4: Zero out extra coordinates when using shadow compare</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>nv50: handle pure integer vertex attributes</li>
<li>nouveau: initialise the nouveau_transfer maps</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965/gen4: Fix fragment program rectangle texture shadow compares.</li>
</ul>
<p>Ian Romanick (11):</p>
<ul>
<li>mesa: Remove stray debug printfs in attachment completeness code</li>
<li>mesa: Validate the layer selection of an array texture too</li>
<li>mesa/vbo: Fix handling of attribute 0 in non-compatibilty contexts</li>
<li>glsl: Add new overload of program_resource_visitor::visit_field method</li>
<li>glsl: Use alignment of container record for its first field</li>
<li>mesa: Remove all traces of GL_OES_matrix_get</li>
<li>mesa: Don't call driver RenderTexture for really broken textures</li>
<li>mesa: Don't call driver RenderTexture for invalid zoffset</li>
<li>mesa: Generate a renderbuffer wrapper even if the texture has no image</li>
<li>glsl: Move and refine test for unsized arrays in GLSL ES</li>
<li>mesa: Don't return any data for GL_SHADER_BINARY_FORMATS</li>
</ul>
<p>Ilia Mirkin (2):</p>
<ul>
<li>nv30: U8_USCALED only works for size 4</li>
<li>nv30: remove no-longer-used formats from table</li>
</ul>
<p>Joakim Sindholt (1):</p>
<ul>
<li>nvc0: fix blitctx memory leak</li>
</ul>
<p>Johannes Obermayr (1):</p>
<ul>
<li>st/gbm: Add $(WAYLAND_CFLAGS) for HAVE_EGL_PLATFORM_WAYLAND.</li>
</ul>
<p>Kenneth Graunke (1):</p>
<ul>
<li>meta: Set correct viewport and projection in decompress_texture_image.</li>
</ul>
<p>Maarten Lankhorst (1):</p>
<ul>
<li>nvc0: restore viewport after blit</li>
</ul>
<p>Rico Schüller (1):</p>
<ul>
<li>glx: Initialize OpenGL version to 1.0</li>
</ul>
<p>Tiziano Bacocco (1):</p>
<ul>
<li>nvc0/ir: fix use after free in texture barrier insertion pass</li>
</ul>
<p>Torsten Duwe (1):</p>
<ul>
<li>wayland-egl.pc requires wayland-client.pc.</li>
</ul>
</div>
</body>
</html>

206
docs/relnotes/9.2.1.html Normal file
View File

@@ -0,0 +1,206 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 9.2.1 Release Notes / (October 4, 2013)</h1>
<p>
Mesa 9.2.1 is a bug fix release which fixes bugs found since the 9.2 release.
</p>
<p>
Mesa 9.2 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
e6cdfa84dfddd86e3d36ec7ff4b6478a MesaLib-9.2.1.tar.gz
dd4c82667d9c19c28a553b12eba3f8a0 MesaLib-9.2.1.tar.bz2
d9af0f5607f7d275793d293057ca9ac6 MesaLib-9.2.1.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66779">Bug 66779</a> - Use of uninitialized stack variable with brw_search_cache()</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68233">Bug 68233</a> - Valgrind errors in mesa</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68250">Bug 68250</a> - Automatic mipmap generation with texture compression produces borders that fade to black</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68637">Bug 68637</a> - [Bisected IVB/HSW]Unigine demo crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68753">Bug 68753</a> - [regression bisected] GLSL ES: structs members can't have precision qualifiers anymore in 9.2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69525">Bug 69525</a> - [GM45, bisected] Piglit tex-shadow2drect fails</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-9.2..mesa-9.2.1
</pre>
<p>Alex Deucher (1):</p>
<ul>
<li>radeon/winsys: pad IBs to a multiple of 8 DWs</li>
</ul>
<p>Andreas Boll (1):</p>
<ul>
<li>os: First check for __GLIBC__ and then for PIPE_OS_BSD</li>
</ul>
<p>Anuj Phogat (1):</p>
<ul>
<li>glsl: Allow precision qualifiers for sampler types</li>
</ul>
<p>Brian Paul (2):</p>
<ul>
<li>docs: minor fixes for 9.2 release notes</li>
<li>mesa: check for bufSize &gt; 0 in _mesa_GetSynciv()</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>cherry-ignore: Ignore a commit which appeared twice on master</li>
<li>Use -Bsymbolic when linking libEGL.so</li>
<li>mesa: Bump version to 9.2.1</li>
</ul>
<p>Chris Forbes (3):</p>
<ul>
<li>i965/fs: Gen4: Zero out extra coordinates when using shadow compare</li>
<li>i965: Fix cube array coordinate normalization</li>
<li>i965: fix bogus swizzle in brw_cubemap_normalize</li>
</ul>
<p>Christoph Bumiller (2):</p>
<ul>
<li>nvc0/ir: add f32 long immediate cannot saturate</li>
<li>nvc0: delete compute object on screen destruction</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>st/mesa: don't dereference stObj-&gt;pt if NULL</li>
</ul>
<p>Dominik Behr (1):</p>
<ul>
<li>glsl: propagate max_array_access through function calls</li>
</ul>
<p>Emil Velikov (1):</p>
<ul>
<li>nouveau: initialise the nouveau_transfer maps</li>
</ul>
<p>Eric Anholt (4):</p>
<ul>
<li>mesa: Rip out more extension checking from texformat.c.</li>
<li>mesa: Don't choose S3TC for generic compression if we can't compress.</li>
<li>i965/gen4: Fix fragment program rectangle texture shadow compares.</li>
<li>i965: Reenable glBitmap() after the sRGB winsys enabling.</li>
</ul>
<p>Ian Romanick (7):</p>
<ul>
<li>docs: Add 9.2 release md5sums</li>
<li>Add .cherry-ignore file</li>
<li>mesa: Note that 89a665e should not be picked</li>
<li>glsl: Reallow precision qualifiers on structure members</li>
<li>mesa: Support GL_MAX_VERTEX_OUTPUT_COMPONENTS query with ES3</li>
<li>mesa: Remove all traces of GL_OES_matrix_get</li>
<li>mesa: Don't return any data for GL_SHADER_BINARY_FORMATS</li>
</ul>
<p>Ilia Mirkin (2):</p>
<ul>
<li>nv30: find first unused texcoord rather than bailing if first is used</li>
<li>nv30: fix inconsistent setting of push-&gt;user_priv</li>
</ul>
<p>Joakim Sindholt (1):</p>
<ul>
<li>nvc0: fix blitctx memory leak</li>
</ul>
<p>Johannes Obermayr (1):</p>
<ul>
<li>st/gbm: Add $(WAYLAND_CFLAGS) for HAVE_EGL_PLATFORM_WAYLAND.</li>
</ul>
<p>Kenneth Graunke (5):</p>
<ul>
<li>i965/vs: Detect GRF sources in split_virtual_grfs send-from-GRF code.</li>
<li>i965/fs: Detect GRF sources in split_virtual_grfs send-from-GRF code.</li>
<li>i965/vec4: Only zero out unused message components when there are any.</li>
<li>i965: Fix brw_vs_prog_data_compare to actually check field members.</li>
<li>meta: Set correct viewport and projection in decompress_texture_image.</li>
</ul>
<p>Maarten Lankhorst (2):</p>
<ul>
<li>st/dri: do not create a new context for msaa copy</li>
<li>nvc0: restore viewport after blit</li>
</ul>
<p>Marek Olšák (2):</p>
<ul>
<li>r600g: fix constant buffer cache flushing</li>
<li>r600g: fix texture buffer object cache flushing</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>i965: Initialize inout_offset parameter to brw_search_cache().</li>
</ul>
<p>Rico Schüller (1):</p>
<ul>
<li>glx: Initialize OpenGL version to 1.0</li>
</ul>
<p>Tiziano Bacocco (1):</p>
<ul>
<li>nvc0/ir: fix use after free in texture barrier insertion pass</li>
</ul>
<p>Torsten Duwe (1):</p>
<ul>
<li>wayland-egl.pc requires wayland-client.pc.</li>
</ul>
</div>
</body>
</html>

97
docs/relnotes/9.2.2.html Normal file
View File

@@ -0,0 +1,97 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 9.2.2 Release Notes / (October 18, 2013)</h1>
<p>
Mesa 9.2.2 is a bug fix release which fixes bugs found since the 9.2.1 release.
</p>
<p>
Mesa 9.2 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69449">Bug 69449</a> - Valgrind error in program_resource_visitor::recursion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70411">Bug 70411</a> - glInvalidateFramebuffer fails with GL_INVALID_ENUM</li>
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-9.2.1..mesa-9.2.2
</pre>
<p>Brian Paul (3):</p>
<ul>
<li>docs: add missing &lt;pre&gt; tag</li>
<li>svga: fix incorrect memcpy src in svga_buffer_upload_piecewise()</li>
<li>mesa: consolidate cube width=height error checking</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>docs: Add md5sums for 9.2.1 release</li>
<li>Bump version to 9.2.2</li>
</ul>
<p>Constantin Baranov (1):</p>
<ul>
<li>mesa: Add missing switch break in invalidate_framebuffer_storage()</li>
</ul>
<p>Eric Anholt (3):</p>
<ul>
<li>i965: Don't forget the cube map padding on gen5+.</li>
<li>mesa: Fix compiler warnings when ALIGN's alignment is "1 &lt;&lt; value".</li>
<li>i965: Fix 3D texture layout by more literally copying from the spec.</li>
</ul>
<p>Francisco Jerez (1):</p>
<ul>
<li>glsl: Fix usage of the wrong union member in program_resource_visitor::recursion.</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>radeonsi: Use 'SI' as the LLVM processor for CIK on LLVM &lt;= 3.3</li>
</ul>
</div>
</body>
</html>

View File

@@ -14,7 +14,7 @@
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 9.2 Release Notes / (date TBD)</h1>
<h1>Mesa 9.2 Release Notes / (August 27, 2013)</h1>
<p>
Mesa 9.2 is a new development release.
@@ -33,7 +33,9 @@ because GL_ARB_compatibility is not supported.
<h2>MD5 checksums</h2>
<pre>
tbd
4f93c6475ec656fc1f7b93aeffc9b6c4 MesaLib-9.2.0.tar.gz
4185b6aae890bc62a964f4b24cc1aca8 MesaLib-9.2.0.tar.bz2
3bc5339bc98b9c37777ffd14e3a8eca4 MesaLib-9.2.0.zip
</pre>
@@ -44,21 +46,166 @@ Note: some of the new features are only available with certain drivers.
</p>
<ul>
<li>GL_ARB_shading_language_420pack in all drivers that support GLSL 1.30.</li>
<li>GL_ARB_texture_buffer_range</li>
<li>GL_ARB_texture_multisample</li>
<li>GL_ARB_texture_storage_multisample</li>
<li>GL_ARB_texture_query_lod</li>
<li>Enable GL_ARB_texture_storage on radeon, r200, and nouveau</li>
<li>GL_ARB_texture_storage on radeon, r200, and nouveau</li>
<li>GL_EXT_discard_framebuffer in all OpenGL ES (all versions) drivers</li>
<li>GL_EXT_framebuffer_multisample_blit_scaled on i965</li>
<li>Added new freedreno gallium driver</li>
<li>OSMesa interface for gallium llvmpipe/softpipe drivers</li>
<li>Gallium Heads-Up Display (HUD) feature for performance monitoring</li>
<li>Added support for UVD (2.2 and 3.0) video decoding on r600g and radeonsi through VDPAU (requires Kernel 3.10 or later)</li>
</ul>
<h2>Bug fixes</h2>
<p>TBD -- This list is likely incomplete.</p>
<p>Attempts have been made to <b>not</b> include bugs fixed in previous 9.1
releases or bugs that were regressions during 9.2 development. This list is
likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=41787">Bug 41787</a> - [llvmpipe] stencil broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=44618">Bug 44618</a> - Cross-compilation broken by glsl builtin_compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=46632">Bug 46632</a> - Make the alignment checks for the readpixel blit fastpath a bit more lenient</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47116">Bug 47116</a> - Enemy territory freezes with rs880 and commit fbebd431ec4e2e461a0cbcd5f3a04a000b8f6bbf</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47248">Bug 47248</a> - autogen missing dependency on flex and bison, causes infinite loop in glsl build</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48694">Bug 48694</a> - radeonsi_pipe.c:322:7: error: PIPE_CAP_DUAL_SOURCE_BLEND undeclared</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50655">Bug 50655</a> - [r600g][RV670 HD3870] Ioquake games causes GPU lockup (waiting for 0x00003039 last fence id 0x00003030)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51471">Bug 51471</a> - [965gm] Corrupted graphics in corners of screen with pixel shaders enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51782">Bug 51782</a> - mesa-8.0.3: fails to compile against uclibc</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54240">Bug 54240</a> - [swrast] piglit fbo-generatemipmap-filtering regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55503">Bug 55503</a> - Constant vertex attributes broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55783">Bug 55783</a> - glEnable(GL_FRAMEBUFFER_SRGB) has no effect on the backbuffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55825">Bug 55825</a> - [Bisected i965]Oglc max_values(advanced.fragmentProgram.GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB) causes OOM-killer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56920">Bug 56920</a> - [sandybridge][uxa] graphics very glitchy and always flickering</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=57753">Bug 57753</a> - leak in loop_analysis</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=57875">Bug 57875</a> - Second Life viewer bad rendering with git-ec83535</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=58666">Bug 58666</a> - rv670 + llvm = errors.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=58680">Bug 58680</a> - [IVB] Graphical glitches in 0 A.D</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=58872">Bug 58872</a> - Mac OS X configure: error: Couldn't find clock_gettime</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59322">Bug 59322</a> - r300g MSAA breaks Half-Life 2 in Wine</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59364">Bug 59364</a> - [bisected] Mesa build fails: clientattrib.c:33:22: fatal error: indirect.h: No such file or directory</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59439">Bug 59439</a> - glCopyPixels generates no fragments (occlusion_query_meta_fragments test fails)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59440">Bug 59440</a> - glBitmap generates no fragments (occlusion_query_meta_fragments test fails)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59494">Bug 59494</a> - [Bisected]Piglit glean_depthStencil fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59592">Bug 59592</a> - Radeon HD 5670: reproducable GPU lockups with htile enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59648">Bug 59648</a> - [SNB/IVB/HSW Bisected]Piglit spec/ARB_uniform_buffer/object_layout-std140-base-size-and-alignment fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59701">Bug 59701</a> - lp_test_arit fails on non-sse41 capable machines, breaking make check</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59737">Bug 59737</a> - [bisected] 0d108116bd80b757fb01a84a9f1946ef870b57b8 breaks osmesa when cross compiling</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59740">Bug 59740</a> - [i965 Bisected]Oglc api-error(negative.glEvalMesh) fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59851">Bug 59851</a> - AC_ARG_WITH misusage leading to mesa configure failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59873">Bug 59873</a> - [swrast] piglit ext_framebuffer_multisample-interpolation 0 centroid-edges regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=59876">Bug 59876</a> - glGetTexLevelParameteriv broken for indirect rendering</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60038">Bug 60038</a> - [osmesa] [git] building 32-bit mesa on 64 bit fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60047">Bug 60047</a> - [softpipe] piglit masked-clear regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60052">Bug 60052</a> - [Bisected]Piglit glx_extension_string_sanity fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60082">Bug 60082</a> - [ FAILED ] DispatchSanity_test.GL31_CORE</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60086">Bug 60086</a> - Wayland platform backend crashes if there's no back buffer during dri2_swap_buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60098">Bug 60098</a> - [softpipe] Unexpected PIPE_CAP 78 query</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60172">Bug 60172</a> - Planeshift: triangles where grass would be</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60200">Bug 60200</a> - radeon_bo with virtual address referencing mismatch</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60212">Bug 60212</a> - [Bisected] Weston black output</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60524">Bug 60524</a> - [softpipe] piglit depthstencil-render-miplevels 146 s=z24_s8 regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60527">Bug 60527</a> - [softpipe] fbo-stencil GL_DEPTH24_STENCIL8 clear regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60633">Bug 60633</a> - EXT_texture_sRGB does not work in game The Cave on IvyBridge</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60737">Bug 60737</a> - In GLSL ES, a missing FS precision qualifier does not generate an error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60866">Bug 60866</a> - GLSL performance issues for uniform buffer objects</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61036">Bug 61036</a> - Shader fails to build in LLVMpipe, aborts program</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61200">Bug 61200</a> - insufficient linking of libxatracker.so</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61635">Bug 61635</a> - glVertexAttribPointer(id, GL_UNSIGNED_BYTE, GL_FALSE,...) does not work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62466">Bug 62466</a> - r600g hyperz lockups with KSP 0.19</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62669">Bug 62669</a> - HyperZ freeze when playing PrBoom-Plus demo with lots of monsters</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62721">Bug 62721</a> - GPU lockup in Minecraft 1.5.1 with HyperZ</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62830">Bug 62830</a> - [i965 bisected] Wrong Lightning on Freespace 2 SCP (patch attached)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63124">Bug 63124</a> - [r600g] HyperZ lockup on REDWOOD in Half Life 2 Deathmatch</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=63702">Bug 63702</a> - tiling2d in radeon trash vdpau UVD textures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64935">Bug 64935</a> - [swrast] s_texfetch.c:1335: set_fetch_functions: Assertion `texImage-&gt;FetchTexel' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64959">Bug 64959</a> - Cannot build against EGL without X11</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65112">Bug 65112</a> - glcpp hangs parsing line continuations</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=65958">Bug 65958</a> - GPU Lockup on Trinity 7500G</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66450">Bug 66450</a> - JUNIPER UVD accelerated playback of MPEG 1/2 streams does not work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66606">Bug 66606</a> - [i965 bisected]GLBenchmark 2.5.1/2.7.0 sometimes render error with gnome-session enabling SNA</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66713">Bug 66713</a> - Team Fortress 2 crashes with r600-sb on HD4850</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67354">Bug 67354</a> - glsl_parser.cpp is broken with bison 3.0</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67548">Bug 67548</a> - glGetAttribLocation seems to be broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67927">Bug 67927</a> - R600_DEBUG=sb: Celestia show 2 earths, one wrongly rendered</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67934">Bug 67934</a> - [SNB/IVB/HSW 9.2 Bisected]Ogles2conform/GL2Tests/glUniform/glUniform.test fails with gnome-session enable compositing</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68162">Bug 68162</a> - [radeonsi] texture rendering is broken in Source-Engine games</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68195">Bug 68195</a> - piglit tests vs-struct-pad and fs-struct-pad both fail</li>
</ul>
<h2>Changes</h2>
@@ -70,7 +217,8 @@ Note: some of the new features are only available with certain drivers.
the (unsupported) GDI driver.</li>
<li>GL_EXT_separate_shader_objects has been removed from all Gallium drivers,
because it disallows a critical GLSL shader optimization.
GL_ARB_separate_shader_objects doesn't have this issue.
GL_ARB_separate_shader_objects doesn't have this issue.</li>
<li>i965 Gen6+ requires Kernel 3.6 or later. (92d2f5a)</li>
</ul>
</div>

View File

@@ -59,7 +59,6 @@ each directory.
<li><b>osmesa</b> - off-screen software driver
<li>XXX more
</ul>
<li><b>es</b> - OpenGL ES overlay, parallelly buildable with the core Mesa
<li><b>math</b> - vertex array translation and transformation code
(not used with Gallium)
<li><b>program</b> - Vertex/fragment shader and GLSL compiler code
@@ -135,7 +134,6 @@ each directory.
<li><b>clover</b> - OpenCL state tracker
<li><b>dri</b> - Meta state tracker for DRI drivers
<li><b>egl</b> - Meta state tracker for EGL drivers
<li><b>es</b> - OpenGL ES 1.x and 2.x state trackers
<li><b>glx</b> - Meta state tracker for GLX
<li><b>vdpau</b> - VDPAU state tracker
<li><b>vega</b> - OpenVG 1.x state tracker

View File

@@ -0,0 +1,138 @@
Name
EXT_shader_integer_mix
Name Strings
GL_EXT_shader_integer_mix
Contact
Matt Turner (matt.turner 'at' intel.com)
Contributors
Matt Turner, Intel
Ian Romanick, Intel
Status
Shipping
Version
Last Modified Date: 09/12/2013
Author Revision: 6
Number
TBD
Dependencies
OpenGL 3.0 or OpenGL ES 3.0 is required. This extension interacts with
GL_ARB_ES3_compatibility.
This extension is written against the OpenGL 4.4 (core) specification
and the GLSL 4.40 specification.
Overview
GLSL 1.30 (and GLSL ES 3.00) expanded the mix() built-in function to
operate on a boolean third argument that does not interpolate but
selects. This extension extends mix() to select between int, uint,
and bool components.
New Procedures and Functions
None.
New Tokens
None.
Additions to Chapter 8 of the GLSL 4.40 Specification (Built-in Functions)
Modify Section 8.3, Common Functions
Additions to the table listing common built-in functions:
Syntax Description
--------------------------- --------------------------------------------------
genIType mix(genIType x, Selects which vector each returned component comes
genIType y, from. For a component of a that is false, the
genBType a) corresponding component of x is returned. For a
genUType mix(genUType x, component of a that is true, the corresponding
genUType y, component of y is returned.
genBType a)
genBType mix(genBType x,
genBType y,
genBType a)
Additions to the AGL/GLX/WGL Specifications
None.
Modifications to The OpenGL Shading Language Specification, Version 4.40
Including the following line in a shader can be used to control the
language features described in this extension:
#extension GL_EXT_shader_integer_mix : <behavior>
where <behavior> is as specified in section 3.3.
New preprocessor #defines are added to the OpenGL Shading Language:
#define GL_EXT_shader_integer_mix 1
Interactions with ARB_ES3_compatibility
On desktop implementations that support ARB_ES3_compatibility,
GL_EXT_shader_integer_mix can be enabled (and the new functions
used) in shaders declared with '#version 300 es'.
GLX Protocol
None.
Errors
None.
New State
None.
New Implementation Dependent State
None.
Issues
1) Should we allow linear interpolation of integers via a non-boolean
third component?
RESOLVED: No.
2) Should we allow mix() to select between boolean components?
RESOLVED: Yes. Implementing the same functionality using casts would be
possible but ugly.
Revision History
Rev. Date Author Changes
---- -------- -------- ---------------------------------------------
6 09/12/2013 idr After discussions in Khronos, change vendor
prefix to EXT.
5 09/09/2013 idr Add ARB_ES3_compatibility interaction.
4 09/06/2013 mattst88 Allow extension on OpenGL ES 3.0.
3 08/28/2013 mattst88 Add #extension/#define changes.
2 08/26/2013 mattst88 Change vendor prefix to MESA. Add mix() that
selects between boolean components.
1 08/26/2013 mattst88 Initial revision

View File

@@ -0,0 +1,405 @@
Name
MESA_query_renderer
Name Strings
GLX_MESA_query_renderer
Contact
Ian Romanick <ian.d.romanick@intel.com>
IP Status
No known IP claims.
Status
Incomplete. DO NOT SHIP.
Version
Version 6, 7-November-2013
Number
TBD.
Dependencies
GLX 1.4 is required.
GLX_ARB_create_context and GLX_ARB_create_context_profile are required.
This extension interacts with GLX_EXT_create_context_es2_profile and
GLX_EXT_create_context_es_profile.
Overview
In many situations, applications want to detect characteristics of a
rendering device before creating a context for that device. Information
gathered at this stage may guide choices the application makes about
color depth, number of samples per-pixel, texture quality, and so on.
In addition, versions of supported APIs and implementation API
preference may also guide start-up decisions made by the application.
For example, one implementation may prefer vertex data be supplied using
methods only available in a compatibility profile, but another
implementation may only support the desired version in a core profile.
There are also cases where more than one renderer may be available per
display. For example, there is typically a hardware implementation and
a software based implementation. There are cases where an application
may want to pick one over the other. One such situation is when the
software implementation supports more features than the hardware
implementation. Another situation is when a particular version of the
hardware implementation is blacklisted due to known bugs.
This extension provides a mechanism for the application to query all of
the available renderers for a particular display and screen. In
addition, this extension provides a mechanism for applications to create
contexts with respect to a specific renderer.
New Procedures and Functions
Bool glXQueryRendererIntegerMESA(Display *dpy, int screen,
int renderer, int attribute,
unsigned int *value);
Bool glXQueryCurrentRendererIntegerMESA(int attribute, unsigned int *value);
const char *glXQueryRendererStringMESA(Display *dpy, int screen,
int renderer, int attribute);
const char *glXQueryCurrentRendererStringMESA(int attribute);
New Tokens
Accepted as an <attribute> in glXQueryRendererIntegerMESA and
glXQueryCurrentRendererIntegerMESA:
GLX_RENDERER_VENDOR_ID_MESA 0x8183
GLX_RENDERER_DEVICE_ID_MESA 0x8184
GLX_RENDERER_VERSION_MESA 0x8185
GLX_RENDERER_ACCELERATED_MESA 0x8186
GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187
GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188
GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189
GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A
GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B
GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C
GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D
Accepted as an <attribute> in glXQueryRendererStringMESA and
glXQueryCurrentRendererStringMESA:
GLX_RENDERER_VENDOR_ID_MESA
GLX_RENDERER_DEVICE_ID_MESA
Accepted as an attribute name in <*attrib_list> in
glXCreateContextAttribsARB:
GLX_RENDERER_ID_MESA 0x818E
Additions to the OpenGL / WGL Specifications
None. This specification is written for GLX.
Additions to the GLX 1.4 Specification
[Add the following to Section X.Y.Z of the GLX Specification]
To obtain information about the available renderers for a particular
display and screen,
Bool glXQueryRendererIntegerMESA(Display *dpy, int screen, int renderer,
int attribute, unsigned int *value);
can be used. The value for <attribute> will be returned in one or more
integers specified by <value>. The values, data sizes, and descriptions
of each renderer attribute are listed in the table below.
GLX renderer attribute number description
of values
---------------------- --------- -----------
GLX_RENDERER_VENDOR_ID_MESA 1 PCI ID of the device vendor
GLX_RENDERER_DEVICE_ID_MESA 1 PCI ID of the device
GLX_RENDERER_VERSION_MESA 3 Major, minor, and patch level of
the renderer implementation
GLX_RENDERER_ACCELERATED_MESA 1 Boolean indicating whether or
not the renderer is hardware
accelerated
GLX_RENDERER_VIDEO_MEMORY_MESA 1 Number of megabytes of video
memory available to the renderer
GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA
1 Boolean indicating whether or
not the renderer uses a unified
memory architecture or has
separate "on-card" and GART
memory.
GLX_RENDERER_PREFERRED_PROFILE_MESA
1 Bitmask of the preferred context
profile for this renderer. This
value is suitable to be supplied
with the
GLX_CONTEXT_PROFILE_MASK_ARB
attribute to
glXCreateContextAttribsARB
GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA
2 Maximum core profile major and
minor version supported by the
renderer
GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA
2 Maximum compatibility profile
major and minor version
supported by the renderer
GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA
2 Maximum OpenGL ES 1.x
major and minor version
supported by the renderer
GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA
2 Maximum OpenGL ES 2.x or 3.x
major and minor version
supported by the renderer
In the table, boolean attributes will have either the value 0 or 1.
GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA,
GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA,
GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA, and
GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA each return <0, 0> in
*value if no version of that profile is supported.
GLX_RENDERER_VENDOR_ID_MESA and GLX_RENDERER_DEVICE_ID_MESA may return
0xFFFFFFFF if the device does not have a PCI ID (because it is not a PCI
device) or if the PCI ID is not available. In this case the application
should rely on the string query instead.
If <attribute> is not a recognized value, False is returned, but no GLX
error is generated. Otherwise, True is returned.
String versions of some attributes may also be queried using
const char *glXQueryRendererStringMESA(Display *dpy, int screen,
int renderer, int attribute);
The value for <attribute> will be returned in one or more
integers specified by <value>. The values, data sizes, and descriptions
of each renderer attribute are listed in the table below.
GLX renderer attribute description
---------------------- -----------
GLX_RENDERER_VENDOR_ID_MESA Name of the renderer provider. This may
differ from the vendor name of the
underlying hardware.
GLX_RENDERER_DEVICE_ID_MESA Name of the renderer. This may differ from
the name of the underlying hardware (e.g.,
for a software renderer).
If <attribute> is not a recognized value, NULL is returned, but no GLX
error is generated.
The string returned for GLX_RENDERER_VENDOR_ID_MESA will have the same
format as the string that would be returned by glGetString of GL_VENDOR.
It may, however, have a different value.
The string returned for GLX_RENDERER_DEVICE_ID_MESA will have the same
format as the string that would be returned by glGetString of GL_RENDERER.
It may, however, have a different value.
[Add to section section 3.3.7 "Rendering Contexts"]
The attribute name GLX_RENDERER_ID_MESA specified the index of the render
against which the context should be created. The default value of
GLX_RENDER_ID_MESA is 0.
[Add to list of errors for glXCreateContextAttribsARB in section section
3.3.7 "Rendering Contexts"]
* If the value of GLX_RENDERER_ID_MESA specifies a non-existent
renderer, BadMatch is generated.
Dependencies on GLX_EXT_create_context_es_profile and
GLX_EXT_create_context_es2_profile
If neither extension is supported, remove all mention of
GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA from the spec.
If GLX_EXT_create_context_es_profile is not supported, remove all mention of
GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA from the spec.
Issues
1) How should the difference between on-card and GART memory be exposed?
UNRESOLVED.
2) How should memory limitations of unified memory architecture (UMA)
systems be exposed?
UNRESOLVED. Some hardware has different per-process and global
limits for memory that can be accessed within a single draw call.
3) How should the renderer's API preference be advertised?
UNRESOLVED. The common case for desktop renderers is to prefer
either core or compatibility. However, some renderers may actually
prefer an ES context. This leaves the application in a tough spot
if it can only support core or compatibility and the renderer says it
wants ES.
4) Should OpenGL ES 2.0 and OpenGL ES 3.0 be treated separately?
RESOLVED. No. OpenGL ES 3.0 is backwards compatible with OpenGL ES
2.0. Applications can detect OpenGL ES 3.0 support by querying
GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA.
5) How can applications tell the difference between different hardware
renderers for the same device? For example, whether the renderer is the
open-source driver or the closed-source driver.
RESOLVED. Assuming this extension is ever implemented outside Mesa,
applications can query GLX_RENDERER_VENDOR_ID_MESA from
glXQueryRendererStringMESA. This will almost certainly return
different strings for open-source and closed-source drivers.
6) What is the value of GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA for
software renderers?
UNRESOLVED. Video (display) memory and texture memory is not unified
for software implementations, so it seems reasonable for this to be
False.
7) How does an application determine the number of available renderers?
UNRESOLVED.
8) What happens if a fbconfig is used to create context on a renderer
that cannot support it? For example, if a multisampled config is used
with a software renderer that does not support multisampling.
RESOLVED. The language for glXCreateContextAttribsARB already covers
this case. Context creation will fail, and BadMatch is generated.
9) In addition to being able to query the supported versions, should
applications also be able to query the supported extensions?
RESOLVED. No. Desktop OpenGL core profiles and OpenGL ES 3.0 have
moved away from the monolithic string returned by glGetString of
GL_EXTENSIONS. Providing the newer indexed query would require adding
a lot of extra infrastructure, and it would probably provide little
benefit to applications.
10) What combination of values for GLX_RENDERER_PREFERRED_PROFILE_MESA,
GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA, and
GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA should be returned
for a renderer that only supports OpenGL 3.1 without the
GL_ARB_compatibility extension?
RESOLVED. The renderer will return GLX_CONTEXT_CORE_PROFILE_BIT_ARB
for GLX_RENDERER_PREFERRED_PROFILE_MESA.
Further, the renderer will return <3,0> for
GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA because OpenGL
3.1 without GL_ARB_compatibility is not backwards compatible with
previous versions of OpenGL. The render will return <3,1> for
GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA indicating that support
for OpenGL 3.1 is available.
Even though there is no OpenGL 3.1 core profile, the values
returned for GLX_RENDERER_PREFERRED_PROFILE_MESA and
GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA can be supplied
with the GLX_CONTEXT_PROFILE_MASK_ARB and
GLX_CONTEXT_{MAJOR,MINOR}_VERSION_ARB attributes of
glXCreateContextAttribsARB without error. If the requested
OpenGL version is less than 3.2, the
GLX_CONTEXT_PROFILE_MASK_ARB attribute is ignored by
glXCreateContextAttribsARB.
11) How can application learn about multi-GPU (e.g., SLI, CrossFireX,
etc.) configurations?
UNRESOLVED. Based on ISV feedback, this is important information to
provide to the application. Given the variety of possible hardware
configurations (e.g., Hybrid CrossFireX) and different rendering
modes (e.g., split-frame rendering vs. alternate-frame rendering),
it's not clear how this information can be communicated.
It is likely that this will be left to a layered extension.
12) Should capability queries similar to those in
GL_ARB_internalformat_query or GL_ARB_internalformat_query2 be added?
RESOLVED. No. With the possible exception of the texture size
queries, it seems unlikely that applications would ever use this
information before creating a context.
13) Existing GL extensions (e.g., GL_ATI_meminfo and
GL_NVX_gpu_memory_info) allow easy queries after context creation. With
this extension it is a bit of a pain for a portable application to query
the information after context creation.
RESOLVED. Add versions of the queries that implicitly take the
display, screen, and renderer from the currently bound context.
14) Why not make the queries from issue #13 GL functions (instead of GLX)?
RESOLVED. It is fairly compelling for the post-creation queries to
just use glGetInteger and glGetString. However, the GL enums and
the GLX enums would have different names and would almost certainly
have different values. It seems like this would cause more problems
than it would solve.
15) Should the string queries be required to return the same values as
glGetString(GL_VENDOR) and glGetString(GL_RENDERER)?
UNRESOLVED. This may be useful for applications that already do
device detection based on these strings.
16) What type should the value parameter of glXQueryRendererIntegerMESA
and glXQueryCurrentRendererIntegerMESA be?
UNRESOLVED. Other similar GLX query functions just use int or
unsigned int, so that's what this extension uses for now. However,
an expeclitly sized value, such as uint32_t or uint64_t, seems
preferable.
17) What about SoCs and other systems that don't have PCI?
RESOLVED. The GLX_RENDERER_VENDOR_ID_MESA and
GLX_RENDERER_DEVICE_ID_MESA integer queries may return 0xFFFFFFFF if a
PCI ID either does not exist or is not available. Implementations
should make every attempt to return as much information as is
possible. For example, if the implementation is running on a non-PCI
SoC with a Qualcomm GPU, GLX_RENDERER_VENDOR_ID_MESA should return
0x168C, but GLX_RENDERER_DEVICE_ID_MESA will return 0x0000.
Revision History
Version 1, 2012/08/27 - Initial version
Version 2, 2012/09/04 - Specify behavior of implementations that
do not support certain profiles.
Change wording of issue #8 to be more
clear.
Make some wording changes to issue #10 to
clarify the resolution a bit.
Version 3, 2012/09/23 - Add issue #11 regarding multi-GPU systems.
Version 4, 2013/02/01 - Add issue #12 regarding texture / renderbuffer
format queries.
Version 5, 2013/02/14 - Add issues #13 and #14 regarding simpler queires
after the context is created and made current.
Add issue #15 regarding the string query.
Add issue #16 regarding the value type returned
by the Integer functions.
Version 6, 2013/10/25 - Fix a typo. Update the list of functions to
which the new enums can be passed. The "Current"
versions were previously missing.
Version 7, 2013/11/07 - Fix a couple more typos. Add issue #17 regarding
the PCI queries on systems that don't have PCI.

View File

@@ -17,7 +17,7 @@ Status
Version
Version 1, March 1, 2011
Version 5, July 16, 2013
Number
@@ -57,7 +57,7 @@ New Procedures and Functions
struct wl_display *display);
EGLBoolean eglQueryWaylandBufferWL(EGLDisplay dpy,
struct wl_buffer *buffer,
struct wl_resource *buffer,
EGLint attribute, EGLint *value);
New Tokens
@@ -76,6 +76,11 @@ New Tokens
EGL_TEXTURE_Y_UV_WL 0x31D8
EGL_TEXTURE_Y_XUXV_WL 0x31D9
Accepted in the <attribute> parameter of eglQueryWaylandBufferWL:
EGL_TEXTURE_FORMAT 0x3080
EGL_WAYLAND_Y_INVERTED_WL 0x31DB
Additions to the EGL 1.4 Specification:
@@ -157,6 +162,16 @@ Additions to the EGL 1.4 Specification:
Further, eglQueryWaylandBufferWL accepts attributes EGL_WIDTH and
EGL_HEIGHT to query the width and height of the wl_buffer.
Also, eglQueryWaylandBufferWL may accept
EGL_WAYLAND_Y_INVERTED_WL attribute to query orientation of
wl_buffer. If EGL_WAYLAND_Y_INVERTED_WL is supported
eglQueryWaylandBufferWL returns EGL_TRUE and value is a boolean
that tells if wl_buffer is y-inverted or not. If
EGL_WAYLAND_Y_INVERTED_WL is not supported
eglQueryWaylandBufferWL returns EGL_FALSE, in that case
wl_buffer should be treated as if value of
EGL_WAYLAND_Y_INVERTED_WL was EGL_TRUE.
Issues
Revision History
@@ -173,3 +188,10 @@ Revision History
Use EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB, and EGL_TEXTURE_RGBA,
and just define the new YUV texture formats. Add support for
EGL_WIDTH and EGL_HEIGHT in the query attributes (Kristian Høgsberg)
Version 5, July 16, 2013
Change eglQueryWaylandBufferWL to take a resource pointer to the
buffer instead of a pointer to a struct wl_buffer, as the latter has
been deprecated. (Ander Conselvan de Oliveira)
Version 6, September 16, 2013
Add EGL_WAYLAND_Y_INVERTED_WL attribute to allow specifying
wl_buffer's orientation.

1
doxygen/.gitignore vendored
View File

@@ -8,6 +8,7 @@ gallium
gbm
glapi
glsl
i965
main
math
math_subset

View File

@@ -17,7 +17,8 @@ FULL = \
swrast_setup.doxy \
tnl.doxy \
tnl_dd.doxy \
gbm.doxy
gbm.doxy \
i965.doxy
full: $(FULL:.doxy=.tag)
$(foreach FILE,$(FULL),doxygen $(FILE);)

View File

@@ -15,5 +15,6 @@
<a class="qindex" href="../swrast_setup/index.html">swrast_setup</a> |
<a class="qindex" href="../tnl/index.html">tnl</a> |
<a class="qindex" href="../tnl_dd/index.html">tnl_dd</a> |
<a class="qindex" href="../gbm/index.html">gbm</a>
<a class="qindex" href="../gbm/index.html">gbm</a> |
<a class="qindex" href="../i965/index.html">i965</a>
</div>

50
doxygen/i965.doxy Normal file
View File

@@ -0,0 +1,50 @@
# Doxyfile 0.1
@INCLUDE = common.doxy
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Intel i965 Driver"
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src/mesa/drivers/dri/i965
FILE_PATTERNS = *.c *.cpp *.h
RECURSIVE = NO
EXCLUDE =
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
HTML_OUTPUT = i965
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH = ../include/
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES = glsl.tag=../glsl \
main.tag=../main \
math.tag=../math \
swrast.tag=../swrast \
swrast_setup.tag=../swrast_setup \
tnl.tag=../tnl \
tnl_dd.tag=../tnl_dd \
vbo.tag=vbo
GENERATE_TAGFILE = i965.tag

View File

@@ -115,20 +115,22 @@ typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
#define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */
#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB /* eglQueryWaylandBufferWL attribute */
#define EGL_TEXTURE_Y_U_V_WL 0x31D7
#define EGL_TEXTURE_Y_UV_WL 0x31D8
#define EGL_TEXTURE_Y_XUXV_WL 0x31D9
struct wl_display;
struct wl_buffer;
struct wl_resource;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
#endif
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
#endif

View File

@@ -33,25 +33,14 @@
/**********************************************************************
* Begin system-specific stuff. Do not do any of this when building
* for SciTech SNAP, as this is all done before this header file is
* included.
* Begin system-specific stuff.
*/
#if !defined(__SCITECH_SNAP__)
#if defined(__BEOS__)
#include <stdlib.h> /* to get some BeOS-isms */
#endif
#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO))
#define OPENSTEP
#endif
#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
#define __WIN32__
#endif
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
#if defined(__WIN32__) && !defined(__CYGWIN__)
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
@@ -72,10 +61,6 @@
# define GLAPIENTRY
#endif /* WIN32 && !CYGWIN */
#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
# define PRAGMA_EXPORT_SUPPORTED 1
#endif
/*
* WINDOWS: Include windows.h here to define APIENTRY.
* It is also useful when applications include this file by
@@ -91,10 +76,6 @@
#include <windows.h>
#endif
#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
#pragma import on
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
@@ -116,15 +97,10 @@
#define GLAPIENTRYP GLAPIENTRY *
#endif
#ifdef CENTERLINE_CLPP
#define signed
#endif
#if defined(PRAGMA_EXPORT_SUPPORTED)
#pragma export on
#endif
#endif /* !__SCITECH_SNAP__ */
/*
* End system-specific stuff.
**********************************************************************/
@@ -1736,8 +1712,6 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
@@ -2088,26 +2062,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
#if GL_ARB_shader_objects
#ifndef GL_MESA_shader_debug
#define GL_MESA_shader_debug 1
#define GL_DEBUG_OBJECT_MESA 0x8759
#define GL_DEBUG_PRINT_MESA 0x875A
#define GL_DEBUG_ASSERT_MESA 0x875B
GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void);
GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
GLsizei *length, GLcharARB *debugLog);
GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
#endif /* GL_MESA_shader_debug */
#endif /* GL_ARB_shader_objects */
/*
* ???. GL_MESA_packed_depth_stencil
* XXX obsolete
@@ -2124,27 +2078,6 @@ GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logTyp
#endif /* GL_MESA_packed_depth_stencil */
#ifndef GL_MESA_program_debug
#define GL_MESA_program_debug 1
#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0
#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1
#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2
#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3
#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4
#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5
#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6
#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7
typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
#endif /* GL_MESA_program_debug */
#ifndef GL_MESA_texture_array
#define GL_MESA_texture_array 1
@@ -2220,9 +2153,6 @@ typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum t
#pragma export off
#endif
#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
#pragma import off
#endif
/*
* End system-specific stuff
**********************************************************************/

File diff suppressed because it is too large Load Diff

View File

@@ -168,7 +168,6 @@ typedef XID GLXDrawable;
/* GLX 1.3 and later */
typedef struct __GLXFBConfigRec *GLXFBConfig;
typedef XID GLXFBConfigID;
typedef XID GLXContextID;
typedef XID GLXWindow;
typedef XID GLXPbuffer;
@@ -468,7 +467,32 @@ extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer
#endif /* GLX_EXT_texture_from_pixmap */
#ifndef GLX_MESA_query_renderer
#define GLX_MESA_query_renderer 1
#define GLX_RENDERER_VENDOR_ID_MESA 0x8183
#define GLX_RENDERER_DEVICE_ID_MESA 0x8184
#define GLX_RENDERER_VERSION_MESA 0x8185
#define GLX_RENDERER_ACCELERATED_MESA 0x8186
#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187
#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188
#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189
#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A
#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B
#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C
#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D
#define GLX_RENDERER_ID_MESA 0x818E
Bool glXQueryRendererIntegerMESA(Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
Bool glXQueryCurrentRendererIntegerMESA(int attribute, unsigned int *value);
const char *glXQueryRendererStringMESA(Display *dpy, int screen, int renderer, int attribute);
const char *glXQueryCurrentRendererStringMESA(int attribute);
typedef Bool (*PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
typedef Bool (*PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int *value);
typedef const char *(*PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute);
typedef const char *(*PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute);
#endif /* GLX_MESA_query_renderer */
/*** Should these go here, or in another header? */
/*

File diff suppressed because it is too large Load Diff

View File

@@ -86,6 +86,10 @@ typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
typedef struct __DRI2throttleExtensionRec __DRI2throttleExtension;
typedef struct __DRIimageLoaderExtensionRec __DRIimageLoaderExtension;
typedef struct __DRIimageDriverExtensionRec __DRIimageDriverExtension;
/*@}*/
@@ -330,12 +334,6 @@ struct __DRI2throttleExtensionRec {
enum __DRI2throttleReason reason);
};
/**
* XML document describing the configuration options supported by the
* driver.
*/
extern const char __driConfigOptions[];
/*@}*/
/**
@@ -493,6 +491,19 @@ struct __DRIuseInvalidateExtensionRec {
*/
#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
/**
* This symbol replaces the __DRI_DRIVER_EXTENSIONS symbol, and will be
* suffixed by "_drivername", allowing multiple drivers to be built into one
* library, and also giving the driver the chance to return a variable driver
* extensions struct depending on the driver name being loaded or any other
* system state.
*
* The function prototype is:
*
* const __DRIextension **__driDriverGetExtensions_drivername(void);
*/
#define __DRI_DRIVER_GET_EXTENSIONS "__driDriverGetExtensions"
/**
* Tokens for __DRIconfig attribs. A number of attributes defined by
* GLX or EGL standards are not in the table, as they must be provided
@@ -706,7 +717,7 @@ struct __DRIlegacyExtensionRec {
* conjunction with the core extension.
*/
#define __DRI_SWRAST "DRI_SWRast"
#define __DRI_SWRAST_VERSION 3
#define __DRI_SWRAST_VERSION 4
struct __DRIswrastExtensionRec {
__DRIextension base;
@@ -742,8 +753,48 @@ struct __DRIswrastExtensionRec {
const uint32_t *attribs,
unsigned *error,
void *loaderPrivate);
/**
* createNewScreen() with the driver extensions passed in.
*
* \since version 4
*/
__DRIscreen *(*createNewScreen2)(int screen,
const __DRIextension **loader_extensions,
const __DRIextension **driver_extensions,
const __DRIconfig ***driver_configs,
void *loaderPrivate);
};
/** Common DRI function definitions, shared among DRI2 and Image extensions
*/
typedef __DRIscreen *
(*__DRIcreateNewScreen2Func)(int screen, int fd,
const __DRIextension **extensions,
const __DRIextension **driver_extensions,
const __DRIconfig ***driver_configs,
void *loaderPrivate);
typedef __DRIdrawable *
(*__DRIcreateNewDrawableFunc)(__DRIscreen *screen,
const __DRIconfig *config,
void *loaderPrivate);
typedef __DRIcontext *
(*__DRIcreateContextAttribsFunc)(__DRIscreen *screen,
int api,
const __DRIconfig *config,
__DRIcontext *shared,
unsigned num_attribs,
const uint32_t *attribs,
unsigned *error,
void *loaderPrivate);
typedef unsigned int
(*__DRIgetAPIMaskFunc)(__DRIscreen *screen);
/**
* DRI2 Loader extension.
*/
@@ -824,7 +875,7 @@ struct __DRIdri2LoaderExtensionRec {
* constructors for DRI2.
*/
#define __DRI_DRI2 "DRI_DRI2"
#define __DRI_DRI2_VERSION 3
#define __DRI_DRI2_VERSION 4
#define __DRI_API_OPENGL 0 /**< OpenGL compatibility profile */
#define __DRI_API_GLES 1 /**< OpenGL ES 1.x */
@@ -891,17 +942,14 @@ struct __DRIdri2ExtensionRec {
const __DRIconfig ***driver_configs,
void *loaderPrivate);
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
void *loaderPrivate);
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
const __DRIconfig *config,
__DRIcontext *shared,
void *loaderPrivate);
__DRIcreateNewDrawableFunc createNewDrawable;
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
const __DRIconfig *config,
__DRIcontext *shared,
void *loaderPrivate);
/* Since version 2 */
unsigned int (*getAPIMask)(__DRIscreen *screen);
__DRIgetAPIMaskFunc getAPIMask;
__DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
int api,
@@ -924,14 +972,14 @@ struct __DRIdri2ExtensionRec {
*
* \sa __DRIswrastExtensionRec::createContextAttribs
*/
__DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
int api,
const __DRIconfig *config,
__DRIcontext *shared,
unsigned num_attribs,
const uint32_t *attribs,
unsigned *error,
void *loaderPrivate);
__DRIcreateContextAttribsFunc createContextAttribs;
/**
* createNewScreen with the driver's extension list passed in.
*
* \since version 4
*/
__DRIcreateNewScreen2Func createNewScreen2;
};
@@ -940,7 +988,7 @@ struct __DRIdri2ExtensionRec {
* extensions.
*/
#define __DRI_IMAGE "DRI_IMAGE"
#define __DRI_IMAGE_VERSION 7
#define __DRI_IMAGE_VERSION 8
/**
* These formats correspond to the similarly named MESA_FORMAT_*
@@ -964,10 +1012,14 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_FORMAT_R8 0x1006 /* Since version 5 */
#define __DRI_IMAGE_FORMAT_GR88 0x1007
#define __DRI_IMAGE_FORMAT_NONE 0x1008
#define __DRI_IMAGE_FORMAT_XRGB2101010 0x1009
#define __DRI_IMAGE_FORMAT_ARGB2101010 0x100a
#define __DRI_IMAGE_FORMAT_SARGB8 0x100b
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
#define __DRI_IMAGE_USE_CURSOR 0x0004 /* Depricated */
#define __DRI_IMAGE_USE_LINEAR 0x0008
/**
@@ -1027,6 +1079,25 @@ struct __DRIdri2ExtensionRec {
* 7+. Each query will return a
* new fd. */
enum __DRIYUVColorSpace {
__DRI_YUV_COLOR_SPACE_UNDEFINED = 0,
__DRI_YUV_COLOR_SPACE_ITU_REC601 = 0x327F,
__DRI_YUV_COLOR_SPACE_ITU_REC709 = 0x3280,
__DRI_YUV_COLOR_SPACE_ITU_REC2020 = 0x3281
};
enum __DRISampleRange {
__DRI_YUV_RANGE_UNDEFINED = 0,
__DRI_YUV_FULL_RANGE = 0x3282,
__DRI_YUV_NARROW_RANGE = 0x3283
};
enum __DRIChromaSiting {
__DRI_YUV_CHROMA_SITING_UNDEFINED = 0,
__DRI_YUV_CHROMA_SITING_0 = 0x3284,
__DRI_YUV_CHROMA_SITING_0_5 = 0x3285
};
/**
* \name Reasons that __DRIimageExtensionRec::createImageFromTexture might fail
*/
@@ -1132,6 +1203,24 @@ struct __DRIimageExtensionRec {
int *fds, int num_fds,
int *strides, int *offsets,
void *loaderPrivate);
/**
* Like createImageFromFds, but takes additional attributes.
*
* For EGL_EXT_image_dma_buf_import.
*
* \since 8
*/
__DRIimage *(*createImageFromDmaBufs)(__DRIscreen *screen,
int width, int height, int fourcc,
int *fds, int num_fds,
int *strides, int *offsets,
enum __DRIYUVColorSpace color_space,
enum __DRISampleRange sample_range,
enum __DRIChromaSiting horiz_siting,
enum __DRIChromaSiting vert_siting,
unsigned *error,
void *loaderPrivate);
};
@@ -1186,4 +1275,135 @@ struct __DRIrobustnessExtensionRec {
__DRIextension base;
};
/**
* DRI config options extension.
*
* This extension provides the XML string containing driver options for use by
* the loader in supporting the driconf application.
*/
#define __DRI_CONFIG_OPTIONS "DRI_ConfigOptions"
#define __DRI_CONFIG_OPTIONS_VERSION 1
typedef struct __DRIconfigOptionsExtensionRec {
__DRIextension base;
const char *xml;
} __DRIconfigOptionsExtension;
/**
* This extension provides a driver vtable to a set of common driver helper
* functions (driCoreExtension, driDRI2Extension) within the driver
* implementation, as opposed to having to pass them through a global
* variable.
*
* It is not intended to be public API to the actual loader, and the vtable
* layout may change at any time.
*/
#define __DRI_DRIVER_VTABLE "DRI_DriverVtable"
#define __DRI_DRIVER_VTABLE_VERSION 1
typedef struct __DRIDriverVtableExtensionRec {
__DRIextension base;
const struct __DriverAPIRec *vtable;
} __DRIDriverVtableExtension;
/**
* Query renderer driver extension
*
* This allows the window system layer (either EGL or GLX) to query aspects of
* hardware and driver support without creating a context.
*/
#define __DRI2_RENDERER_QUERY "DRI_RENDERER_QUERY"
#define __DRI2_RENDERER_QUERY_VERSION 1
#define __DRI2_RENDERER_VENDOR_ID 0x0000
#define __DRI2_RENDERER_DEVICE_ID 0x0001
#define __DRI2_RENDERER_VERSION 0x0002
#define __DRI2_RENDERER_ACCELERATED 0x0003
#define __DRI2_RENDERER_VIDEO_MEMORY 0x0004
#define __DRI2_RENDERER_UNIFIED_MEMORY_ARCHITECTURE 0x0005
#define __DRI2_RENDERER_PREFERRED_PROFILE 0x0006
#define __DRI2_RENDERER_OPENGL_CORE_PROFILE_VERSION 0x0007
#define __DRI2_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION 0x0008
#define __DRI2_RENDERER_OPENGL_ES_PROFILE_VERSION 0x0009
#define __DRI2_RENDERER_OPENGL_ES2_PROFILE_VERSION 0x000a
typedef struct __DRI2rendererQueryExtensionRec __DRI2rendererQueryExtension;
struct __DRI2rendererQueryExtensionRec {
__DRIextension base;
int (*queryInteger)(__DRIscreen *screen, int attribute, unsigned int *val);
int (*queryString)(__DRIscreen *screen, int attribute, const char **val);
};
/**
* Image Loader extension. Drivers use this to allocate color buffers
*/
enum __DRIimageBufferMask {
__DRI_IMAGE_BUFFER_BACK = (1 << 0),
__DRI_IMAGE_BUFFER_FRONT = (1 << 1)
};
struct __DRIimageList {
uint32_t image_mask;
__DRIimage *back;
__DRIimage *front;
};
#define __DRI_IMAGE_LOADER "DRI_IMAGE_LOADER"
#define __DRI_IMAGE_LOADER_VERSION 1
struct __DRIimageLoaderExtensionRec {
__DRIextension base;
/**
* Allocate color buffers.
*
* \param driDrawable
* \param width Width of allocated buffers
* \param height Height of allocated buffers
* \param format one of __DRI_IMAGE_FORMAT_*
* \param stamp Address of variable to be updated when
* getBuffers must be called again
* \param loaderPrivate The loaderPrivate for driDrawable
* \param buffer_mask Set of buffers to allocate
* \param buffers Returned buffers
*/
int (*getBuffers)(__DRIdrawable *driDrawable,
unsigned int format,
uint32_t *stamp,
void *loaderPrivate,
uint32_t buffer_mask,
struct __DRIimageList *buffers);
/**
* Flush pending front-buffer rendering
*
* Any rendering that has been performed to the
* fake front will be flushed to the front
*
* \param driDrawable Drawable whose front-buffer is to be flushed
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable
*/
void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
};
/**
* DRI extension.
*/
#define __DRI_IMAGE_DRIVER "DRI_IMAGE_DRIVER"
#define __DRI_IMAGE_DRIVER_VERSION 1
struct __DRIimageDriverExtensionRec {
__DRIextension base;
/* Common DRI functions, shared with DRI2 */
__DRIcreateNewScreen2Func createNewScreen2;
__DRIcreateNewDrawableFunc createNewDrawable;
__DRIcreateContextAttribsFunc createContextAttribs;
__DRIgetAPIMaskFunc getAPIMask;
};
#endif

View File

@@ -101,11 +101,6 @@ extern "C" {
typedef struct osmesa_context *OSMesaContext;
#if defined(__QUICKDRAW__)
#pragma export on
#endif
/*
* Create an Off-Screen Mesa rendering context. The only attribute needed is
* an RGBA vs Color-Index mode flag.

View File

@@ -1,7 +1,7 @@
#ifndef __glext_h_
#define __glext_h_
/* $Revision: 19260 $ on $Date:: 2012-09-20 11:30:36 -0700 #$ */
/* $Revision: 20798 $ on $Date:: 2013-03-07 01:19:34 -0800 #$ */
#ifdef __cplusplus
extern "C" {
@@ -1055,10 +1055,10 @@ typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum
#ifndef GL_EXT_multi_draw_arrays
#define GL_EXT_multi_draw_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
GL_API void GL_APIENTRY glMultiDrawArraysEXT (GLenum, const GLint *, const GLsizei *, GLsizei);
GL_API void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
#endif

View File

@@ -1,7 +1,7 @@
#ifndef __gl2_h_
#define __gl2_h_
/* $Revision: 16803 $ on $Date:: 2012-02-02 09:49:18 -0800 #$ */
/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */
#include <GLES2/gl2platform.h>
@@ -527,7 +527,7 @@ GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL GLenum GL_APIENTRY glGetError (void);
@@ -546,7 +546,7 @@ GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum p
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);

View File

@@ -1,7 +1,7 @@
#ifndef __gl2ext_h_
#define __gl2ext_h_
/* $Revision: 19436 $ on $Date:: 2012-10-10 10:37:04 -0700 #$ */
/* $Revision: 22161 $ on $Date:: 2013-06-25 08:17:27 -0700 #$ */
#ifdef __cplusplus
extern "C" {
@@ -16,6 +16,20 @@ extern "C" {
# define GL_APIENTRYP GL_APIENTRY*
#endif
/* New types shared by several extensions */
#ifndef __gl3_h_
/* These are defined with respect to <inttypes.h> in the
* Apple extension spec, but they are also used by non-APPLE
* extensions, and in the Khronos header we use the Khronos
* portable types in khrplatform.h, which must be defined.
*/
typedef khronos_int64_t GLint64;
typedef khronos_uint64_t GLuint64;
typedef struct __GLsync *GLsync;
#endif
/*------------------------------------------------------------------------*
* OES extension tokens
*------------------------------------------------------------------------*/
@@ -94,23 +108,23 @@ typedef void* GLeglImageOES;
#endif
/* GL_OES_required_internalformat */
#ifndef GL_OES_required_internalformat
#ifndef GL_OES_required_internalformat
#define GL_ALPHA8_OES 0x803C
#define GL_DEPTH_COMPONENT16_OES 0x81A5
/* reuse GL_DEPTH_COMPONENT24_OES */
/* reuse GL_DEPTH24_STENCIL8_OES */
/* reuse GL_DEPTH_COMPONENT32_OES */
/* reuse GL_DEPTH_COMPONENT24_OES */
/* reuse GL_DEPTH24_STENCIL8_OES */
/* reuse GL_DEPTH_COMPONENT32_OES */
#define GL_LUMINANCE4_ALPHA4_OES 0x8043
#define GL_LUMINANCE8_ALPHA8_OES 0x8045
#define GL_LUMINANCE8_OES 0x8040
#define GL_RGBA4_OES 0x8056
#define GL_RGB5_A1_OES 0x8057
#define GL_RGB565_OES 0x8D62
/* reuse GL_RGB8_OES */
/* reuse GL_RGBA8_OES */
/* reuse GL_RGB8_OES */
/* reuse GL_RGBA8_OES */
/* reuse GL_RGB10_EXT */
/* reuse GL_RGB10_A2_EXT */
#endif
#endif
/* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
@@ -183,47 +197,47 @@ typedef void* GLeglImageOES;
*------------------------------------------------------------------------*/
#ifndef GL_KHR_debug
typedef void (GL_APIENTRYP GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
#define GL_DEBUG_SOURCE_API 0x8246
#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
#define GL_DEBUG_SOURCE_APPLICATION 0x824A
#define GL_DEBUG_SOURCE_OTHER 0x824B
#define GL_DEBUG_TYPE_ERROR 0x824C
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
#define GL_DEBUG_TYPE_PORTABILITY 0x824F
#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
#define GL_DEBUG_TYPE_OTHER 0x8251
#define GL_DEBUG_TYPE_MARKER 0x8268
#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
#define GL_DEBUG_TYPE_POP_GROUP 0x826A
#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
#define GL_BUFFER 0x82E0
#define GL_SHADER 0x82E1
#define GL_PROGRAM 0x82E2
#define GL_QUERY 0x82E3
/* PROGRAM_PIPELINE only in GL */
#define GL_SAMPLER 0x82E6
/* DISPLAY_LIST only in GL */
#define GL_MAX_LABEL_LENGTH 0x82E8
#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
#define GL_DEBUG_LOGGED_MESSAGES 0x9145
#define GL_DEBUG_SEVERITY_HIGH 0x9146
#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
#define GL_DEBUG_SEVERITY_LOW 0x9148
#define GL_DEBUG_OUTPUT 0x92E0
#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
#define GL_STACK_OVERFLOW 0x0503
#define GL_STACK_UNDERFLOW 0x0504
typedef void (GL_APIENTRYP GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam);
#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243
#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244
#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245
#define GL_DEBUG_SOURCE_API_KHR 0x8246
#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247
#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248
#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249
#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A
#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B
#define GL_DEBUG_TYPE_ERROR_KHR 0x824C
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E
#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F
#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250
#define GL_DEBUG_TYPE_OTHER_KHR 0x8251
#define GL_DEBUG_TYPE_MARKER_KHR 0x8268
#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269
#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A
#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B
#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C
#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D
#define GL_BUFFER_KHR 0x82E0
#define GL_SHADER_KHR 0x82E1
#define GL_PROGRAM_KHR 0x82E2
#define GL_QUERY_KHR 0x82E3
/* PROGRAM_PIPELINE only in GL */
#define GL_SAMPLER_KHR 0x82E6
/* DISPLAY_LIST only in GL */
#define GL_MAX_LABEL_LENGTH_KHR 0x82E8
#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143
#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144
#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145
#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146
#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147
#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148
#define GL_DEBUG_OUTPUT_KHR 0x92E0
#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002
#define GL_STACK_OVERFLOW_KHR 0x0503
#define GL_STACK_UNDERFLOW_KHR 0x0504
#endif
#ifndef GL_KHR_texture_compression_astc_ldr
@@ -294,6 +308,18 @@ typedef void (GL_APIENTRYP GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLen
* ANGLE extension tokens
*------------------------------------------------------------------------*/
/* GL_ANGLE_depth_texture */
#ifndef GL_ANGLE_depth_texture
#define GL_DEPTH_COMPONENT 0x1902
#define GL_DEPTH_STENCIL_OES 0x84F9
#define GL_UNSIGNED_SHORT 0x1403
#define GL_UNSIGNED_INT 0x1405
#define GL_UNSIGNED_INT_24_8_OES 0x84FA
#define GL_DEPTH_COMPONENT16 0x81A5
#define GL_DEPTH_COMPONENT32_OES 0x81A7
#define GL_DEPTH24_STENCIL8_OES 0x88F0
#endif
/* GL_ANGLE_framebuffer_blit */
#ifndef GL_ANGLE_framebuffer_blit
#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8
@@ -310,33 +336,38 @@ typedef void (GL_APIENTRYP GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLen
#endif
/* GL_ANGLE_instanced_arrays */
#ifndef GL_ANGLE_instanced_arrays
#ifndef GL_ANGLE_instanced_arrays
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE
#endif
/* GL_ANGLE_pack_reverse_row_order */
#ifndef GL_ANGLE_pack_reverse_row_order
#ifndef GL_ANGLE_pack_reverse_row_order
#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4
#endif
/* GL_ANGLE_program_binary */
#ifndef GL_ANGLE_program_binary
#define GL_PROGRAM_BINARY_ANGLE 0x93A6
#endif
/* GL_ANGLE_texture_compression_dxt3 */
#ifndef GL_ANGLE_texture_compression_dxt3
#ifndef GL_ANGLE_texture_compression_dxt3
#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
#endif
/* GL_ANGLE_texture_compression_dxt5 */
#ifndef GL_ANGLE_texture_compression_dxt5
#ifndef GL_ANGLE_texture_compression_dxt5
#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
#endif
/* GL_ANGLE_texture_usage */
#ifndef GL_ANGLE_texture_usage
#ifndef GL_ANGLE_texture_usage
#define GL_TEXTURE_USAGE_ANGLE 0x93A2
#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3
#endif
/* GL_ANGLE_translated_shader_source */
#ifndef GL_ANGLE_translated_shader_source
#ifndef GL_ANGLE_translated_shader_source
#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
#endif
@@ -346,7 +377,7 @@ typedef void (GL_APIENTRYP GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLen
/* GL_APPLE_copy_texture_levels */
/* No new tokens introduced by this extension. */
/* GL_APPLE_framebuffer_multisample */
#ifndef GL_APPLE_framebuffer_multisample
#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB
@@ -368,19 +399,6 @@ typedef void (GL_APIENTRYP GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLen
/* GL_APPLE_sync */
#ifndef GL_APPLE_sync
#ifndef __gl3_h_
/* These types are defined with reference to <inttypes.h>
* in the Apple extension spec, but here we use the Khronos
* portable types in khrplatform.h, and assume those types
* are always defined.
* If any other extensions using these types are defined,
* the typedefs must move out of this block and be shared.
*/
typedef khronos_int64_t GLint64;
typedef khronos_uint64_t GLuint64;
typedef struct __GLsync *GLsync;
#endif
#define GL_SYNC_OBJECT_APPLE 0x8A53
#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111
#define GL_OBJECT_TYPE_APPLE 0x9112
@@ -466,6 +484,54 @@ typedef struct __GLsync *GLsync;
#define GL_STENCIL_EXT 0x1802
#endif
#ifndef GL_EXT_disjoint_timer_query
#define GL_QUERY_COUNTER_BITS_EXT 0x8864
#define GL_CURRENT_QUERY_EXT 0x8865
#define GL_QUERY_RESULT_EXT 0x8866
#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867
#define GL_TIME_ELAPSED_EXT 0x88BF
#define GL_TIMESTAMP_EXT 0x8E28
#define GL_GPU_DISJOINT_EXT 0x8FBB
#endif
#ifndef GL_EXT_draw_buffers
#define GL_EXT_draw_buffers 1
#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
#define GL_MAX_DRAW_BUFFERS_EXT 0x8824
#define GL_DRAW_BUFFER0_EXT 0x8825
#define GL_DRAW_BUFFER1_EXT 0x8826
#define GL_DRAW_BUFFER2_EXT 0x8827
#define GL_DRAW_BUFFER3_EXT 0x8828
#define GL_DRAW_BUFFER4_EXT 0x8829
#define GL_DRAW_BUFFER5_EXT 0x882A
#define GL_DRAW_BUFFER6_EXT 0x882B
#define GL_DRAW_BUFFER7_EXT 0x882C
#define GL_DRAW_BUFFER8_EXT 0x882D
#define GL_DRAW_BUFFER9_EXT 0x882E
#define GL_DRAW_BUFFER10_EXT 0x882F
#define GL_DRAW_BUFFER11_EXT 0x8830
#define GL_DRAW_BUFFER12_EXT 0x8831
#define GL_DRAW_BUFFER13_EXT 0x8832
#define GL_DRAW_BUFFER14_EXT 0x8833
#define GL_DRAW_BUFFER15_EXT 0x8834
#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
#endif
/* GL_EXT_map_buffer_range */
#ifndef GL_EXT_map_buffer_range
#define GL_MAP_READ_BIT_EXT 0x0001
@@ -479,7 +545,7 @@ typedef struct __GLsync *GLsync;
/* GL_EXT_multisampled_render_to_texture */
#ifndef GL_EXT_multisampled_render_to_texture
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */
/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */
#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
#define GL_MAX_SAMPLES_EXT 0x8D57
@@ -587,10 +653,10 @@ typedef struct __GLsync *GLsync;
/* GL_EXT_texture_storage */
#ifndef GL_EXT_texture_storage
#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
#define GL_ALPHA8_EXT 0x803C
#define GL_ALPHA8_EXT 0x803C
#define GL_LUMINANCE8_EXT 0x8040
#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
#define GL_RGBA32F_EXT 0x8814
#define GL_RGBA32F_EXT 0x8814
#define GL_RGB32F_EXT 0x8815
#define GL_ALPHA32F_EXT 0x8816
#define GL_LUMINANCE32F_EXT 0x8818
@@ -600,12 +666,12 @@ typedef struct __GLsync *GLsync;
#define GL_ALPHA16F_EXT 0x881C
#define GL_LUMINANCE16F_EXT 0x881E
#define GL_LUMINANCE_ALPHA16F_EXT 0x881F
#define GL_RGB10_A2_EXT 0x8059
#define GL_RGB10_A2_EXT 0x8059
#define GL_RGB10_EXT 0x8052
#define GL_BGRA8_EXT 0x93A1
#define GL_R8_EXT 0x8229
#define GL_RG8_EXT 0x822B
#define GL_R32F_EXT 0x822E
#define GL_R32F_EXT 0x822E
#define GL_RG32F_EXT 0x8230
#define GL_R16F_EXT 0x822D
#define GL_RG16F_EXT 0x822F
@@ -618,9 +684,9 @@ typedef struct __GLsync *GLsync;
/* GL_EXT_unpack_subimage */
#ifndef GL_EXT_unpack_subimage
#define GL_UNPACK_ROW_LENGTH 0x0CF2
#define GL_UNPACK_SKIP_ROWS 0x0CF3
#define GL_UNPACK_SKIP_PIXELS 0x0CF4
#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2
#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3
#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4
#endif
/*------------------------------------------------------------------------*
@@ -638,7 +704,7 @@ typedef struct __GLsync *GLsync;
/* GL_FJ_shader_binary_GCCSO */
#ifndef GL_FJ_shader_binary_GCCSO
#define GCCSO_SHADER_BINARY_FJ 0x9260
#define GL_GCCSO_SHADER_BINARY_FJ 0x9260
#endif
/*------------------------------------------------------------------------*
@@ -669,6 +735,12 @@ typedef struct __GLsync *GLsync;
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
#endif
/* GL_IMG_texture_compression_pvrtc2 */
#ifndef GL_IMG_texture_compression_pvrtc2
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137
#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138
#endif
/* GL_IMG_multisampled_render_to_texture */
#ifndef GL_IMG_multisampled_render_to_texture
#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
@@ -691,7 +763,7 @@ typedef struct __GLsync *GLsync;
#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5
#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6
#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7
#define GL_COVERAGE_BUFFER_BIT_NV 0x8000
#define GL_COVERAGE_BUFFER_BIT_NV 0x00008000
#endif
/* GL_NV_depth_nonlinear */
@@ -736,6 +808,9 @@ typedef struct __GLsync *GLsync;
#define GL_COLOR_ATTACHMENT15_NV 0x8CEF
#endif
/* GL_NV_draw_instanced */
/* No new tokens introduced by this extension. */
/* GL_NV_fbo_color_attachments */
#ifndef GL_NV_fbo_color_attachments
#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF
@@ -749,6 +824,29 @@ typedef struct __GLsync *GLsync;
#define GL_FENCE_CONDITION_NV 0x84F4
#endif
/* GL_NV_framebuffer_blit */
#ifndef GL_NV_framebuffer_blit
#define GL_READ_FRAMEBUFFER_NV 0x8CA8
#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9
#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6
#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA
#endif
/* GL_NV_framebuffer_multisample */
#ifndef GL_NV_framebuffer_multisample
#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56
#define GL_MAX_SAMPLES_NV 0x8D57
#endif
/* GL_NV_generate_mipmap_sRGB */
/* No new tokens introduced by this extension. */
/* GL_NV_instanced_arrays */
#ifndef GL_NV_instanced_arrays
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE
#endif
/* GL_NV_read_buffer */
#ifndef GL_NV_read_buffer
#define GL_READ_BUFFER_NV 0x0C02
@@ -766,6 +864,36 @@ typedef struct __GLsync *GLsync;
/* GL_NV_read_stencil */
/* No new tokens introduced by this extension. */
/* GL_NV_shadow_samplers_array */
#ifndef GL_NV_shadow_samplers_array
#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4
#endif
/* GL_NV_shadow_samplers_cube */
#ifndef GL_NV_shadow_samplers_cube
#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5
#endif
/* GL_NV_sRGB_formats */
#ifndef GL_NV_sRGB_formats
#define GL_SLUMINANCE_NV 0x8C46
#define GL_SLUMINANCE_ALPHA_NV 0x8C44
#define GL_SRGB8_NV 0x8C41
#define GL_SLUMINANCE8_NV 0x8C47
#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45
#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F
#define GL_ETC1_SRGB8_NV 0x88EE
#endif
/* GL_NV_texture_border_clamp */
#ifndef GL_NV_texture_border_clamp
#define GL_TEXTURE_BORDER_COLOR_NV 0x1004
#define GL_CLAMP_TO_BORDER_NV 0x812D
#endif
/* GL_NV_texture_compression_s3tc_update */
/* No new tokens introduced by this extension. */
@@ -1066,29 +1194,29 @@ typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
#ifndef GL_KHR_debug
#define GL_KHR_debug 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
GL_APICALL void GL_APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
GL_APICALL void GL_APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam);
GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
GL_APICALL void GL_APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message);
GL_APICALL void GL_APIENTRY glPopDebugGroup (void);
GL_APICALL void GL_APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
GL_APICALL void GL_APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
GL_APICALL void GL_APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label);
GL_APICALL void GL_APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
GL_APICALL void GL_APIENTRY glGetPointerv (GLenum pname, void **params);
#endif
typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);
typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void);
typedef void (GL_APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);
typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
typedef void (GL_APIENTRYP PFNGLGETPOINTERVPROC) (GLenum pname, void **params);
GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam);
GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message);
GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void);
GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label);
GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params);
#endif
typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam);
typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void);
typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label);
typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params);
#endif
#ifndef GL_KHR_texture_compression_astc_ldr
@@ -1148,6 +1276,11 @@ typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monito
* ANGLE extension functions
*------------------------------------------------------------------------*/
/* GL_ANGLE_depth_texture */
#ifndef GL_ANGLE_depth_texture
#define GL_ANGLE_depth_texture 1
#endif
/* GL_ANGLE_framebuffer_blit */
#ifndef GL_ANGLE_framebuffer_blit
#define GL_ANGLE_framebuffer_blit 1
@@ -1166,43 +1299,49 @@ GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
#endif
#ifndef GL_ANGLE_instanced_arrays
#ifndef GL_ANGLE_instanced_arrays
#define GL_ANGLE_instanced_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor);
#endif
typedef void (GL_APIENTRYP PFLGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
typedef void (GL_APIENTRYP PFLGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
typedef void (GL_APIENTRYP PFLGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor);
typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor);
#endif
/* GL_ANGLE_pack_reverse_row_order */
#ifndef GL_ANGLE_pack_reverse_row_order
#ifndef GL_ANGLE_pack_reverse_row_order
#define GL_ANGLE_pack_reverse_row_order 1
#endif
/* GL_ANGLE_program_binary */
#ifndef GL_ANGLE_program_binary
#define GL_ANGLE_program_binary 1
#endif
/* GL_ANGLE_texture_compression_dxt3 */
#ifndef GL_ANGLE_texture_compression_dxt3
#ifndef GL_ANGLE_texture_compression_dxt3
#define GL_ANGLE_texture_compression_dxt3 1
#endif
/* GL_ANGLE_texture_compression_dxt5 */
#ifndef GL_ANGLE_texture_compression_dxt5
#ifndef GL_ANGLE_texture_compression_dxt5
#define GL_ANGLE_texture_compression_dxt5 1
#endif
/* GL_ANGLE_texture_usage */
#ifndef GL_ANGLE_texture_usage
#ifndef GL_ANGLE_texture_usage
#define GL_ANGLE_texture_usage 1
#endif
#ifndef GL_ANGLE_translated_shader_source
#ifndef GL_ANGLE_translated_shader_source
#define GL_ANGLE_translated_shader_source 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
#endif
typedef void (GL_APIENTRYP PFLGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
#endif
/*------------------------------------------------------------------------*
@@ -1331,6 +1470,42 @@ GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numA
typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
#endif
#ifndef GL_EXT_disjoint_timer_query
#define GL_EXT_disjoint_timer_query 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id);
GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id);
GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target);
GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target);
GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params);
GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params);
#endif
typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids);
typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids);
typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id);
typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id);
typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target);
typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target);
typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params);
typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params);
#endif /* GL_EXT_disjoint_timer_query */
#ifndef GL_EXT_draw_buffers
#define GL_EXT_draw_buffers 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs);
#endif
typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs);
#endif /* GL_EXT_draw_buffers */
/* GL_EXT_map_buffer_range */
#ifndef GL_EXT_map_buffer_range
#define GL_EXT_map_buffer_range 1
@@ -1369,10 +1544,10 @@ typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint ind
#ifndef GL_EXT_multi_draw_arrays
#define GL_EXT_multi_draw_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum, const GLint *, const GLsizei *, GLsizei);
GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
#endif
@@ -1595,6 +1770,11 @@ typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum
#define GL_IMG_texture_compression_pvrtc 1
#endif
/* GL_IMG_texture_compression_pvrtc2 */
#ifndef GL_IMG_texture_compression_pvrtc2
#define GL_IMG_texture_compression_pvrtc2 1
#endif
/* GL_IMG_multisampled_render_to_texture */
#ifndef GL_IMG_multisampled_render_to_texture
#define GL_IMG_multisampled_render_to_texture 1
@@ -1635,6 +1815,17 @@ GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
#endif
/* GL_NV_draw_instanced */
#ifndef GL_NV_draw_instanced
#define GL_NV_draw_instanced 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
#endif
typedef void (GL_APIENTRYP PFNDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
typedef void (GL_APIENTRYP PFNDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
#endif
/* GL_NV_fbo_color_attachments */
#ifndef GL_NV_fbo_color_attachments
#define GL_NV_fbo_color_attachments 1
@@ -1661,6 +1852,38 @@ typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
#endif
/* GL_NV_framebuffer_blit */
#ifndef GL_NV_framebuffer_blit
#define GL_NV_framebuffer_blit 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glBlitFramebufferNV (int srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
#endif
typedef void (GL_APIENTRYP PFNBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
#endif
/* GL_NV_framebuffer_multisample */
#ifndef GL_NV_framebuffer_multisample
#define GL_NV_framebuffer_multisample 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
#endif
typedef void (GL_APIENTRYP PFNRENDERBUFFERSTORAGEMULTISAMPLENVPROC) ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
#endif
/* GL_NV_generate_mipmap_sRGB */
#ifndef GL_NV_generate_mipmap_sRGB
#define GL_NV_generate_mipmap_sRGB 1
#endif
/* GL_NV_instanced_arrays */
#ifndef GL_NV_instanced_arrays
#define GL_NV_instanced_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor);
#endif
typedef void (GL_APIENTRYP PFNVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor);
#endif
/* GL_NV_read_buffer */
#ifndef GL_NV_read_buffer
#define GL_NV_read_buffer 1
@@ -1690,6 +1913,26 @@ typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
#define GL_NV_read_stencil 1
#endif
/* GL_NV_shadow_samplers_array */
#ifndef GL_NV_shadow_samplers_array
#define GL_NV_shadow_samplers_array 1
#endif
/* GL_NV_shadow_samplers_cube */
#ifndef GL_NV_shadow_samplers_cube
#define GL_NV_shadow_samplers_cube 1
#endif
/* GL_NV_sRGB_formats */
#ifndef GL_NV_sRGB_formats
#define GL_NV_sRGB_formats 1
#endif
/* GL_NV_texture_border_clamp */
#ifndef GL_NV_texture_border_clamp
#define GL_NV_texture_border_clamp 1
#endif
/* GL_NV_texture_compression_s3tc_update */
#ifndef GL_NV_texture_compression_s3tc_update
#define GL_NV_texture_compression_s3tc_update 1

View File

@@ -2,7 +2,7 @@
#define __gl3_h_
/*
* gl3.h last updated on $Date: 2012-10-03 07:52:40 -0700 (Wed, 03 Oct 2012) $
* gl3.h last updated on $Date: 2013-02-12 14:37:24 -0800 (Tue, 12 Feb 2013) $
*/
#include <GLES3/gl3platform.h>
@@ -12,7 +12,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2007-2012 The Khronos Group Inc.
** Copyright (c) 2007-2013 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -861,7 +861,7 @@ GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL GLenum GL_APIENTRY glGetError (void);
@@ -880,7 +880,7 @@ GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);

View File

@@ -35,7 +35,8 @@
#define bool _Bool
/* For compilers that don't have the builtin _Bool type. */
#if defined(_MSC_VER) || (__STDC_VERSION__ < 199901L && __GNUC__ < 3)
#if (defined(_MSC_VER) && _MSC_VER < 1800) || \
(defined __GNUC__&& __STDC_VERSION__ < 199901L && __GNUC__ < 3)
typedef unsigned char _Bool;
#endif

View File

@@ -1,93 +1,93 @@
CHIPSET(0x29A2, I965_G, "Intel(R) 965G")
CHIPSET(0x2992, I965_Q, "Intel(R) 965Q")
CHIPSET(0x2982, I965_G_1, "Intel(R) 965G")
CHIPSET(0x2972, I946_GZ, "Intel(R) 946GZ")
CHIPSET(0x2A02, I965_GM, "Intel(R) 965GM")
CHIPSET(0x2A12, I965_GME, "Intel(R) 965GME/GLE")
CHIPSET(0x2A42, GM45_GM, "Mobile Intel® GM45 Express Chipset")
CHIPSET(0x2E02, IGD_E_G, "Intel(R) Integrated Graphics Device")
CHIPSET(0x2E12, Q45_G, "Intel(R) Q45/Q43")
CHIPSET(0x2E22, G45_G, "Intel(R) G45/G43")
CHIPSET(0x2E32, G41_G, "Intel(R) G41")
CHIPSET(0x2E42, B43_G, "Intel(R) B43")
CHIPSET(0x2E92, B43_G1, "Intel(R) B43")
CHIPSET(0x0042, ILD_G, "Intel(R) Ironlake Desktop")
CHIPSET(0x0046, ILM_G, "Intel(R) Ironlake Mobile")
CHIPSET(0x0102, SANDYBRIDGE_GT1, "Intel(R) Sandybridge Desktop")
CHIPSET(0x0112, SANDYBRIDGE_GT2, "Intel(R) Sandybridge Desktop")
CHIPSET(0x0122, SANDYBRIDGE_GT2_PLUS, "Intel(R) Sandybridge Desktop")
CHIPSET(0x0106, SANDYBRIDGE_M_GT1, "Intel(R) Sandybridge Mobile")
CHIPSET(0x0116, SANDYBRIDGE_M_GT2, "Intel(R) Sandybridge Mobile")
CHIPSET(0x0126, SANDYBRIDGE_M_GT2_PLUS, "Intel(R) Sandybridge Mobile")
CHIPSET(0x010A, SANDYBRIDGE_S, "Intel(R) Sandybridge Server")
CHIPSET(0x0152, IVYBRIDGE_GT1, "Intel(R) Ivybridge Desktop")
CHIPSET(0x0162, IVYBRIDGE_GT2, "Intel(R) Ivybridge Desktop")
CHIPSET(0x0156, IVYBRIDGE_M_GT1, "Intel(R) Ivybridge Mobile")
CHIPSET(0x0166, IVYBRIDGE_M_GT2, "Intel(R) Ivybridge Mobile")
CHIPSET(0x015a, IVYBRIDGE_S_GT1, "Intel(R) Ivybridge Server")
CHIPSET(0x016a, IVYBRIDGE_S_GT2, "Intel(R) Ivybridge Server")
CHIPSET(0x0402, HASWELL_GT1, "Intel(R) Haswell Desktop")
CHIPSET(0x0412, HASWELL_GT2, "Intel(R) Haswell Desktop")
CHIPSET(0x0422, HASWELL_GT3, "Intel(R) Haswell Desktop")
CHIPSET(0x0406, HASWELL_M_GT1, "Intel(R) Haswell Mobile")
CHIPSET(0x0416, HASWELL_M_GT2, "Intel(R) Haswell Mobile")
CHIPSET(0x0426, HASWELL_M_GT3, "Intel(R) Haswell Mobile")
CHIPSET(0x040A, HASWELL_S_GT1, "Intel(R) Haswell Server")
CHIPSET(0x041A, HASWELL_S_GT2, "Intel(R) Haswell Server")
CHIPSET(0x042A, HASWELL_S_GT3, "Intel(R) Haswell Server")
CHIPSET(0x040B, HASWELL_B_GT1, "Intel(R) Haswell")
CHIPSET(0x041B, HASWELL_B_GT2, "Intel(R) Haswell")
CHIPSET(0x042B, HASWELL_B_GT3, "Intel(R) Haswell")
CHIPSET(0x040E, HASWELL_E_GT1, "Intel(R) Haswell")
CHIPSET(0x041E, HASWELL_E_GT2, "Intel(R) Haswell")
CHIPSET(0x042E, HASWELL_E_GT3, "Intel(R) Haswell")
CHIPSET(0x0C02, HASWELL_SDV_GT1, "Intel(R) Haswell Desktop")
CHIPSET(0x0C12, HASWELL_SDV_GT2, "Intel(R) Haswell Desktop")
CHIPSET(0x0C22, HASWELL_SDV_GT3, "Intel(R) Haswell Desktop")
CHIPSET(0x0C06, HASWELL_SDV_M_GT1, "Intel(R) Haswell Mobile")
CHIPSET(0x0C16, HASWELL_SDV_M_GT2, "Intel(R) Haswell Mobile")
CHIPSET(0x0C26, HASWELL_SDV_M_GT3, "Intel(R) Haswell Mobile")
CHIPSET(0x0C0A, HASWELL_SDV_S_GT1, "Intel(R) Haswell Server")
CHIPSET(0x0C1A, HASWELL_SDV_S_GT2, "Intel(R) Haswell Server")
CHIPSET(0x0C2A, HASWELL_SDV_S_GT3, "Intel(R) Haswell Server")
CHIPSET(0x0C0B, HASWELL_SDV_B_GT1, "Intel(R) Haswell")
CHIPSET(0x0C1B, HASWELL_SDV_B_GT2, "Intel(R) Haswell")
CHIPSET(0x0C2B, HASWELL_SDV_B_GT3, "Intel(R) Haswell")
CHIPSET(0x0C0E, HASWELL_SDV_E_GT1, "Intel(R) Haswell")
CHIPSET(0x0C1E, HASWELL_SDV_E_GT2, "Intel(R) Haswell")
CHIPSET(0x0C2E, HASWELL_SDV_E_GT3, "Intel(R) Haswell")
CHIPSET(0x0A02, HASWELL_ULT_GT1, "Intel(R) Haswell Desktop")
CHIPSET(0x0A12, HASWELL_ULT_GT2, "Intel(R) Haswell Desktop")
CHIPSET(0x0A22, HASWELL_ULT_GT3, "Intel(R) Haswell Desktop")
CHIPSET(0x0A06, HASWELL_ULT_M_GT1, "Intel(R) Haswell Mobile")
CHIPSET(0x0A16, HASWELL_ULT_M_GT2, "Intel(R) Haswell Mobile")
CHIPSET(0x0A26, HASWELL_ULT_M_GT3, "Intel(R) Haswell Mobile")
CHIPSET(0x0A0A, HASWELL_ULT_S_GT1, "Intel(R) Haswell Server")
CHIPSET(0x0A1A, HASWELL_ULT_S_GT2, "Intel(R) Haswell Server")
CHIPSET(0x0A2A, HASWELL_ULT_S_GT3, "Intel(R) Haswell Server")
CHIPSET(0x0A0B, HASWELL_ULT_B_GT1, "Intel(R) Haswell")
CHIPSET(0x0A1B, HASWELL_ULT_B_GT2, "Intel(R) Haswell")
CHIPSET(0x0A2B, HASWELL_ULT_B_GT3, "Intel(R) Haswell")
CHIPSET(0x0A0E, HASWELL_ULT_E_GT1, "Intel(R) Haswell")
CHIPSET(0x0A1E, HASWELL_ULT_E_GT2, "Intel(R) Haswell")
CHIPSET(0x0A2E, HASWELL_ULT_E_GT3, "Intel(R) Haswell")
CHIPSET(0x0D02, HASWELL_CRW_GT1, "Intel(R) Haswell Desktop")
CHIPSET(0x0D12, HASWELL_CRW_GT2, "Intel(R) Haswell Desktop")
CHIPSET(0x0D22, HASWELL_CRW_GT3, "Intel(R) Haswell Desktop")
CHIPSET(0x0D06, HASWELL_CRW_M_GT1, "Intel(R) Haswell Mobile")
CHIPSET(0x0D16, HASWELL_CRW_M_GT2, "Intel(R) Haswell Mobile")
CHIPSET(0x0D26, HASWELL_CRW_M_GT3, "Intel(R) Haswell Mobile")
CHIPSET(0x0D0A, HASWELL_CRW_S_GT1, "Intel(R) Haswell Server")
CHIPSET(0x0D1A, HASWELL_CRW_S_GT2, "Intel(R) Haswell Server")
CHIPSET(0x0D2A, HASWELL_CRW_S_GT3, "Intel(R) Haswell")
CHIPSET(0x0D0B, HASWELL_CRW_B_GT1, "Intel(R) Haswell")
CHIPSET(0x0D1B, HASWELL_CRW_B_GT2, "Intel(R) Haswell")
CHIPSET(0x0D2B, HASWELL_CRW_B_GT3, "Intel(R) Haswell")
CHIPSET(0x0D0E, HASWELL_CRW_E_GT1, "Intel(R) Haswell")
CHIPSET(0x0D1E, HASWELL_CRW_E_GT2, "Intel(R) Haswell")
CHIPSET(0x0D2E, HASWELL_CRW_E_GT3, "Intel(R) Haswell")
CHIPSET(0x0F31, BAYTRAIL_M_1, "Intel(R) Bay Trail")
CHIPSET(0x0F32, BAYTRAIL_M_2, "Intel(R) Bay Trail")
CHIPSET(0x0F33, BAYTRAIL_M_3, "Intel(R) Bay Trail")
CHIPSET(0x0157, BAYTRAIL_M_4, "Intel(R) Bay Trail")
CHIPSET(0x0155, BAYTRAIL_D, "Intel(R) Bay Trail")
CHIPSET(0x29A2, i965, "Intel(R) 965G")
CHIPSET(0x2992, i965, "Intel(R) 965Q")
CHIPSET(0x2982, i965, "Intel(R) 965G")
CHIPSET(0x2972, i965, "Intel(R) 946GZ")
CHIPSET(0x2A02, i965, "Intel(R) 965GM")
CHIPSET(0x2A12, i965, "Intel(R) 965GME/GLE")
CHIPSET(0x2A42, g4x, "Mobile Intel® GM45 Express Chipset")
CHIPSET(0x2E02, g4x, "Intel(R) Integrated Graphics Device")
CHIPSET(0x2E12, g4x, "Intel(R) Q45/Q43")
CHIPSET(0x2E22, g4x, "Intel(R) G45/G43")
CHIPSET(0x2E32, g4x, "Intel(R) G41")
CHIPSET(0x2E42, g4x, "Intel(R) B43")
CHIPSET(0x2E92, g4x, "Intel(R) B43")
CHIPSET(0x0042, ilk, "Intel(R) Ironlake Desktop")
CHIPSET(0x0046, ilk, "Intel(R) Ironlake Mobile")
CHIPSET(0x0102, snb_gt1, "Intel(R) Sandybridge Desktop")
CHIPSET(0x0112, snb_gt2, "Intel(R) Sandybridge Desktop")
CHIPSET(0x0122, snb_gt2, "Intel(R) Sandybridge Desktop")
CHIPSET(0x0106, snb_gt1, "Intel(R) Sandybridge Mobile")
CHIPSET(0x0116, snb_gt2, "Intel(R) Sandybridge Mobile")
CHIPSET(0x0126, snb_gt2, "Intel(R) Sandybridge Mobile")
CHIPSET(0x010A, snb_gt1, "Intel(R) Sandybridge Server")
CHIPSET(0x0152, ivb_gt1, "Intel(R) Ivybridge Desktop")
CHIPSET(0x0162, ivb_gt2, "Intel(R) Ivybridge Desktop")
CHIPSET(0x0156, ivb_gt1, "Intel(R) Ivybridge Mobile")
CHIPSET(0x0166, ivb_gt2, "Intel(R) Ivybridge Mobile")
CHIPSET(0x015a, ivb_gt1, "Intel(R) Ivybridge Server")
CHIPSET(0x016a, ivb_gt2, "Intel(R) Ivybridge Server")
CHIPSET(0x0402, hsw_gt1, "Intel(R) Haswell Desktop")
CHIPSET(0x0412, hsw_gt2, "Intel(R) Haswell Desktop")
CHIPSET(0x0422, hsw_gt3, "Intel(R) Haswell Desktop")
CHIPSET(0x0406, hsw_gt1, "Intel(R) Haswell Mobile")
CHIPSET(0x0416, hsw_gt2, "Intel(R) Haswell Mobile")
CHIPSET(0x0426, hsw_gt3, "Intel(R) Haswell Mobile")
CHIPSET(0x040A, hsw_gt1, "Intel(R) Haswell Server")
CHIPSET(0x041A, hsw_gt2, "Intel(R) Haswell Server")
CHIPSET(0x042A, hsw_gt3, "Intel(R) Haswell Server")
CHIPSET(0x040B, hsw_gt1, "Intel(R) Haswell")
CHIPSET(0x041B, hsw_gt2, "Intel(R) Haswell")
CHIPSET(0x042B, hsw_gt3, "Intel(R) Haswell")
CHIPSET(0x040E, hsw_gt1, "Intel(R) Haswell")
CHIPSET(0x041E, hsw_gt2, "Intel(R) Haswell")
CHIPSET(0x042E, hsw_gt3, "Intel(R) Haswell")
CHIPSET(0x0C02, hsw_gt1, "Intel(R) Haswell Desktop")
CHIPSET(0x0C12, hsw_gt2, "Intel(R) Haswell Desktop")
CHIPSET(0x0C22, hsw_gt3, "Intel(R) Haswell Desktop")
CHIPSET(0x0C06, hsw_gt1, "Intel(R) Haswell Mobile")
CHIPSET(0x0C16, hsw_gt2, "Intel(R) Haswell Mobile")
CHIPSET(0x0C26, hsw_gt3, "Intel(R) Haswell Mobile")
CHIPSET(0x0C0A, hsw_gt1, "Intel(R) Haswell Server")
CHIPSET(0x0C1A, hsw_gt2, "Intel(R) Haswell Server")
CHIPSET(0x0C2A, hsw_gt3, "Intel(R) Haswell Server")
CHIPSET(0x0C0B, hsw_gt1, "Intel(R) Haswell")
CHIPSET(0x0C1B, hsw_gt2, "Intel(R) Haswell")
CHIPSET(0x0C2B, hsw_gt3, "Intel(R) Haswell")
CHIPSET(0x0C0E, hsw_gt1, "Intel(R) Haswell")
CHIPSET(0x0C1E, hsw_gt2, "Intel(R) Haswell")
CHIPSET(0x0C2E, hsw_gt3, "Intel(R) Haswell")
CHIPSET(0x0A02, hsw_gt1, "Intel(R) Haswell Desktop")
CHIPSET(0x0A12, hsw_gt2, "Intel(R) Haswell Desktop")
CHIPSET(0x0A22, hsw_gt3, "Intel(R) Haswell Desktop")
CHIPSET(0x0A06, hsw_gt1, "Intel(R) Haswell Mobile")
CHIPSET(0x0A16, hsw_gt2, "Intel(R) Haswell Mobile")
CHIPSET(0x0A26, hsw_gt3, "Intel(R) Haswell Mobile")
CHIPSET(0x0A0A, hsw_gt1, "Intel(R) Haswell Server")
CHIPSET(0x0A1A, hsw_gt2, "Intel(R) Haswell Server")
CHIPSET(0x0A2A, hsw_gt3, "Intel(R) Haswell Server")
CHIPSET(0x0A0B, hsw_gt1, "Intel(R) Haswell")
CHIPSET(0x0A1B, hsw_gt2, "Intel(R) Haswell")
CHIPSET(0x0A2B, hsw_gt3, "Intel(R) Haswell")
CHIPSET(0x0A0E, hsw_gt1, "Intel(R) Haswell")
CHIPSET(0x0A1E, hsw_gt2, "Intel(R) Haswell")
CHIPSET(0x0A2E, hsw_gt3, "Intel(R) Haswell")
CHIPSET(0x0D02, hsw_gt1, "Intel(R) Haswell Desktop")
CHIPSET(0x0D12, hsw_gt2, "Intel(R) Haswell Desktop")
CHIPSET(0x0D22, hsw_gt3, "Intel(R) Haswell Desktop")
CHIPSET(0x0D06, hsw_gt1, "Intel(R) Haswell Mobile")
CHIPSET(0x0D16, hsw_gt2, "Intel(R) Haswell Mobile")
CHIPSET(0x0D26, hsw_gt3, "Intel(R) Haswell Mobile")
CHIPSET(0x0D0A, hsw_gt1, "Intel(R) Haswell Server")
CHIPSET(0x0D1A, hsw_gt2, "Intel(R) Haswell Server")
CHIPSET(0x0D2A, hsw_gt3, "Intel(R) Haswell")
CHIPSET(0x0D0B, hsw_gt1, "Intel(R) Haswell")
CHIPSET(0x0D1B, hsw_gt2, "Intel(R) Haswell")
CHIPSET(0x0D2B, hsw_gt3, "Intel(R) Haswell")
CHIPSET(0x0D0E, hsw_gt1, "Intel(R) Haswell")
CHIPSET(0x0D1E, hsw_gt2, "Intel(R) Haswell")
CHIPSET(0x0D2E, hsw_gt3, "Intel(R) Haswell")
CHIPSET(0x0F31, byt, "Intel(R) Bay Trail")
CHIPSET(0x0F32, byt, "Intel(R) Bay Trail")
CHIPSET(0x0F33, byt, "Intel(R) Bay Trail")
CHIPSET(0x0157, byt, "Intel(R) Bay Trail")
CHIPSET(0x0155, byt, "Intel(R) Bay Trail")

View File

@@ -14,7 +14,7 @@ static const int i915_chip_ids[] = {
};
static const int i965_chip_ids[] = {
#define CHIPSET(chip, desc, name) chip,
#define CHIPSET(chip, family, name) chip,
#include "pci_ids/i965_pci_ids.h"
#undef CHIPSET
};

View File

@@ -96,3 +96,25 @@ CHIPSET(0x983C, KABINI_983C, KABINI)
CHIPSET(0x983D, KABINI_983D, KABINI)
CHIPSET(0x983E, KABINI_983E, KABINI)
CHIPSET(0x983F, KABINI_983F, KABINI)
CHIPSET(0x1304, KAVERI_1304, KAVERI)
CHIPSET(0x1305, KAVERI_1305, KAVERI)
CHIPSET(0x1306, KAVERI_1306, KAVERI)
CHIPSET(0x1307, KAVERI_1307, KAVERI)
CHIPSET(0x1309, KAVERI_1309, KAVERI)
CHIPSET(0x130A, KAVERI_130A, KAVERI)
CHIPSET(0x130B, KAVERI_130B, KAVERI)
CHIPSET(0x130C, KAVERI_130C, KAVERI)
CHIPSET(0x130D, KAVERI_130D, KAVERI)
CHIPSET(0x130E, KAVERI_130E, KAVERI)
CHIPSET(0x130F, KAVERI_130F, KAVERI)
CHIPSET(0x1310, KAVERI_1310, KAVERI)
CHIPSET(0x1311, KAVERI_1311, KAVERI)
CHIPSET(0x1312, KAVERI_1312, KAVERI)
CHIPSET(0x1313, KAVERI_1313, KAVERI)
CHIPSET(0x1315, KAVERI_1315, KAVERI)
CHIPSET(0x1316, KAVERI_1316, KAVERI)
CHIPSET(0x1317, KAVERI_1317, KAVERI)
CHIPSET(0x131B, KAVERI_131B, KAVERI)
CHIPSET(0x131C, KAVERI_131C, KAVERI)
CHIPSET(0x131D, KAVERI_131D, KAVERI)

View File

@@ -1,125 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PROG_CC_FOR_BUILD
#
# DESCRIPTION
#
# This macro searches for a C compiler that generates native executables,
# that is a C compiler that surely is not a cross-compiler. This can be
# useful if you have to generate source code at compile-time like for
# example GCC does.
#
# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything
# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD).
# The value of these variables can be overridden by the user by specifying
# a compiler with an environment variable (like you do for standard CC).
#
# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object
# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if
# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are
# substituted in the Makefile.
#
# LICENSE
#
# Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 5
AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_REQUIRE([AC_EXEEXT])dnl
AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
dnl Use the standard macros, but make them use other variable names
dnl
pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
pushdef([ac_cv_objext], ac_cv_build_objext)dnl
pushdef([ac_exeext], ac_build_exeext)dnl
pushdef([ac_objext], ac_build_objext)dnl
pushdef([CC], CC_FOR_BUILD)dnl
pushdef([CPP], CPP_FOR_BUILD)dnl
pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
pushdef([host], build)dnl
pushdef([host_alias], build_alias)dnl
pushdef([host_cpu], build_cpu)dnl
pushdef([host_vendor], build_vendor)dnl
pushdef([host_os], build_os)dnl
pushdef([ac_cv_host], ac_cv_build)dnl
pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
pushdef([ac_cv_host_os], ac_cv_build_os)dnl
pushdef([ac_cpp], ac_build_cpp)dnl
pushdef([ac_compile], ac_build_compile)dnl
pushdef([ac_link], ac_build_link)dnl
save_cross_compiling=$cross_compiling
save_ac_tool_prefix=$ac_tool_prefix
cross_compiling=no
ac_tool_prefix=
AC_PROG_CC
AC_PROG_CPP
AC_EXEEXT
ac_tool_prefix=$save_ac_tool_prefix
cross_compiling=$save_cross_compiling
dnl Restore the old definitions
dnl
popdef([ac_link])dnl
popdef([ac_compile])dnl
popdef([ac_cpp])dnl
popdef([ac_cv_host_os])dnl
popdef([ac_cv_host_vendor])dnl
popdef([ac_cv_host_cpu])dnl
popdef([ac_cv_host_alias])dnl
popdef([ac_cv_host])dnl
popdef([host_os])dnl
popdef([host_vendor])dnl
popdef([host_cpu])dnl
popdef([host_alias])dnl
popdef([host])dnl
popdef([LDFLAGS])dnl
popdef([CPPFLAGS])dnl
popdef([CFLAGS])dnl
popdef([CPP])dnl
popdef([CC])dnl
popdef([ac_objext])dnl
popdef([ac_exeext])dnl
popdef([ac_cv_objext])dnl
popdef([ac_cv_exeext])dnl
popdef([ac_cv_prog_cc_g])dnl
popdef([ac_cv_prog_cc_cross])dnl
popdef([ac_cv_prog_cc_works])dnl
popdef([ac_cv_prog_gcc])dnl
popdef([ac_cv_prog_CPP])dnl
dnl Finally, set Makefile variables
dnl
BUILD_EXEEXT=$ac_build_exeext
BUILD_OBJEXT=$ac_build_objext
AC_SUBST(BUILD_EXEEXT)dnl
AC_SUBST(BUILD_OBJEXT)dnl
AC_SUBST([CFLAGS_FOR_BUILD])dnl
AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
AC_SUBST([LDFLAGS_FOR_BUILD])dnl
])

View File

@@ -1,109 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_prog_cxx_for_build.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PROG_CXX_FOR_BUILD
#
# DESCRIPTION
#
# This macro searches for a C++ compiler that generates native executables,
# that is a C++ compiler that surely is not a cross-compiler. This can be
# useful if you have to generate source code at compile-time like for
# example GCC does.
#
# The macro sets the CXX_FOR_BUILD and CXXCPP_FOR_BUILD macros to anything
# needed to compile or link (CXX_FOR_BUILD) and preprocess (CXXCPP_FOR_BUILD).
# The value of these variables can be overridden by the user by specifying
# a compiler with an environment variable (like you do for standard CXX).
#
# LICENSE
#
# Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
# Copyright (c) 2012 Avionic Design GmbH
#
# Based on the AX_PROG_CC_FOR_BUILD macro by Paolo Bonzini.
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 5
AU_ALIAS([AC_PROG_CXX_FOR_BUILD], [AX_PROG_CXX_FOR_BUILD])
AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [dnl
AC_REQUIRE([AX_PROG_CC_FOR_BUILD])dnl
AC_REQUIRE([AC_PROG_CXX])dnl
AC_REQUIRE([AC_PROG_CXXCPP])dnl
AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
dnl Use the standard macros, but make them use other variable names
dnl
pushdef([ac_cv_prog_CXXCPP], ac_cv_build_prog_CXXCPP)dnl
pushdef([ac_cv_prog_gxx], ac_cv_build_prog_gxx)dnl
pushdef([ac_cv_prog_cxx_works], ac_cv_build_prog_cxx_works)dnl
pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross)dnl
pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g)dnl
pushdef([CXX], CXX_FOR_BUILD)dnl
pushdef([CXXCPP], CXXCPP_FOR_BUILD)dnl
pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD)dnl
pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD)dnl
pushdef([host], build)dnl
pushdef([host_alias], build_alias)dnl
pushdef([host_cpu], build_cpu)dnl
pushdef([host_vendor], build_vendor)dnl
pushdef([host_os], build_os)dnl
pushdef([ac_cv_host], ac_cv_build)dnl
pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
pushdef([ac_cv_host_os], ac_cv_build_os)dnl
pushdef([ac_cxxcpp], ac_build_cxxcpp)dnl
pushdef([ac_compile], ac_build_compile)dnl
pushdef([ac_link], ac_build_link)dnl
save_cross_compiling=$cross_compiling
save_ac_tool_prefix=$ac_tool_prefix
cross_compiling=no
ac_tool_prefix=
AC_PROG_CXX
AC_PROG_CXXCPP
ac_tool_prefix=$save_ac_tool_prefix
cross_compiling=$save_cross_compiling
dnl Restore the old definitions
dnl
popdef([ac_link])dnl
popdef([ac_compile])dnl
popdef([ac_cxxcpp])dnl
popdef([ac_cv_host_os])dnl
popdef([ac_cv_host_vendor])dnl
popdef([ac_cv_host_cpu])dnl
popdef([ac_cv_host_alias])dnl
popdef([ac_cv_host])dnl
popdef([host_os])dnl
popdef([host_vendor])dnl
popdef([host_cpu])dnl
popdef([host_alias])dnl
popdef([host])dnl
popdef([CXXCPPFLAGS])dnl
popdef([CPPFLAGS])dnl
popdef([CXXFLAGS])dnl
popdef([CXXCPP])dnl
popdef([CXX])dnl
popdef([ac_cv_prog_cxx_g])dnl
popdef([ac_cv_prog_cxx_cross])dnl
popdef([ac_cv_prog_cxx_works])dnl
popdef([ac_cv_prog_gxx])dnl
popdef([ac_cv_prog_CXXCPP])dnl
dnl Finally, set Makefile variables
dnl
AC_SUBST([CXXFLAGS_FOR_BUILD])dnl
AC_SUBST([CXXCPPFLAGS_FOR_BUILD])dnl
])

View File

@@ -295,8 +295,6 @@ def generate(env):
cppdefines += ['_DEBUG']
if platform == 'windows':
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_USER']
if platform == 'haiku':
cppdefines += ['BEOS_THREADS']
if env['embedded']:
cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
if env['texture_float']:
@@ -506,6 +504,8 @@ def generate(env):
libs += ['m', 'pthread', 'dl']
if env['platform'] in ('linux',):
libs += ['rt']
if env['platform'] in ('haiku'):
libs += ['root', 'be', 'network', 'translation']
env.Append(LIBS = libs)
# OpenMP

View File

@@ -190,14 +190,16 @@ def generate(env):
pass
env.MergeFlags(cppflags)
# Match llvm --fno-rtti flag
cxxflags = env.backtick('llvm-config --cxxflags').split()
if '-fno-rtti' in cxxflags:
env.Append(CXXFLAGS = ['-fno-rtti'])
components = ['engine', 'bitwriter', 'x86asmprinter']
if llvm_version >= distutils.version.LooseVersion('3.1'):
components.append('mcjit')
if llvm_version >= distutils.version.LooseVersion('3.2'):
env.Append(CXXFLAGS = ('-fno-rtti',))
env.ParseConfig('llvm-config --libs ' + ' '.join(components))
env.ParseConfig('llvm-config --ldflags')
except OSError:

View File

@@ -29,6 +29,10 @@ if HAVE_DRI_GLX
SUBDIRS += glx
endif
if HAVE_EGL_PLATFORM_WAYLAND
SUBDIRS += egl/wayland
endif
if HAVE_GBM
SUBDIRS += gbm
endif

View File

@@ -21,8 +21,4 @@
SUBDIRS=
if HAVE_EGL_PLATFORM_WAYLAND
SUBDIRS += wayland
endif
SUBDIRS += drivers main

View File

@@ -28,6 +28,7 @@ AM_CFLAGS = \
-I$(top_srcdir)/src/egl/wayland/wayland-drm \
-I$(top_builddir)/src/egl/wayland/wayland-drm \
$(DEFINES) \
$(VISIBILITY_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(LIBUDEV_CFLAGS) \
$(LIBKMS_CFLAGS) \

View File

@@ -34,6 +34,7 @@
#include <errno.h>
#include <unistd.h>
#include <xf86drm.h>
#include <drm_fourcc.h>
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#include <sys/types.h>
@@ -41,6 +42,10 @@
#include "egl_dri2.h"
#ifdef HAVE_WAYLAND_PLATFORM
#include "wayland-drm.h"
#endif
const __DRIuseInvalidateExtension use_invalidate = {
{ __DRI_USE_INVALIDATE, 1 }
};
@@ -111,7 +116,7 @@ dri2_match_config(const _EGLConfig *conf, const _EGLConfig *criteria)
struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
int depth, EGLint surface_type, const EGLint *attr_list,
EGLint surface_type, const EGLint *attr_list,
const unsigned int *rgba_masks)
{
struct dri2_egl_config *conf;
@@ -195,16 +200,6 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
for (i = 0; attr_list[i] != EGL_NONE; i += 2)
_eglSetConfigKey(&base, attr_list[i], attr_list[i+1]);
/* Allow a 24-bit RGB visual to match a 32-bit RGBA EGLConfig. Otherwise
* it will only match a 32-bit RGBA visual. On a composited window manager
* on X11, this will make all of the EGLConfigs with destination alpha get
* blended by the compositor. This is probably not what the application
* wants... especially on drivers that only have 32-bit RGBA EGLConfigs!
*/
if (depth > 0 && depth != base.BufferSize
&& !(depth == 24 && base.BufferSize == 32))
return NULL;
if (rgba_masks && memcmp(rgba_masks, dri_masks, sizeof(dri_masks)))
return NULL;
@@ -372,8 +367,10 @@ static const __DRIextension **
dri2_open_driver(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = disp->DriverData;
const __DRIextension **extensions;
const __DRIextension **extensions = NULL;
char path[PATH_MAX], *search_paths, *p, *next, *end;
char *get_extensions_name;
const __DRIextension **(*get_extensions)(void);
search_paths = NULL;
if (geteuid() == getuid()) {
@@ -414,7 +411,21 @@ dri2_open_driver(_EGLDisplay *disp)
}
_eglLog(_EGL_DEBUG, "DRI2: dlopen(%s)", path);
extensions = dlsym(dri2_dpy->driver, __DRI_DRIVER_EXTENSIONS);
if (asprintf(&get_extensions_name, "%s_%s",
__DRI_DRIVER_GET_EXTENSIONS, dri2_dpy->driver_name) != -1) {
get_extensions = dlsym(dri2_dpy->driver, get_extensions_name);
if (get_extensions) {
extensions = get_extensions();
} else {
_eglLog(_EGL_DEBUG, "driver does not expose %s(): %s\n",
get_extensions_name, dlerror());
}
free(get_extensions_name);
}
if (!extensions)
extensions = dlsym(dri2_dpy->driver, __DRI_DRIVER_EXTENSIONS);
if (extensions == NULL) {
_eglLog(_EGL_WARNING,
"DRI2: driver exports no extensions (%s)", dlerror());
@@ -438,6 +449,7 @@ dri2_load_driver(_EGLDisplay *disp)
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
dri2_dpy->driver_extensions = extensions;
return EGL_TRUE;
}
@@ -458,6 +470,7 @@ dri2_load_driver_swrast(_EGLDisplay *disp)
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
dri2_dpy->driver_extensions = extensions;
return EGL_TRUE;
}
@@ -507,6 +520,10 @@ dri2_setup_screen(_EGLDisplay *disp)
disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
disp->Extensions.KHR_gl_texture_cubemap_image = EGL_TRUE;
}
if (dri2_dpy->image->base.version >= 8 &&
dri2_dpy->image->createImageFromDmaBufs) {
disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE;
}
}
}
@@ -519,14 +536,30 @@ dri2_create_screen(_EGLDisplay *disp)
dri2_dpy = disp->DriverData;
if (dri2_dpy->dri2) {
dri2_dpy->dri_screen =
dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
if (dri2_dpy->dri2->base.version >= 4) {
dri2_dpy->dri_screen =
dri2_dpy->dri2->createNewScreen2(0, dri2_dpy->fd,
dri2_dpy->extensions,
dri2_dpy->driver_extensions,
&dri2_dpy->driver_configs, disp);
} else {
dri2_dpy->dri_screen =
dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd,
dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
}
} else {
assert(dri2_dpy->swrast);
dri2_dpy->dri_screen =
dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
if (dri2_dpy->swrast->base.version >= 4) {
dri2_dpy->dri_screen =
dri2_dpy->swrast->createNewScreen2(0, dri2_dpy->extensions,
dri2_dpy->driver_extensions,
&dri2_dpy->driver_configs, disp);
} else {
dri2_dpy->dri_screen =
dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
&dri2_dpy->driver_configs, disp);
}
}
if (dri2_dpy->dri_screen == NULL) {
@@ -1195,7 +1228,7 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer _buffer,
const EGLint *attr_list)
{
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;
struct wl_drm_buffer *buffer;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
const struct wl_drm_components_descriptor *f;
__DRIimage *dri_image;
@@ -1203,7 +1236,9 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
EGLint err;
int32_t plane;
if (!wayland_buffer_is_drm(&buffer->buffer))
buffer = wayland_drm_buffer_get(dri2_dpy->wl_server_drm,
(struct wl_resource *) _buffer);
if (!buffer)
return NULL;
err = _eglParseImageAttribList(&attrs, disp, attr_list);
@@ -1340,6 +1375,261 @@ dri2_create_image_khr_texture(_EGLDisplay *disp, _EGLContext *ctx,
return &dri2_img->base;
}
static EGLBoolean
dri2_check_dma_buf_attribs(const _EGLImageAttribs *attrs)
{
unsigned i;
/**
* The spec says:
*
* "Required attributes and their values are as follows:
*
* * EGL_WIDTH & EGL_HEIGHT: The logical dimensions of the buffer in pixels
*
* * EGL_LINUX_DRM_FOURCC_EXT: The pixel format of the buffer, as specified
* by drm_fourcc.h and used as the pixel_format parameter of the
* drm_mode_fb_cmd2 ioctl."
*
* and
*
* "* If <target> is EGL_LINUX_DMA_BUF_EXT, and the list of attributes is
* incomplete, EGL_BAD_PARAMETER is generated."
*/
if (attrs->Width <= 0 || attrs->Height <= 0 ||
!attrs->DMABufFourCC.IsPresent) {
_eglError(EGL_BAD_PARAMETER, "attribute(s) missing");
return EGL_FALSE;
}
/**
* Also:
*
* "If <target> is EGL_LINUX_DMA_BUF_EXT and one or more of the values
* specified for a plane's pitch or offset isn't supported by EGL,
* EGL_BAD_ACCESS is generated."
*/
for (i = 0; i < ARRAY_SIZE(attrs->DMABufPlanePitches); ++i) {
if (attrs->DMABufPlanePitches[i].IsPresent &&
attrs->DMABufPlanePitches[i].Value <= 0) {
_eglError(EGL_BAD_ACCESS, "invalid pitch");
return EGL_FALSE;
}
}
return EGL_TRUE;
}
/* Returns the total number of file descriptors. Zero indicates an error. */
static unsigned
dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
{
unsigned i, plane_n;
switch (attrs->DMABufFourCC.Value) {
case DRM_FORMAT_RGB332:
case DRM_FORMAT_BGR233:
case DRM_FORMAT_XRGB4444:
case DRM_FORMAT_XBGR4444:
case DRM_FORMAT_RGBX4444:
case DRM_FORMAT_BGRX4444:
case DRM_FORMAT_ARGB4444:
case DRM_FORMAT_ABGR4444:
case DRM_FORMAT_RGBA4444:
case DRM_FORMAT_BGRA4444:
case DRM_FORMAT_XRGB1555:
case DRM_FORMAT_XBGR1555:
case DRM_FORMAT_RGBX5551:
case DRM_FORMAT_BGRX5551:
case DRM_FORMAT_ARGB1555:
case DRM_FORMAT_ABGR1555:
case DRM_FORMAT_RGBA5551:
case DRM_FORMAT_BGRA5551:
case DRM_FORMAT_RGB565:
case DRM_FORMAT_BGR565:
case DRM_FORMAT_RGB888:
case DRM_FORMAT_BGR888:
case DRM_FORMAT_XRGB8888:
case DRM_FORMAT_XBGR8888:
case DRM_FORMAT_RGBX8888:
case DRM_FORMAT_BGRX8888:
case DRM_FORMAT_ARGB8888:
case DRM_FORMAT_ABGR8888:
case DRM_FORMAT_RGBA8888:
case DRM_FORMAT_BGRA8888:
case DRM_FORMAT_XRGB2101010:
case DRM_FORMAT_XBGR2101010:
case DRM_FORMAT_RGBX1010102:
case DRM_FORMAT_BGRX1010102:
case DRM_FORMAT_ARGB2101010:
case DRM_FORMAT_ABGR2101010:
case DRM_FORMAT_RGBA1010102:
case DRM_FORMAT_BGRA1010102:
case DRM_FORMAT_YUYV:
case DRM_FORMAT_YVYU:
case DRM_FORMAT_UYVY:
case DRM_FORMAT_VYUY:
plane_n = 1;
break;
case DRM_FORMAT_NV12:
case DRM_FORMAT_NV21:
case DRM_FORMAT_NV16:
case DRM_FORMAT_NV61:
plane_n = 2;
break;
case DRM_FORMAT_YUV410:
case DRM_FORMAT_YVU410:
case DRM_FORMAT_YUV411:
case DRM_FORMAT_YVU411:
case DRM_FORMAT_YUV420:
case DRM_FORMAT_YVU420:
case DRM_FORMAT_YUV422:
case DRM_FORMAT_YVU422:
case DRM_FORMAT_YUV444:
case DRM_FORMAT_YVU444:
plane_n = 3;
break;
default:
_eglError(EGL_BAD_ATTRIBUTE, "invalid format");
return 0;
}
/**
* The spec says:
*
* "* If <target> is EGL_LINUX_DMA_BUF_EXT, and the list of attributes is
* incomplete, EGL_BAD_PARAMETER is generated."
*/
for (i = 0; i < plane_n; ++i) {
if (!attrs->DMABufPlaneFds[i].IsPresent ||
!attrs->DMABufPlaneOffsets[i].IsPresent ||
!attrs->DMABufPlanePitches[i].IsPresent) {
_eglError(EGL_BAD_PARAMETER, "plane attribute(s) missing");
return 0;
}
}
/**
* The spec also says:
*
* "If <target> is EGL_LINUX_DMA_BUF_EXT, and the EGL_LINUX_DRM_FOURCC_EXT
* attribute indicates a single-plane format, EGL_BAD_ATTRIBUTE is
* generated if any of the EGL_DMA_BUF_PLANE1_* or EGL_DMA_BUF_PLANE2_*
* attributes are specified."
*/
for (i = plane_n; i < 3; ++i) {
if (attrs->DMABufPlaneFds[i].IsPresent ||
attrs->DMABufPlaneOffsets[i].IsPresent ||
attrs->DMABufPlanePitches[i].IsPresent) {
_eglError(EGL_BAD_ATTRIBUTE, "too many plane attributes");
return 0;
}
}
return plane_n;
}
/**
* The spec says:
*
* "If eglCreateImageKHR is successful for a EGL_LINUX_DMA_BUF_EXT target,
* the EGL takes ownership of the file descriptor and is responsible for
* closing it, which it may do at any time while the EGLDisplay is
* initialized."
*/
static void
dri2_take_dma_buf_ownership(const int *fds, unsigned num_fds)
{
int already_closed[num_fds];
unsigned num_closed = 0;
unsigned i, j;
for (i = 0; i < num_fds; ++i) {
/**
* The same file descriptor can be referenced multiple times in case more
* than one plane is found in the same buffer, just with a different
* offset.
*/
for (j = 0; j < num_closed; ++j) {
if (already_closed[j] == fds[i])
break;
}
if (j == num_closed) {
close(fds[i]);
already_closed[num_closed++] = fds[i];
}
}
}
static _EGLImage *
dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLImage *res;
EGLint err;
_EGLImageAttribs attrs;
__DRIimage *dri_image;
unsigned num_fds;
unsigned i;
int fds[3];
int pitches[3];
int offsets[3];
unsigned error;
/**
* The spec says:
*
* ""* If <target> is EGL_LINUX_DMA_BUF_EXT and <buffer> is not NULL, the
* error EGL_BAD_PARAMETER is generated."
*/
if (buffer != NULL) {
_eglError(EGL_BAD_PARAMETER, "buffer not NULL");
return NULL;
}
err = _eglParseImageAttribList(&attrs, disp, attr_list);
if (err != EGL_SUCCESS) {
_eglError(err, "bad attribute");
return NULL;
}
if (!dri2_check_dma_buf_attribs(&attrs))
return NULL;
num_fds = dri2_check_dma_buf_format(&attrs);
if (!num_fds)
return NULL;
for (i = 0; i < num_fds; ++i) {
fds[i] = attrs.DMABufPlaneFds[i].Value;
pitches[i] = attrs.DMABufPlanePitches[i].Value;
offsets[i] = attrs.DMABufPlaneOffsets[i].Value;
}
dri_image =
dri2_dpy->image->createImageFromDmaBufs(dri2_dpy->dri_screen,
attrs.Width, attrs.Height, attrs.DMABufFourCC.Value,
fds, num_fds, pitches, offsets,
attrs.DMABufYuvColorSpaceHint.Value,
attrs.DMABufSampleRangeHint.Value,
attrs.DMABufChromaHorizontalSiting.Value,
attrs.DMABufChromaVerticalSiting.Value,
&error,
NULL);
dri2_create_image_khr_texture_error(error);
if (!dri_image)
return EGL_NO_IMAGE_KHR;
res = dri2_create_image(disp, dri_image);
if (res)
dri2_take_dma_buf_ownership(fds, num_fds);
return res;
}
_EGLImage *
dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
@@ -1364,6 +1654,8 @@ dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
case EGL_WAYLAND_BUFFER_WL:
return dri2_create_image_wayland_wl_buffer(disp, ctx, buffer, attr_list);
#endif
case EGL_LINUX_DMA_BUF_EXT:
return dri2_create_image_dma_buf(disp, ctx, buffer, attr_list);
default:
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr");
return EGL_NO_IMAGE_KHR;
@@ -1508,8 +1800,8 @@ dri2_wl_reference_buffer(void *user_data, uint32_t name, int fd,
if (fd == -1)
img = dri2_dpy->image->createImageFromNames(dri2_dpy->dri_screen,
buffer->buffer.width,
buffer->buffer.height,
buffer->width,
buffer->height,
buffer->format,
(int*)&name, 1,
buffer->stride,
@@ -1517,8 +1809,8 @@ dri2_wl_reference_buffer(void *user_data, uint32_t name, int fd,
NULL);
else
img = dri2_dpy->image->createImageFromFds(dri2_dpy->dri_screen,
buffer->buffer.width,
buffer->buffer.height,
buffer->width,
buffer->height,
buffer->format,
&fd, 1,
buffer->stride,
@@ -1585,6 +1877,11 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
if (!dri2_dpy->wl_server_drm)
return EGL_FALSE;
/* We have to share the wl_drm instance with gbm, so gbm can convert
* wl_buffers to gbm bos. */
if (dri2_dpy->gbm_dri)
dri2_dpy->gbm_dri->wl_drm = dri2_dpy->wl_server_drm;
return EGL_TRUE;
}
@@ -1607,13 +1904,15 @@ dri2_unbind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
static EGLBoolean
dri2_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *disp,
struct wl_buffer *_buffer,
struct wl_resource *buffer_resource,
EGLint attribute, EGLint *value)
{
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct wl_drm_buffer *buffer;
const struct wl_drm_components_descriptor *format;
if (!wayland_buffer_is_drm(&buffer->buffer))
buffer = wayland_drm_buffer_get(dri2_dpy->wl_server_drm, buffer_resource);
if (!buffer)
return EGL_FALSE;
format = buffer->driver_format;
@@ -1622,10 +1921,10 @@ dri2_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *disp,
*value = format->components;
return EGL_TRUE;
case EGL_WIDTH:
*value = buffer->buffer.width;
*value = buffer->width;
return EGL_TRUE;
case EGL_HEIGHT:
*value = buffer->buffer.height;
*value = buffer->height;
return EGL_TRUE;
}

View File

@@ -37,7 +37,6 @@
#ifdef HAVE_WAYLAND_PLATFORM
#include <wayland-client.h>
#include "wayland-drm.h"
#include "wayland-egl-priv.h"
#endif
@@ -118,7 +117,8 @@ struct dri2_egl_display
__DRIdri2LoaderExtension dri2_loader_extension;
__DRIswrastLoaderExtension swrast_loader_extension;
const __DRIextension *extensions[4];
const __DRIextension *extensions[5];
const __DRIextension **driver_extensions;
#ifdef HAVE_X11_PLATFORM
xcb_connection_t *conn;
@@ -189,7 +189,6 @@ struct dri2_egl_surface
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_buffer *wl_buffer;
__DRIimage *dri_image;
int pitch, name;
#endif
#ifdef HAVE_DRM_PLATFORM
struct gbm_bo *bo;
@@ -247,7 +246,7 @@ dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data);
struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
int depth, EGLint surface_type, const EGLint *attr_list,
EGLint surface_type, const EGLint *attr_list,
const unsigned int *rgba_masks);
_EGLImage *

View File

@@ -547,14 +547,13 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
const struct {
int format;
int size;
unsigned int rgba_masks[4];
} visuals[] = {
{ HAL_PIXEL_FORMAT_RGBA_8888, 32, { 0xff, 0xff00, 0xff0000, 0xff000000 } },
{ HAL_PIXEL_FORMAT_RGBX_8888, 32, { 0xff, 0xff00, 0xff0000, 0x0 } },
{ HAL_PIXEL_FORMAT_RGB_888, 24, { 0xff, 0xff00, 0xff0000, 0x0 } },
{ HAL_PIXEL_FORMAT_RGB_565, 16, { 0xf800, 0x7e0, 0x1f, 0x0 } },
{ HAL_PIXEL_FORMAT_BGRA_8888, 32, { 0xff0000, 0xff00, 0xff, 0xff000000 } },
{ HAL_PIXEL_FORMAT_RGBA_8888, { 0xff, 0xff00, 0xff0000, 0xff000000 } },
{ HAL_PIXEL_FORMAT_RGBX_8888, { 0xff, 0xff00, 0xff0000, 0x0 } },
{ HAL_PIXEL_FORMAT_RGB_888, { 0xff, 0xff00, 0xff0000, 0x0 } },
{ HAL_PIXEL_FORMAT_RGB_565, { 0xf800, 0x7e0, 0x1f, 0x0 } },
{ HAL_PIXEL_FORMAT_BGRA_8888, { 0xff0000, 0xff00, 0xff, 0xff000000 } },
{ 0, 0, { 0, 0, 0, 0 } }
};
int count, i, j;
@@ -576,8 +575,7 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
continue;
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
count + 1, visuals[i].size, surface_type, NULL,
visuals[i].rgba_masks);
count + 1, surface_type, NULL, visuals[i].rgba_masks);
if (dri2_conf) {
dri2_conf->base.NativeVisualID = visuals[i].format;
dri2_conf->base.NativeVisualType = visuals[i].format;

View File

@@ -175,13 +175,12 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
}
static int
get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
get_back_bo(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
struct gbm_dri_bo *bo;
struct gbm_dri_surface *surf = dri2_surf->gbm_surf;
int i, name, pitch;
int i;
if (dri2_surf->back == NULL) {
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
@@ -201,6 +200,17 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
if (dri2_surf->back->bo == NULL)
return -1;
return 0;
}
static void
back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
struct gbm_dri_bo *bo;
int name, pitch;
bo = (struct gbm_dri_bo *) dri2_surf->back->bo;
dri2_dpy->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_NAME, &name);
@@ -211,8 +221,6 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
buffer->pitch = pitch;
buffer->cpp = 4;
buffer->flags = 0;
return 0;
}
static int
@@ -254,10 +262,11 @@ dri2_get_buffers_with_format(__DRIdrawable *driDrawable,
switch (attachments[i]) {
case __DRI_BUFFER_BACK_LEFT:
if (get_back_bo(dri2_surf, &dri2_surf->buffers[j]) < 0) {
if (get_back_bo(dri2_surf) < 0) {
_eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
return NULL;
}
back_bo_to_dri_buffer(dri2_surf, &dri2_surf->buffers[j]);
break;
default:
if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
@@ -312,6 +321,27 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
return buffer;
}
static int
dri_image_get_buffers(__DRIdrawable *driDrawable,
unsigned int format,
uint32_t *stamp,
void *loaderPrivate,
uint32_t buffer_mask,
struct __DRIimageList *buffers)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct gbm_dri_bo *bo;
if (get_back_bo(dri2_surf) < 0)
return 0;
bo = (struct gbm_dri_bo *) dri2_surf->back->bo;
buffers->image_mask = __DRI_IMAGE_BUFFER_BACK;
buffers->back = bo->image;
return 1;
}
static void
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
@@ -348,9 +378,8 @@ dri2_query_buffer_age(_EGLDriver *drv,
_EGLDisplay *disp, _EGLSurface *surface)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
__DRIbuffer buffer;
if (get_back_bo(dri2_surf, &buffer) < 0) {
if (get_back_bo(dri2_surf) < 0) {
_eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age");
return 0;
}
@@ -469,6 +498,7 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->gbm_dri->get_buffers = dri2_get_buffers;
dri2_dpy->gbm_dri->flush_front_buffer = dri2_flush_front_buffer;
dri2_dpy->gbm_dri->get_buffers_with_format = dri2_get_buffers_with_format;
dri2_dpy->gbm_dri->image_get_buffers = dri_image_get_buffers;
dri2_dpy->gbm_dri->base.base.surface_lock_front_buffer = lock_front_buffer;
dri2_dpy->gbm_dri->base.base.surface_release_buffer = release_buffer;
@@ -476,9 +506,28 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
dri2_setup_screen(disp);
for (i = 0; dri2_dpy->driver_configs[i]; i++)
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
EGLint format, attr_list[3];
unsigned int mask;
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[i],
__DRI_ATTRIB_RED_MASK, &mask);
if (mask == 0x3ff00000)
format = GBM_FORMAT_XRGB2101010;
else if (mask == 0x00ff0000)
format = GBM_FORMAT_XRGB8888;
else if (mask == 0xf800)
format = GBM_FORMAT_RGB565;
else
continue;
attr_list[0] = EGL_NATIVE_VISUAL_ID;
attr_list[1] = format;
attr_list[2] = EGL_NONE;
dri2_add_config(disp, dri2_dpy->driver_configs[i],
i + 1, 0, EGL_WINDOW_BIT, NULL, NULL);
i + 1, EGL_WINDOW_BIT, attr_list, NULL);
}
drv->API.CreateWindowSurface = dri2_create_window_surface;
drv->API.DestroySurface = dri2_destroy_surface;

View File

@@ -42,7 +42,8 @@
enum wl_drm_format_flags {
HAS_ARGB8888 = 1,
HAS_XRGB8888 = 2
HAS_XRGB8888 = 2,
HAS_RGB565 = 4,
};
static void
@@ -132,7 +133,9 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surf;
if (conf->AlphaSize == 0)
if (conf->RedSize == 5)
dri2_surf->format = WL_DRM_FORMAT_RGB565;
else if (conf->AlphaSize == 0)
dri2_surf->format = WL_DRM_FORMAT_XRGB8888;
else
dri2_surf->format = WL_DRM_FORMAT_ARGB8888;
@@ -254,12 +257,11 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
}
static int
get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
get_back_bo(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
__DRIimage *image;
int i, name, pitch;
int i;
/* There might be a buffer release already queued that wasn't processed */
wl_display_dispatch_queue_pending(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
@@ -292,23 +294,30 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
if (dri2_surf->back->dri_image == NULL)
return -1;
dri2_surf->back->locked = 1;
return 0;
}
static void
back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
__DRIimage *image;
int name, pitch;
image = dri2_surf->back->dri_image;
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_NAME, &name);
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &pitch);
dri2_surf->back->name = name;
dri2_surf->back->pitch = pitch;
buffer->attachment = __DRI_BUFFER_BACK_LEFT;
buffer->name = name;
buffer->pitch = pitch;
buffer->cpp = 4;
buffer->flags = 0;
dri2_surf->back->locked = 1;
return 0;
}
static int
@@ -334,16 +343,12 @@ get_aux_bo(struct dri2_egl_surface *dri2_surf,
return 0;
}
static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
static int
update_buffers(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
int i, j;
int i;
if (dri2_surf->base.Type == EGL_WINDOW_BIT &&
(dri2_surf->base.Width != dri2_surf->wl_win->width ||
@@ -357,22 +362,9 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
dri2_surf->dy = dri2_surf->wl_win->dy;
}
for (i = 0, j = 0; i < 2 * count; i += 2, j++) {
switch (attachments[i]) {
case __DRI_BUFFER_BACK_LEFT:
if (get_back_bo(dri2_surf, &dri2_surf->buffers[j]) < 0) {
_eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
return NULL;
}
break;
default:
if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
&dri2_surf->buffers[j]) < 0) {
_eglError(EGL_BAD_ALLOC, "failed to allocate aux buffer");
return NULL;
}
break;
}
if (get_back_bo(dri2_surf) < 0) {
_eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
return -1;
}
/* If we have an extra unlocked buffer at this point, we had to do triple
@@ -388,6 +380,36 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
}
}
return 0;
}
static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
int i, j;
if (update_buffers(dri2_surf) < 0)
return NULL;
for (i = 0, j = 0; i < 2 * count; i += 2, j++) {
switch (attachments[i]) {
case __DRI_BUFFER_BACK_LEFT:
back_bo_to_dri_buffer(dri2_surf, &dri2_surf->buffers[j]);
break;
default:
if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
&dri2_surf->buffers[j]) < 0) {
_eglError(EGL_BAD_ALLOC, "failed to allocate aux buffer");
return NULL;
}
break;
}
}
*out_count = j;
if (j == 0)
return NULL;
@@ -431,6 +453,25 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
return buffer;
}
static int
image_get_buffers(__DRIdrawable *driDrawable,
unsigned int format,
uint32_t *stamp,
void *loaderPrivate,
uint32_t buffer_mask,
struct __DRIimageList *buffers)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
if (update_buffers(dri2_surf) < 0)
return 0;
buffers->image_mask = __DRI_IMAGE_BUFFER_BACK;
buffers->back = dri2_surf->back->dri_image;
return 1;
}
static void
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
@@ -438,6 +479,12 @@ dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
(void) loaderPrivate;
}
static const __DRIimageLoaderExtension image_loader_extension = {
{ __DRI_IMAGE_LOADER, 1 },
image_get_buffers,
dri2_flush_front_buffer
};
static void
wayland_frame_callback(void *data, struct wl_callback *callback, uint32_t time)
{
@@ -456,7 +503,7 @@ create_wl_buffer(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
int fd;
int fd, stride, name;
if (dri2_surf->current->wl_buffer != NULL)
return;
@@ -464,6 +511,8 @@ create_wl_buffer(struct dri2_egl_surface *dri2_surf)
if (dri2_dpy->capabilities & WL_DRM_CAPABILITY_PRIME) {
dri2_dpy->image->queryImage(dri2_surf->current->dri_image,
__DRI_IMAGE_ATTRIB_FD, &fd);
dri2_dpy->image->queryImage(dri2_surf->current->dri_image,
__DRI_IMAGE_ATTRIB_STRIDE, &stride);
dri2_surf->current->wl_buffer =
wl_drm_create_prime_buffer(dri2_dpy->wl_drm,
@@ -471,17 +520,22 @@ create_wl_buffer(struct dri2_egl_surface *dri2_surf)
dri2_surf->base.Width,
dri2_surf->base.Height,
dri2_surf->format,
0, dri2_surf->current->pitch,
0, stride,
0, 0,
0, 0);
close(fd);
} else {
dri2_dpy->image->queryImage(dri2_surf->current->dri_image,
__DRI_IMAGE_ATTRIB_NAME, &name);
dri2_dpy->image->queryImage(dri2_surf->current->dri_image,
__DRI_IMAGE_ATTRIB_STRIDE, &stride);
dri2_surf->current->wl_buffer =
wl_drm_create_buffer(dri2_dpy->wl_drm,
dri2_surf->current->name,
name,
dri2_surf->base.Width,
dri2_surf->base.Height,
dri2_surf->current->pitch,
stride,
dri2_surf->format);
}
@@ -503,7 +557,8 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
__DRIbuffer buffer;
struct dri2_egl_context *dri2_ctx;
_EGLContext *ctx;
int i, ret = 0;
while (dri2_surf->frame_callback && ret != -1)
@@ -523,7 +578,7 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
/* Make sure we have a back buffer in case we're swapping without ever
* rendering. */
if (get_back_bo(dri2_surf, &buffer) < 0) {
if (get_back_bo(dri2_surf) < 0) {
_eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
return EGL_FALSE;
}
@@ -545,8 +600,8 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
dri2_surf->dy = 0;
if (n_rects == 0) {
wl_surface_damage(dri2_surf->wl_win->surface, 0, 0,
dri2_surf->base.Width, dri2_surf->base.Height);
wl_surface_damage(dri2_surf->wl_win->surface,
0, 0, INT32_MAX, INT32_MAX);
} else {
for (i = 0; i < n_rects; i++) {
const int *rect = &rects[i * 4];
@@ -557,11 +612,22 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
}
}
wl_surface_commit(dri2_surf->wl_win->surface);
if (dri2_dpy->flush->base.version >= 4) {
ctx = _eglGetCurrentContext();
dri2_ctx = dri2_egl_context(ctx);
(*dri2_dpy->flush->flush_with_flags)(dri2_ctx->dri_context,
dri2_surf->dri_drawable,
__DRI2_FLUSH_DRAWABLE,
__DRI2_THROTTLE_SWAPBUFFER);
} else {
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
}
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
wl_surface_commit(dri2_surf->wl_win->surface);
wl_display_flush(dri2_dpy->wl_dpy);
return EGL_TRUE;
}
@@ -570,9 +636,8 @@ dri2_query_buffer_age(_EGLDriver *drv,
_EGLDisplay *disp, _EGLSurface *surface)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
__DRIbuffer buffer;
if (get_back_bo(dri2_surf, &buffer) < 0) {
if (get_back_bo(dri2_surf) < 0) {
_eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age");
return 0;
}
@@ -674,6 +739,9 @@ drm_handle_format(void *data, struct wl_drm *drm, uint32_t format)
case WL_DRM_FORMAT_XRGB8888:
dri2_dpy->formats |= HAS_XRGB8888;
break;
case WL_DRM_FORMAT_RGB565:
dri2_dpy->formats |= HAS_RGB565;
break;
}
}
@@ -736,6 +804,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
static const unsigned int argb_masks[4] =
{ 0xff0000, 0xff00, 0xff, 0xff000000 };
static const unsigned int rgb_masks[4] = { 0xff0000, 0xff00, 0xff, 0 };
static const unsigned int rgb565_masks[4] = { 0xf800, 0x07e0, 0x001f, 0 };
drv->API.CreateWindowSurface = dri2_create_window_surface;
drv->API.DestroySurface = dri2_destroy_surface;
@@ -792,11 +861,12 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
dri2_get_buffers_with_format;
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
dri2_dpy->extensions[1] = &image_lookup_extension.base;
dri2_dpy->extensions[2] = &use_invalidate.base;
dri2_dpy->extensions[3] = NULL;
dri2_dpy->extensions[1] = &image_loader_extension.base;
dri2_dpy->extensions[2] = &image_lookup_extension.base;
dri2_dpy->extensions[3] = &use_invalidate.base;
dri2_dpy->extensions[4] = NULL;
if (!dri2_create_screen(disp))
goto cleanup_driver;
@@ -814,9 +884,11 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
config = dri2_dpy->driver_configs[i];
if (dri2_dpy->formats & HAS_XRGB8888)
dri2_add_config(disp, config, i + 1, 0, types, NULL, rgb_masks);
dri2_add_config(disp, config, i + 1, types, NULL, rgb_masks);
if (dri2_dpy->formats & HAS_ARGB8888)
dri2_add_config(disp, config, i + 1, 0, types, NULL, argb_masks);
dri2_add_config(disp, config, i + 1, types, NULL, argb_masks);
if (dri2_dpy->formats & HAS_RGB565)
dri2_add_config(disp, config, i + 1, types, NULL, rgb565_masks);
}
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;

View File

@@ -630,6 +630,7 @@ dri2_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
xcb_depth_iterator_t d;
xcb_visualtype_t *visuals;
int i, j, id;
unsigned int rgba_masks[4];
EGLint surface_type;
EGLint config_attrs[] = {
EGL_NATIVE_VISUAL_ID, 0,
@@ -660,8 +661,26 @@ dri2_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
config_attrs[1] = visuals[i].visual_id;
config_attrs[3] = visuals[i]._class;
rgba_masks[0] = visuals[i].red_mask;
rgba_masks[1] = visuals[i].green_mask;
rgba_masks[2] = visuals[i].blue_mask;
rgba_masks[3] = 0;
dri2_add_config(disp, dri2_dpy->driver_configs[j], id++,
d.data->depth, surface_type, config_attrs, NULL);
surface_type, config_attrs, rgba_masks);
/* Allow a 24-bit RGB visual to match a 32-bit RGBA EGLConfig.
* Otherwise it will only match a 32-bit RGBA visual. On a
* composited window manager on X11, this will make all of the
* EGLConfigs with destination alpha get blended by the
* compositor. This is probably not what the application
* wants... especially on drivers that only have 32-bit RGBA
* EGLConfigs! */
if (d.data->depth == 24) {
rgba_masks[3] =
~(rgba_masks[0] | rgba_masks[1] | rgba_masks[2]);
dri2_add_config(disp, dri2_dpy->driver_configs[j], id++,
surface_type, config_attrs, rgba_masks);
}
}
}
@@ -743,6 +762,20 @@ dri2_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
free(reply);
}
/* Since we aren't watching for the server's invalidate events like we're
* supposed to (due to XCB providing no mechanism for filtering the events
* the way xlib does), and SwapBuffers is a common cause of invalidate
* events, just shove one down to the driver, even though we haven't told
* the driver that we're the kind of loader that provides reliable
* invalidate events. This causes the driver to request buffers again at
* its next draw, so that we get the correct buffers if a pageflip
* happened. The driver should still be using the viewport hack to catch
* window resizes.
*/
if (dri2_dpy->flush &&
dri2_dpy->flush->base.version >= 3 && dri2_dpy->flush->invalidate)
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
return swap_count;
}

View File

@@ -22,7 +22,8 @@
AM_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/egl/main \
$(X11_CFLAGS) \
$(VISIBILITY_CFLAGS) \
$(X11_INCLUDES) \
$(DEFINES)
noinst_LTLIBRARIES = libegl_glx.la

View File

@@ -19,8 +19,6 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
GLAPI_LIB = ../mapi/glapi/libglapi.la
if HAVE_XF86VIDMODE
EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE
endif
@@ -29,6 +27,7 @@ AM_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gbm/main \
$(DEFINES) \
$(VISIBILITY_CFLAGS) \
$(EGL_CFLAGS) \
-D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
-D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\" \
@@ -74,7 +73,7 @@ libEGL_la_SOURCES = \
libEGL_la_LIBADD = \
$(EGL_LIB_DEPS)
libEGL_la_LDFLAGS = -version-number 1:0 -no-undefined
libEGL_la_LDFLAGS = -Wl,-Bsymbolic -version-number 1:0 -no-undefined
if HAVE_EGL_PLATFORM_X11
AM_CFLAGS += -DHAVE_X11_PLATFORM
@@ -106,7 +105,7 @@ endif
if HAVE_EGL_DRIVER_GLX
AM_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX
libEGL_la_LIBADD += ../drivers/glx/libegl_glx.la
libEGL_la_LIBADD += $(X11_LIBS) $(DLOPEN_LIBS)
libEGL_la_LIBADD += $(DLOPEN_LIBS)
endif
if HAVE_EGL_DRIVER_DRI2

View File

@@ -1344,6 +1344,11 @@ eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR);
if (!context && ctx != EGL_NO_CONTEXT)
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR);
/* "If <target> is EGL_LINUX_DMA_BUF_EXT, <dpy> must be a valid display,
* <ctx> must be EGL_NO_CONTEXT..."
*/
if (ctx != EGL_NO_CONTEXT && target == EGL_LINUX_DMA_BUF_EXT)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
img = drv->API.CreateImageKHR(drv,
disp, context, target, buffer, attr_list);
@@ -1571,7 +1576,7 @@ eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
}
EGLBoolean EGLAPIENTRY
eglQueryWaylandBufferWL(EGLDisplay dpy,struct wl_buffer *buffer,
eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer,
EGLint attribute, EGLint *value)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);

View File

@@ -123,7 +123,7 @@ typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _
struct wl_display;
typedef EGLBoolean (*BindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
typedef EGLBoolean (*UnbindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
typedef EGLBoolean (*QueryWaylandBufferWL_t)(_EGLDriver *drv, _EGLDisplay *displ, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
typedef EGLBoolean (*QueryWaylandBufferWL_t)(_EGLDriver *drv, _EGLDisplay *displ, struct wl_resource *buffer, EGLint attribute, EGLint *value);
#endif
typedef EGLBoolean (*PostSubBufferNV_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface, EGLint x, EGLint y, EGLint width, EGLint height);

View File

@@ -116,6 +116,7 @@ struct _egl_extensions
EGLBoolean EXT_create_context_robustness;
EGLBoolean EXT_buffer_age;
EGLBoolean EXT_swap_buffers_with_damage;
EGLBoolean EXT_image_dma_buf_import;
};

View File

@@ -93,6 +93,82 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
attrs->PlaneWL = val;
break;
case EGL_LINUX_DRM_FOURCC_EXT:
attrs->DMABufFourCC.Value = val;
attrs->DMABufFourCC.IsPresent = EGL_TRUE;
break;
case EGL_DMA_BUF_PLANE0_FD_EXT:
attrs->DMABufPlaneFds[0].Value = val;
attrs->DMABufPlaneFds[0].IsPresent = EGL_TRUE;
break;
case EGL_DMA_BUF_PLANE0_OFFSET_EXT:
attrs->DMABufPlaneOffsets[0].Value = val;
attrs->DMABufPlaneOffsets[0].IsPresent = EGL_TRUE;
break;
case EGL_DMA_BUF_PLANE0_PITCH_EXT:
attrs->DMABufPlanePitches[0].Value = val;
attrs->DMABufPlanePitches[0].IsPresent = EGL_TRUE;
break;
case EGL_DMA_BUF_PLANE1_FD_EXT:
attrs->DMABufPlaneFds[1].Value = val;
attrs->DMABufPlaneFds[1].IsPresent = EGL_TRUE;
break;
case EGL_DMA_BUF_PLANE1_OFFSET_EXT:
attrs->DMABufPlaneOffsets[1].Value = val;
attrs->DMABufPlaneOffsets[1].IsPresent = EGL_TRUE;
break;
case EGL_DMA_BUF_PLANE1_PITCH_EXT:
attrs->DMABufPlanePitches[1].Value = val;
attrs->DMABufPlanePitches[1].IsPresent = EGL_TRUE;
break;
case EGL_DMA_BUF_PLANE2_FD_EXT:
attrs->DMABufPlaneFds[2].Value = val;
attrs->DMABufPlaneFds[2].IsPresent = EGL_TRUE;
break;
case EGL_DMA_BUF_PLANE2_OFFSET_EXT:
attrs->DMABufPlaneOffsets[2].Value = val;
attrs->DMABufPlaneOffsets[2].IsPresent = EGL_TRUE;
break;
case EGL_DMA_BUF_PLANE2_PITCH_EXT:
attrs->DMABufPlanePitches[2].Value = val;
attrs->DMABufPlanePitches[2].IsPresent = EGL_TRUE;
break;
case EGL_YUV_COLOR_SPACE_HINT_EXT:
if (val != EGL_ITU_REC601_EXT && val != EGL_ITU_REC709_EXT &&
val != EGL_ITU_REC2020_EXT) {
err = EGL_BAD_ATTRIBUTE;
} else {
attrs->DMABufYuvColorSpaceHint.Value = val;
attrs->DMABufYuvColorSpaceHint.IsPresent = EGL_TRUE;
}
break;
case EGL_SAMPLE_RANGE_HINT_EXT:
if (val != EGL_YUV_FULL_RANGE_EXT && val != EGL_YUV_NARROW_RANGE_EXT) {
err = EGL_BAD_ATTRIBUTE;
} else {
attrs->DMABufSampleRangeHint.Value = val;
attrs->DMABufSampleRangeHint.IsPresent = EGL_TRUE;
}
break;
case EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT:
if (val != EGL_YUV_CHROMA_SITING_0_EXT &&
val != EGL_YUV_CHROMA_SITING_0_5_EXT) {
err = EGL_BAD_ATTRIBUTE;
} else {
attrs->DMABufChromaHorizontalSiting.Value = val;
attrs->DMABufChromaHorizontalSiting.IsPresent = EGL_TRUE;
}
break;
case EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT:
if (val != EGL_YUV_CHROMA_SITING_0_EXT &&
val != EGL_YUV_CHROMA_SITING_0_5_EXT) {
err = EGL_BAD_ATTRIBUTE;
} else {
attrs->DMABufChromaVerticalSiting.Value = val;
attrs->DMABufChromaVerticalSiting.IsPresent = EGL_TRUE;
}
break;
default:
/* unknown attrs are ignored */
break;

View File

@@ -34,6 +34,11 @@
#include "egltypedefs.h"
#include "egldisplay.h"
struct _egl_image_attrib_int
{
EGLint Value;
EGLBoolean IsPresent;
};
struct _egl_image_attribs
{
@@ -53,6 +58,16 @@ struct _egl_image_attribs
/* EGL_WL_bind_wayland_display */
EGLint PlaneWL;
/* EGL_EXT_image_dma_buf_import */
struct _egl_image_attrib_int DMABufFourCC;
struct _egl_image_attrib_int DMABufPlaneFds[3];
struct _egl_image_attrib_int DMABufPlaneOffsets[3];
struct _egl_image_attrib_int DMABufPlanePitches[3];
struct _egl_image_attrib_int DMABufYuvColorSpaceHint;
struct _egl_image_attrib_int DMABufSampleRangeHint;
struct _egl_image_attrib_int DMABufChromaHorizontalSiting;
struct _egl_image_attrib_int DMABufChromaVerticalSiting;
};
/**

View File

@@ -118,6 +118,7 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(EXT_create_context_robustness);
_EGL_CHECK_EXTENSION(EXT_buffer_age);
_EGL_CHECK_EXTENSION(EXT_swap_buffers_with_damage);
_EGL_CHECK_EXTENSION(EXT_image_dma_buf_import);
_EGL_CHECK_EXTENSION(NV_post_sub_buffer);
#undef _EGL_CHECK_EXTENSION

View File

@@ -1,6 +1,7 @@
AM_CFLAGS = -I$(top_srcdir)/src/egl/main \
-I$(top_srcdir)/include \
$(DEFINES) \
$(VISIBILITY_CFLAGS) \
$(WAYLAND_CFLAGS)
noinst_LTLIBRARIES = libwayland-drm.la

View File

@@ -37,14 +37,19 @@
#include "wayland-drm.h"
#include "wayland-drm-server-protocol.h"
#define MIN(x,y) (((x)<(y))?(x):(y))
struct wl_drm {
struct wl_display *display;
struct wl_global *wl_drm_global;
void *user_data;
char *device_name;
uint32_t flags;
struct wayland_drm_callbacks *callbacks;
struct wl_buffer_interface buffer_interface;
};
static void
@@ -63,10 +68,6 @@ buffer_destroy(struct wl_client *client, struct wl_resource *resource)
wl_resource_destroy(resource);
}
const static struct wl_buffer_interface drm_buffer_interface = {
buffer_destroy
};
static void
create_buffer(struct wl_client *client, struct wl_resource *resource,
uint32_t id, uint32_t name, int fd,
@@ -86,8 +87,8 @@ create_buffer(struct wl_client *client, struct wl_resource *resource,
}
buffer->drm = drm;
buffer->buffer.width = width;
buffer->buffer.height = height;
buffer->width = width;
buffer->height = height;
buffer->format = format;
buffer->offset[0] = offset0;
buffer->stride[0] = stride0;
@@ -104,16 +105,17 @@ create_buffer(struct wl_client *client, struct wl_resource *resource,
return;
}
buffer->buffer.resource.object.id = id;
buffer->buffer.resource.object.interface = &wl_buffer_interface;
buffer->buffer.resource.object.implementation =
(void (**)(void)) &drm_buffer_interface;
buffer->buffer.resource.data = buffer;
buffer->resource =
wl_resource_create(client, &wl_buffer_interface, 1, id);
if (!buffer->resource) {
wl_resource_post_no_memory(resource);
free(buffer);
return;
}
buffer->buffer.resource.destroy = destroy_buffer;
buffer->buffer.resource.client = resource->client;
wl_client_add_resource(resource->client, &buffer->buffer.resource);
wl_resource_set_implementation(buffer->resource,
(void (**)(void)) &drm->buffer_interface,
buffer, destroy_buffer);
}
static void
@@ -125,6 +127,7 @@ drm_create_buffer(struct wl_client *client, struct wl_resource *resource,
case WL_DRM_FORMAT_ARGB8888:
case WL_DRM_FORMAT_XRGB8888:
case WL_DRM_FORMAT_YUYV:
case WL_DRM_FORMAT_RGB565:
break;
default:
wl_resource_post_error(resource,
@@ -208,13 +211,22 @@ bind_drm(struct wl_client *client, void *data, uint32_t version, uint32_t id)
struct wl_resource *resource;
uint32_t capabilities;
resource = wl_client_add_object(client, &wl_drm_interface,
&drm_interface, id, data);
resource = wl_resource_create(client, &wl_drm_interface,
MIN(version, 2), id);
if (!resource) {
wl_client_post_no_memory(client);
return;
}
wl_resource_set_implementation(resource, &drm_interface, data, NULL);
wl_resource_post_event(resource, WL_DRM_DEVICE, drm->device_name);
wl_resource_post_event(resource, WL_DRM_FORMAT,
WL_DRM_FORMAT_ARGB8888);
wl_resource_post_event(resource, WL_DRM_FORMAT,
WL_DRM_FORMAT_XRGB8888);
wl_resource_post_event(resource, WL_DRM_FORMAT,
WL_DRM_FORMAT_RGB565);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV410);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV411);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV420);
@@ -232,6 +244,19 @@ bind_drm(struct wl_client *client, void *data, uint32_t version, uint32_t id)
wl_resource_post_event(resource, WL_DRM_CAPABILITIES, capabilities);
}
struct wl_drm_buffer *
wayland_drm_buffer_get(struct wl_drm *drm, struct wl_resource *resource)
{
if (resource == NULL)
return NULL;
if (wl_resource_instance_of(resource, &wl_buffer_interface,
&drm->buffer_interface))
return wl_resource_get_user_data(resource);
else
return NULL;
}
struct wl_drm *
wayland_drm_init(struct wl_display *display, char *device_name,
struct wayland_drm_callbacks *callbacks, void *user_data,
@@ -247,7 +272,11 @@ wayland_drm_init(struct wl_display *display, char *device_name,
drm->user_data = user_data;
drm->flags = flags;
wl_display_add_global(display, &wl_drm_interface, drm, bind_drm);
drm->buffer_interface.destroy = buffer_destroy;
drm->wl_drm_global =
wl_global_create(display, &wl_drm_interface, 2,
drm, bind_drm);
return drm;
}
@@ -257,30 +286,19 @@ wayland_drm_uninit(struct wl_drm *drm)
{
free(drm->device_name);
/* FIXME: need wl_display_del_{object,global} */
wl_global_destroy(drm->wl_drm_global);
free(drm);
}
int
wayland_buffer_is_drm(struct wl_buffer *buffer)
{
return buffer->resource.object.implementation ==
(void (**)(void)) &drm_buffer_interface;
}
uint32_t
wayland_drm_buffer_get_format(struct wl_buffer *buffer_base)
wayland_drm_buffer_get_format(struct wl_drm_buffer *buffer)
{
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) buffer_base;
return buffer->format;
}
void *
wayland_drm_buffer_get_buffer(struct wl_buffer *buffer_base)
wayland_drm_buffer_get_buffer(struct wl_drm_buffer *buffer)
{
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) buffer_base;
return buffer->driver_buffer;
}

View File

@@ -70,8 +70,9 @@ enum wl_drm_format {
struct wl_drm;
struct wl_drm_buffer {
struct wl_buffer buffer;
struct wl_resource *resource;
struct wl_drm *drm;
int32_t width, height;
uint32_t format;
const void *driver_format;
int32_t offset[3];
@@ -90,6 +91,9 @@ struct wayland_drm_callbacks {
enum { WAYLAND_DRM_PRIME = 0x01 };
struct wl_drm_buffer *
wayland_drm_buffer_get(struct wl_drm *drm, struct wl_resource *resource);
struct wl_drm *
wayland_drm_init(struct wl_display *display, char *device_name,
struct wayland_drm_callbacks *callbacks, void *user_data,
@@ -98,13 +102,10 @@ wayland_drm_init(struct wl_display *display, char *device_name,
void
wayland_drm_uninit(struct wl_drm *drm);
int
wayland_buffer_is_drm(struct wl_buffer *buffer);
uint32_t
wayland_drm_buffer_get_format(struct wl_buffer *buffer_base);
wayland_drm_buffer_get_format(struct wl_drm_buffer *buffer);
void *
wayland_drm_buffer_get_buffer(struct wl_buffer *buffer);
wayland_drm_buffer_get_buffer(struct wl_drm_buffer *buffer);
#endif

View File

@@ -2,6 +2,7 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = wayland-egl.pc
AM_CFLAGS = $(DEFINES) \
$(VISIBILITY_CFLAGS) \
$(WAYLAND_CFLAGS)
lib_LTLIBRARIES = libwayland-egl.la

View File

@@ -6,5 +6,6 @@ includedir=@includedir@
Name: wayland-egl
Description: Mesa wayland-egl library
Version: @VERSION@
Requires: wayland-client
Libs: -L${libdir} -lwayland-egl
Cflags: -I${includedir}

View File

@@ -48,10 +48,7 @@ endif
ifneq ($(filter nouveau, $(MESA_GPU_DRIVERS)),)
SUBDIRS += \
winsys/nouveau/drm \
drivers/nouveau \
drivers/nvfx \
drivers/nv50 \
drivers/nvc0
drivers/nouveau
endif
# r300g/r600g/radeonsi

View File

@@ -45,9 +45,6 @@ if not env['embedded']:
if env['dri']:
SConscript('state_trackers/dri/SConscript')
if env['dri'] and env['xorg']:
SConscript('state_trackers/xorg/SConscript')
if env['platform'] == 'windows':
SConscript('state_trackers/wgl/SConscript')
@@ -122,6 +119,7 @@ if not env['embedded']:
if env['platform'] == 'haiku':
SConscript([
'targets/haiku-softpipe/SConscript',
'targets/libgl-haiku/SConscript',
])
if env['dri']:
@@ -135,11 +133,6 @@ if not env['embedded']:
'targets/dri-i915/SConscript',
])
if env['xorg'] and env['drm']:
SConscript([
#'targets/xorg-i915/SConscript',
])
#
# Unit tests & tools

View File

@@ -25,12 +25,6 @@ AM_CXXFLAGS += \
$(GALLIUM_CFLAGS) \
$(LLVM_CXXFLAGS)
if LLVM_NEEDS_FNORTTI
AM_CXXFLAGS += -fno-rtti
endif
libgallium_la_SOURCES += \
$(GALLIVM_SOURCES) \
$(GALLIVM_CPP_SOURCES)
@@ -38,13 +32,17 @@ libgallium_la_SOURCES += \
endif
indices/u_indices_gen.c: $(srcdir)/indices/u_indices_gen.py
$(MKDIR_P) indices
$(AM_V_GEN) $(PYTHON2) $< > $@
indices/u_unfilled_gen.c: $(srcdir)/indices/u_unfilled_gen.py
$(MKDIR_P) indices
$(AM_V_GEN) $(PYTHON2) $< > $@
util/u_format_srgb.c: $(srcdir)/util/u_format_srgb.py
$(MKDIR_P) util
$(AM_V_GEN) $(PYTHON2) $< > $@
util/u_format_table.c: $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format_pack.py $(srcdir)/util/u_format_parse.py $(srcdir)/util/u_format.csv
$(MKDIR_P) util
$(AM_V_GEN) $(PYTHON2) $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format.csv > $@

View File

@@ -43,6 +43,7 @@ C_SOURCES := \
hud/hud_cpu.c \
hud/hud_fps.c \
hud/hud_driver_query.c \
indices/u_primconvert.c \
os/os_misc.c \
os/os_process.c \
os/os_time.c \

View File

@@ -304,16 +304,28 @@ void cso_release_all( struct cso_context *ctx )
if (ctx->pipe) {
ctx->pipe->bind_blend_state( ctx->pipe, NULL );
ctx->pipe->bind_rasterizer_state( ctx->pipe, NULL );
ctx->pipe->bind_fragment_sampler_states( ctx->pipe, 0, NULL );
if (ctx->pipe->bind_vertex_sampler_states)
ctx->pipe->bind_vertex_sampler_states(ctx->pipe, 0, NULL);
{
static struct pipe_sampler_view *views[PIPE_MAX_SAMPLERS] = { NULL };
static void *zeros[PIPE_MAX_SAMPLERS] = { NULL };
struct pipe_screen *scr = ctx->pipe->screen;
unsigned sh;
for (sh = 0; sh < PIPE_SHADER_TYPES; sh++) {
int max = scr->get_shader_param(scr, sh,
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS);
assert(max <= PIPE_MAX_SAMPLERS);
if (max > 0) {
ctx->pipe->bind_sampler_states(ctx->pipe, sh, 0, max, zeros);
ctx->pipe->set_sampler_views(ctx->pipe, sh, 0, max, views);
}
}
}
ctx->pipe->bind_depth_stencil_alpha_state( ctx->pipe, NULL );
ctx->pipe->bind_fs_state( ctx->pipe, NULL );
ctx->pipe->bind_vs_state( ctx->pipe, NULL );
ctx->pipe->bind_vertex_elements_state( ctx->pipe, NULL );
ctx->pipe->set_fragment_sampler_views(ctx->pipe, 0, NULL);
if (ctx->pipe->set_vertex_sampler_views)
ctx->pipe->set_vertex_sampler_views(ctx->pipe, 0, NULL);
if (ctx->pipe->set_stream_output_targets)
ctx->pipe->set_stream_output_targets(ctx->pipe, 0, NULL, 0);
}
@@ -1077,27 +1089,17 @@ single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
memcpy(info->hw.samplers,
info->samplers,
info->nr_samplers * sizeof(void *));
info->hw.nr_samplers = info->nr_samplers;
switch (shader_stage) {
case PIPE_SHADER_FRAGMENT:
ctx->pipe->bind_fragment_sampler_states(ctx->pipe,
info->nr_samplers,
info->samplers);
break;
case PIPE_SHADER_VERTEX:
ctx->pipe->bind_vertex_sampler_states(ctx->pipe,
info->nr_samplers,
info->samplers);
break;
case PIPE_SHADER_GEOMETRY:
ctx->pipe->bind_geometry_sampler_states(ctx->pipe,
info->nr_samplers,
info->samplers);
break;
default:
assert(!"bad shader type in single_sampler_done()");
}
/* set remaining slots/pointers to null */
for (i = info->nr_samplers; i < info->hw.nr_samplers; i++)
info->samplers[i] = NULL;
ctx->pipe->bind_sampler_states(ctx->pipe, shader_stage, 0,
MAX2(info->nr_samplers,
info->hw.nr_samplers),
info->samplers);
info->hw.nr_samplers = info->nr_samplers;
}
}
@@ -1183,19 +1185,8 @@ cso_set_sampler_views(struct cso_context *ctx,
info->nr_views = count;
/* bind the new sampler views */
switch (shader_stage) {
case PIPE_SHADER_FRAGMENT:
ctx->pipe->set_fragment_sampler_views(ctx->pipe, count, info->views);
break;
case PIPE_SHADER_VERTEX:
ctx->pipe->set_vertex_sampler_views(ctx->pipe, count, info->views);
break;
case PIPE_SHADER_GEOMETRY:
ctx->pipe->set_geometry_sampler_views(ctx->pipe, count, info->views);
break;
default:
assert(!"bad shader type in cso_set_sampler_views()");
}
ctx->pipe->set_sampler_views(ctx->pipe, shader_stage, 0, count,
info->views);
}
@@ -1219,6 +1210,7 @@ cso_restore_sampler_views(struct cso_context *ctx, unsigned shader_stage)
{
struct sampler_info *info = &ctx->samplers[shader_stage];
unsigned i, nr_saved = info->nr_views_saved;
unsigned num;
for (i = 0; i < nr_saved; i++) {
pipe_sampler_view_reference(&info->views[i], NULL);
@@ -1230,20 +1222,10 @@ cso_restore_sampler_views(struct cso_context *ctx, unsigned shader_stage)
pipe_sampler_view_reference(&info->views[i], NULL);
}
num = MAX2(info->nr_views, nr_saved);
/* bind the old/saved sampler views */
switch (shader_stage) {
case PIPE_SHADER_FRAGMENT:
ctx->pipe->set_fragment_sampler_views(ctx->pipe, nr_saved, info->views);
break;
case PIPE_SHADER_VERTEX:
ctx->pipe->set_vertex_sampler_views(ctx->pipe, nr_saved, info->views);
break;
case PIPE_SHADER_GEOMETRY:
ctx->pipe->set_geometry_sampler_views(ctx->pipe, nr_saved, info->views);
break;
default:
assert(!"bad shader type in cso_restore_sampler_views()");
}
ctx->pipe->set_sampler_views(ctx->pipe, shader_stage, 0, num, info->views);
info->nr_views = nr_saved;
info->nr_views_saved = 0;

View File

@@ -140,7 +140,7 @@ static boolean TAG(do_cliptest)( struct pt_post_vs *pvs,
clipdist = out->data[cd[0]][i];
else
clipdist = out->data[cd[1]][i-4];
if (clipdist < 0)
if (clipdist < 0 || util_is_inf_or_nan(clipdist))
mask |= 1 << plane_idx;
} else {
if (dot4(clipvertex, plane[plane_idx]) < 0)

View File

@@ -38,7 +38,10 @@
#include "util/u_inlines.h"
#include "util/u_helpers.h"
#include "util/u_prim.h"
#include "util/u_format.h"
#include "draw_context.h"
#include "draw_pipe.h"
#include "draw_prim_assembler.h"
#include "draw_vs.h"
#include "draw_gs.h"
@@ -58,7 +61,7 @@ draw_get_option_use_llvm(void)
#ifdef PIPE_ARCH_X86
util_cpu_detect();
/* require SSE2 due to LLVM PR6960. */
/* require SSE2 due to LLVM PR6960. XXX Might be fixed by now? */
if (!util_cpu_caps.has_sse2)
value = FALSE;
#endif
@@ -78,6 +81,9 @@ draw_create_context(struct pipe_context *pipe, boolean try_llvm)
if (draw == NULL)
goto err_out;
/* we need correct cpu caps for disabling denorms in draw_vbo() */
util_cpu_detect();
#if HAVE_LLVM
if (try_llvm && draw_get_option_use_llvm()) {
draw->llvm = draw_llvm_create(draw);
@@ -91,6 +97,10 @@ draw_create_context(struct pipe_context *pipe, boolean try_llvm)
if (!draw_init(draw))
goto err_destroy;
draw->ia = draw_prim_assembler_create(draw);
if (!draw->ia)
goto err_destroy;
return draw;
err_destroy:
@@ -155,6 +165,8 @@ boolean draw_init(struct draw_context *draw)
draw->quads_always_flatshade_last = !draw->pipe->screen->get_param(
draw->pipe->screen, PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION);
draw->floating_point_depth = false;
return TRUE;
}
@@ -202,6 +214,7 @@ void draw_destroy( struct draw_context *draw )
draw->render->destroy( draw->render );
*/
draw_prim_assembler_destroy(draw->ia);
draw_pipeline_destroy( draw );
draw_pt_destroy( draw );
draw_vs_destroy( draw );
@@ -223,15 +236,20 @@ void draw_flush( struct draw_context *draw )
/**
* Specify the Minimum Resolvable Depth factor for polygon offset.
* Specify the depth stencil format for the draw pipeline. This function
* determines the Minimum Resolvable Depth factor for polygon offset.
* This factor potentially depends on the number of Z buffer bits,
* the rasterization algorithm and the arithmetic performed on Z
* values between vertex shading and rasterization. It will vary
* from one driver to another.
* values between vertex shading and rasterization.
*/
void draw_set_mrd(struct draw_context *draw, double mrd)
void draw_set_zs_format(struct draw_context *draw, enum pipe_format format)
{
draw->mrd = mrd;
const struct util_format_description *desc = util_format_description(format);
draw->floating_point_depth =
(util_get_depth_format_type(desc) == UTIL_FORMAT_TYPE_FLOAT);
draw->mrd = util_get_depth_format_mrd(desc);
}
@@ -537,6 +555,28 @@ draw_get_shader_info(const struct draw_context *draw)
}
}
/**
* Prepare outputs slots from the draw module
*
* Certain parts of the draw module can emit additional
* outputs that can be quite useful to the backends, a good
* example of it is the process of decomposing primitives
* into wireframes (aka. lines) which normally would lose
* the face-side information, but using this method we can
* inject another shader output which passes the original
* face side information to the backend.
*/
void
draw_prepare_shader_outputs(struct draw_context *draw)
{
draw_remove_extra_vertex_attribs(draw);
draw_prim_assembler_prepare_outputs(draw->ia);
draw_unfilled_prepare_outputs(draw, draw->pipeline.unfilled);
if (draw->pipeline.aapoint)
draw_aapoint_prepare_outputs(draw, draw->pipeline.aapoint);
if (draw->pipeline.aaline)
draw_aaline_prepare_outputs(draw, draw->pipeline.aaline);
}
/**
* Ask the draw module for the location/slot of the given vertex attribute in
@@ -601,6 +641,40 @@ draw_num_shader_outputs(const struct draw_context *draw)
}
/**
* Return total number of the vertex shader outputs. This function
* also counts any extra vertex output attributes that may
* be filled in by some draw stages (such as AA point, AA line,
* front face).
*/
uint
draw_total_vs_outputs(const struct draw_context *draw)
{
const struct tgsi_shader_info *info = &draw->vs.vertex_shader->info;
return info->num_outputs + draw->extra_shader_outputs.num;;
}
/**
* Return total number of the geometry shader outputs. This function
* also counts any extra geometry output attributes that may
* be filled in by some draw stages (such as AA point, AA line, front
* face).
*/
uint
draw_total_gs_outputs(const struct draw_context *draw)
{
const struct tgsi_shader_info *info;
if (!draw->gs.geometry_shader)
return 0;
info = &draw->gs.geometry_shader->info;
return info->num_outputs + draw->extra_shader_outputs.num;
}
/**
* Provide TGSI sampler objects for vertex/geometry shaders that use
* texture fetches. This state only needs to be set once per context.
@@ -970,3 +1044,29 @@ draw_stats_clipper_primitives(struct draw_context *draw,
}
}
}
/**
* Returns true if the draw module will inject the frontface
* info into the outputs.
*
* Given the specified primitive and rasterizer state
* the function will figure out if the draw module
* will inject the front-face information into shader
* outputs. This is done to preserve the front-facing
* info when decomposing primitives into wireframes.
*/
boolean
draw_will_inject_frontface(const struct draw_context *draw)
{
unsigned reduced_prim = u_reduced_prim(draw->pt.prim);
const struct pipe_rasterizer_state *rast = draw->rasterizer;
if (reduced_prim != PIPE_PRIM_TRIANGLES) {
return FALSE;
}
return (rast &&
(rast->fill_front != PIPE_POLYGON_MODE_FILL ||
rast->fill_back != PIPE_POLYGON_MODE_FILL));
}

View File

@@ -111,7 +111,7 @@ void draw_enable_line_stipple(struct draw_context *draw, boolean enable);
void draw_enable_point_sprites(struct draw_context *draw, boolean enable);
void draw_set_mrd(struct draw_context *draw, double mrd);
void draw_set_zs_format(struct draw_context *draw, enum pipe_format format);
boolean
draw_install_aaline_stage(struct draw_context *draw, struct pipe_context *pipe);
@@ -126,13 +126,24 @@ draw_install_pstipple_stage(struct draw_context *draw, struct pipe_context *pipe
struct tgsi_shader_info *
draw_get_shader_info(const struct draw_context *draw);
void
draw_prepare_shader_outputs(struct draw_context *draw);
int
draw_find_shader_output(const struct draw_context *draw,
uint semantic_name, uint semantic_index);
boolean
draw_will_inject_frontface(const struct draw_context *draw);
uint
draw_num_shader_outputs(const struct draw_context *draw);
uint
draw_total_vs_outputs(const struct draw_context *draw);
uint
draw_total_gs_outputs(const struct draw_context *draw);
void
draw_texture_sampler(struct draw_context *draw,

View File

@@ -126,7 +126,8 @@ static void tgsi_fetch_gs_input(struct draw_geometry_shader *shader,
unsigned prim_idx)
{
struct tgsi_exec_machine *machine = shader->machine;
unsigned slot, vs_slot, i;
unsigned slot, i;
int vs_slot;
unsigned input_vertex_stride = shader->input_vertex_stride;
const float (*input_ptr)[4];
@@ -225,7 +226,8 @@ llvm_fetch_gs_input(struct draw_geometry_shader *shader,
unsigned num_vertices,
unsigned prim_idx)
{
unsigned slot, vs_slot, i;
unsigned slot, i;
int vs_slot;
unsigned input_vertex_stride = shader->input_vertex_stride;
const float (*input_ptr)[4];
float (*input_data)[6][PIPE_MAX_SHADER_INPUTS][TGSI_NUM_CHANNELS][TGSI_NUM_CHANNELS] = &shader->gs_input->data;
@@ -534,7 +536,7 @@ int draw_geometry_shader_run(struct draw_geometry_shader *shader,
{
const float (*input)[4] = (const float (*)[4])input_verts->verts->data;
unsigned input_stride = input_verts->vertex_size;
unsigned num_outputs = shader->info.num_outputs;
unsigned num_outputs = draw_total_gs_outputs(shader->draw);
unsigned vertex_size = sizeof(struct vertex_header) + num_outputs * 4 * sizeof(float);
unsigned num_input_verts = input_prim->linear ?
input_verts->count :

View File

@@ -707,15 +707,14 @@ generate_fetch(struct gallivm_state *gallivm,
if (velem->instance_divisor) {
/* Index is equal to the start instance plus the number of current
* instance divided by the divisor. In this case we compute it as:
* index = start_instance + ((instance_id - start_instance) / divisor)
* index = start_instance + (instance_id / divisor)
*/
LLVMValueRef current_instance;
index = lp_build_const_int32(gallivm, draw->start_instance);
current_instance = LLVMBuildSub(builder, instance_id, index, "");
current_instance = LLVMBuildUDiv(builder, current_instance,
current_instance = LLVMBuildUDiv(builder, instance_id,
lp_build_const_int32(gallivm, velem->instance_divisor),
"instance_divisor");
index = LLVMBuildAdd(builder, index, current_instance, "instance");
index = lp_build_uadd_overflow(gallivm, index, current_instance, &ofbit);
}
stride = lp_build_umul_overflow(gallivm, vb_stride, index, &ofbit);
@@ -978,6 +977,12 @@ convert_to_aos(struct gallivm_state *gallivm,
LLVMConstInt(LLVMInt32TypeInContext(gallivm->context),
chan, 0));
lp_build_print_value(gallivm, "val = ", out);
{
LLVMValueRef iv =
LLVMBuildBitCast(builder, out, lp_build_int_vec_type(gallivm, soa_type), "");
lp_build_print_value(gallivm, " ival = ", iv);
}
#endif
soa[chan] = out;
}
@@ -1031,6 +1036,9 @@ store_clip(struct gallivm_state *gallivm,
LLVMValueRef io_ptrs[LP_MAX_VECTOR_WIDTH / 32];
LLVMValueRef inds[LP_MAX_VECTOR_WIDTH / 32];
LLVMValueRef clip_ptrs[LP_MAX_VECTOR_WIDTH / 32];
LLVMTypeRef clip_ptr_type =
LLVMPointerType(LLVMVectorType(LLVMFloatTypeInContext(gallivm->context),
4), 0);
int i, j;
indices[0] =
@@ -1065,7 +1073,6 @@ store_clip(struct gallivm_state *gallivm,
}
for (j = 0; j < vs_type.length; j++) {
LLVMTypeRef clip_ptr_type = LLVMPointerType(LLVMVectorType(LLVMFloatTypeInContext(gallivm->context), 4), 0);
LLVMValueRef clip_ptr;
clip_ptr = LLVMBuildGEP(builder, clip_ptrs[j], indices, 2, "clipo");
@@ -1256,6 +1263,7 @@ generate_clipmask(struct draw_llvm *llvm,
if (clip_user) {
LLVMValueRef planes_ptr = draw_jit_context_planes(gallivm, context_ptr);
LLVMValueRef indices[3];
LLVMValueRef is_nan_or_inf;
/* userclip planes */
while (ucp_enable) {
@@ -1275,6 +1283,8 @@ generate_clipmask(struct draw_llvm *llvm,
clipdist = LLVMBuildLoad(builder, outputs[cd[1]][i-4], "");
}
test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, clipdist);
is_nan_or_inf = lp_build_is_inf_or_nan(gallivm, vs_type, clipdist);
test = LLVMBuildOr(builder, test, is_nan_or_inf, "");
temp = lp_build_const_int_vec(gallivm, i32_type, 1 << plane_idx);
test = LLVMBuildAnd(builder, test, temp, "");
mask = LLVMBuildOr(builder, mask, test, "");
@@ -1352,8 +1362,9 @@ clipmask_booli32(struct gallivm_state *gallivm,
static LLVMValueRef
draw_gs_llvm_fetch_input(const struct lp_build_tgsi_gs_iface *gs_iface,
struct lp_build_tgsi_context * bld_base,
boolean is_indirect,
boolean is_vindex_indirect,
LLVMValueRef vertex_index,
boolean is_aindex_indirect,
LLVMValueRef attrib_index,
LLVMValueRef swizzle_index)
{
@@ -1364,18 +1375,28 @@ draw_gs_llvm_fetch_input(const struct lp_build_tgsi_gs_iface *gs_iface,
LLVMValueRef res;
struct lp_type type = bld_base->base.type;
if (is_indirect) {
if (is_vindex_indirect || is_aindex_indirect) {
int i;
res = bld_base->base.zero;
for (i = 0; i < type.length; ++i) {
LLVMValueRef idx = lp_build_const_int32(gallivm, i);
LLVMValueRef vert_chan_index = LLVMBuildExtractElement(builder,
vertex_index, idx, "");
LLVMValueRef vert_chan_index = vertex_index;
LLVMValueRef attr_chan_index = attrib_index;
LLVMValueRef channel_vec, value;
if (is_vindex_indirect) {
vert_chan_index = LLVMBuildExtractElement(builder,
vertex_index, idx, "");
}
if (is_aindex_indirect) {
attr_chan_index = LLVMBuildExtractElement(builder,
attrib_index, idx, "");
}
indices[0] = vert_chan_index;
indices[1] = attrib_index;
indices[1] = attr_chan_index;
indices[2] = swizzle_index;
channel_vec = LLVMBuildGEP(builder, gs->input, indices, 3, "");
channel_vec = LLVMBuildLoad(builder, channel_vec, "");
value = LLVMBuildExtractElement(builder, channel_vec, idx, "");
@@ -1487,7 +1508,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
struct gallivm_state *gallivm = variant->gallivm;
LLVMContextRef context = gallivm->context;
LLVMTypeRef int32_type = LLVMInt32TypeInContext(context);
LLVMTypeRef arg_types[9];
LLVMTypeRef arg_types[10];
unsigned num_arg_types =
elts ? Elements(arg_types) : Elements(arg_types) - 1;
LLVMTypeRef func_type;
@@ -1497,6 +1518,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
struct lp_type vs_type;
LLVMValueRef end, start;
LLVMValueRef count, fetch_elts, fetch_elt_max, fetch_count;
LLVMValueRef vertex_id_offset;
LLVMValueRef stride, step, io_itr;
LLVMValueRef io_ptr, vbuffers_ptr, vb_ptr;
LLVMValueRef zero = lp_build_const_int32(gallivm, 0);
@@ -1542,6 +1564,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
arg_types[i++] = int32_type; /* stride */
arg_types[i++] = get_vb_ptr_type(variant); /* pipe_vertex_buffer's */
arg_types[i++] = int32_type; /* instance_id */
arg_types[i++] = int32_type; /* vertex_id_offset */
func_type = LLVMFunctionType(int32_type, arg_types, num_arg_types, 0);
@@ -1566,6 +1589,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
stride = LLVMGetParam(variant_func, 5 + (elts ? 1 : 0));
vb_ptr = LLVMGetParam(variant_func, 6 + (elts ? 1 : 0));
system_values.instance_id = LLVMGetParam(variant_func, 7 + (elts ? 1 : 0));
vertex_id_offset = LLVMGetParam(variant_func, 8 + (elts ? 1 : 0));
lp_build_name(context_ptr, "context");
lp_build_name(io_ptr, "io");
@@ -1573,6 +1597,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
lp_build_name(stride, "stride");
lp_build_name(vb_ptr, "vb");
lp_build_name(system_values.instance_id, "instance_id");
lp_build_name(vertex_id_offset, "vertex_id_offset");
if (elts) {
fetch_elts = LLVMGetParam(variant_func, 3);
@@ -1647,22 +1672,19 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
#endif
system_values.vertex_id = lp_build_zero(gallivm, lp_type_uint_vec(32, 32*vector_length));
for (i = 0; i < vector_length; ++i) {
LLVMValueRef true_index =
LLVMValueRef vert_index =
LLVMBuildAdd(builder,
lp_loop.counter,
lp_build_const_int32(gallivm, i), "");
true_index = LLVMBuildAdd(builder, start, true_index, "");
LLVMValueRef true_index =
LLVMBuildAdd(builder, start, vert_index, "");
LLVMValueRef vertex_id;
/* make sure we're not out of bounds which can happen
* if fetch_count % 4 != 0, because on the last iteration
* a few of the 4 vertex fetches will be out of bounds */
true_index = lp_build_min(&bld, true_index, fetch_max);
system_values.vertex_id = LLVMBuildInsertElement(
gallivm->builder,
system_values.vertex_id, true_index,
lp_build_const_int32(gallivm, i), "");
if (elts) {
LLVMValueRef fetch_ptr;
LLVMValueRef index_overflowed;
@@ -1674,7 +1696,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
index_overflowed = LLVMBuildICmp(builder, LLVMIntUGT,
true_index, fetch_elt_max,
"index_overflowed");
lp_build_if(&if_ctx, gallivm, index_overflowed);
{
/* Generate maximum possible index so that
@@ -1699,6 +1721,23 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
lp_build_endif(&if_ctx);
true_index = LLVMBuildLoad(builder, index_ptr, "true_index");
}
/* in the paths with elts vertex id has to be unaffected by the
* index bias and because indices inside our elements array have
* already had index bias applied we need to subtract it here to
* get back to the original index.
* in the linear paths vertex id has to be unaffected by the
* original start index and because we abuse the 'start' variable
* to either represent the actual start index or the index at which
* the primitive was split (we split rendering into chunks of at
* most 4095-vertices) we need to back out the original start
* index out of our vertex id here.
*/
vertex_id = LLVMBuildSub(builder, true_index, vertex_id_offset, "");
system_values.vertex_id = LLVMBuildInsertElement(
gallivm->builder,
system_values.vertex_id, vertex_id,
lp_build_const_int32(gallivm, i), "");
for (j = 0; j < draw->pt.nr_vertex_elements; ++j) {
struct pipe_vertex_element *velem = &draw->pt.vertex_element[j];
@@ -1810,6 +1849,7 @@ draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store)
key->need_edgeflags = (llvm->draw->vs.edgeflag_output ? TRUE : FALSE);
key->ucp_enable = llvm->draw->rasterizer->clip_plane_enable;
key->has_gs = llvm->draw->gs.geometry_shader != NULL;
key->num_outputs = draw_total_vs_outputs(llvm->draw);
key->pad1 = 0;
/* All variants of this shader will have the same value for
@@ -2016,31 +2056,19 @@ generate_mask_value(struct draw_gs_llvm_variant *variant,
{
struct gallivm_state *gallivm = variant->gallivm;
LLVMBuilderRef builder = gallivm->builder;
LLVMValueRef bits[16];
struct lp_type mask_type = lp_int_type(gs_type);
struct lp_type mask_elem_type = lp_elem_type(mask_type);
LLVMValueRef mask_val = lp_build_const_vec(gallivm,
mask_type,
0);
struct lp_type mask_type = lp_int_type(gs_type);
LLVMValueRef num_prims;
LLVMValueRef mask_val = lp_build_const_vec(gallivm, mask_type, 0);
unsigned i;
assert(gs_type.length <= Elements(bits));
for (i = gs_type.length; i >= 1; --i) {
int idx = i - 1;
LLVMValueRef ind = lp_build_const_int32(gallivm, i);
bits[idx] = lp_build_compare(gallivm,
mask_elem_type, PIPE_FUNC_GEQUAL,
variant->num_prims, ind);
num_prims = lp_build_broadcast(gallivm, lp_build_vec_type(gallivm, mask_type),
variant->num_prims);
for (i = 0; i <= gs_type.length; i++) {
LLVMValueRef idx = lp_build_const_int32(gallivm, i);
mask_val = LLVMBuildInsertElement(builder, mask_val, idx, idx, "");
}
for (i = 0; i < gs_type.length; ++i) {
LLVMValueRef ind = lp_build_const_int32(gallivm, i);
mask_val = LLVMBuildInsertElement(builder, mask_val, bits[i], ind, "");
}
mask_val = lp_build_compare(gallivm,
mask_type, PIPE_FUNC_NOTEQUAL,
mask_val,
lp_build_const_int_vec(gallivm, mask_type, 0));
mask_val = lp_build_compare(gallivm, mask_type,
PIPE_FUNC_GREATER, num_prims, mask_val);
return mask_val;
}
@@ -2153,6 +2181,11 @@ draw_gs_llvm_generate(struct draw_llvm *llvm,
system_values.prim_id = LLVMBuildLoad(builder, prim_id_ptr, "prim_id");;
}
if (gallivm_debug & (GALLIVM_DEBUG_TGSI | GALLIVM_DEBUG_IR)) {
tgsi_dump(tokens, 0);
draw_gs_llvm_dump_variant_key(&variant->key);
}
lp_build_tgsi_soa(variant->gallivm,
tokens,
gs_type,
@@ -2247,6 +2280,8 @@ draw_gs_llvm_make_variant_key(struct draw_llvm *llvm, char *store)
key = (struct draw_gs_llvm_variant_key *)store;
key->num_outputs = draw_total_gs_outputs(llvm->draw);
/* All variants of this shader will have the same value for
* nr_samplers. Not yet trying to compact away holes in the
* sampler array.

View File

@@ -263,7 +263,8 @@ typedef int
unsigned count,
unsigned stride,
struct pipe_vertex_buffer *vertex_buffers,
unsigned instance_id);
unsigned instance_id,
unsigned vertex_id_offset);
typedef int
@@ -275,7 +276,8 @@ typedef int
unsigned fetch_count,
unsigned stride,
struct pipe_vertex_buffer *vertex_buffers,
unsigned instance_id);
unsigned instance_id,
unsigned vertex_id_offset);
typedef int
@@ -299,12 +301,13 @@ struct draw_llvm_variant_key
unsigned bypass_viewport:1;
unsigned need_edgeflags:1;
unsigned has_gs:1;
unsigned num_outputs:8;
/*
* it is important there are no holes in this struct
* (and all padding gets zeroed).
*/
unsigned ucp_enable:PIPE_MAX_CLIP_PLANES;
unsigned pad1:32-PIPE_MAX_CLIP_PLANES;
unsigned pad1:24-PIPE_MAX_CLIP_PLANES;
/* Variable number of vertex elements:
*/
@@ -319,6 +322,7 @@ struct draw_gs_llvm_variant_key
{
unsigned nr_samplers:8;
unsigned nr_sampler_views:8;
unsigned num_outputs:8;
struct draw_sampler_static_state samplers[1];
};

View File

@@ -238,7 +238,7 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
const struct lp_derivatives *derivs,
LLVMValueRef lod_bias, /* optional */
LLVMValueRef explicit_lod, /* optional */
boolean scalar_lod,
enum lp_sampler_lod_property lod_property,
LLVMValueRef *texel)
{
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
@@ -257,7 +257,7 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
coords,
offsets,
derivs,
lod_bias, explicit_lod, scalar_lod,
lod_bias, explicit_lod, lod_property,
texel);
}
@@ -270,7 +270,9 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
struct gallivm_state *gallivm,
struct lp_type type,
unsigned texture_unit,
boolean need_nr_mips,
unsigned target,
boolean is_sviewinfo,
enum lp_sampler_lod_property lod_property,
LLVMValueRef explicit_lod, /* optional */
LLVMValueRef *sizes_out)
{
@@ -283,7 +285,9 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
&sampler->dynamic_state.base,
type,
texture_unit,
need_nr_mips,
target,
is_sviewinfo,
lod_property,
explicit_lod,
sizes_out);
}

View File

@@ -35,6 +35,7 @@
#include "pipe/p_compiler.h"
#include "draw_private.h" /* for sizeof(vertex_header) */
#include "draw_context.h"
/**
@@ -91,7 +92,6 @@ extern struct draw_stage *draw_wide_line_stage( struct draw_context *context );
extern struct draw_stage *draw_wide_point_stage( struct draw_context *context );
extern struct draw_stage *draw_validate_stage( struct draw_context *context );
extern void draw_free_temp_verts( struct draw_stage *stage );
extern boolean draw_alloc_temp_verts( struct draw_stage *stage, unsigned nr );
@@ -101,7 +101,12 @@ void draw_pipe_passthrough_tri(struct draw_stage *stage, struct prim_header *hea
void draw_pipe_passthrough_line(struct draw_stage *stage, struct prim_header *header);
void draw_pipe_passthrough_point(struct draw_stage *stage, struct prim_header *header);
void draw_aapoint_prepare_outputs(struct draw_context *context,
struct draw_stage *stage);
void draw_aaline_prepare_outputs(struct draw_context *context,
struct draw_stage *stage);
void draw_unfilled_prepare_outputs(struct draw_context *context,
struct draw_stage *stage);
/**
* Get a writeable copy of a vertex.
@@ -117,7 +122,7 @@ dup_vert( struct draw_stage *stage,
{
struct vertex_header *tmp = stage->tmp[idx];
const uint vsize = sizeof(struct vertex_header)
+ stage->draw->vs.num_vs_outputs * 4 * sizeof(float);
+ draw_num_shader_outputs(stage->draw) * 4 * sizeof(float);
memcpy(tmp, vert, vsize);
tmp->vertex_id = UNDEFINED_VERTEX_ID;
return tmp;

View File

@@ -107,7 +107,7 @@ struct aaline_stage
struct aaline_fragment_shader *fs;
struct {
void *sampler[PIPE_MAX_SAMPLERS];
struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
struct pipe_sampler_view *sampler_views[PIPE_MAX_SHADER_SAMPLER_VIEWS];
} state;
/*
@@ -118,11 +118,11 @@ struct aaline_stage
void (*driver_bind_fs_state)(struct pipe_context *, void *);
void (*driver_delete_fs_state)(struct pipe_context *, void *);
void (*driver_bind_sampler_states)(struct pipe_context *, unsigned,
void **);
void (*driver_bind_sampler_states)(struct pipe_context *, unsigned, unsigned,
unsigned, void **);
void (*driver_set_sampler_views)(struct pipe_context *,
unsigned,
void (*driver_set_sampler_views)(struct pipe_context *, unsigned shader,
unsigned start, unsigned count,
struct pipe_sampler_view **);
};
@@ -692,13 +692,7 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
return;
}
/* update vertex attrib info */
aaline->pos_slot = draw_current_shader_position_output(draw);;
/* allocate the extra post-transformed vertex attribute */
aaline->tex_slot = draw_alloc_extra_vertex_attrib(draw,
TGSI_SEMANTIC_GENERIC,
aaline->fs->generic_attrib);
draw_aaline_prepare_outputs(draw, draw->pipeline.aaline);
/* how many samplers? */
/* we'll use sampler/texture[pstip->sampler_unit] for the stipple */
@@ -710,8 +704,12 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
aaline->sampler_view);
draw->suspend_flushing = TRUE;
aaline->driver_bind_sampler_states(pipe, num_samplers, aaline->state.sampler);
aaline->driver_set_sampler_views(pipe, num_samplers, aaline->state.sampler_views);
aaline->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
num_samplers, aaline->state.sampler);
aaline->driver_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
num_samplers, aaline->state.sampler_views);
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
@@ -738,10 +736,13 @@ aaline_flush(struct draw_stage *stage, unsigned flags)
/* restore original frag shader, texture, sampler state */
draw->suspend_flushing = TRUE;
aaline->driver_bind_fs_state(pipe, aaline->fs ? aaline->fs->driver_fs : NULL);
aaline->driver_bind_sampler_states(pipe, aaline->num_samplers,
aaline->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
aaline->num_samplers,
aaline->state.sampler);
aaline->driver_set_sampler_views(pipe,
aaline->num_sampler_views,
aaline->driver_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
aaline->num_samplers,
aaline->state.sampler_views);
/* restore original rasterizer state */
@@ -769,7 +770,7 @@ aaline_destroy(struct draw_stage *stage)
struct pipe_context *pipe = stage->draw->pipe;
uint i;
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
for (i = 0; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) {
pipe_sampler_view_reference(&aaline->state.sampler_views[i], NULL);
}
@@ -790,8 +791,8 @@ aaline_destroy(struct draw_stage *stage)
pipe->bind_fs_state = aaline->driver_bind_fs_state;
pipe->delete_fs_state = aaline->driver_delete_fs_state;
pipe->bind_fragment_sampler_states = aaline->driver_bind_sampler_states;
pipe->set_fragment_sampler_views = aaline->driver_set_sampler_views;
pipe->bind_sampler_states = aaline->driver_bind_sampler_states;
pipe->set_sampler_views = aaline->driver_set_sampler_views;
FREE( stage );
}
@@ -909,27 +910,31 @@ aaline_delete_fs_state(struct pipe_context *pipe, void *fs)
static void
aaline_bind_sampler_states(struct pipe_context *pipe,
unsigned num, void **sampler)
aaline_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
unsigned start, unsigned num, void **sampler)
{
struct aaline_stage *aaline = aaline_stage_from_pipe(pipe);
assert(start == 0);
if (aaline == NULL) {
return;
}
/* save current */
memcpy(aaline->state.sampler, sampler, num * sizeof(void *));
aaline->num_samplers = num;
if (shader == PIPE_SHADER_FRAGMENT) {
/* save current */
memcpy(aaline->state.sampler, sampler, num * sizeof(void *));
aaline->num_samplers = num;
}
/* pass-through */
aaline->driver_bind_sampler_states(pipe, num, sampler);
aaline->driver_bind_sampler_states(pipe, shader, start, num, sampler);
}
static void
aaline_set_sampler_views(struct pipe_context *pipe,
unsigned num,
aaline_set_sampler_views(struct pipe_context *pipe, unsigned shader,
unsigned start, unsigned num,
struct pipe_sampler_view **views)
{
struct aaline_stage *aaline = aaline_stage_from_pipe(pipe);
@@ -939,20 +944,39 @@ aaline_set_sampler_views(struct pipe_context *pipe,
return;
}
/* save current */
for (i = 0; i < num; i++) {
pipe_sampler_view_reference(&aaline->state.sampler_views[i], views[i]);
if (shader == PIPE_SHADER_FRAGMENT) {
/* save current */
for (i = 0; i < num; i++) {
pipe_sampler_view_reference(&aaline->state.sampler_views[start + i],
views[i]);
}
aaline->num_sampler_views = num;
}
for ( ; i < PIPE_MAX_SAMPLERS; i++) {
pipe_sampler_view_reference(&aaline->state.sampler_views[i], NULL);
}
aaline->num_sampler_views = num;
/* pass-through */
aaline->driver_set_sampler_views(pipe, num, views);
aaline->driver_set_sampler_views(pipe, shader, start, num, views);
}
void
draw_aaline_prepare_outputs(struct draw_context *draw,
struct draw_stage *stage)
{
struct aaline_stage *aaline = aaline_stage(stage);
const struct pipe_rasterizer_state *rast = draw->rasterizer;
/* update vertex attrib info */
aaline->pos_slot = draw_current_shader_position_output(draw);;
if (!rast->line_smooth)
return;
/* allocate the extra post-transformed vertex attribute */
aaline->tex_slot = draw_alloc_extra_vertex_attrib(draw,
TGSI_SEMANTIC_GENERIC,
aaline->fs->generic_attrib);
}
/**
* Called by drivers that want to install this AA line prim stage
* into the draw module's pipeline. This will not be used if the
@@ -984,16 +1008,16 @@ draw_install_aaline_stage(struct draw_context *draw, struct pipe_context *pipe)
aaline->driver_bind_fs_state = pipe->bind_fs_state;
aaline->driver_delete_fs_state = pipe->delete_fs_state;
aaline->driver_bind_sampler_states = pipe->bind_fragment_sampler_states;
aaline->driver_set_sampler_views = pipe->set_fragment_sampler_views;
aaline->driver_bind_sampler_states = pipe->bind_sampler_states;
aaline->driver_set_sampler_views = pipe->set_sampler_views;
/* override the driver's functions */
pipe->create_fs_state = aaline_create_fs_state;
pipe->bind_fs_state = aaline_bind_fs_state;
pipe->delete_fs_state = aaline_delete_fs_state;
pipe->bind_fragment_sampler_states = aaline_bind_sampler_states;
pipe->set_fragment_sampler_views = aaline_set_sampler_views;
pipe->bind_sampler_states = aaline_bind_sampler_states;
pipe->set_sampler_views = aaline_set_sampler_views;
/* Install once everything is known to be OK:
*/

View File

@@ -696,28 +696,7 @@ aapoint_first_point(struct draw_stage *stage, struct prim_header *header)
*/
bind_aapoint_fragment_shader(aapoint);
/* update vertex attrib info */
aapoint->pos_slot = draw_current_shader_position_output(draw);
/* allocate the extra post-transformed vertex attribute */
aapoint->tex_slot = draw_alloc_extra_vertex_attrib(draw,
TGSI_SEMANTIC_GENERIC,
aapoint->fs->generic_attrib);
assert(aapoint->tex_slot > 0); /* output[0] is vertex pos */
/* find psize slot in post-transform vertex */
aapoint->psize_slot = -1;
if (draw->rasterizer->point_size_per_vertex) {
const struct tgsi_shader_info *info = draw_get_shader_info(draw);
uint i;
/* find PSIZ vertex output */
for (i = 0; i < info->num_outputs; i++) {
if (info->output_semantic_name[i] == TGSI_SEMANTIC_PSIZE) {
aapoint->psize_slot = i;
break;
}
}
}
draw_aapoint_prepare_outputs(draw, draw->pipeline.aapoint);
draw->suspend_flushing = TRUE;
@@ -781,6 +760,39 @@ aapoint_destroy(struct draw_stage *stage)
FREE( stage );
}
void
draw_aapoint_prepare_outputs(struct draw_context *draw,
struct draw_stage *stage)
{
struct aapoint_stage *aapoint = aapoint_stage(stage);
const struct pipe_rasterizer_state *rast = draw->rasterizer;
/* update vertex attrib info */
aapoint->pos_slot = draw_current_shader_position_output(draw);
if (!rast->point_smooth)
return;
/* allocate the extra post-transformed vertex attribute */
aapoint->tex_slot = draw_alloc_extra_vertex_attrib(draw,
TGSI_SEMANTIC_GENERIC,
aapoint->fs->generic_attrib);
assert(aapoint->tex_slot > 0); /* output[0] is vertex pos */
/* find psize slot in post-transform vertex */
aapoint->psize_slot = -1;
if (draw->rasterizer->point_size_per_vertex) {
const struct tgsi_shader_info *info = draw_get_shader_info(draw);
uint i;
/* find PSIZ vertex output */
for (i = 0; i < info->num_outputs; i++) {
if (info->output_semantic_name[i] == TGSI_SEMANTIC_PSIZE) {
aapoint->psize_slot = i;
break;
}
}
}
}
static struct aapoint_stage *
draw_aapoint_stage(struct draw_context *draw)

View File

@@ -104,7 +104,7 @@ static void interp_attr( float dst[4],
float t,
const float in[4],
const float out[4] )
{
{
dst[0] = LINTERP( t, out[0], in[0] );
dst[1] = LINTERP( t, out[1], in[1] );
dst[2] = LINTERP( t, out[2], in[2] );
@@ -136,7 +136,7 @@ static void interp( const struct clip_stage *clip,
const struct vertex_header *in,
unsigned viewport_index )
{
const unsigned nr_attrs = draw_current_shader_outputs(clip->stage.draw);
const unsigned nr_attrs = draw_num_shader_outputs(clip->stage.draw);
const unsigned pos_attr = draw_current_shader_position_output(clip->stage.draw);
const unsigned clip_attr = draw_current_shader_clipvertex_output(clip->stage.draw);
unsigned j;
@@ -209,6 +209,29 @@ static void interp( const struct clip_stage *clip,
}
}
/**
* Checks whether the specifed triangle is empty and if it is returns
* true, otherwise returns false.
* Triangle is considered null/empty if it's area is qual to zero.
*/
static INLINE boolean
is_tri_null(struct draw_context *draw, const struct prim_header *header)
{
const unsigned pos_attr = draw_current_shader_position_output(draw);
float x1 = header->v[1]->data[pos_attr][0] - header->v[0]->data[pos_attr][0];
float y1 = header->v[1]->data[pos_attr][1] - header->v[0]->data[pos_attr][1];
float z1 = header->v[1]->data[pos_attr][2] - header->v[0]->data[pos_attr][2];
float x2 = header->v[2]->data[pos_attr][0] - header->v[0]->data[pos_attr][0];
float y2 = header->v[2]->data[pos_attr][1] - header->v[0]->data[pos_attr][1];
float z2 = header->v[2]->data[pos_attr][2] - header->v[0]->data[pos_attr][2];
float vx = y1 * z2 - z1 * y2;
float vy = x1 * z2 - z1 * x2;
float vz = x1 * y2 - y1 * x2;
return (vx*vx + vy*vy + vz*vz) == 0.f;
}
/**
* Emit a post-clip polygon to the next pipeline stage. The polygon
@@ -223,6 +246,8 @@ static void emit_poly( struct draw_stage *stage,
struct prim_header header;
unsigned i;
ushort edge_first, edge_middle, edge_last;
boolean last_tri_was_null = FALSE;
boolean tri_was_not_null = FALSE;
if (stage->draw->rasterizer->flatshade_first) {
edge_first = DRAW_PIPE_EDGE_FLAG_0;
@@ -244,6 +269,7 @@ static void emit_poly( struct draw_stage *stage,
header.pad = 0;
for (i = 2; i < n; i++, header.flags = edge_middle) {
boolean tri_null;
/* order the triangle verts to respect the provoking vertex mode */
if (stage->draw->rasterizer->flatshade_first) {
header.v[0] = inlist[0]; /* the provoking vertex */
@@ -256,6 +282,19 @@ static void emit_poly( struct draw_stage *stage,
header.v[2] = inlist[0]; /* the provoking vertex */
}
tri_null = is_tri_null(stage->draw, &header);
/* If we generated a triangle with an area, aka. non-null triangle,
* or if the previous triangle was also null then skip all subsequent
* null triangles */
if ((tri_was_not_null && tri_null) || (last_tri_was_null && tri_null)) {
last_tri_was_null = tri_null;
continue;
}
last_tri_was_null = tri_null;
if (!tri_null) {
tri_was_not_null = TRUE;
}
if (!edgeflags[i-1]) {
header.flags &= ~edge_middle;
}
@@ -264,7 +303,6 @@ static void emit_poly( struct draw_stage *stage,
header.flags |= edge_last;
if (DEBUG_CLIP) {
const struct draw_vertex_shader *vs = stage->draw->vs.vertex_shader;
uint j, k;
debug_printf("Clipped tri: (flat-shade-first = %d)\n",
stage->draw->rasterizer->flatshade_first);
@@ -274,7 +312,7 @@ static void emit_poly( struct draw_stage *stage,
header.v[j]->clip[1],
header.v[j]->clip[2],
header.v[j]->clip[3]);
for (k = 0; k < vs->info.num_outputs; k++) {
for (k = 0; k < draw_num_shader_outputs(stage->draw); k++) {
debug_printf(" Vert %d: Attr %d: %f %f %f %f\n", j, k,
header.v[j]->data[k][0],
header.v[j]->data[k][1],
@@ -283,7 +321,6 @@ static void emit_poly( struct draw_stage *stage,
}
}
}
stage->next->tri( stage->next, &header );
}
}
@@ -382,6 +419,9 @@ do_clip_tri( struct draw_stage *stage,
dp_prev = getclipdist(clipper, vert_prev, plane_idx);
clipmask &= ~(1<<plane_idx);
if (util_is_inf_or_nan(dp_prev))
return; //discard nan
assert(n < MAX_CLIPPED_VERTICES);
if (n >= MAX_CLIPPED_VERTICES)
return;
@@ -394,6 +434,9 @@ do_clip_tri( struct draw_stage *stage,
float dp = getclipdist(clipper, vert, plane_idx);
if (util_is_inf_or_nan(dp))
return; //discard nan
if (!IS_NEGATIVE(dp_prev)) {
assert(outcount < MAX_CLIPPED_VERTICES);
if (outcount >= MAX_CLIPPED_VERTICES)
@@ -524,6 +567,9 @@ do_clip_line( struct draw_stage *stage,
const float dp0 = getclipdist(clipper, v0, plane_idx);
const float dp1 = getclipdist(clipper, v1, plane_idx);
if (util_is_inf_or_nan(dp0) || util_is_inf_or_nan(dp1))
return; //discard nan
if (dp1 < 0.0F) {
float t = dp1 / (dp1 - dp0);
t1 = MAX2(t1, t);
@@ -576,7 +622,7 @@ clip_line( struct draw_stage *stage,
{
unsigned clipmask = (header->v[0]->clipmask |
header->v[1]->clipmask);
if (clipmask == 0) {
/* no clipping needed */
stage->next->line( stage->next, header );
@@ -596,7 +642,7 @@ clip_tri( struct draw_stage *stage,
unsigned clipmask = (header->v[0]->clipmask |
header->v[1]->clipmask |
header->v[2]->clipmask);
if (clipmask == 0) {
/* no clipping needed */
stage->next->tri( stage->next, header );
@@ -609,6 +655,35 @@ clip_tri( struct draw_stage *stage,
}
static int
find_interp(const struct draw_fragment_shader *fs, int *indexed_interp,
uint semantic_name, uint semantic_index)
{
int interp;
/* If it's gl_{Front,Back}{,Secondary}Color, pick up the mode
* from the array we've filled before. */
if (semantic_name == TGSI_SEMANTIC_COLOR ||
semantic_name == TGSI_SEMANTIC_BCOLOR) {
interp = indexed_interp[semantic_index];
} else {
/* Otherwise, search in the FS inputs, with a decent default
* if we don't find it.
*/
uint j;
interp = TGSI_INTERPOLATE_PERSPECTIVE;
if (fs) {
for (j = 0; j < fs->info.num_inputs; j++) {
if (semantic_name == fs->info.input_semantic_name[j] &&
semantic_index == fs->info.input_semantic_index[j]) {
interp = fs->info.input_interpolate[j];
break;
}
}
}
}
return interp;
}
/* Update state. Could further delay this until we hit the first
* primitive that really requires clipping.
*/
@@ -616,11 +691,9 @@ static void
clip_init_state( struct draw_stage *stage )
{
struct clip_stage *clipper = clip_stage( stage );
const struct draw_vertex_shader *vs = stage->draw->vs.vertex_shader;
const struct draw_geometry_shader *gs = stage->draw->gs.geometry_shader;
const struct draw_fragment_shader *fs = stage->draw->fs.fragment_shader;
uint i;
const struct tgsi_shader_info *vs_info = gs ? &gs->info : &vs->info;
uint i, j;
const struct tgsi_shader_info *info = draw_get_shader_info(stage->draw);
/* We need to know for each attribute what kind of interpolation is
* done on it (flat, smooth or noperspective). But the information
@@ -663,42 +736,36 @@ clip_init_state( struct draw_stage *stage )
clipper->num_flat_attribs = 0;
memset(clipper->noperspective_attribs, 0, sizeof(clipper->noperspective_attribs));
for (i = 0; i < vs_info->num_outputs; i++) {
/* Find the interpolation mode for a specific attribute
*/
int interp;
/* If it's gl_{Front,Back}{,Secondary}Color, pick up the mode
* from the array we've filled before. */
if (vs_info->output_semantic_name[i] == TGSI_SEMANTIC_COLOR ||
vs_info->output_semantic_name[i] == TGSI_SEMANTIC_BCOLOR) {
interp = indexed_interp[vs_info->output_semantic_index[i]];
} else {
/* Otherwise, search in the FS inputs, with a decent default
* if we don't find it.
*/
uint j;
interp = TGSI_INTERPOLATE_PERSPECTIVE;
if (fs) {
for (j = 0; j < fs->info.num_inputs; j++) {
if (vs_info->output_semantic_name[i] == fs->info.input_semantic_name[j] &&
vs_info->output_semantic_index[i] == fs->info.input_semantic_index[j]) {
interp = fs->info.input_interpolate[j];
break;
}
}
}
}
for (i = 0; i < info->num_outputs; i++) {
/* Find the interpolation mode for a specific attribute */
int interp = find_interp(fs, indexed_interp,
info->output_semantic_name[i],
info->output_semantic_index[i]);
/* If it's flat, add it to the flat vector. Otherwise update
* the noperspective mask.
*/
if (interp == TGSI_INTERPOLATE_CONSTANT) {
clipper->flat_attribs[clipper->num_flat_attribs] = i;
clipper->num_flat_attribs++;
} else
clipper->noperspective_attribs[i] = interp == TGSI_INTERPOLATE_LINEAR;
}
/* Search the extra vertex attributes */
for (j = 0; j < stage->draw->extra_shader_outputs.num; j++) {
/* Find the interpolation mode for a specific attribute */
int interp = find_interp(fs, indexed_interp,
stage->draw->extra_shader_outputs.semantic_name[j],
stage->draw->extra_shader_outputs.semantic_index[j]);
/* If it's flat, add it to the flat vector. Otherwise update
* the noperspective mask.
*/
if (interp == TGSI_INTERPOLATE_CONSTANT) {
clipper->flat_attribs[clipper->num_flat_attribs] = i + j;
clipper->num_flat_attribs++;
} else
clipper->noperspective_attribs[i + j] = interp == TGSI_INTERPOLATE_LINEAR;
}
stage->tri = clip_tri;
stage->line = clip_line;

View File

@@ -32,6 +32,7 @@
* \author Brian Paul
*/
#include "util/u_format.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "draw_pipe.h"
@@ -89,7 +90,22 @@ static void do_offset_tri( struct draw_stage *stage,
float dzdx = fabsf(a * inv_det);
float dzdy = fabsf(b * inv_det);
float zoffset = offset->units + MAX2(dzdx, dzdy) * offset->scale;
float zoffset, maxz, bias, mult;
mult = MAX2(dzdx, dzdy) * offset->scale;
if (stage->draw->floating_point_depth) {
maxz = MAX3(v0[2], v1[2], v2[2]);
/**
* XXX: TODO optimize this to quickly resolve a pow2 number through
* an exponent only operation.
*/
bias = offset->units * util_fast_exp2(util_get_float32_exponent(maxz) - 23);
zoffset = bias + mult;
} else {
zoffset = offset->units + mult;
}
if (offset->clamp)
zoffset = (offset->clamp < 0.0f) ? MAX2(zoffset, offset->clamp) :
@@ -157,7 +173,17 @@ static void offset_first_tri( struct draw_stage *stage,
if (do_offset) {
offset->scale = rast->offset_scale;
offset->clamp = rast->offset_clamp;
offset->units = (float) (rast->offset_units * stage->draw->mrd);
/*
* If depth is floating point, depth bias is calculated with respect
* to the primitive's maximum Z value. Retain the original depth bias
* value until that stage.
*/
if (stage->draw->floating_point_depth) {
offset->units = (float) rast->offset_units;
} else {
offset->units = (float) (rast->offset_units * stage->draw->mrd);
}
}
else {
offset->scale = 0.0f;

View File

@@ -87,7 +87,7 @@ struct pstip_stage
struct pstip_fragment_shader *fs;
struct {
void *samplers[PIPE_MAX_SAMPLERS];
struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
struct pipe_sampler_view *sampler_views[PIPE_MAX_SHADER_SAMPLER_VIEWS];
const struct pipe_poly_stipple *stipple;
} state;
@@ -99,10 +99,12 @@ struct pstip_stage
void (*driver_bind_fs_state)(struct pipe_context *, void *);
void (*driver_delete_fs_state)(struct pipe_context *, void *);
void (*driver_bind_sampler_states)(struct pipe_context *, unsigned, void **);
void (*driver_bind_sampler_states)(struct pipe_context *, unsigned,
unsigned, unsigned, void **);
void (*driver_set_sampler_views)(struct pipe_context *,
unsigned,
unsigned shader, unsigned start,
unsigned count,
struct pipe_sampler_view **);
void (*driver_set_polygon_stipple)(struct pipe_context *,
@@ -547,8 +549,13 @@ pstip_first_tri(struct draw_stage *stage, struct prim_header *header)
assert(num_samplers <= PIPE_MAX_SAMPLERS);
draw->suspend_flushing = TRUE;
pstip->driver_bind_sampler_states(pipe, num_samplers, pstip->state.samplers);
pstip->driver_set_sampler_views(pipe, num_samplers, pstip->state.sampler_views);
pstip->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
num_samplers, pstip->state.samplers);
pstip->driver_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
num_samplers, pstip->state.sampler_views);
draw->suspend_flushing = FALSE;
/* now really draw first triangle */
@@ -570,11 +577,15 @@ pstip_flush(struct draw_stage *stage, unsigned flags)
/* restore original frag shader, texture, sampler state */
draw->suspend_flushing = TRUE;
pstip->driver_bind_fs_state(pipe, pstip->fs ? pstip->fs->driver_fs : NULL);
pstip->driver_bind_sampler_states(pipe, pstip->num_samplers,
pstip->driver_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0,
pstip->num_samplers,
pstip->state.samplers);
pstip->driver_set_sampler_views(pipe,
pstip->driver_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
pstip->num_sampler_views,
pstip->state.sampler_views);
draw->suspend_flushing = FALSE;
}
@@ -592,7 +603,7 @@ pstip_destroy(struct draw_stage *stage)
struct pstip_stage *pstip = pstip_stage(stage);
uint i;
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
for (i = 0; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) {
pipe_sampler_view_reference(&pstip->state.sampler_views[i], NULL);
}
@@ -701,44 +712,47 @@ pstip_delete_fs_state(struct pipe_context *pipe, void *fs)
static void
pstip_bind_sampler_states(struct pipe_context *pipe,
unsigned num, void **sampler)
pstip_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
unsigned start, unsigned num, void **sampler)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
uint i;
/* save current */
memcpy(pstip->state.samplers, sampler, num * sizeof(void *));
for (i = num; i < PIPE_MAX_SAMPLERS; i++) {
pstip->state.samplers[i] = NULL;
assert(start == 0);
if (shader == PIPE_SHADER_FRAGMENT) {
/* save current */
memcpy(pstip->state.samplers, sampler, num * sizeof(void *));
for (i = num; i < PIPE_MAX_SAMPLERS; i++) {
pstip->state.samplers[i] = NULL;
}
pstip->num_samplers = num;
}
pstip->num_samplers = num;
/* pass-through */
pstip->driver_bind_sampler_states(pstip->pipe, num, sampler);
pstip->driver_bind_sampler_states(pstip->pipe, shader, start, num, sampler);
}
static void
pstip_set_sampler_views(struct pipe_context *pipe,
unsigned num,
unsigned shader, unsigned start, unsigned num,
struct pipe_sampler_view **views)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
uint i;
/* save current */
for (i = 0; i < num; i++) {
pipe_sampler_view_reference(&pstip->state.sampler_views[i], views[i]);
if (shader == PIPE_SHADER_FRAGMENT) {
/* save current */
for (i = 0; i < num; i++) {
pipe_sampler_view_reference(&pstip->state.sampler_views[start + i],
views[i]);
}
pstip->num_sampler_views = num;
}
for (; i < PIPE_MAX_SAMPLERS; i++) {
pipe_sampler_view_reference(&pstip->state.sampler_views[i], NULL);
}
pstip->num_sampler_views = num;
/* pass-through */
pstip->driver_set_sampler_views(pstip->pipe, num, views);
pstip->driver_set_sampler_views(pstip->pipe, shader, start, num, views);
}
@@ -792,8 +806,8 @@ draw_install_pstipple_stage(struct draw_context *draw,
pstip->driver_bind_fs_state = pipe->bind_fs_state;
pstip->driver_delete_fs_state = pipe->delete_fs_state;
pstip->driver_bind_sampler_states = pipe->bind_fragment_sampler_states;
pstip->driver_set_sampler_views = pipe->set_fragment_sampler_views;
pstip->driver_bind_sampler_states = pipe->bind_sampler_states;
pstip->driver_set_sampler_views = pipe->set_sampler_views;
pstip->driver_set_polygon_stipple = pipe->set_polygon_stipple;
/* override the driver's functions */
@@ -801,8 +815,8 @@ draw_install_pstipple_stage(struct draw_context *draw,
pipe->bind_fs_state = pstip_bind_fs_state;
pipe->delete_fs_state = pstip_delete_fs_state;
pipe->bind_fragment_sampler_states = pstip_bind_sampler_states;
pipe->set_fragment_sampler_views = pstip_set_sampler_views;
pipe->bind_sampler_states = pstip_bind_sampler_states;
pipe->set_sampler_views = pstip_set_sampler_views;
pipe->set_polygon_stipple = pstip_set_polygon_stipple;
return TRUE;

View File

@@ -37,6 +37,7 @@
#include "pipe/p_defines.h"
#include "draw_private.h"
#include "draw_pipe.h"
#include "draw_fs.h"
struct unfilled_stage {
@@ -47,6 +48,8 @@ struct unfilled_stage {
* and PIPE_POLYGON_MODE_POINT,
*/
unsigned mode[2];
int face_slot;
};
@@ -55,8 +58,33 @@ static INLINE struct unfilled_stage *unfilled_stage( struct draw_stage *stage )
return (struct unfilled_stage *)stage;
}
static void
inject_front_face_info(struct draw_stage *stage,
struct prim_header *header)
{
struct unfilled_stage *unfilled = unfilled_stage(stage);
unsigned ccw = header->det < 0.0;
boolean is_front_face = (
(stage->draw->rasterizer->front_ccw && ccw) ||
(!stage->draw->rasterizer->front_ccw && !ccw));
int slot = unfilled->face_slot;
unsigned i;
/* In case the backend doesn't care about it */
if (slot < 0) {
return;
}
for (i = 0; i < 3; ++i) {
struct vertex_header *v = header->v[i];
v->data[slot][0] = is_front_face;
v->data[slot][1] = is_front_face;
v->data[slot][2] = is_front_face;
v->data[slot][3] = is_front_face;
}
}
static void point( struct draw_stage *stage,
struct vertex_header *v0 )
{
@@ -83,6 +111,8 @@ static void points( struct draw_stage *stage,
struct vertex_header *v1 = header->v[1];
struct vertex_header *v2 = header->v[2];
inject_front_face_info(stage, header);
if ((header->flags & DRAW_PIPE_EDGE_FLAG_0) && v0->edgeflag) point( stage, v0 );
if ((header->flags & DRAW_PIPE_EDGE_FLAG_1) && v1->edgeflag) point( stage, v1 );
if ((header->flags & DRAW_PIPE_EDGE_FLAG_2) && v2->edgeflag) point( stage, v2 );
@@ -99,6 +129,8 @@ static void lines( struct draw_stage *stage,
if (header->flags & DRAW_PIPE_RESET_STIPPLE)
stage->next->reset_stipple_counter( stage->next );
inject_front_face_info(stage, header);
if ((header->flags & DRAW_PIPE_EDGE_FLAG_2) && v2->edgeflag) line( stage, v2, v0 );
if ((header->flags & DRAW_PIPE_EDGE_FLAG_0) && v0->edgeflag) line( stage, v0, v1 );
if ((header->flags & DRAW_PIPE_EDGE_FLAG_1) && v1->edgeflag) line( stage, v1, v2 );
@@ -192,6 +224,29 @@ static void unfilled_destroy( struct draw_stage *stage )
FREE( stage );
}
/*
* Try to allocate an output slot which we can use
* to preserve the front face information.
*/
void
draw_unfilled_prepare_outputs( struct draw_context *draw,
struct draw_stage *stage )
{
struct unfilled_stage *unfilled = unfilled_stage(stage);
const struct pipe_rasterizer_state *rast = draw ? draw->rasterizer : 0;
boolean is_unfilled = (rast &&
(rast->fill_front != PIPE_POLYGON_MODE_FILL ||
rast->fill_back != PIPE_POLYGON_MODE_FILL));
const struct draw_fragment_shader *fs = draw ? draw->fs.fragment_shader : 0;
if (is_unfilled && fs && fs->info.uses_frontface) {
unfilled->face_slot = draw_alloc_extra_vertex_attrib(
stage->draw, TGSI_SEMANTIC_FACE, 0);
} else {
unfilled->face_slot = -1;
}
}
/**
* Create unfilled triangle stage.
@@ -213,6 +268,8 @@ struct draw_stage *draw_unfilled_stage( struct draw_context *draw )
unfilled->stage.reset_stipple_counter = unfilled_reset_stipple_counter;
unfilled->stage.destroy = unfilled_destroy;
unfilled->face_slot = -1;
if (!draw_alloc_temp_verts( &unfilled->stage, 0 ))
goto fail;

View File

@@ -30,28 +30,13 @@
#include "util/u_memory.h"
#include "util/u_math.h"
#include "util/u_prim.h"
#include "pipe/p_defines.h"
#include "draw_private.h"
#include "draw_pipe.h"
#include "draw_context.h"
#include "draw_vbuf.h"
static boolean points( unsigned prim )
{
return (prim == PIPE_PRIM_POINTS);
}
static boolean lines( unsigned prim )
{
return (prim == PIPE_PRIM_LINES ||
prim == PIPE_PRIM_LINE_STRIP ||
prim == PIPE_PRIM_LINE_LOOP);
}
static boolean triangles( unsigned prim )
{
return prim >= PIPE_PRIM_TRIANGLES;
}
/**
* Default version of a function to check if we need any special
@@ -66,6 +51,8 @@ draw_need_pipeline(const struct draw_context *draw,
const struct pipe_rasterizer_state *rasterizer,
unsigned int prim )
{
unsigned reduced_prim = u_reduced_prim(prim);
/* If the driver has overridden this, use that version:
*/
if (draw->render &&
@@ -80,8 +67,7 @@ draw_need_pipeline(const struct draw_context *draw,
* and triggering the pipeline, because we have to trigger the
* pipeline *anyway* if unfilled mode is active.
*/
if (lines(prim))
{
if (reduced_prim == PIPE_PRIM_LINES) {
/* line stipple */
if (rasterizer->line_stipple_enable && draw->pipeline.line_stipple)
return TRUE;
@@ -97,9 +83,7 @@ draw_need_pipeline(const struct draw_context *draw,
if (draw_current_shader_num_written_culldistances(draw))
return TRUE;
}
if (points(prim))
{
else if (reduced_prim == PIPE_PRIM_POINTS) {
/* large points */
if (rasterizer->point_size > draw->pipeline.wide_point_threshold)
return TRUE;
@@ -117,10 +101,7 @@ draw_need_pipeline(const struct draw_context *draw,
if (rasterizer->sprite_coord_enable && draw->pipeline.point_sprite)
return TRUE;
}
if (triangles(prim))
{
else if (reduced_prim == PIPE_PRIM_TRIANGLES) {
/* polygon stipple */
if (rasterizer->poly_stipple_enable && draw->pipeline.pstipple)
return TRUE;
@@ -280,7 +261,6 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage )
next = draw->pipeline.clip;
}
draw->pipeline.first = next;
if (0) {

View File

@@ -250,7 +250,7 @@ vbuf_start_prim( struct vbuf_stage *vbuf, uint prim )
}
hw_key.nr_elements = vbuf->vinfo->num_attribs;
hw_key.output_stride = vbuf->vinfo->size * 4;
hw_key.output_stride = vbuf->vertex_size;
/* Don't bother with caching at this stage:
*/

View File

@@ -27,6 +27,9 @@
#include "draw_prim_assembler.h"
#include "draw_fs.h"
#include "draw_gs.h"
#include "util/u_debug.h"
#include "util/u_memory.h"
#include "util/u_prim.h"
@@ -42,8 +45,28 @@ struct draw_assembler
const struct draw_prim_info *input_prims;
const struct draw_vertex_info *input_verts;
boolean needs_primid;
int primid_slot;
unsigned primid;
boolean is_strip;
boolean is_first_prim;
unsigned num_prims;
};
static boolean
needs_primid(const struct draw_context *draw)
{
const struct draw_fragment_shader *fs = draw->fs.fragment_shader;
const struct draw_geometry_shader *gs = draw->gs.geometry_shader;
if (fs && fs->info.uses_primid) {
return !gs || !gs->info.uses_primid;
}
return FALSE;
}
boolean
draw_prim_assembler_is_required(const struct draw_context *draw,
const struct draw_prim_info *prim_info,
@@ -56,7 +79,7 @@ draw_prim_assembler_is_required(const struct draw_context *draw,
case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY:
return TRUE;
default:
return FALSE;
return needs_primid(draw);
}
}
@@ -84,16 +107,43 @@ copy_verts(struct draw_assembler *asmblr,
asmblr->input_verts->vertex_size);
asmblr->output_verts->count += 1;
}
++asmblr->num_prims;
}
static void
inject_primid(struct draw_assembler *asmblr,
unsigned idx,
unsigned primid)
{
int slot = asmblr->primid_slot;
char *input = (char*)asmblr->input_verts->verts;
unsigned input_offset = asmblr->input_verts->stride * idx;
struct vertex_header *v = (struct vertex_header*)(input + input_offset);
/* In case the backend doesn't care about it */
if (slot < 0) {
return;
}
memcpy(&v->data[slot][0], &primid, sizeof(primid));
memcpy(&v->data[slot][1], &primid, sizeof(primid));
memcpy(&v->data[slot][2], &primid, sizeof(primid));
memcpy(&v->data[slot][3], &primid, sizeof(primid));
}
static void
prim_point(struct draw_assembler *asmblr,
unsigned idx)
{
unsigned indices[1];
if (asmblr->needs_primid) {
inject_primid(asmblr, idx, asmblr->primid++);
}
indices[0] = idx;
copy_verts(asmblr, indices, 1);
}
@@ -103,6 +153,18 @@ prim_line(struct draw_assembler *asmblr,
{
unsigned indices[2];
if (asmblr->needs_primid) {
if (asmblr->is_strip && asmblr->is_first_prim) {
inject_primid(asmblr, i0, asmblr->primid++);
inject_primid(asmblr, i1, asmblr->primid++);
asmblr->is_first_prim = FALSE;
} else if (asmblr->is_strip) {
inject_primid(asmblr, i1, asmblr->primid++);
} else {
inject_primid(asmblr, i0, asmblr->primid);
inject_primid(asmblr, i1, asmblr->primid++);
}
}
indices[0] = i0;
indices[1] = i1;
@@ -115,6 +177,19 @@ prim_line_adj(struct draw_assembler *asmblr,
{
unsigned indices[2];
if (asmblr->needs_primid) {
if (asmblr->is_strip && asmblr->is_first_prim) {
inject_primid(asmblr, i1, asmblr->primid++);
inject_primid(asmblr, i2, asmblr->primid++);
asmblr->is_first_prim = FALSE;
} else if (asmblr->is_strip) {
inject_primid(asmblr, i2, asmblr->primid++);
} else {
inject_primid(asmblr, i1, asmblr->primid);
inject_primid(asmblr, i2, asmblr->primid++);
}
}
indices[0] = i1;
indices[1] = i2;
@@ -127,6 +202,24 @@ prim_tri(struct draw_assembler *asmblr,
{
unsigned indices[3];
if (asmblr->needs_primid) {
if (asmblr->is_strip && asmblr->is_first_prim) {
inject_primid(asmblr, i0, asmblr->primid++);
inject_primid(asmblr, i1, asmblr->primid++);
inject_primid(asmblr, i2, asmblr->primid++);
asmblr->is_first_prim = FALSE;
} else if (asmblr->is_strip) {
if (asmblr->num_prims & 1) {
inject_primid(asmblr, i1, asmblr->primid++);
} else {
inject_primid(asmblr, i2, asmblr->primid++);
}
} else {
inject_primid(asmblr, i0, asmblr->primid);
inject_primid(asmblr, i1, asmblr->primid);
inject_primid(asmblr, i2, asmblr->primid++);
}
}
indices[0] = i0;
indices[1] = i1;
indices[2] = i2;
@@ -141,6 +234,25 @@ prim_tri_adj(struct draw_assembler *asmblr,
{
unsigned indices[3];
if (asmblr->needs_primid) {
if (asmblr->is_strip && asmblr->is_first_prim) {
inject_primid(asmblr, i0, asmblr->primid++);
inject_primid(asmblr, i2, asmblr->primid++);
inject_primid(asmblr, i4, asmblr->primid++);
asmblr->is_first_prim = FALSE;
} else if (asmblr->is_strip) {
if (asmblr->num_prims & 1) {
inject_primid(asmblr, i2, asmblr->primid++);
} else {
inject_primid(asmblr, i4, asmblr->primid++);
}
} else {
inject_primid(asmblr, i0, asmblr->primid);
inject_primid(asmblr, i2, asmblr->primid);
inject_primid(asmblr, i4, asmblr->primid);
asmblr->primid++;
}
}
indices[0] = i0;
indices[1] = i2;
indices[2] = i4;
@@ -148,6 +260,18 @@ prim_tri_adj(struct draw_assembler *asmblr,
copy_verts(asmblr, indices, 3);
}
void
draw_prim_assembler_prepare_outputs(struct draw_assembler *ia)
{
struct draw_context *draw = ia->draw;
if (needs_primid(draw)) {
ia->primid_slot = draw_alloc_extra_vertex_attrib(
ia->draw, TGSI_SEMANTIC_PRIMID, 0);
} else {
ia->primid_slot = -1;
}
ia->primid = 0;
}
#define FUNC assembler_run_linear
@@ -178,18 +302,26 @@ draw_prim_assembler_run(struct draw_context *draw,
struct draw_prim_info *output_prims,
struct draw_vertex_info *output_verts)
{
struct draw_assembler asmblr;
struct draw_assembler *asmblr = draw->ia;
unsigned start, i;
unsigned assembled_prim = u_assembled_prim(input_prims->prim);
unsigned max_primitives = u_decomposed_prims_for_vertices(
input_prims->prim, input_prims->count);
unsigned max_verts = u_vertices_per_prim(assembled_prim) * max_primitives;
asmblr.draw = draw;
asmblr.output_prims = output_prims;
asmblr.output_verts = output_verts;
asmblr.input_prims = input_prims;
asmblr.input_verts = input_verts;
asmblr->output_prims = output_prims;
asmblr->output_verts = output_verts;
asmblr->input_prims = input_prims;
asmblr->input_verts = input_verts;
asmblr->is_strip =
(input_prims->prim == PIPE_PRIM_TRIANGLE_STRIP ||
input_prims->prim == PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY) ||
(input_prims->prim == PIPE_PRIM_LINE_STRIP ||
input_prims->prim == PIPE_PRIM_LINE_STRIP_ADJACENCY);
asmblr->needs_primid = needs_primid(asmblr->draw);
asmblr->is_first_prim = asmblr->is_strip;
asmblr->primid = 0;
asmblr->num_prims = 0;
output_prims->linear = TRUE;
output_prims->elts = NULL;
@@ -212,10 +344,10 @@ draw_prim_assembler_run(struct draw_context *draw,
{
unsigned count = input_prims->primitive_lengths[i];
if (input_prims->linear) {
assembler_run_linear(&asmblr, input_prims, input_verts,
assembler_run_linear(asmblr, input_prims, input_verts,
start, count);
} else {
assembler_run_elts(&asmblr, input_prims, input_verts,
assembler_run_elts(asmblr, input_prims, input_verts,
start, count);
}
}
@@ -223,3 +355,19 @@ draw_prim_assembler_run(struct draw_context *draw,
output_prims->primitive_lengths[0] = output_verts->count;
output_prims->count = output_verts->count;
}
struct draw_assembler *
draw_prim_assembler_create(struct draw_context *draw)
{
struct draw_assembler *ia = CALLOC_STRUCT( draw_assembler );
ia->draw = draw;
return ia;
}
void
draw_prim_assembler_destroy(struct draw_assembler *ia)
{
FREE(ia);
}

View File

@@ -46,6 +46,14 @@
#include "draw/draw_private.h"
struct draw_assembler;
struct draw_assembler *
draw_prim_assembler_create(struct draw_context *draw);
void
draw_prim_assembler_destroy(struct draw_assembler *ia);
boolean
draw_prim_assembler_is_required(const struct draw_context *draw,
const struct draw_prim_info *prim_info,
@@ -59,4 +67,8 @@ draw_prim_assembler_run(struct draw_context *draw,
struct draw_vertex_info *out_vert_info);
void
draw_prim_assembler_prepare_outputs(struct draw_assembler *ia);
#endif

View File

@@ -68,6 +68,7 @@ struct vbuf_render;
struct tgsi_exec_machine;
struct tgsi_sampler;
struct draw_pt_front_end;
struct draw_assembler;
/**
@@ -235,6 +236,8 @@ struct draw_context
boolean dump_vs;
/** Depth format and bias related settings. */
boolean floating_point_depth;
double mrd; /**< minimum resolvable depth value, for polygon offset */
/** Current rasterizer state given to us by the driver */
@@ -311,6 +314,7 @@ struct draw_context
unsigned instance_id;
unsigned start_instance;
unsigned start_index;
#ifdef HAVE_LLVM
struct draw_llvm *llvm;
@@ -329,6 +333,8 @@ struct draw_context
struct pipe_query_data_pipeline_statistics statistics;
boolean collect_statistics;
struct draw_assembler *ia;
void *driver_private;
};

View File

@@ -535,6 +535,7 @@ draw_vbo(struct draw_context *draw,
}
draw->pt.max_index = index_limit - 1;
draw->start_index = info->start;
/*
* TODO: We could use draw->pt.max_index to further narrow
@@ -542,11 +543,12 @@ draw_vbo(struct draw_context *draw,
*/
for (instance = 0; instance < info->instance_count; instance++) {
draw->instance_id = instance + info->start_instance;
unsigned instance_idx = instance + info->start_instance;
draw->start_instance = info->start_instance;
draw->instance_id = instance;
/* check for overflow */
if (draw->instance_id < instance ||
draw->instance_id < info->start_instance) {
if (instance_idx < instance ||
instance_idx < draw->start_instance) {
/* if we overflown just set the instance id to the max */
draw->instance_id = 0xffffffff;
}

View File

@@ -180,6 +180,13 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
}
static void
fetch_emit_bind_parameters(struct draw_pt_middle_end *middle)
{
/* No-op? */
}
static void fetch_emit_run( struct draw_pt_middle_end *middle,
const unsigned *fetch_elts,
unsigned fetch_count,
@@ -379,6 +386,7 @@ struct draw_pt_middle_end *draw_pt_fetch_emit( struct draw_context *draw )
}
fetch_emit->base.prepare = fetch_emit_prepare;
fetch_emit->base.bind_parameters = fetch_emit_bind_parameters;
fetch_emit->base.run = fetch_emit_run;
fetch_emit->base.run_linear = fetch_emit_run_linear;
fetch_emit->base.run_linear_elts = fetch_emit_run_linear_elts;

View File

@@ -178,6 +178,12 @@ fse_prepare(struct draw_pt_middle_end *middle,
}
static void
fse_bind_parameters(struct draw_pt_middle_end *middle)
{
/* No-op? */
}
static void
fse_run_linear(struct draw_pt_middle_end *middle,
@@ -366,6 +372,7 @@ draw_pt_middle_fse(struct draw_context *draw)
return NULL;
fse->base.prepare = fse_prepare;
fse->base.bind_parameters = fse_bind_parameters;
fse->base.run = fse_run;
fse->base.run_linear = fse_run_linear;
fse->base.run_linear_elts = fse_run_linear_elts;

View File

@@ -72,12 +72,8 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle,
const unsigned gs_out_prim = (gs ? gs->output_primitive :
u_assembled_prim(prim));
/* Add one to num_outputs because the pipeline occasionally tags on
* an additional texcoord, eg for AA lines.
*/
unsigned nr = MAX2( vs->info.num_inputs,
vs->info.num_outputs + 1 );
draw_total_vs_outputs(draw) );
if (gs) {
nr = MAX2(nr, gs->info.num_outputs + 1);

View File

@@ -141,12 +141,8 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
struct draw_geometry_shader *gs = draw->gs.geometry_shader;
const unsigned out_prim = gs ? gs->output_primitive :
u_assembled_prim(in_prim);
/* Add one to num_outputs because the pipeline occasionally tags on
* an additional texcoord, eg for AA lines.
*/
const unsigned nr = MAX2( vs->info.num_inputs,
vs->info.num_outputs + 1 );
const unsigned nr = MAX2(vs->info.num_inputs,
draw_total_vs_outputs(draw));
fpme->input_prim = in_prim;
fpme->opt = opt;
@@ -353,7 +349,8 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle,
fetch_info->count,
fpme->vertex_size,
draw->pt.vertex_buffer,
draw->instance_id);
draw->instance_id,
draw->start_index);
else
clipped = fpme->current_variant->jit_func_elts( &fpme->llvm->jit_context,
llvm_vert_info.verts,
@@ -363,7 +360,8 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle,
fetch_info->count,
fpme->vertex_size,
draw->pt.vertex_buffer,
draw->instance_id);
draw->instance_id,
draw->pt.user.eltBias);
/* Finished with fetch and vs:
*/

View File

@@ -48,7 +48,6 @@ struct pt_so_emit {
boolean use_pre_clip_pos;
int pos_idx;
unsigned emitted_primitives;
unsigned emitted_vertices;
unsigned generated_primitives;
};
@@ -214,7 +213,6 @@ static void so_emit_prim(struct pt_so_emit *so,
}
}
}
so->emitted_vertices += num_vertices;
++so->emitted_primitives;
}
@@ -274,7 +272,6 @@ void draw_pt_so_emit( struct pt_so_emit *emit,
if (!draw->so.num_targets)
return;
emit->emitted_vertices = 0;
emit->emitted_primitives = 0;
emit->generated_primitives = 0;
emit->input_vertex_stride = input_verts->stride;
@@ -302,7 +299,6 @@ void draw_pt_so_emit( struct pt_so_emit *emit,
render->set_stream_output_info(render,
emit->emitted_primitives,
emit->emitted_vertices,
emit->generated_primitives);
}

View File

@@ -125,7 +125,6 @@ struct vbuf_render {
*/
void (*set_stream_output_info)( struct vbuf_render *vbufr,
unsigned primitive_count,
unsigned vertices_count,
unsigned primitive_generated );
/**

Some files were not shown because too many files have changed in this diff Show More